@depup/miniflare 4.20260317.0-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/bootstrap.js +11 -0
- package/changes.json +10 -0
- package/dist/local-explorer-ui/assets/Breadcrumbs-7hjI0sYt.js +1 -0
- package/dist/local-explorer-ui/assets/TableSelect-_bi6l6Iv.js +25 -0
- package/dist/local-explorer-ui/assets/_className-gSkjniQn.js +1 -0
- package/dist/local-explorer-ui/assets/_databaseId-DWcfgBis.js +1 -0
- package/dist/local-explorer-ui/assets/_namespaceId-8ViM8VDL.js +1 -0
- package/dist/local-explorer-ui/assets/_objectId-X6x-JUph.js +1 -0
- package/dist/local-explorer-ui/assets/dropdown-DFeFcKfn-BCd_NRZS.js +1 -0
- package/dist/local-explorer-ui/assets/index-BFNDwiew.js +42 -0
- package/dist/local-explorer-ui/assets/index-CLSFsgi0.js +1 -0
- package/dist/local-explorer-ui/assets/index-KG4JeHCX.js +1 -0
- package/dist/local-explorer-ui/assets/index-mgoUmSld.css +1 -0
- package/dist/local-explorer-ui/assets/table-BUmvaBj8-v-EIZgOz.js +1 -0
- package/dist/local-explorer-ui/favicon.svg +3 -0
- package/dist/local-explorer-ui/index.html +14 -0
- package/dist/src/index.d.ts +8703 -0
- package/dist/src/index.js +83666 -0
- package/dist/src/index.js.map +6 -0
- package/dist/src/shared/dev-registry.worker.js +69801 -0
- package/dist/src/shared/dev-registry.worker.js.map +6 -0
- package/dist/src/workers/analytics-engine/analytics-engine.worker.js +15 -0
- package/dist/src/workers/analytics-engine/analytics-engine.worker.js.map +6 -0
- package/dist/src/workers/assets/assets-kv.worker.js +28 -0
- package/dist/src/workers/assets/assets-kv.worker.js.map +6 -0
- package/dist/src/workers/assets/assets.worker.js +9014 -0
- package/dist/src/workers/assets/assets.worker.js.map +6 -0
- package/dist/src/workers/assets/router.worker.js +9625 -0
- package/dist/src/workers/assets/router.worker.js.map +6 -0
- package/dist/src/workers/assets/rpc-proxy.worker.js +29 -0
- package/dist/src/workers/assets/rpc-proxy.worker.js.map +6 -0
- package/dist/src/workers/browser-rendering/binding.worker.js +129 -0
- package/dist/src/workers/browser-rendering/binding.worker.js.map +6 -0
- package/dist/src/workers/cache/cache-entry-noop.worker.js +19 -0
- package/dist/src/workers/cache/cache-entry-noop.worker.js.map +6 -0
- package/dist/src/workers/cache/cache-entry.worker.js +28 -0
- package/dist/src/workers/cache/cache-entry.worker.js.map +6 -0
- package/dist/src/workers/cache/cache.worker.js +653 -0
- package/dist/src/workers/cache/cache.worker.js.map +6 -0
- package/dist/src/workers/core/do-wrapper.worker.js +43 -0
- package/dist/src/workers/core/do-wrapper.worker.js.map +6 -0
- package/dist/src/workers/core/entry.worker.js +4633 -0
- package/dist/src/workers/core/entry.worker.js.map +6 -0
- package/dist/src/workers/core/strip-cf-connecting-ip.worker.js +11 -0
- package/dist/src/workers/core/strip-cf-connecting-ip.worker.js.map +6 -0
- package/dist/src/workers/d1/database.worker.js +219 -0
- package/dist/src/workers/d1/database.worker.js.map +6 -0
- package/dist/src/workers/dispatch-namespace/dispatch-namespace-proxy.worker.js +2271 -0
- package/dist/src/workers/dispatch-namespace/dispatch-namespace-proxy.worker.js.map +6 -0
- package/dist/src/workers/dispatch-namespace/dispatch-namespace.worker.js +12 -0
- package/dist/src/workers/dispatch-namespace/dispatch-namespace.worker.js.map +6 -0
- package/dist/src/workers/email/email.worker.js +23 -0
- package/dist/src/workers/email/email.worker.js.map +6 -0
- package/dist/src/workers/email/send_email.worker.js +3294 -0
- package/dist/src/workers/email/send_email.worker.js.map +6 -0
- package/dist/src/workers/hello-world/binding.worker.js +19 -0
- package/dist/src/workers/hello-world/binding.worker.js.map +6 -0
- package/dist/src/workers/hello-world/object.worker.js +14 -0
- package/dist/src/workers/hello-world/object.worker.js.map +6 -0
- package/dist/src/workers/images/images.worker.js +155 -0
- package/dist/src/workers/images/images.worker.js.map +6 -0
- package/dist/src/workers/kv/namespace.worker.js +322 -0
- package/dist/src/workers/kv/namespace.worker.js.map +6 -0
- package/dist/src/workers/kv/sites.worker.js +146 -0
- package/dist/src/workers/kv/sites.worker.js.map +6 -0
- package/dist/src/workers/local-explorer/explorer.worker.js +5245 -0
- package/dist/src/workers/local-explorer/explorer.worker.js.map +6 -0
- package/dist/src/workers/pipelines/pipeline.worker.js +10 -0
- package/dist/src/workers/pipelines/pipeline.worker.js.map +6 -0
- package/dist/src/workers/queues/broker.worker.js +289 -0
- package/dist/src/workers/queues/broker.worker.js.map +6 -0
- package/dist/src/workers/r2/bucket.worker.js +1134 -0
- package/dist/src/workers/r2/bucket.worker.js.map +6 -0
- package/dist/src/workers/ratelimit/ratelimit.worker.js +54 -0
- package/dist/src/workers/ratelimit/ratelimit.worker.js.map +6 -0
- package/dist/src/workers/secrets-store/secret.worker.js +65 -0
- package/dist/src/workers/secrets-store/secret.worker.js.map +6 -0
- package/dist/src/workers/shared/index.worker.js +693 -0
- package/dist/src/workers/shared/index.worker.js.map +6 -0
- package/dist/src/workers/shared/object-entry.worker.js +21 -0
- package/dist/src/workers/shared/object-entry.worker.js.map +6 -0
- package/dist/src/workers/shared/remote-proxy-client.worker.js +2271 -0
- package/dist/src/workers/shared/remote-proxy-client.worker.js.map +6 -0
- package/dist/src/workers/shared/zod.worker.js +2954 -0
- package/dist/src/workers/shared/zod.worker.js.map +6 -0
- package/dist/src/workers/workflows/binding.worker.js +2422 -0
- package/dist/src/workers/workflows/binding.worker.js.map +6 -0
- package/dist/src/workers/workflows/wrapped-binding.worker.js +71 -0
- package/dist/src/workers/workflows/wrapped-binding.worker.js.map +6 -0
- package/package.json +139 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_namespaceId-8ViM8VDL.js","assets/Breadcrumbs-7hjI0sYt.js","assets/dropdown-DFeFcKfn-BCd_NRZS.js","assets/table-BUmvaBj8-v-EIZgOz.js","assets/_databaseId-DWcfgBis.js","assets/TableSelect-_bi6l6Iv.js","assets/index-KG4JeHCX.js","assets/_objectId-X6x-JUph.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
function f3(n,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in n)){const o=Object.getOwnPropertyDescriptor(i,r);o&&Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function t(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(r){if(r.ep)return;r.ep=!0;const o=t(r);fetch(r.href,o)}})();var bH=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function h3(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Cg={exports:{}},Ru={};var uw;function d3(){if(uw)return Ru;uw=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,r,o){var a=null;if(o!==void 0&&(a=""+o),r.key!==void 0&&(a=""+r.key),"key"in r){o={};for(var u in r)u!=="key"&&(o[u]=r[u])}else o=r;return r=o.ref,{$$typeof:n,type:i,key:a,ref:r!==void 0?r:null,props:o}}return Ru.Fragment=e,Ru.jsx=t,Ru.jsxs=t,Ru}var cw;function p3(){return cw||(cw=1,Cg.exports=d3()),Cg.exports}var Y=p3();const P0=new WeakMap,m3=new WeakMap,Wh={current:[]};let Rg=!1,Yu=0;const Hu=new Set,th=new Map;function yC(n){for(const e of n){if(Wh.current.includes(e))continue;Wh.current.push(e),e.recompute();const t=m3.get(e);if(t)for(const i of t){const r=P0.get(i);r?.length&&yC(r)}}}function g3(n){const e={prevVal:n.prevState,currentVal:n.state};for(const t of n.listeners)t(e)}function y3(n){const e={prevVal:n.prevState,currentVal:n.state};for(const t of n.listeners)t(e)}function vC(n){if(Yu>0&&!th.has(n)&&th.set(n,n.prevState),Hu.add(n),!(Yu>0)&&!Rg)try{for(Rg=!0;Hu.size>0;){const e=Array.from(Hu);Hu.clear();for(const t of e){const i=th.get(t)??t.prevState;t.prevState=i,g3(t)}for(const t of e){const i=P0.get(t);i&&(Wh.current.push(t),yC(i))}for(const t of e){const i=P0.get(t);if(i)for(const r of i)y3(r)}}}finally{Rg=!1,Wh.current=[],th.clear()}}function v3(n){Yu++;try{n()}finally{if(Yu--,Yu===0){const e=Hu.values().next().value;e&&vC(e)}}}function b3(n){return typeof n=="function"}class x3{constructor(e,t){this.listeners=new Set,this.subscribe=i=>{var r,o;this.listeners.add(i);const a=(o=(r=this.options)==null?void 0:r.onSubscribe)==null?void 0:o.call(r,i,this);return()=>{this.listeners.delete(i),a?.()}},this.prevState=e,this.state=e,this.options=t}setState(e){var t,i,r;this.prevState=this.state,(t=this.options)!=null&&t.updateFn?this.state=this.options.updateFn(this.prevState)(e):b3(e)?this.state=e(this.prevState):this.state=e,(r=(i=this.options)==null?void 0:i.onUpdate)==null||r.call(i),vC(this)}}const Us="__TSR_index",fw="popstate",hw="beforeunload";function S3(n){let e=n.getLocation();const t=new Set,i=a=>{e=n.getLocation(),t.forEach(u=>u({location:e,action:a}))},r=a=>{n.notifyOnIndexChange??!0?i(a):e=n.getLocation()},o=async({task:a,navigateOpts:u,...f})=>{if(u?.ignoreBlocker??!1){a();return}const p=n.getBlockers?.()??[],m=f.type==="PUSH"||f.type==="REPLACE";if(typeof document<"u"&&p.length&&m)for(const g of p){const v=Zh(f.path,f.state);if(await g.blockerFn({currentLocation:e,nextLocation:v,action:f.type})){n.onBlocked?.();return}}a()};return{get location(){return e},get length(){return n.getLength()},subscribers:t,subscribe:a=>(t.add(a),()=>{t.delete(a)}),push:(a,u,f)=>{const d=e.state[Us];u=dw(d+1,u),o({task:()=>{n.pushState(a,u),i({type:"PUSH"})},navigateOpts:f,type:"PUSH",path:a,state:u})},replace:(a,u,f)=>{const d=e.state[Us];u=dw(d,u),o({task:()=>{n.replaceState(a,u),i({type:"REPLACE"})},navigateOpts:f,type:"REPLACE",path:a,state:u})},go:(a,u)=>{o({task:()=>{n.go(a),r({type:"GO",index:a})},navigateOpts:u,type:"GO"})},back:a=>{o({task:()=>{n.back(a?.ignoreBlocker??!1),r({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{o({task:()=>{n.forward(a?.ignoreBlocker??!1),r({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>e.state[Us]!==0,createHref:a=>n.createHref(a),block:a=>{if(!n.setBlockers)return()=>{};const u=n.getBlockers?.()??[];return n.setBlockers([...u,a]),()=>{const f=n.getBlockers?.()??[];n.setBlockers?.(f.filter(d=>d!==a))}},flush:()=>n.flush?.(),destroy:()=>n.destroy?.(),notify:i}}function dw(n,e){e||(e={});const t=Gy();return{...e,key:t,__TSR_key:t,[Us]:n}}function w3(n){const e=typeof document<"u"?window:void 0,t=e.history.pushState,i=e.history.replaceState;let r=[];const o=()=>r,a=D=>r=D,u=(D=>D),f=(()=>Zh(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!e.history.state?.__TSR_key&&!e.history.state?.key){const D=Gy();e.history.replaceState({[Us]:0,key:D,__TSR_key:D},"")}let d=f(),p,m=!1,g=!1,v=!1,x=!1;const w=()=>d;let C,E;const k=()=>{C&&(M._ignoreSubscribers=!0,(C.isPush?e.history.pushState:e.history.replaceState)(C.state,"",C.href),M._ignoreSubscribers=!1,C=void 0,E=void 0,p=void 0)},T=(D,V,U)=>{const j=u(V);E||(p=d),d=Zh(V,U),C={href:j,state:U,isPush:C?.isPush||D==="push"},E||(E=Promise.resolve().then(()=>k()))},A=D=>{d=f(),M.notify({type:D})},O=async()=>{if(g){g=!1;return}const D=f(),V=D.state[Us]-d.state[Us],U=V===1,j=V===-1,I=!U&&!j||m;m=!1;const q=I?"GO":j?"BACK":"FORWARD",P=I?{type:"GO",index:V}:{type:j?"BACK":"FORWARD"};if(v)v=!1;else{const $=o();if(typeof document<"u"&&$.length){for(const _ of $)if(await _.blockerFn({currentLocation:d,nextLocation:D,action:q})){g=!0,e.history.go(1),M.notify(P);return}}}d=f(),M.notify(P)},N=D=>{if(x){x=!1;return}let V=!1;const U=o();if(typeof document<"u"&&U.length)for(const j of U){const I=j.enableBeforeUnload??!0;if(I===!0){V=!0;break}if(typeof I=="function"&&I()===!0){V=!0;break}}if(V)return D.preventDefault(),D.returnValue=""},M=S3({getLocation:w,getLength:()=>e.history.length,pushState:(D,V)=>T("push",D,V),replaceState:(D,V)=>T("replace",D,V),back:D=>(D&&(v=!0),x=!0,e.history.back()),forward:D=>{D&&(v=!0),x=!0,e.history.forward()},go:D=>{m=!0,e.history.go(D)},createHref:D=>u(D),flush:k,destroy:()=>{e.history.pushState=t,e.history.replaceState=i,e.removeEventListener(hw,N,{capture:!0}),e.removeEventListener(fw,O)},onBlocked:()=>{p&&d!==p&&(d=p)},getBlockers:o,setBlockers:a,notifyOnIndexChange:!1});return e.addEventListener(hw,N,{capture:!0}),e.addEventListener(fw,O),e.history.pushState=function(...D){const V=t.apply(e.history,D);return M._ignoreSubscribers||A("PUSH"),V},e.history.replaceState=function(...D){const V=i.apply(e.history,D);return M._ignoreSubscribers||A("REPLACE"),V},M}function E3(n){let e=n.replace(/[\x00-\x1f\x7f]/g,"");return e.startsWith("//")&&(e="/"+e.replace(/^\/+/,"")),e}function Zh(n,e){const t=E3(n),i=t.indexOf("#"),r=t.indexOf("?"),o=Gy();return{href:t,pathname:t.substring(0,i>0?r>0?Math.min(i,r):i:r>0?r:t.length),hash:i>-1?t.substring(i):"",search:r>-1?t.slice(r,i===-1?void 0:i):"",state:e||{[Us]:0,key:o,__TSR_key:o}}}function Gy(){return(Math.random()+1).toString(36).substring(7)}const C3=!1;function Gu(n){let e;return v3(()=>{e=n()}),e}function oc(n){return n[n.length-1]}function R3(n){return typeof n=="function"}function _s(n,e){return R3(n)?n(e):n}const k3=Object.prototype.hasOwnProperty,pw=Object.prototype.propertyIsEnumerable;function di(n,e,t=0){if(n===e)return n;if(t>500)return e;const i=e,r=yw(n)&&yw(i);if(!r&&!(Jh(n)&&Jh(i)))return i;const o=r?n:mw(n);if(!o)return i;const a=r?i:mw(i);if(!a)return i;const u=o.length,f=a.length,d=r?new Array(f):{};let p=0;for(let m=0;m<f;m++){const g=r?m:a[m],v=n[g],x=i[g];if(v===x){d[g]=v,(r?m<u:k3.call(n,g))&&p++;continue}if(v===null||x===null||typeof v!="object"||typeof x!="object"){d[g]=x;continue}const w=di(v,x,t+1);d[g]=w,w===v&&p++}return u===f&&p===u?n:d}function mw(n){const e=Object.getOwnPropertyNames(n);for(const r of e)if(!pw.call(n,r))return!1;const t=Object.getOwnPropertySymbols(n);if(t.length===0)return e;const i=e;for(const r of t){if(!pw.call(n,r))return!1;i.push(r)}return i}function Jh(n){if(!gw(n))return!1;const e=n.constructor;if(typeof e>"u")return!0;const t=e.prototype;return!(!gw(t)||!t.hasOwnProperty("isPrototypeOf"))}function gw(n){return Object.prototype.toString.call(n)==="[object Object]"}function yw(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function Po(n,e,t){if(n===e)return!0;if(typeof n!=typeof e)return!1;if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return!1;for(let i=0,r=n.length;i<r;i++)if(!Po(n[i],e[i],t))return!1;return!0}if(Jh(n)&&Jh(e)){const i=t?.ignoreUndefined??!0;if(t?.partial){for(const a in e)if((!i||e[a]!==void 0)&&!Po(n[a],e[a],t))return!1;return!0}let r=0;if(!i)r=Object.keys(n).length;else for(const a in n)n[a]!==void 0&&r++;let o=0;for(const a in e)if((!i||e[a]!==void 0)&&(o++,o>r||!Po(n[a],e[a],t)))return!1;return r===o}return!1}function ha(n){let e,t;const i=new Promise((r,o)=>{e=r,t=o});return i.status="pending",i.resolve=r=>{i.status="resolved",i.value=r,e(r),n?.(r)},i.reject=r=>{i.status="rejected",t(r)},i}function T3(n){return typeof n?.message!="string"?!1:n.message.startsWith("Failed to fetch dynamically imported module")||n.message.startsWith("error loading dynamically imported module")||n.message.startsWith("Importing a module script failed")}function ea(n){return!!(n&&typeof n=="object"&&typeof n.then=="function")}function A3(n){return n.replace(/[\x00-\x1f\x7f]/g,"")}function vw(n){let e;try{e=decodeURI(n)}catch{e=n.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return A3(e)}const bC=["http:","https:","mailto:","tel:"];function ed(n){if(!n)return!1;try{const e=new URL(n);return!bC.includes(e.protocol)}catch{return!1}}function ku(n){if(!n)return{path:n,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(n)&&!n.startsWith("//"))return{path:n,handledProtocolRelativeURL:!1};const e=/%25|%5C/gi;let t=0,i="",r;for(;(r=e.exec(n))!==null;)i+=vw(n.slice(t,r.index))+r[0],t=e.lastIndex;i=i+vw(t?n.slice(t):n);let o=!1;return i.startsWith("//")&&(o=!0,i="/"+i.replace(/^\/+/,"")),{path:i,handledProtocolRelativeURL:o}}function O3(n){return/\s|[^\u0000-\u007F]/.test(n)?n.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):n}var M3="Invariant failed";function Jr(n,e){if(!n)throw new Error(M3)}function td(n){const e=new Map;let t,i;const r=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,i&&(i.next=o,o.prev=i)):(o.next.prev=void 0,t=o.next,o.next=void 0,i&&(o.prev=i,i.next=o)),i=o)};return{get(o){const a=e.get(o);if(a)return r(a),a.value},set(o,a){if(e.size>=n&&t){const f=t;e.delete(f.key),f.next&&(t=f.next,f.next.prev=void 0),f===i&&(i=void 0)}const u=e.get(o);if(u)u.value=a,r(u);else{const f={key:o,value:a,prev:i};i&&(i.next=f),i=f,t||(t=f),e.set(o,f)}},clear(){e.clear(),t=void 0,i=void 0}}}const da=0,qo=1,Fo=2,lc=3,Lo=4,xC=5;function D3(n){const e=n.indexOf("{");if(e===-1)return null;const t=n.indexOf("}",e);return t===-1||e+1>=n.length?null:[e,t]}function Qy(n,e,t=new Uint16Array(6)){const i=n.indexOf("/",e),r=i===-1?n.length:i,o=n.substring(e,r);if(!o||!o.includes("$"))return t[0]=da,t[1]=e,t[2]=e,t[3]=r,t[4]=r,t[5]=r,t;if(o==="$"){const u=n.length;return t[0]=Fo,t[1]=e,t[2]=e,t[3]=u,t[4]=u,t[5]=u,t}if(o.charCodeAt(0)===36)return t[0]=qo,t[1]=e,t[2]=e+1,t[3]=r,t[4]=r,t[5]=r,t;const a=D3(o);if(a){const[u,f]=a,d=o.charCodeAt(u+1);if(d===45){if(u+2<o.length&&o.charCodeAt(u+2)===36){const p=u+3,m=f;if(p<m)return t[0]=lc,t[1]=e+u,t[2]=e+p,t[3]=e+m,t[4]=e+f+1,t[5]=r,t}}else if(d===36){const p=u+1,m=u+2;return m===f?(t[0]=Fo,t[1]=e+u,t[2]=e+p,t[3]=e+m,t[4]=e+f+1,t[5]=n.length,t):(t[0]=qo,t[1]=e+u,t[2]=e+m,t[3]=e+f,t[4]=e+f+1,t[5]=r,t)}}return t[0]=da,t[1]=e,t[2]=e,t[3]=r,t[4]=r,t[5]=r,t}function Ld(n,e,t,i,r,o,a){a?.(t);let u=i;{const f=t.fullPath??t.from,d=f.length,p=t.options?.caseSensitive??n,m=!!(t.options?.params?.parse&&t.options?.skipRouteOnParseError?.params);for(;u<d;){const v=Qy(f,u,e);let x;const w=u,C=v[5];switch(u=C+1,o++,v[0]){case da:{const k=f.substring(v[2],v[3]);if(p){const T=r.static?.get(k);if(T)x=T;else{r.static??=new Map;const A=Io(t.fullPath??t.from);A.parent=r,A.depth=o,x=A,r.static.set(k,A)}}else{const T=k.toLowerCase(),A=r.staticInsensitive?.get(T);if(A)x=A;else{r.staticInsensitive??=new Map;const O=Io(t.fullPath??t.from);O.parent=r,O.depth=o,x=O,r.staticInsensitive.set(T,O)}}break}case qo:{const k=f.substring(w,v[1]),T=f.substring(v[4],C),A=p&&!!(k||T),O=k?A?k:k.toLowerCase():void 0,N=T?A?T:T.toLowerCase():void 0,M=!m&&r.dynamic?.find(D=>!D.skipOnParamError&&D.caseSensitive===A&&D.prefix===O&&D.suffix===N);if(M)x=M;else{const D=Tg(qo,t.fullPath??t.from,A,O,N);x=D,D.depth=o,D.parent=r,r.dynamic??=[],r.dynamic.push(D)}break}case lc:{const k=f.substring(w,v[1]),T=f.substring(v[4],C),A=p&&!!(k||T),O=k?A?k:k.toLowerCase():void 0,N=T?A?T:T.toLowerCase():void 0,M=!m&&r.optional?.find(D=>!D.skipOnParamError&&D.caseSensitive===A&&D.prefix===O&&D.suffix===N);if(M)x=M;else{const D=Tg(lc,t.fullPath??t.from,A,O,N);x=D,D.parent=r,D.depth=o,r.optional??=[],r.optional.push(D)}break}case Fo:{const k=f.substring(w,v[1]),T=f.substring(v[4],C),A=p&&!!(k||T),O=k?A?k:k.toLowerCase():void 0,N=T?A?T:T.toLowerCase():void 0,M=Tg(Fo,t.fullPath??t.from,A,O,N);x=M,M.parent=r,M.depth=o,r.wildcard??=[],r.wildcard.push(M)}}r=x}if(m&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const v=Io(t.fullPath??t.from);v.kind=xC,v.parent=r,o++,v.depth=o,r.pathless??=[],r.pathless.push(v),r=v}const g=(t.path||!t.children)&&!t.isRoot;if(g&&f.endsWith("/")){const v=Io(t.fullPath??t.from);v.kind=Lo,v.parent=r,o++,v.depth=o,r.index=v,r=v}r.parse=t.options?.params?.parse??null,r.skipOnParamError=m,r.parsingPriority=t.options?.skipRouteOnParseError?.priority??0,g&&!r.route&&(r.route=t,r.fullPath=t.fullPath??t.from)}if(t.children)for(const f of t.children)Ld(n,e,f,u,r,o,a)}function kg(n,e){if(n.skipOnParamError&&!e.skipOnParamError)return-1;if(!n.skipOnParamError&&e.skipOnParamError)return 1;if(n.skipOnParamError&&e.skipOnParamError&&(n.parsingPriority||e.parsingPriority))return e.parsingPriority-n.parsingPriority;if(n.prefix&&e.prefix&&n.prefix!==e.prefix){if(n.prefix.startsWith(e.prefix))return-1;if(e.prefix.startsWith(n.prefix))return 1}if(n.suffix&&e.suffix&&n.suffix!==e.suffix){if(n.suffix.endsWith(e.suffix))return-1;if(e.suffix.endsWith(n.suffix))return 1}return n.prefix&&!e.prefix?-1:!n.prefix&&e.prefix?1:n.suffix&&!e.suffix?-1:!n.suffix&&e.suffix?1:n.caseSensitive&&!e.caseSensitive?-1:!n.caseSensitive&&e.caseSensitive?1:0}function Ns(n){if(n.pathless)for(const e of n.pathless)Ns(e);if(n.static)for(const e of n.static.values())Ns(e);if(n.staticInsensitive)for(const e of n.staticInsensitive.values())Ns(e);if(n.dynamic?.length){n.dynamic.sort(kg);for(const e of n.dynamic)Ns(e)}if(n.optional?.length){n.optional.sort(kg);for(const e of n.optional)Ns(e)}if(n.wildcard?.length){n.wildcard.sort(kg);for(const e of n.wildcard)Ns(e)}}function Io(n){return{kind:da,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Tg(n,e,t,i,r){return{kind:n,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:t,prefix:i,suffix:r}}function N3(n,e){const t=Io("/"),i=new Uint16Array(6);for(const r of n)Ld(!1,i,r,1,t,0);Ns(t),e.masksTree=t,e.flatCache=td(1e3)}function L3(n,e){n||="/";const t=e.flatCache.get(n);if(t)return t;const i=Xy(n,e.masksTree);return e.flatCache.set(n,i),i}function I3(n,e,t,i,r){n||="/",i||="/";const o=e?`case\0${n}`:n;let a=r.singleCache.get(o);if(!a){a=Io("/");const u=new Uint16Array(6);Ld(e,u,{from:n},1,a,0),r.singleCache.set(o,a)}return Xy(i,a,t)}function B3(n,e,t=!1){const i=t?n:`nofuzz\0${n}`,r=e.matchCache.get(i);if(r!==void 0)return r;n||="/";let o;try{o=Xy(n,e.segmentTree,t)}catch(a){if(a instanceof URIError)o=null;else throw a}return o&&(o.branch=z3(o.route)),e.matchCache.set(i,o),o}function _3(n){return n==="/"?n:n.replace(/\/{1,}$/,"")}function P3(n,e=!1,t){const i=Io(n.fullPath),r=new Uint16Array(6),o={},a={};let u=0;return Ld(e,r,n,1,i,0,d=>{if(t?.(d,u),Jr(!(d.id in o),`Duplicate routes found with id: ${String(d.id)}`),o[d.id]=d,u!==0&&d.path){const p=_3(d.fullPath);(!a[p]||d.fullPath.endsWith("/"))&&(a[p]=d)}u++}),Ns(i),{processedTree:{segmentTree:i,singleCache:td(1e3),matchCache:td(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:a}}function Xy(n,e,t=!1){const i=n.split("/"),r=V3(n,i,e,t);if(!r)return null;const[o]=SC(n,i,r);return{route:r.node.route,rawParams:o,parsedParams:r.parsedParams}}function SC(n,e,t){const i=H3(t.node);let r=null;const o={};let a=t.extract?.part??0,u=t.extract?.node??0,f=t.extract?.path??0,d=t.extract?.segment??0;for(;u<i.length;a++,u++,f++,d++){const p=i[u];if(p.kind===Lo)break;if(p.kind===xC){d--,a--,f--;continue}const m=e[a],g=f;if(m&&(f+=m.length),p.kind===qo){r??=t.node.fullPath.split("/");const v=r[d],x=p.prefix?.length??0;if(v.charCodeAt(x)===123){const C=p.suffix?.length??0,E=v.substring(x+2,v.length-C-1),k=m.substring(x,m.length-C);o[E]=decodeURIComponent(k)}else{const C=v.substring(1);o[C]=decodeURIComponent(m)}}else if(p.kind===lc){if(t.skipped&1<<u){a--,f=g-1;continue}r??=t.node.fullPath.split("/");const v=r[d],x=p.prefix?.length??0,w=p.suffix?.length??0,C=v.substring(x+3,v.length-w-1),E=p.suffix||p.prefix?m.substring(x,m.length-w):m;E&&(o[C]=decodeURIComponent(E))}else if(p.kind===Fo){const v=p,x=n.substring(g+(v.prefix?.length??0),n.length-(v.suffix?.length??0)),w=decodeURIComponent(x);o["*"]=w,o._splat=w;break}}return t.rawParams&&Object.assign(o,t.rawParams),[o,{part:a,node:u,path:f,segment:d}]}function z3(n){const e=[n];for(;n.parentRoute;)n=n.parentRoute,e.push(n);return e.reverse(),e}function H3(n){const e=Array(n.depth+1);do e[n.depth]=n,n=n.parent;while(n);return e}function V3(n,e,t,i){if(n==="/"&&t.index)return{node:t.index,skipped:0};const r=!oc(e),o=r&&n!=="/",a=e.length-(r?1:0),u=[{node:t,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let f=null,d=null,p=null;for(;u.length;){const m=u.pop(),{node:g,index:v,skipped:x,depth:w,statics:C,dynamics:E,optionals:k}=m;let{extract:T,rawParams:A,parsedParams:O}=m;if(g.skipOnParamError){if(!Ag(n,e,m))continue;A=m.rawParams,T=m.extract,O=m.parsedParams}i&&g.route&&g.kind!==Lo&&Tu(d,m)&&(d=m);const N=v===a;if(N&&(g.route&&!o&&Tu(p,m)&&(p=m),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const M=N?void 0:e[v];let D;if(N&&g.index){const V={node:g.index,index:v,skipped:x,depth:w+1,statics:C,dynamics:E,optionals:k,extract:T,rawParams:A,parsedParams:O};let U=!0;if(g.index.skipOnParamError&&(Ag(n,e,V)||(U=!1)),U){if(C===a&&!E&&!k&&!x)return V;Tu(p,V)&&(p=V)}}if(g.wildcard&&Tu(f,m))for(const V of g.wildcard){const{prefix:U,suffix:j}=V;if(U&&(N||!(V.caseSensitive?M:D??=M.toLowerCase()).startsWith(U)))continue;if(j){if(N)continue;const q=e.slice(v).join("/").slice(-j.length);if((V.caseSensitive?q:q.toLowerCase())!==j)continue}const I={node:V,index:a,skipped:x,depth:w,statics:C,dynamics:E,optionals:k,extract:T,rawParams:A,parsedParams:O};if(!(V.skipOnParamError&&!Ag(n,e,I))){f=I;break}}if(g.optional){const V=x|1<<w,U=w+1;for(let j=g.optional.length-1;j>=0;j--){const I=g.optional[j];u.push({node:I,index:v,skipped:V,depth:U,statics:C,dynamics:E,optionals:k,extract:T,rawParams:A,parsedParams:O})}if(!N)for(let j=g.optional.length-1;j>=0;j--){const I=g.optional[j],{prefix:q,suffix:P}=I;if(q||P){const $=I.caseSensitive?M:D??=M.toLowerCase();if(q&&!$.startsWith(q)||P&&!$.endsWith(P))continue}u.push({node:I,index:v+1,skipped:x,depth:U,statics:C,dynamics:E,optionals:k+1,extract:T,rawParams:A,parsedParams:O})}}if(!N&&g.dynamic&&M)for(let V=g.dynamic.length-1;V>=0;V--){const U=g.dynamic[V],{prefix:j,suffix:I}=U;if(j||I){const q=U.caseSensitive?M:D??=M.toLowerCase();if(j&&!q.startsWith(j)||I&&!q.endsWith(I))continue}u.push({node:U,index:v+1,skipped:x,depth:w+1,statics:C,dynamics:E+1,optionals:k,extract:T,rawParams:A,parsedParams:O})}if(!N&&g.staticInsensitive){const V=g.staticInsensitive.get(D??=M.toLowerCase());V&&u.push({node:V,index:v+1,skipped:x,depth:w+1,statics:C+1,dynamics:E,optionals:k,extract:T,rawParams:A,parsedParams:O})}if(!N&&g.static){const V=g.static.get(M);V&&u.push({node:V,index:v+1,skipped:x,depth:w+1,statics:C+1,dynamics:E,optionals:k,extract:T,rawParams:A,parsedParams:O})}if(g.pathless){const V=w+1;for(let U=g.pathless.length-1;U>=0;U--){const j=g.pathless[U];u.push({node:j,index:v,skipped:x,depth:V,statics:C,dynamics:E,optionals:k,extract:T,rawParams:A,parsedParams:O})}}}if(p&&f)return Tu(f,p)?p:f;if(p)return p;if(f)return f;if(i&&d){let m=d.index;for(let v=0;v<d.index;v++)m+=e[v].length;const g=m===n.length?"/":n.slice(m);return d.rawParams??={},d.rawParams["**"]=decodeURIComponent(g),d}return null}function Ag(n,e,t){try{const[i,r]=SC(n,e,t);t.rawParams=i,t.extract=r;const o=t.node.parse(i);return t.parsedParams=Object.assign({},t.parsedParams,o),!0}catch{return null}}function Tu(n,e){return n?e.statics>n.statics||e.statics===n.statics&&(e.dynamics>n.dynamics||e.dynamics===n.dynamics&&(e.optionals>n.optionals||e.optionals===n.optionals&&((e.node.kind===Lo)>(n.node.kind===Lo)||e.node.kind===Lo==(n.node.kind===Lo)&&e.depth>n.depth))):!0}function _h(n){return Wy(n.filter(e=>e!==void 0).join("/"))}function Wy(n){return n.replace(/\/{2,}/g,"/")}function wC(n){return n==="/"?n:n.replace(/^\/{1,}/,"")}function Gr(n){const e=n.length;return e>1&&n[e-1]==="/"?n.replace(/\/{1,}$/,""):n}function EC(n){return Gr(wC(n))}function nd(n,e){return n?.endsWith("/")&&n!=="/"&&n!==`${e}/`?n.slice(0,-1):n}function U3(n,e,t){return nd(n,t)===nd(e,t)}function j3({base:n,to:e,trailingSlash:t="never",cache:i}){const r=e.startsWith("/"),o=!r&&e===".";let a;if(i){a=r?e:o?n:n+"\0"+e;const m=i.get(a);if(m)return m}let u;if(o)u=n.split("/");else if(r)u=e.split("/");else{for(u=n.split("/");u.length>1&&oc(u)==="";)u.pop();const m=e.split("/");for(let g=0,v=m.length;g<v;g++){const x=m[g];x===""?g?g===v-1&&u.push(x):u=[x]:x===".."?u.pop():x==="."||u.push(x)}}u.length>1&&(oc(u)===""?t==="never"&&u.pop():t==="always"&&u.push(""));let f,d="";for(let m=0;m<u.length;m++){m>0&&(d+="/");const g=u[m];if(!g)continue;f=Qy(g,0,f);const v=f[0];if(v===da){d+=g;continue}const x=f[5],w=g.substring(0,f[1]),C=g.substring(f[4],x),E=g.substring(f[2],f[3]);v===qo?d+=w||C?`${w}{$${E}}${C}`:`$${E}`:v===Fo?d+=w||C?`${w}{$}${C}`:"$":d+=`${w}{-$${E}}${C}`}d=Wy(d);const p=d||"/";return a&&i&&i.set(a,p),p}function q3(n){const e=new Map(n.map(r=>[encodeURIComponent(r),r])),t=Array.from(e.keys()).map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),i=new RegExp(t,"g");return r=>r.replace(i,o=>e.get(o)??o)}function Og(n,e,t){const i=e[n];return typeof i!="string"?i:n==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(i)?i:i.split("/").map(r=>bw(r,t)).join("/"):bw(i,t)}function Mg({path:n,params:e,decoder:t,...i}){let r=!1;const o={};if(!n||n==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:r};if(!n.includes("$"))return{interpolatedPath:n,usedParams:o,isMissingParams:r};const a=n.length;let u=0,f,d="";for(;u<a;){const m=u;f=Qy(n,m,f);const g=f[5];if(u=g+1,m===g)continue;const v=f[0];if(v===da){d+="/"+n.substring(m,g);continue}if(v===Fo){const x=e._splat;o._splat=x,o["*"]=x;const w=n.substring(m,f[1]),C=n.substring(f[4],g);if(!x){r=!0,(w||C)&&(d+="/"+w+C);continue}const E=Og("_splat",e,t);d+="/"+w+E+C;continue}if(v===qo){const x=n.substring(f[2],f[3]);!r&&!(x in e)&&(r=!0),o[x]=e[x];const w=n.substring(m,f[1]),C=n.substring(f[4],g),E=Og(x,e,t)??"undefined";d+="/"+w+E+C;continue}if(v===lc){const x=n.substring(f[2],f[3]),w=e[x];if(w==null)continue;o[x]=w;const C=n.substring(m,f[1]),E=n.substring(f[4],g),k=Og(x,e,t)??"";d+="/"+C+k+E;continue}}return n.endsWith("/")&&(d+="/"),{usedParams:o,interpolatedPath:d||"/",isMissingParams:r}}function bw(n,e){const t=encodeURIComponent(n);return e?.(t)??t}function CC(n={}){if(n.isNotFound=!0,n.throw)throw n;return n}function bi(n){return!!n?.isNotFound}function F3(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const z0="tsr-scroll-restoration-v1_3",$3=(n,e)=>{let t;return(...i)=>{t||(t=setTimeout(()=>{n(...i),t=null},e))}};function K3(){const n=F3();if(!n)return null;const e=n.getItem(z0);let t=e?JSON.parse(e):{};return{state:t,set:i=>{t=_s(i,t)||t;try{n.setItem(z0,JSON.stringify(t))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const nh=K3(),Y3=n=>n.state.__TSR_key||n.href;function G3(n){const e=[];let t;for(;t=n.parentNode;)e.push(`${n.tagName}:nth-child(${Array.prototype.indexOf.call(t.children,n)+1})`),n=t;return`${e.reverse().join(" > ")}`.toLowerCase()}let id=!1;function Q3({storageKey:n,key:e,behavior:t,shouldScrollRestoration:i,scrollToTopSelectors:r,location:o}){let a;try{a=JSON.parse(sessionStorage.getItem(n)||"{}")}catch(d){console.error(d);return}const u=e||window.history.state?.__TSR_key,f=a[u];id=!0;e:{if(i&&f&&Object.keys(f).length>0){for(const m in f){const g=f[m];if(m==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:t});else if(m){const v=document.querySelector(m);v&&(v.scrollLeft=g.scrollX,v.scrollTop=g.scrollY)}}break e}const d=(o??window.location).hash.split("#",2)[1];if(d){const m=window.history.state?.__hashScrollIntoViewOptions??!0;if(m){const g=document.getElementById(d);g&&g.scrollIntoView(m)}break e}const p={top:0,left:0,behavior:t};if(window.scrollTo(p),r)for(const m of r){if(m==="window")continue;const g=typeof m=="function"?m():document.querySelector(m);g&&g.scrollTo(p)}}id=!1}function X3(n,e){if(!nh||((n.options.scrollRestoration??!1)&&(n.isScrollRestoring=!0),n.isScrollRestorationSetup||!nh))return;n.isScrollRestorationSetup=!0,id=!1;const i=n.options.getScrollRestorationKey||Y3;window.history.scrollRestoration="manual";const r=o=>{if(id||!n.isScrollRestoring)return;let a="";if(o.target===document||o.target===window)a="window";else{const f=o.target.getAttribute("data-scroll-restoration-id");f?a=`[data-scroll-restoration-id="${f}"]`:a=G3(o.target)}const u=i(n.state.location);nh.set(f=>{const d=f[u]||={},p=d[a]||={};if(a==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(a){const m=document.querySelector(a);m&&(p.scrollX=m.scrollLeft||0,p.scrollY=m.scrollTop||0)}return f})};typeof document<"u"&&document.addEventListener("scroll",$3(r,100),!0),n.subscribe("onRendered",o=>{const a=i(o.toLocation);if(!n.resetNextScroll){n.resetNextScroll=!0;return}typeof n.options.scrollRestoration=="function"&&!n.options.scrollRestoration({location:n.latestLocation})||(Q3({storageKey:z0,key:a,behavior:n.options.scrollRestorationBehavior,shouldScrollRestoration:n.isScrollRestoring,scrollToTopSelectors:n.options.scrollToTopSelectors,location:n.history.location}),n.isScrollRestoring&&nh.set(u=>(u[a]||={},u)))})}function W3(n){if(typeof document<"u"&&document.querySelector){const e=n.state.location.state.__hashScrollIntoViewOptions??!0;if(e&&n.state.location.hash!==""){const t=document.getElementById(n.state.location.hash);t&&t.scrollIntoView(e)}}}function Z3(n,e=String){const t=new URLSearchParams;for(const i in n){const r=n[i];r!==void 0&&t.set(i,e(r))}return t.toString()}function Dg(n){return n?n==="false"?!1:n==="true"?!0:+n*0===0&&+n+""===n?+n:n:""}function J3(n){const e=new URLSearchParams(n),t={};for(const[i,r]of e.entries()){const o=t[i];o==null?t[i]=Dg(r):Array.isArray(o)?o.push(Dg(r)):t[i]=[o,Dg(r)]}return t}const e4=n4(JSON.parse),t4=i4(JSON.stringify,JSON.parse);function n4(n){return e=>{e[0]==="?"&&(e=e.substring(1));const t=J3(e);for(const i in t){const r=t[i];if(typeof r=="string")try{t[i]=n(r)}catch{}}return t}}function i4(n,e){const t=typeof e=="function";function i(r){if(typeof r=="object"&&r!==null)try{return n(r)}catch{}else if(t&&typeof r=="string")try{return e(r),n(r)}catch{}return r}return r=>{const o=Z3(r,i);return o?`?${o}`:""}}const Di="__root__";function RC(n){if(n.statusCode=n.statusCode||n.code||307,!n._builtLocation&&typeof n.href=="string"&&ed(n.href))throw new Error(`Redirect blocked: unsafe protocol in href "${n.href}". Only ${bC.join(", ")} protocols are allowed.`);if(!n._builtLocation&&!n.reloadDocument&&typeof n.href=="string")try{new URL(n.href),n.reloadDocument=!0}catch{}const e=new Headers(n.headers);n.href&&e.get("Location")===null&&e.set("Location",n.href);const t=new Response(null,{status:n.statusCode,headers:e});if(t.options=n,n.throw)throw t;return t}function Li(n){return n instanceof Response&&!!n.options}const Ph=n=>{if(!n.rendered)return n.rendered=!0,n.onReady?.()},Id=(n,e)=>!!(n.preload&&!n.router.state.matches.some(t=>t.id===e)),ta=(n,e,t=!0)=>{const i={...n.router.options.context??{}},r=t?e:e-1;for(let o=0;o<=r;o++){const a=n.matches[o];if(!a)continue;const u=n.router.getMatch(a.id);u&&Object.assign(i,u.__routeContext,u.__beforeLoadContext)}return i},kC=(n,e)=>{const t=n.router.routesById[e.routeId??""]??n.router.routeTree;!t.options.notFoundComponent&&n.router.options?.defaultNotFoundComponent&&(t.options.notFoundComponent=n.router.options.defaultNotFoundComponent),Jr(t.options.notFoundComponent);const i=n.matches.find(r=>r.routeId===t.id);Jr(i,"Could not find match for route: "+t.id),n.updateMatch(i.id,r=>({...r,status:"notFound",error:e,isFetching:!1})),e.routerCode==="BEFORE_LOAD"&&t.parentRoute&&(e.routeId=t.parentRoute.id,kC(n,e))},Ps=(n,e,t)=>{if(!(!Li(t)&&!bi(t))){if(Li(t)&&t.redirectHandled&&!t.options.reloadDocument)throw t;if(e){e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.loaderPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loaderPromise=void 0;const i=Li(t)?"redirected":"notFound";e._nonReactive.error=t,n.updateMatch(e.id,r=>({...r,status:i,context:ta(n,e.index),isFetching:!1,error:t})),bi(t)&&!t.routeId&&(t.routeId=e.routeId),e._nonReactive.loadPromise?.resolve()}throw Li(t)?(n.rendered=!0,t.options._fromLocation=n.location,t.redirectHandled=!0,t=n.router.resolveRedirect(t),t):(kC(n,t),t)}},TC=(n,e)=>!!n.router.getMatch(e)._nonReactive.dehydrated,Au=(n,e,t,i)=>{const{id:r,routeId:o}=n.matches[e],a=n.router.looseRoutesById[o];if(t instanceof Promise)throw t;t.routerCode=i,n.firstBadMatchIndex??=e,Ps(n,n.router.getMatch(r),t);try{a.options.onError?.(t)}catch(u){t=u,Ps(n,n.router.getMatch(r),t)}n.updateMatch(r,u=>(u._nonReactive.beforeLoadPromise?.resolve(),u._nonReactive.beforeLoadPromise=void 0,u._nonReactive.loadPromise?.resolve(),{...u,error:t,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},AC=(n,e,t,i)=>{if(i._nonReactive.pendingTimeout!==void 0)return;const r=t.options.pendingMs??n.router.options.defaultPendingMs;if(!!(n.onReady&&!Id(n,e)&&(t.options.loader||t.options.beforeLoad||DC(t))&&typeof r=="number"&&r!==1/0&&(t.options.pendingComponent??n.router.options?.defaultPendingComponent))){const a=setTimeout(()=>{Ph(n)},r);i._nonReactive.pendingTimeout=a}},r4=(n,e,t)=>{const i=n.router.getMatch(e);if(!i._nonReactive.beforeLoadPromise&&!i._nonReactive.loaderPromise)return;AC(n,e,t,i);const r=()=>{const o=n.router.getMatch(e);o.preload&&(o.status==="redirected"||o.status==="notFound")&&Ps(n,o,o.error)};return i._nonReactive.beforeLoadPromise?i._nonReactive.beforeLoadPromise.then(r):r()},s4=(n,e,t,i)=>{const r=n.router.getMatch(e),o=r._nonReactive.loadPromise;r._nonReactive.loadPromise=ha(()=>{o?.resolve()});const{paramsError:a,searchError:u}=r;a&&Au(n,t,a,"PARSE_PARAMS"),u&&Au(n,t,u,"VALIDATE_SEARCH"),AC(n,e,i,r);const f=new AbortController;let d=!1;const p=()=>{d||(d=!0,n.updateMatch(e,A=>({...A,isFetching:"beforeLoad",fetchCount:A.fetchCount+1,abortController:f})))},m=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,n.updateMatch(e,A=>({...A,isFetching:!1}))};if(!i.options.beforeLoad){Gu(()=>{p(),m()});return}r._nonReactive.beforeLoadPromise=ha();const g={...ta(n,t,!1),...r.__routeContext},{search:v,params:x,cause:w}=r,C=Id(n,e),E={search:v,abortController:f,params:x,preload:C,context:g,location:n.location,navigate:A=>n.router.navigate({...A,_fromLocation:n.location}),buildLocation:n.router.buildLocation,cause:C?"preload":w,matches:n.matches,routeId:i.id,...n.router.options.additionalContext},k=A=>{if(A===void 0){Gu(()=>{p(),m()});return}(Li(A)||bi(A))&&(p(),Au(n,t,A,"BEFORE_LOAD")),Gu(()=>{p(),n.updateMatch(e,O=>({...O,__beforeLoadContext:A})),m()})};let T;try{if(T=i.options.beforeLoad(E),ea(T))return p(),T.catch(A=>{Au(n,t,A,"BEFORE_LOAD")}).then(k)}catch(A){p(),Au(n,t,A,"BEFORE_LOAD")}k(T)},o4=(n,e)=>{const{id:t,routeId:i}=n.matches[e],r=n.router.looseRoutesById[i],o=()=>u(),a=()=>s4(n,t,e,r),u=()=>{if(TC(n,t))return;const f=r4(n,t,r);return ea(f)?f.then(a):a()};return o()},l4=(n,e,t)=>{const i=n.router.getMatch(e);if(!i||!t.options.head&&!t.options.scripts&&!t.options.headers)return;const r={ssr:n.router.options.ssr,matches:n.matches,match:i,params:i.params,loaderData:i.loaderData};return Promise.all([t.options.head?.(r),t.options.scripts?.(r),t.options.headers?.(r)]).then(([o,a,u])=>{const f=o?.meta,d=o?.links,p=o?.scripts,m=o?.styles;return{meta:f,links:d,headScripts:p,headers:u,scripts:a,styles:m}})},OC=(n,e,t,i)=>{const r=n.matchPromises[t-1],{params:o,loaderDeps:a,abortController:u,cause:f}=n.router.getMatch(e),d=ta(n,t),p=Id(n,e);return{params:o,deps:a,preload:!!p,parentMatchPromise:r,abortController:u,context:d,location:n.location,navigate:m=>n.router.navigate({...m,_fromLocation:n.location}),cause:p?"preload":f,route:i,...n.router.options.additionalContext}},xw=async(n,e,t,i)=>{try{const r=n.router.getMatch(e);try{(!(C3??n.router.isServer)||r.ssr===!0)&&MC(i);const o=i.options.loader?.(OC(n,e,t,i)),a=i.options.loader&&ea(o);if((a||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||r._nonReactive.minPendingPromise)&&n.updateMatch(e,d=>({...d,isFetching:"loader"})),i.options.loader){const d=a?await o:o;Ps(n,n.router.getMatch(e),d),d!==void 0&&n.updateMatch(e,p=>({...p,loaderData:d}))}i._lazyPromise&&await i._lazyPromise;const f=r._nonReactive.minPendingPromise;f&&await f,i._componentsPromise&&await i._componentsPromise,n.updateMatch(e,d=>({...d,error:void 0,context:ta(n,t),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(o){let a=o;if(a?.name==="AbortError"){if(r.abortController.signal.aborted){r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loaderPromise=void 0;return}n.updateMatch(e,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:ta(n,t)}));return}const u=r._nonReactive.minPendingPromise;u&&await u,bi(o)&&await i.options.notFoundComponent?.preload?.(),Ps(n,n.router.getMatch(e),o);try{i.options.onError?.(o)}catch(f){a=f,Ps(n,n.router.getMatch(e),f)}n.updateMatch(e,f=>({...f,error:a,context:ta(n,t),status:"error",isFetching:!1}))}}catch(r){const o=n.router.getMatch(e);o&&(o._nonReactive.loaderPromise=void 0),Ps(n,o,r)}},a4=async(n,e)=>{async function t(p,m,g,v){const x=Date.now()-m.updatedAt,w=p?v.options.preloadStaleTime??n.router.options.defaultPreloadStaleTime??3e4:v.options.staleTime??n.router.options.defaultStaleTime??0,C=v.options.shouldReload,E=typeof C=="function"?C(OC(n,i,e,v)):C,{status:k,invalid:T}=g;o=k==="success"&&(T||(E??x>w)),p&&v.options.preload===!1||(o&&!n.sync?(a=!0,(async()=>{try{await xw(n,i,e,v);const A=n.router.getMatch(i);A._nonReactive.loaderPromise?.resolve(),A._nonReactive.loadPromise?.resolve(),A._nonReactive.loaderPromise=void 0}catch(A){Li(A)&&await n.router.navigate(A.options)}})()):(k!=="success"||o&&n.sync)&&await xw(n,i,e,v))}const{id:i,routeId:r}=n.matches[e];let o=!1,a=!1;const u=n.router.looseRoutesById[r];if(!TC(n,i)){const p=n.router.getMatch(i),m=Id(n,i);if(p._nonReactive.loaderPromise){if(p.status==="success"&&!n.sync&&!p.preload)return p;await p._nonReactive.loaderPromise;const g=n.router.getMatch(i),v=g._nonReactive.error||g.error;v&&Ps(n,g,v),g.status==="pending"&&await t(m,p,g,u)}else{const g=m&&!n.router.state.matches.some(x=>x.id===i),v=n.router.getMatch(i);v._nonReactive.loaderPromise=ha(),g!==v.preload&&n.updateMatch(i,x=>({...x,preload:g})),await t(m,p,v,u)}}const f=n.router.getMatch(i);a||(f._nonReactive.loaderPromise?.resolve(),f._nonReactive.loadPromise?.resolve()),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,a||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;const d=a?f.isFetching:!1;return d!==f.isFetching||f.invalid!==!1?(n.updateMatch(i,p=>({...p,isFetching:d,invalid:!1})),n.router.getMatch(i)):f};async function Sw(n){const e=Object.assign(n,{matchPromises:[]});e.router.state.matches.some(t=>t._forcePending)&&Ph(e);try{for(let u=0;u<e.matches.length;u++){const f=o4(e,u);ea(f)&&await f}const t=e.firstBadMatchIndex??e.matches.length;for(let u=0;u<t;u++)e.matchPromises.push(a4(e,u));const r=(await Promise.allSettled(e.matchPromises)).filter(u=>u.status==="rejected").map(u=>u.reason);let o;for(const u of r){if(Li(u))throw u;!o&&bi(u)&&(o=u)}for(const u of e.matches){const{id:f,routeId:d}=u,p=e.router.looseRoutesById[d];try{const m=l4(e,f,p);if(m){const g=await m;e.updateMatch(f,v=>({...v,...g}))}}catch(m){console.error(`Error executing head for route ${d}:`,m)}}if(o)throw o;const a=Ph(e);ea(a)&&await a}catch(t){if(bi(t)&&!e.preload){const i=Ph(e);throw ea(i)&&await i,t}if(Li(t))throw t}return e.matches}async function MC(n){if(!n._lazyLoaded&&n._lazyPromise===void 0&&(n.lazyFn?n._lazyPromise=n.lazyFn().then(e=>{const{id:t,...i}=e.options;Object.assign(n.options,i),n._lazyLoaded=!0,n._lazyPromise=void 0}):n._lazyLoaded=!0),!n._componentsLoaded&&n._componentsPromise===void 0){const e=()=>{const t=[];for(const i of NC){const r=n.options[i]?.preload;r&&t.push(r())}if(t.length)return Promise.all(t).then(()=>{n._componentsLoaded=!0,n._componentsPromise=void 0});n._componentsLoaded=!0,n._componentsPromise=void 0};n._componentsPromise=n._lazyPromise?n._lazyPromise.then(e):e()}return n._componentsPromise}function DC(n){for(const e of NC)if(n.options[e]?.preload)return!0;return!1}const NC=["component","errorComponent","pendingComponent","notFoundComponent"];function u4(n){return{input:({url:e})=>{for(const t of n)e=H0(t,e);return e},output:({url:e})=>{for(let t=n.length-1;t>=0;t--)e=LC(n[t],e);return e}}}function c4(n){const e=EC(n.basepath),t=`/${e}`,i=`${t}/`,r=n.caseSensitive?t:t.toLowerCase(),o=n.caseSensitive?i:i.toLowerCase();return{input:({url:a})=>{const u=n.caseSensitive?a.pathname:a.pathname.toLowerCase();return u===r?a.pathname="/":u.startsWith(o)&&(a.pathname=a.pathname.slice(t.length)),a},output:({url:a})=>(a.pathname=_h(["/",e,a.pathname]),a)}}function H0(n,e){const t=n?.input?.({url:e});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return e}function LC(n,e){const t=n?.output?.({url:e});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return e}function zo(n){const e=n.resolvedLocation,t=n.location,i=e?.pathname!==t.pathname,r=e?.href!==t.href,o=e?.hash!==t.hash;return{fromLocation:e,toLocation:t,pathChanged:i,hrefChanged:r,hashChanged:o}}class f4{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=t=>t(),this.update=t=>{t.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const i=this.options,r=this.basepath??i?.basepath??"/",o=this.basepath===void 0,a=i?.rewrite;if(this.options={...i,...t},this.isServer=this.options.isServer??typeof document>"u",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=q3(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=w3()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let g;this.resolvePathCache=td(1e3),g=this.buildRouteTree(),this.setRoutes(g)}!this.__store&&this.latestLocation&&(this.__store=new x3(d4(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(g=>!["redirected"].includes(g.status))}}}),X3(this));let u=!1;const f=this.options.basepath??"/",d=this.options.rewrite;if(o||r!==f||a!==d){this.basepath=f;const g=[],v=EC(f);v&&v!=="/"&&g.push(c4({basepath:f})),d&&g.push(d),this.rewrite=g.length===0?void 0:g.length===1?g[0]:u4(g),this.history&&this.updateLatestLocation(),u=!0}u&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=P3(this.routeTree,this.options.caseSensitive,(i,r)=>{i.init({originalIndex:r})});return this.options.routeMasks&&N3(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,i)=>{const r={eventType:t,fn:i};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=t=>{this.subscribers.forEach(i=>{i.eventType===t.type&&i.fn(t)})},this.parseLocation=(t,i)=>{const r=({pathname:f,search:d,hash:p,href:m,state:g})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(f)){const k=this.options.parseSearch(d),T=this.options.stringifySearch(k);return{href:f+T+p,publicHref:m,pathname:ku(f).path,external:!1,searchStr:T,search:di(i?.search,k),hash:ku(p.slice(1)).path,state:di(i?.state,g)}}const v=new URL(m,this.origin),x=H0(this.rewrite,v),w=this.options.parseSearch(x.search),C=this.options.stringifySearch(w);return x.search=C,{href:x.href.replace(x.origin,""),publicHref:m,pathname:ku(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:C,search:di(i?.search,w),hash:ku(x.hash.slice(1)).path,state:di(i?.state,g)}},o=r(t),{__tempLocation:a,__tempKey:u}=o.state;if(a&&(!u||u===this.tempLocationKey)){const f=r(a);return f.state.key=o.state.key,f.state.__TSR_key=o.state.__TSR_key,delete f.state.__tempLocation,{...f,maskedLocation:o}}return o},this.resolvePathWithBase=(t,i)=>j3({base:t,to:Wy(i),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,i,r)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:i},r):this.matchRoutesInternal(t,i),this.getMatchedRoutes=t=>p4({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const i=this.getMatch(t);i&&(i.abortController.abort(),clearTimeout(i._nonReactive.pendingTimeout),i._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(o=>o.status==="pending"),i=this.state.matches.filter(o=>o.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...i]).forEach(o=>{this.cancelMatch(o.id)})},this.buildLocation=t=>{const i=(o={})=>{const a=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,u=this.matchRoutesLightweight(a);o.from;const f=o.unsafeRelative==="path"?a.pathname:o.from??u.fullPath,d=this.resolvePathWithBase(f,"."),p=u.search,m={...u.params},g=o.to?this.resolvePathWithBase(d,`${o.to}`):this.resolvePathWithBase(d,"."),v=o.params===!1||o.params===null?{}:(o.params??!0)===!0?m:Object.assign(m,_s(o.params,m)),x=Mg({path:g,params:v,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,w=this.getMatchedRoutes(x);let C=w.matchedRoutes;(w.foundRoute?w.foundRoute.path!=="/"&&w.routeParams["**"]:Gr(x))&&this.options.notFoundRoute&&(C=[...C,this.options.notFoundRoute]);let k=!1;if(Object.keys(v).length>0)for(const q of C){const P=q.options.params?.stringify??q.options.stringifyParams;P&&(k=!0,Object.assign(v,P(v)))}const T=t.leaveParams?g:ku(k?Mg({path:g,params:v,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:x).path;let A=p;if(t._includeValidateSearch&&this.options.search?.strict){const q={};C.forEach(P=>{if(P.options.validateSearch)try{Object.assign(q,zh(P.options.validateSearch,{...q,...A}))}catch{}}),A=q}A=m4({search:A,dest:o,destRoutes:C,_includeValidateSearch:t._includeValidateSearch}),A=di(p,A);const O=this.options.stringifySearch(A),N=o.hash===!0?a.hash:o.hash?_s(o.hash,a.hash):void 0,M=N?`#${N}`:"";let D=o.state===!0?a.state:o.state?_s(o.state,a.state):{};D=di(a.state,D);const V=`${T}${O}${M}`;let U,j,I=!1;if(this.rewrite){const q=new URL(V,this.origin),P=LC(this.rewrite,q);U=q.href.replace(q.origin,""),P.origin!==this.origin?(j=P.href,I=!0):j=P.pathname+P.search+P.hash}else U=O3(V),j=U;return{publicHref:j,href:U,pathname:T,search:A,searchStr:O,state:D,hash:N??"",external:I,unmaskOnReload:o.unmaskOnReload}},r=(o={},a)=>{const u=i(o);let f=a?i(a):void 0;if(!f){const d={};if(this.options.routeMasks){const p=L3(u.pathname,this.processedTree);if(p){Object.assign(d,p.rawParams);const{from:m,params:g,...v}=p.route,x=g===!1||g===null?{}:(g??!0)===!0?d:Object.assign(d,_s(g,d));a={from:t.from,...v,params:x},f=i(a)}}}return f&&(u.maskedLocation=f),u};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:i,...r})=>{const o=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(p=>{r.state[p]=this.latestLocation.state[p]});const d=Po(r.state,this.latestLocation.state);return f.forEach(p=>{delete r.state[p]}),d},a=Gr(this.latestLocation.href)===Gr(r.href),u=this.commitLocationPromise;if(this.commitLocationPromise=ha(()=>{u?.resolve()}),a&&o())this.load();else{let{maskedLocation:f,hashScrollIntoView:d,...p}=r;f&&(p={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[r.replace?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:i})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:i,hashScrollIntoView:r,viewTransition:o,ignoreBlocker:a,href:u,...f}={})=>{if(u){const m=this.history.location.state.__TSR_index,g=Zh(u,{__TSR_index:t?m:m+1}),v=new URL(g.pathname,this.origin),x=H0(this.rewrite,v);f.to=x.pathname,f.search=this.options.parseSearch(g.search),f.hash=g.hash.slice(1)}const d=this.buildLocation({...f,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const p=this.commitLocation({...d,viewTransition:o,replace:t,resetScroll:i,hashScrollIntoView:r,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:t,reloadDocument:i,href:r,publicHref:o,...a})=>{let u=!1;if(r)try{new URL(`${r}`),u=!0}catch{}if(u&&!i&&(i=!0),i){if(t!==void 0||!r){const d=this.buildLocation({to:t,...a});r=r??d.publicHref,o=o??d.publicHref}const f=!u&&o?o:r;if(ed(f))return Promise.resolve();if(!a.ignoreBlocker){const p=this.history.getBlockers?.()??[];for(const m of p)if(m?.blockerFn&&await m.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(f):window.location.href=f,Promise.resolve()}return this.buildAndCommitLocation({...a,href:r,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(i=>({...i,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:i.cachedMatches.filter(r=>!t.some(o=>o.id===r.id))}))},this.load=async t=>{let i,r,o;for(o=new Promise(u=>{this.startTransition(async()=>{try{this.beforeLoad();const f=this.latestLocation,d=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...zo({resolvedLocation:d,location:f})}),this.emit({type:"onBeforeLoad",...zo({resolvedLocation:d,location:f})}),await Sw({router:this,sync:t?.sync,matches:this.state.pendingMatches,location:f,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],m=[],g=[];Gu(()=>{this.__store.setState(v=>{const x=v.matches,w=v.pendingMatches||v.matches;return p=x.filter(C=>!w.some(E=>E.id===C.id)),m=w.filter(C=>!x.some(E=>E.id===C.id)),g=w.filter(C=>x.some(E=>E.id===C.id)),{...v,isLoading:!1,loadedAt:Date.now(),matches:w,pendingMatches:void 0,cachedMatches:[...v.cachedMatches,...p.filter(C=>C.status!=="error"&&C.status!=="notFound")]}}),this.clearExpiredCache()}),[[p,"onLeave"],[m,"onEnter"],[g,"onStay"]].forEach(([v,x])=>{v.forEach(w=>{this.looseRoutesById[w.routeId].options[x]?.(w)})})})})}})}catch(f){Li(f)?(i=f,this.navigate({...i.options,replace:!0,ignoreBlocker:!0})):bi(f)&&(r=f),this.__store.setState(d=>({...d,statusCode:i?i.status:r?404:d.matches.some(p=>p.status==="error")?500:200,redirect:i}))}this.latestLoadPromise===o&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),u()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(u=>u.status==="error")&&(a=500),a!==void 0&&this.__store.setState(u=>({...u,statusCode:a}))},this.startViewTransition=t=>{const i=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,i&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof i=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,a=this.state.resolvedLocation,u=typeof i.types=="function"?i.types(zo({resolvedLocation:a,location:o})):i.types;if(u===!1){t();return}r={update:t,types:u}}else r=t;document.startViewTransition(r)}else t()},this.updateMatch=(t,i)=>{this.startTransition(()=>{const r=this.state.pendingMatches?.some(o=>o.id===t)?"pendingMatches":this.state.matches.some(o=>o.id===t)?"matches":this.state.cachedMatches.some(o=>o.id===t)?"cachedMatches":"";r&&this.__store.setState(o=>({...o,[r]:o[r]?.map(a=>a.id===t?i(a):a)}))})},this.getMatch=t=>{const i=r=>r.id===t;return this.state.cachedMatches.find(i)??this.state.pendingMatches?.find(i)??this.state.matches.find(i)},this.invalidate=t=>{const i=r=>t?.filter?.(r)??!0?{...r,invalid:!0,...t?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r;return this.__store.setState(r=>({...r,matches:r.matches.map(i),cachedMatches:r.cachedMatches.map(i),pendingMatches:r.pendingMatches?.map(i)})),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const i=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const r=t.options._builtLocation??this.buildLocation(t.options),o=this.getParsedLocationHref(r);t.options.href=o,t.headers.set("Location",o)}else if(i)try{const r=new URL(i);if(this.origin&&r.origin===this.origin){const o=r.pathname+r.search+r.hash;t.options.href=o,t.headers.set("Location",o)}}catch{}return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{const i=t?.filter;i!==void 0?this.__store.setState(r=>({...r,cachedMatches:r.cachedMatches.filter(o=>!i(o))})):this.__store.setState(r=>({...r,cachedMatches:[]}))},this.clearExpiredCache=()=>{const t=i=>{const r=this.looseRoutesById[i.routeId];if(!r.options.loader)return!0;const o=(i.preload?r.options.preloadGcTime??this.options.defaultPreloadGcTime:r.options.gcTime??this.options.defaultGcTime)??300*1e3;return i.status==="error"?!0:Date.now()-i.updatedAt>=o};this.clearCache({filter:t})},this.loadRouteChunk=MC,this.preloadRoute=async t=>{const i=this.buildLocation(t);let r=this.matchRoutes(i,{throwOnError:!0,preload:!0,dest:t});const o=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(u=>u.id)),a=new Set([...o,...this.state.cachedMatches.map(u=>u.id)]);Gu(()=>{r.forEach(u=>{a.has(u.id)||this.__store.setState(f=>({...f,cachedMatches:[...f.cachedMatches,u]}))})});try{return r=await Sw({router:this,matches:r,location:i,preload:!0,updateMatch:(u,f)=>{o.has(u)?r=r.map(d=>d.id===u?f(d):d):this.updateMatch(u,f)}}),r}catch(u){if(Li(u))return u.options.reloadDocument?void 0:await this.preloadRoute({...u.options,_fromLocation:i});bi(u)||console.error(u);return}},this.matchRoute=(t,i)=>{const r={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},o=this.buildLocation(r);if(i?.pending&&this.state.status!=="pending")return!1;const u=(i?.pending===void 0?!this.state.isLoading:i.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,f=I3(o.pathname,i?.caseSensitive??!1,i?.fuzzy??!1,u.pathname,this.processedTree);return!f||t.params&&!Po(f.rawParams,t.params,{partial:!0})?!1:i?.includeSearch??!0?Po(u.search,o.search,{partial:!0})?f.rawParams:!1:f.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(t=>t.status==="notFound"||t.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??t4,parseSearch:e.parseSearch??e4}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:i}){this.routesById=e,this.routesByPath=t,this.processedTree=i;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const i=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:o,parsedParams:a}=i;let{matchedRoutes:u}=i,f=!1;(r?r.path!=="/"&&o["**"]:Gr(e.pathname))&&(this.options.notFoundRoute?u=[...u,this.options.notFoundRoute]:f=!0);const d=f?y4(this.options.notFoundMode,u):void 0,p=new Array(u.length),m=new Map(this.state.matches.map(g=>[g.routeId,g]));for(let g=0;g<u.length;g++){const v=u[g],x=p[g-1];let w,C,E;{const P=x?.search??e.search,$=x?._strictSearch??void 0;try{const _=zh(v.options.validateSearch,{...P})??void 0;w={...P,..._},C={...$,..._},E=void 0}catch(_){let H=_;if(_ instanceof rd||(H=new rd(_.message,{cause:_})),t?.throwOnError)throw H;w=P,C={},E=H}}const k=v.options.loaderDeps?.({search:w})??"",T=k?JSON.stringify(k):"",{interpolatedPath:A,usedParams:O}=Mg({path:v.fullPath,params:o,decoder:this.pathParamsDecoder,server:this.isServer}),N=v.id+A+T,M=this.getMatch(N),D=m.get(v.id),V=M?._strictParams??O;let U;if(!M)try{ww(v,O,a,V)}catch(P){if(bi(P)||Li(P)?U=P:U=new h4(P.message,{cause:P}),t?.throwOnError)throw U}Object.assign(o,V);const j=D?"stay":"enter";let I;if(M)I={...M,cause:j,params:D?.params??o,_strictParams:V,search:di(D?D.search:M.search,w),_strictSearch:C};else{const P=v.options.loader||v.options.beforeLoad||v.lazyFn||DC(v)?"pending":"success";I={id:N,ssr:v.options.ssr,index:g,routeId:v.id,params:D?.params??o,_strictParams:V,pathname:A,updatedAt:Date.now(),search:D?di(D.search,w):w,_strictSearch:C,searchError:void 0,status:P,isFetching:!1,error:void 0,paramsError:U,__routeContext:void 0,_nonReactive:{loadPromise:ha()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:j,loaderDeps:D?di(D.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:v.options.staticData||{},fullPath:v.fullPath}}t?.preload||(I.globalNotFound=d===v.id),I.searchError=E;const q=this.getParentContext(x);I.context={...q,...I.__routeContext,...I.__beforeLoadContext},p[g]=I}for(let g=0;g<p.length;g++){const v=p[g],x=this.looseRoutesById[v.routeId],w=this.getMatch(v.id),C=m.get(v.routeId);if(v.params=C?di(C.params,o):o,!w){const E=p[g-1],k=this.getParentContext(E);if(x.options.context){const T={deps:v.loaderDeps,params:v.params,context:k??{},location:e,navigate:A=>this.navigate({...A,_fromLocation:e}),buildLocation:this.buildLocation,cause:v.cause,abortController:v.abortController,preload:!!v.preload,matches:p,routeId:x.id};v.__routeContext=x.options.context(T)??void 0}v.context={...k,...v.__routeContext,...v.__beforeLoadContext}}}return p}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:i,parsedParams:r}=this.getMatchedRoutes(e.pathname),o=oc(t),a={...e.search};for(const p of t)try{Object.assign(a,zh(p.options.validateSearch,a))}catch{}const u=oc(this.state.matches),f=u&&u.routeId===o.id&&e.pathname===this.state.location.pathname;let d;if(f)d=u.params;else{const p={...i};for(const m of t)try{ww(m,i,r??{},p)}catch{}d=p}return{matchedRoutes:t,fullPath:o.fullPath,search:a,params:d}}}class rd extends Error{}class h4 extends Error{}function d4(n){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:n,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function zh(n,e){if(n==null)return{};if("~standard"in n){const t=n["~standard"].validate(e);if(t instanceof Promise)throw new rd("Async validation not supported");if(t.issues)throw new rd(JSON.stringify(t.issues,void 0,2),{cause:t});return t.value}return"parse"in n?n.parse(e):typeof n=="function"?n(e):{}}function p4({pathname:n,routesById:e,processedTree:t}){const i={},r=Gr(n);let o,a;const u=B3(r,t,!0);return u&&(o=u.route,Object.assign(i,u.rawParams),a=Object.assign({},u.parsedParams)),{matchedRoutes:u?.branch||[e[Di]],routeParams:i,foundRoute:o,parsedParams:a}}function m4({search:n,dest:e,destRoutes:t,_includeValidateSearch:i}){return g4(t)(n,e,i??!1)}function g4(n){const e={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const r of n){if("search"in r.options)r.options.search?.middlewares&&e.middlewares.push(...r.options.search.middlewares);else if(r.options.preSearchFilters||r.options.postSearchFilters){const o=({search:a,next:u})=>{let f=a;"preSearchFilters"in r.options&&r.options.preSearchFilters&&(f=r.options.preSearchFilters.reduce((p,m)=>m(p),a));const d=u(f);return"postSearchFilters"in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((p,m)=>m(p),d):d};e.middlewares.push(o)}if(r.options.validateSearch){const o=({search:a,next:u})=>{const f=u(a);if(!e._includeValidateSearch)return f;try{return{...f,...zh(r.options.validateSearch,f)??void 0}}catch{return f}};e.middlewares.push(o)}}const t=({search:r})=>{const o=e.dest;return o.search?o.search===!0?r:_s(o.search,r):{}};e.middlewares.push(t);const i=(r,o,a)=>{if(r>=a.length)return o;const u=a[r];return u({search:o,next:d=>i(r+1,d,a)})};return function(o,a,u){return e.dest=a,e._includeValidateSearch=u,i(0,o,e.middlewares)}}function y4(n,e){if(n!=="root")for(let t=e.length-1;t>=0;t--){const i=e[t];if(i.children)return i.id}return Di}function ww(n,e,t,i){const r=n.options.params?.parse??n.options.parseParams;if(r)if(n.options.skipRouteOnParseError)for(const o in e)o in t&&(i[o]=t[o]);else{const o=r(i);Object.assign(i,o)}}const v4="Error preloading route! ☝️";class IC{constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const i=this.options,r=!i?.path&&!i?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=Di:this.parentRoute||Jr(!1);let o=r?Di:i?.path;o&&o!=="/"&&(o=wC(o));const a=i?.id||o;let u=r?Di:_h([this.parentRoute.id===Di?"":this.parentRoute.id,a]);o===Di&&(o="/"),u!==Di&&(u=_h(["/",u]));const f=u===Di?"/":_h([this.parentRoute.fullPath,o]);this._path=o,this._id=u,this._fullPath=f,this._to=Gr(f)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>RC({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class b4{constructor({id:e}){this.notFound=t=>CC({routeId:this.id,...t}),this.redirect=t=>RC({from:this.id,...t}),this.id=e}}class x4 extends IC{constructor(e){super(e)}}var Ng={exports:{}},Ze={};var Ew;function S4(){if(Ew)return Ze;Ew=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),g=Symbol.iterator;function v(B){return B===null||typeof B!="object"?null:(B=g&&B[g]||B["@@iterator"],typeof B=="function"?B:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,C={};function E(B,K,X){this.props=B,this.context=K,this.refs=C,this.updater=X||x}E.prototype.isReactComponent={},E.prototype.setState=function(B,K){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,K,"setState")},E.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function k(){}k.prototype=E.prototype;function T(B,K,X){this.props=B,this.context=K,this.refs=C,this.updater=X||x}var A=T.prototype=new k;A.constructor=T,w(A,E.prototype),A.isPureReactComponent=!0;var O=Array.isArray;function N(){}var M={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function V(B,K,X){var J=X.ref;return{$$typeof:n,type:B,key:K,ref:J!==void 0?J:null,props:X}}function U(B,K){return V(B.type,K,B.props)}function j(B){return typeof B=="object"&&B!==null&&B.$$typeof===n}function I(B){var K={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(X){return K[X]})}var q=/\/+/g;function P(B,K){return typeof B=="object"&&B!==null&&B.key!=null?I(""+B.key):K.toString(36)}function $(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(N,N):(B.status="pending",B.then(function(K){B.status==="pending"&&(B.status="fulfilled",B.value=K)},function(K){B.status==="pending"&&(B.status="rejected",B.reason=K)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function _(B,K,X,J,W){var re=typeof B;(re==="undefined"||re==="boolean")&&(B=null);var ae=!1;if(B===null)ae=!0;else switch(re){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(B.$$typeof){case n:case e:ae=!0;break;case p:return ae=B._init,_(ae(B._payload),K,X,J,W)}}if(ae)return W=W(B),ae=J===""?"."+P(B,0):J,O(W)?(X="",ae!=null&&(X=ae.replace(q,"$&/")+"/"),_(W,K,X,"",function(Te){return Te})):W!=null&&(j(W)&&(W=U(W,X+(W.key==null||B&&B.key===W.key?"":(""+W.key).replace(q,"$&/")+"/")+ae)),K.push(W)),1;ae=0;var fe=J===""?".":J+":";if(O(B))for(var pe=0;pe<B.length;pe++)J=B[pe],re=fe+P(J,pe),ae+=_(J,K,X,re,W);else if(pe=v(B),typeof pe=="function")for(B=pe.call(B),pe=0;!(J=B.next()).done;)J=J.value,re=fe+P(J,pe++),ae+=_(J,K,X,re,W);else if(re==="object"){if(typeof B.then=="function")return _($(B),K,X,J,W);throw K=String(B),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return ae}function H(B,K,X){if(B==null)return B;var J=[],W=0;return _(B,J,"","",function(re){return K.call(X,re,W++)}),J}function z(B){if(B._status===-1){var K=B._result;K=K(),K.then(function(X){(B._status===0||B._status===-1)&&(B._status=1,B._result=X)},function(X){(B._status===0||B._status===-1)&&(B._status=2,B._result=X)}),B._status===-1&&(B._status=0,B._result=K)}if(B._status===1)return B._result.default;throw B._result}var Q=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},ee={map:H,forEach:function(B,K,X){H(B,function(){K.apply(this,arguments)},X)},count:function(B){var K=0;return H(B,function(){K++}),K},toArray:function(B){return H(B,function(K){return K})||[]},only:function(B){if(!j(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Ze.Activity=m,Ze.Children=ee,Ze.Component=E,Ze.Fragment=t,Ze.Profiler=r,Ze.PureComponent=T,Ze.StrictMode=i,Ze.Suspense=f,Ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Ze.__COMPILER_RUNTIME={__proto__:null,c:function(B){return M.H.useMemoCache(B)}},Ze.cache=function(B){return function(){return B.apply(null,arguments)}},Ze.cacheSignal=function(){return null},Ze.cloneElement=function(B,K,X){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var J=w({},B.props),W=B.key;if(K!=null)for(re in K.key!==void 0&&(W=""+K.key),K)!D.call(K,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&K.ref===void 0||(J[re]=K[re]);var re=arguments.length-2;if(re===1)J.children=X;else if(1<re){for(var ae=Array(re),fe=0;fe<re;fe++)ae[fe]=arguments[fe+2];J.children=ae}return V(B.type,W,J)},Ze.createContext=function(B){return B={$$typeof:a,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:o,_context:B},B},Ze.createElement=function(B,K,X){var J,W={},re=null;if(K!=null)for(J in K.key!==void 0&&(re=""+K.key),K)D.call(K,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(W[J]=K[J]);var ae=arguments.length-2;if(ae===1)W.children=X;else if(1<ae){for(var fe=Array(ae),pe=0;pe<ae;pe++)fe[pe]=arguments[pe+2];W.children=fe}if(B&&B.defaultProps)for(J in ae=B.defaultProps,ae)W[J]===void 0&&(W[J]=ae[J]);return V(B,re,W)},Ze.createRef=function(){return{current:null}},Ze.forwardRef=function(B){return{$$typeof:u,render:B}},Ze.isValidElement=j,Ze.lazy=function(B){return{$$typeof:p,_payload:{_status:-1,_result:B},_init:z}},Ze.memo=function(B,K){return{$$typeof:d,type:B,compare:K===void 0?null:K}},Ze.startTransition=function(B){var K=M.T,X={};M.T=X;try{var J=B(),W=M.S;W!==null&&W(X,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(N,Q)}catch(re){Q(re)}finally{K!==null&&X.types!==null&&(K.types=X.types),M.T=K}},Ze.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Ze.use=function(B){return M.H.use(B)},Ze.useActionState=function(B,K,X){return M.H.useActionState(B,K,X)},Ze.useCallback=function(B,K){return M.H.useCallback(B,K)},Ze.useContext=function(B){return M.H.useContext(B)},Ze.useDebugValue=function(){},Ze.useDeferredValue=function(B,K){return M.H.useDeferredValue(B,K)},Ze.useEffect=function(B,K){return M.H.useEffect(B,K)},Ze.useEffectEvent=function(B){return M.H.useEffectEvent(B)},Ze.useId=function(){return M.H.useId()},Ze.useImperativeHandle=function(B,K,X){return M.H.useImperativeHandle(B,K,X)},Ze.useInsertionEffect=function(B,K){return M.H.useInsertionEffect(B,K)},Ze.useLayoutEffect=function(B,K){return M.H.useLayoutEffect(B,K)},Ze.useMemo=function(B,K){return M.H.useMemo(B,K)},Ze.useOptimistic=function(B,K){return M.H.useOptimistic(B,K)},Ze.useReducer=function(B,K,X){return M.H.useReducer(B,K,X)},Ze.useRef=function(B){return M.H.useRef(B)},Ze.useState=function(B){return M.H.useState(B)},Ze.useSyncExternalStore=function(B,K,X){return M.H.useSyncExternalStore(B,K,X)},Ze.useTransition=function(){return M.H.useTransition()},Ze.version="19.2.4",Ze}var Cw;function Tc(){return Cw||(Cw=1,Ng.exports=S4()),Ng.exports}var S=Tc();const es=h3(S),Zy=f3({__proto__:null,default:es},[S]),w4="use",Rw=Zy[w4],ih=typeof window<"u"?S.useLayoutEffect:S.useEffect;function Lg(n){const e=S.useRef({value:n,prev:null}),t=e.current.value;return n!==t&&(e.current={value:n,prev:t}),e.current.prev}function E4(n,e,t={},i={}){S.useEffect(()=>{if(!n.current||i.disabled||typeof IntersectionObserver!="function")return;const r=new IntersectionObserver(([o])=>{e(o)},t);return r.observe(n.current),()=>{r.disconnect()}},[e,t,i.disabled,n])}function C4(n){const e=S.useRef(null);return S.useImperativeHandle(n,()=>e.current,[]),e}function Jy(n){const e=n.errorComponent??ev;return Y.jsx(R4,{getResetKey:n.getResetKey,onCatch:n.onCatch,children:({error:t,reset:i})=>t?S.createElement(e,{error:t,reset:i}):n.children})}class R4 extends S.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function ev({error:n}){const[e,t]=S.useState(!1);return Y.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[Y.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[Y.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),Y.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>t(i=>!i),children:e?"Hide Error":"Show Error"})]}),Y.jsx("div",{style:{height:".25rem"}}),e?Y.jsx("div",{children:Y.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:n.message?Y.jsx("code",{children:n.message}):null})}):null]})}function k4({children:n,fallback:e=null}){return BC()?Y.jsx(es.Fragment,{children:n}):Y.jsx(es.Fragment,{children:e})}function BC(){return es.useSyncExternalStore(T4,()=>!0,()=>!1)}function T4(){return()=>{}}var Ig={exports:{}},Bg={},_g={exports:{}},Pg={};var kw;function A4(){if(kw)return Pg;kw=1;var n=Tc();function e(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var t=typeof Object.is=="function"?Object.is:e,i=n.useState,r=n.useEffect,o=n.useLayoutEffect,a=n.useDebugValue;function u(m,g){var v=g(),x=i({inst:{value:v,getSnapshot:g}}),w=x[0].inst,C=x[1];return o(function(){w.value=v,w.getSnapshot=g,f(w)&&C({inst:w})},[m,v,g]),r(function(){return f(w)&&C({inst:w}),m(function(){f(w)&&C({inst:w})})},[m]),a(v),v}function f(m){var g=m.getSnapshot;m=m.value;try{var v=g();return!t(m,v)}catch{return!0}}function d(m,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:u;return Pg.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:p,Pg}var Tw;function O4(){return Tw||(Tw=1,_g.exports=A4()),_g.exports}var Aw;function M4(){if(Aw)return Bg;Aw=1;var n=Tc(),e=O4();function t(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var i=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=n.useRef,a=n.useEffect,u=n.useMemo,f=n.useDebugValue;return Bg.useSyncExternalStoreWithSelector=function(d,p,m,g,v){var x=o(null);if(x.current===null){var w={hasValue:!1,value:null};x.current=w}else w=x.current;x=u(function(){function E(N){if(!k){if(k=!0,T=N,N=g(N),v!==void 0&&w.hasValue){var M=w.value;if(v(M,N))return A=M}return A=N}if(M=A,i(T,N))return M;var D=g(N);return v!==void 0&&v(M,D)?(T=N,M):(T=N,A=D)}var k=!1,T,A,O=m===void 0?null:m;return[function(){return E(p())},O===null?void 0:function(){return E(O())}]},[p,m,g,v]);var C=r(d,x[0],x[1]);return a(function(){w.hasValue=!0,w.value=C},[C]),f(C),C},Bg}var Ow;function D4(){return Ow||(Ow=1,Ig.exports=M4()),Ig.exports}var N4=D4();function L4(n,e=i=>i,t={}){const i=t.equal??I4;return N4.useSyncExternalStoreWithSelector(n.subscribe,()=>n.state,()=>n.state,e,i)}function I4(n,e){if(Object.is(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;if(n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(const[i,r]of n)if(!e.has(i)||!Object.is(r,e.get(i)))return!1;return!0}if(n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(const i of n)if(!e.has(i))return!1;return!0}if(n instanceof Date&&e instanceof Date)return n.getTime()===e.getTime();const t=Mw(n);if(t.length!==Mw(e).length)return!1;for(let i=0;i<t.length;i++)if(!Object.prototype.hasOwnProperty.call(e,t[i])||!Object.is(n[t[i]],e[t[i]]))return!1;return!0}function Mw(n){return Object.keys(n).concat(Object.getOwnPropertySymbols(n))}const zg=S.createContext(null);function _C(){return typeof document>"u"?zg:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=zg,zg)}function Jn(n){const e=S.useContext(_C());return n?.warn,e}function xi(n){const e=Jn({warn:n?.router===void 0}),t=n?.router||e,i=S.useRef(void 0);return L4(t.__store,r=>{if(n?.select){if(n.structuralSharing??t.options.defaultStructuralSharing){const o=di(i.current,n.select(r));return i.current=o,o}return n.select(r)}return r})}const Bd=S.createContext(void 0),B4=S.createContext(void 0);function zi(n){const e=S.useContext(n.from?B4:Bd);return xi({select:i=>{const r=i.matches.find(o=>n.from?n.from===o.routeId:o.id===e);if(Jr(!((n.shouldThrow??!0)&&!r),`Could not find ${n.from?`an active match from "${n.from}"`:"a nearest match!"}`),r!==void 0)return n.select?n.select(r):r},structuralSharing:n.structuralSharing})}function _d(n){return zi({from:n.from,strict:n.strict,structuralSharing:n.structuralSharing,select:e=>n.select?n.select(e.loaderData):e.loaderData})}function Pd(n){const{select:e,...t}=n;return zi({...t,select:i=>e?e(i.loaderDeps):i.loaderDeps})}function zd(n){return zi({from:n.from,shouldThrow:n.shouldThrow,structuralSharing:n.structuralSharing,strict:n.strict,select:e=>{const t=n.strict===!1?e.params:e._strictParams;return n.select?n.select(t):t}})}function Hd(n){return zi({from:n.from,strict:n.strict,shouldThrow:n.shouldThrow,structuralSharing:n.structuralSharing,select:e=>n.select?n.select(e.search):e.search})}function Vd(n){const e=Jn();return S.useCallback(t=>e.navigate({...t,from:t.from??n?.from}),[n?.from,e])}var Hg={exports:{}},Dn={};var Dw;function _4(){if(Dw)return Dn;Dw=1;var n=Tc();function e(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var i={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},r=Symbol.for("react.portal");function o(f,d,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:m==null?null:""+m,children:f,containerInfo:d,implementation:p}}var a=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Dn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Dn.createPortal=function(f,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return o(f,d,null,p)},Dn.flushSync=function(f){var d=a.T,p=i.p;try{if(a.T=null,i.p=2,f)return f()}finally{a.T=d,i.p=p,i.d.f()}},Dn.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,i.d.C(f,d))},Dn.prefetchDNS=function(f){typeof f=="string"&&i.d.D(f)},Dn.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var p=d.as,m=u(p,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,v=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?i.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:g,fetchPriority:v}):p==="script"&&i.d.X(f,{crossOrigin:m,integrity:g,fetchPriority:v,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Dn.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=u(d.as,d.crossOrigin);i.d.M(f,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&i.d.M(f)},Dn.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,m=u(p,d.crossOrigin);i.d.L(f,p,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Dn.preloadModule=function(f,d){if(typeof f=="string")if(d){var p=u(d.as,d.crossOrigin);i.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else i.d.m(f)},Dn.requestFormReset=function(f){i.d.r(f)},Dn.unstable_batchedUpdates=function(f,d){return f(d)},Dn.useFormState=function(f,d,p){return a.H.useFormState(f,d,p)},Dn.useFormStatus=function(){return a.H.useHostTransitionStatus()},Dn.version="19.2.4",Dn}var Nw;function PC(){if(Nw)return Hg.exports;Nw=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),Hg.exports=_4(),Hg.exports}var ei=PC();function P4(n,e){const t=Jn(),i=C4(e),{activeProps:r,inactiveProps:o,activeOptions:a,to:u,preload:f,preloadDelay:d,hashScrollIntoView:p,replace:m,startTransition:g,resetScroll:v,viewTransition:x,children:w,target:C,disabled:E,style:k,className:T,onClick:A,onFocus:O,onMouseEnter:N,onMouseLeave:M,onTouchStart:D,ignoreBlocker:V,params:U,search:j,hash:I,state:q,mask:P,reloadDocument:$,unsafeRelative:_,from:H,_fromLocation:z,...Q}=n,ee=BC(),B=xi({select:Ne=>Ne.location.search,structuralSharing:!0}),K=n.from,X=S.useMemo(()=>({...n,from:K}),[t,B,K,n._fromLocation,n.hash,n.to,n.search,n.params,n.state,n.mask,n.unsafeRelative]),J=S.useMemo(()=>t.buildLocation({...X}),[t,X]),W=J.maskedLocation?J.maskedLocation.publicHref:J.publicHref,re=J.maskedLocation?J.maskedLocation.external:J.external,ae=S.useMemo(()=>q4(W,re,t.history,E),[E,re,W,t.history]),fe=S.useMemo(()=>{if(ae?.external)return ed(ae.href)?void 0:ae.href;if(!F4(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),ed(u)?void 0:u}catch{}},[u,ae]),pe=xi({select:Ne=>{if(fe)return!1;if(a?.exact){if(!U3(Ne.location.pathname,J.pathname,t.basepath))return!1}else{const Ge=nd(Ne.location.pathname,t.basepath),je=nd(J.pathname,t.basepath);if(!(Ge.startsWith(je)&&(Ge.length===je.length||Ge[je.length]==="/")))return!1}return(a?.includeSearch??!0)&&!Po(Ne.location.search,J.search,{partial:!a?.exact,ignoreUndefined:!a?.explicitUndefined})?!1:a?.includeHash?ee&&Ne.location.hash===J.hash:!0}}),Te=pe?_s(r,{})??z4:Vg,le=pe?Vg:_s(o,{})??Vg,Ee=[T,Te.className,le.className].filter(Boolean).join(" "),Ce=(k||Te.style||le.style)&&{...k,...Te.style,...le.style},[Ue,me]=S.useState(!1),ve=S.useRef(!1),ge=n.reloadDocument||fe?!1:f??t.options.defaultPreload,Ae=d??t.options.defaultPreloadDelay??0,Oe=S.useCallback(()=>{t.preloadRoute({...X}).catch(Ne=>{console.warn(Ne),console.warn(v4)})},[t,X]),Ye=S.useCallback(Ne=>{Ne?.isIntersecting&&Oe()},[Oe]);E4(i,Ye,j4,{disabled:!!E||ge!=="viewport"}),S.useEffect(()=>{ve.current||!E&&ge==="render"&&(Oe(),ve.current=!0)},[E,Oe,ge]);const de=Ne=>{const Ge=Ne.currentTarget.getAttribute("target"),je=C!==void 0?C:Ge;if(!E&&!$4(Ne)&&!Ne.defaultPrevented&&(!je||je==="_self")&&Ne.button===0){Ne.preventDefault(),ei.flushSync(()=>{me(!0)});const mt=t.subscribe("onResolved",()=>{mt(),me(!1)});t.navigate({...X,replace:m,resetScroll:v,hashScrollIntoView:p,startTransition:g,viewTransition:x,ignoreBlocker:V})}};if(fe)return{...Q,ref:i,href:fe,...w&&{children:w},...C&&{target:C},...E&&{disabled:E},...k&&{style:k},...T&&{className:T},...A&&{onClick:A},...O&&{onFocus:O},...N&&{onMouseEnter:N},...M&&{onMouseLeave:M},...D&&{onTouchStart:D}};const ke=Ne=>{E||ge&&Oe()},we=ke,ye=Ne=>{if(!(E||!ge))if(!Ae)Oe();else{const Ge=Ne.target;if(Ou.has(Ge))return;const je=setTimeout(()=>{Ou.delete(Ge),Oe()},Ae);Ou.set(Ge,je)}},De=Ne=>{if(E||!ge||!Ae)return;const Ge=Ne.target,je=Ou.get(Ge);je&&(clearTimeout(je),Ou.delete(Ge))};return{...Q,...Te,...le,href:ae?.href,ref:i,onClick:Mu([A,de]),onFocus:Mu([O,ke]),onMouseEnter:Mu([N,ye]),onMouseLeave:Mu([M,De]),onTouchStart:Mu([D,we]),disabled:!!E,target:C,...Ce&&{style:Ce},...Ee&&{className:Ee},...E&&H4,...pe&&V4,...ee&&Ue&&U4}}const Vg={},z4={className:"active"},H4={role:"link","aria-disabled":!0},V4={"data-status":"active","aria-current":"page"},U4={"data-transitioning":"transitioning"},Ou=new WeakMap,j4={rootMargin:"100px"},Mu=n=>e=>{for(const t of n)if(t){if(e.defaultPrevented)return;t(e)}};function q4(n,e,t,i){if(!i)return e?{href:n,external:!0}:{href:t.createHref(n)||"/",external:!1}}function F4(n){if(typeof n!="string")return!1;const e=n.charCodeAt(0);return e===47?n.charCodeAt(1)!==47:e===46}const Ud=S.forwardRef((n,e)=>{const{_asChild:t,...i}=n,{type:r,...o}=P4(i,e),a=typeof i.children=="function"?i.children({isActive:o["data-status"]==="active"}):i.children;if(!t){const{disabled:u,...f}=o;return S.createElement("a",f,a)}return S.createElement(t,o,a)});function $4(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function xH(n){return new K4({id:n})}class K4 extends b4{constructor({id:e}){super({id:e}),this.useMatch=t=>zi({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>zi({from:this.id,select:i=>t?.select?t.select(i.context):i.context}),this.useSearch=t=>Hd({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>zd({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Pd({...t,from:this.id,strict:!1}),this.useLoaderData=t=>_d({...t,from:this.id,strict:!1}),this.useNavigate=()=>{const t=Jn();return Vd({from:t.routesById[this.id].fullPath})},this.notFound=t=>CC({routeId:this.id,...t}),this.Link=es.forwardRef((t,i)=>{const o=Jn().routesById[this.id].fullPath;return Y.jsx(Ud,{ref:i,from:o,...t})})}}let Y4=class extends IC{constructor(e){super(e),this.useMatch=t=>zi({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>zi({...t,from:this.id,select:i=>t?.select?t.select(i.context):i.context}),this.useSearch=t=>Hd({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>zd({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Pd({...t,from:this.id}),this.useLoaderData=t=>_d({...t,from:this.id}),this.useNavigate=()=>Vd({from:this.fullPath}),this.Link=es.forwardRef((t,i)=>Y.jsx(Ud,{ref:i,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function G4(n){return new Y4(n)}class Q4 extends x4{constructor(e){super(e),this.useMatch=t=>zi({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>zi({...t,from:this.id,select:i=>t?.select?t.select(i.context):i.context}),this.useSearch=t=>Hd({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>zd({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Pd({...t,from:this.id}),this.useLoaderData=t=>_d({...t,from:this.id}),this.useNavigate=()=>Vd({from:this.fullPath}),this.Link=es.forwardRef((t,i)=>Y.jsx(Ud,{ref:i,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}}function X4(n){return new Q4(n)}function $s(n){return typeof n=="object"?new Lw(n,{silent:!0}).createRoute(n):new Lw(n,{silent:!0}).createRoute}class Lw{constructor(e,t){this.path=e,this.createRoute=i=>{this.silent;const r=G4(i);return r.isRoot=!1,r},this.silent=t?.silent}}class Iw{constructor(e){this.useMatch=t=>zi({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>zi({from:this.options.id,select:i=>t?.select?t.select(i.context):i.context}),this.useSearch=t=>Hd({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>zd({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>Pd({...t,from:this.options.id}),this.useLoaderData=t=>_d({...t,from:this.options.id}),this.useNavigate=()=>{const t=Jn();return Vd({from:t.routesById[this.options.id].fullPath})},this.options=e,this.$$typeof=Symbol.for("react.memo")}}function Bw(n){return typeof n=="object"?new Iw(n):e=>new Iw({id:n,...e})}function Ta(n,e){let t,i,r,o;const a=()=>(t||(t=n().then(f=>{t=void 0,i=f[e]}).catch(f=>{if(r=f,T3(r)&&r instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const d=`tanstack_router_reload:${r.message}`;sessionStorage.getItem(d)||(sessionStorage.setItem(d,"1"),o=!0)}})),t),u=function(d){if(o)throw window.location.reload(),new Promise(()=>{});if(r)throw r;if(!i)if(Rw)Rw(a());else throw a();return S.createElement(i,d)};return u.preload=a,u}function W4(){const n=Jn(),e=S.useRef({router:n,mounted:!1}),[t,i]=S.useState(!1),{hasPendingMatches:r,isLoading:o}=xi({select:m=>({isLoading:m.isLoading,hasPendingMatches:m.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),a=Lg(o),u=o||t||r,f=Lg(u),d=o||r,p=Lg(d);return n.startTransition=m=>{i(!0),S.startTransition(()=>{m(),i(!1)})},S.useEffect(()=>{const m=n.history.subscribe(n.load),g=n.buildLocation({to:n.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Gr(n.latestLocation.publicHref)!==Gr(g.publicHref)&&n.commitLocation({...g,replace:!0}),()=>{m()}},[n,n.history]),ih(()=>{if(typeof window<"u"&&n.ssr||e.current.router===n&&e.current.mounted)return;e.current={router:n,mounted:!0},(async()=>{try{await n.load()}catch(g){console.error(g)}})()},[n]),ih(()=>{a&&!o&&n.emit({type:"onLoad",...zo(n.state)})},[a,n,o]),ih(()=>{p&&!d&&n.emit({type:"onBeforeRouteMount",...zo(n.state)})},[d,p,n]),ih(()=>{if(f&&!u){const m=zo(n.state);n.emit({type:"onResolved",...m}),n.__store.setState(g=>({...g,status:"idle",resolvedLocation:g.location})),m.hrefChanged&&W3(n)}},[u,f,n]),null}function Z4(n){const e=xi({select:t=>`not-found-${t.location.pathname}-${t.status}`});return Y.jsx(Jy,{getResetKey:()=>e,onCatch:(t,i)=>{if(bi(t))n.onCatch?.(t,i);else throw t},errorComponent:({error:t})=>{if(bi(t))return n.fallback?.(t);throw t},children:n.children})}function J4(){return Y.jsx("p",{children:"Not Found"})}function Kl(n){return Y.jsx(Y.Fragment,{children:n.children})}function zC(n,e,t){return e.options.notFoundComponent?Y.jsx(e.options.notFoundComponent,{...t}):n.options.defaultNotFoundComponent?Y.jsx(n.options.defaultNotFoundComponent,{...t}):Y.jsx(J4,{})}function e6(){return Jn().isScrollRestoring,null}const HC=S.memo(function({matchId:e}){const t=Jn(),i=xi({select:w=>{const C=w.matches.findIndex(k=>k.id===e),E=w.matches[C];return Jr(E),{routeId:E.routeId,ssr:E.ssr,_displayPending:E._displayPending,resetKey:w.loadedAt,parentRouteId:w.matches[C-1]?.routeId}},structuralSharing:!0}),r=t.routesById[i.routeId],o=r.options.pendingComponent??t.options.defaultPendingComponent,a=o?Y.jsx(o,{}):null,u=r.options.errorComponent??t.options.defaultErrorComponent,f=r.options.onCatch??t.options.defaultOnCatch,d=r.isRoot?r.options.notFoundComponent??t.options.notFoundRoute?.options.component:r.options.notFoundComponent,p=i.ssr===!1||i.ssr==="data-only",m=(!r.isRoot||r.options.wrapInSuspense||p)&&(r.options.wrapInSuspense??o??(r.options.errorComponent?.preload||p))?S.Suspense:Kl,g=u?Jy:Kl,v=d?Z4:Kl,x=r.isRoot?r.options.shellComponent??Kl:Kl;return Y.jsxs(x,{children:[Y.jsx(Bd.Provider,{value:e,children:Y.jsx(m,{fallback:a,children:Y.jsx(g,{getResetKey:()=>i.resetKey,errorComponent:u||ev,onCatch:(w,C)=>{if(bi(w))throw w;f?.(w,C)},children:Y.jsx(v,{fallback:w=>{if(!d||w.routeId&&w.routeId!==i.routeId||!w.routeId&&!r.isRoot)throw w;return S.createElement(d,w)},children:p||i._displayPending?Y.jsx(k4,{fallback:a,children:Y.jsx(_w,{matchId:e})}):Y.jsx(_w,{matchId:e})})})})}),i.parentRouteId===Di&&t.options.scrollRestoration?Y.jsxs(Y.Fragment,{children:[Y.jsx(t6,{}),Y.jsx(e6,{})]}):null]})});function t6(){const n=Jn(),e=S.useRef(void 0);return Y.jsx("script",{suppressHydrationWarning:!0,ref:t=>{t&&(e.current===void 0||e.current.href!==n.latestLocation.href)&&(n.emit({type:"onRendered",...zo(n.state)}),e.current=n.latestLocation)}},n.latestLocation.state.__TSR_key)}const _w=S.memo(function({matchId:e}){const t=Jn(),{match:i,key:r,routeId:o}=xi({select:f=>{const d=f.matches.find(x=>x.id===e),p=d.routeId,g=(t.routesById[p].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:p,loaderDeps:d.loaderDeps,params:d._strictParams,search:d._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:p,match:{id:d.id,status:d.status,error:d.error,invalid:d.invalid,_forcePending:d._forcePending,_displayPending:d._displayPending}}},structuralSharing:!0}),a=t.routesById[o],u=S.useMemo(()=>{const f=a.options.component??t.options.defaultComponent;return f?Y.jsx(f,{},r):Y.jsx(VC,{})},[r,a.options.component,t.options.defaultComponent]);if(i._displayPending)throw t.getMatch(i.id)?._nonReactive.displayPendingPromise;if(i._forcePending)throw t.getMatch(i.id)?._nonReactive.minPendingPromise;if(i.status==="pending"){const f=a.options.pendingMinMs??t.options.defaultPendingMinMs;if(f){const d=t.getMatch(i.id);if(d&&!d._nonReactive.minPendingPromise){const p=ha();d._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),d._nonReactive.minPendingPromise=void 0},f)}}throw t.getMatch(i.id)?._nonReactive.loadPromise}if(i.status==="notFound")return Jr(bi(i.error)),zC(t,a,i.error);if(i.status==="redirected")throw Jr(Li(i.error)),t.getMatch(i.id)?._nonReactive.loadPromise;if(i.status==="error")throw i.error;return u}),VC=S.memo(function(){const e=Jn(),t=S.useContext(Bd),i=xi({select:d=>d.matches.find(p=>p.id===t)?.routeId}),r=e.routesById[i],o=xi({select:d=>{const m=d.matches.find(g=>g.id===t);return Jr(m),m.globalNotFound}}),a=xi({select:d=>{const p=d.matches,m=p.findIndex(g=>g.id===t);return p[m+1]?.id}}),u=e.options.defaultPendingComponent?Y.jsx(e.options.defaultPendingComponent,{}):null;if(o)return zC(e,r,void 0);if(!a)return null;const f=Y.jsx(HC,{matchId:a});return i===Di?Y.jsx(S.Suspense,{fallback:u,children:f}):f});function n6(){const n=Jn(),t=n.routesById[Di].options.pendingComponent??n.options.defaultPendingComponent,i=t?Y.jsx(t,{}):null,r=typeof document<"u"&&n.ssr?Kl:S.Suspense,o=Y.jsxs(r,{fallback:i,children:[Y.jsx(W4,{}),Y.jsx(i6,{})]});return n.options.InnerWrap?Y.jsx(n.options.InnerWrap,{children:o}):o}function i6(){const n=Jn(),e=xi({select:r=>r.matches[0]?.id}),t=xi({select:r=>r.loadedAt}),i=e?Y.jsx(HC,{matchId:e}):null;return Y.jsx(Bd.Provider,{value:e,children:n.options.disableGlobalCatchBoundary?i:Y.jsx(Jy,{getResetKey:()=>t,errorComponent:ev,onCatch:r=>{r.message||r.toString()},children:i})})}const r6=n=>new s6(n);class s6 extends f4{constructor(e){super(e)}}typeof globalThis<"u"?(globalThis.createFileRoute=$s,globalThis.createLazyFileRoute=Bw):typeof window<"u"&&(window.createFileRoute=$s,window.createLazyFileRoute=Bw);function o6({router:n,children:e,...t}){Object.keys(t).length>0&&n.update({...n.options,...t,context:{...n.options.context,...t.context}});const i=_C(),r=Y.jsx(i.Provider,{value:n,children:e});return n.options.Wrap?Y.jsx(n.options.Wrap,{children:r}):r}function l6({router:n,...e}){return Y.jsx(o6,{router:n,...e,children:Y.jsx(n6,{})})}var Ug={exports:{}},Du={},jg={exports:{}},qg={};var Pw;function a6(){return Pw||(Pw=1,(function(n){function e(_,H){var z=_.length;_.push(H);e:for(;0<z;){var Q=z-1>>>1,ee=_[Q];if(0<r(ee,H))_[Q]=H,_[z]=ee,z=Q;else break e}}function t(_){return _.length===0?null:_[0]}function i(_){if(_.length===0)return null;var H=_[0],z=_.pop();if(z!==H){_[0]=z;e:for(var Q=0,ee=_.length,B=ee>>>1;Q<B;){var K=2*(Q+1)-1,X=_[K],J=K+1,W=_[J];if(0>r(X,z))J<ee&&0>r(W,X)?(_[Q]=W,_[J]=z,Q=J):(_[Q]=X,_[K]=z,Q=K);else if(J<ee&&0>r(W,z))_[Q]=W,_[J]=z,Q=J;else break e}}return H}function r(_,H){var z=_.sortIndex-H.sortIndex;return z!==0?z:_.id-H.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var a=Date,u=a.now();n.unstable_now=function(){return a.now()-u}}var f=[],d=[],p=1,m=null,g=3,v=!1,x=!1,w=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function A(_){for(var H=t(d);H!==null;){if(H.callback===null)i(d);else if(H.startTime<=_)i(d),H.sortIndex=H.expirationTime,e(f,H);else break;H=t(d)}}function O(_){if(w=!1,A(_),!x)if(t(f)!==null)x=!0,N||(N=!0,I());else{var H=t(d);H!==null&&$(O,H.startTime-_)}}var N=!1,M=-1,D=5,V=-1;function U(){return C?!0:!(n.unstable_now()-V<D)}function j(){if(C=!1,N){var _=n.unstable_now();V=_;var H=!0;try{e:{x=!1,w&&(w=!1,k(M),M=-1),v=!0;var z=g;try{t:{for(A(_),m=t(f);m!==null&&!(m.expirationTime>_&&U());){var Q=m.callback;if(typeof Q=="function"){m.callback=null,g=m.priorityLevel;var ee=Q(m.expirationTime<=_);if(_=n.unstable_now(),typeof ee=="function"){m.callback=ee,A(_),H=!0;break t}m===t(f)&&i(f),A(_)}else i(f);m=t(f)}if(m!==null)H=!0;else{var B=t(d);B!==null&&$(O,B.startTime-_),H=!1}}break e}finally{m=null,g=z,v=!1}H=void 0}}finally{H?I():N=!1}}}var I;if(typeof T=="function")I=function(){T(j)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,P=q.port2;q.port1.onmessage=j,I=function(){P.postMessage(null)}}else I=function(){E(j,0)};function $(_,H){M=E(function(){_(n.unstable_now())},H)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(_){_.callback=null},n.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<_?Math.floor(1e3/_):5},n.unstable_getCurrentPriorityLevel=function(){return g},n.unstable_next=function(_){switch(g){case 1:case 2:case 3:var H=3;break;default:H=g}var z=g;g=H;try{return _()}finally{g=z}},n.unstable_requestPaint=function(){C=!0},n.unstable_runWithPriority=function(_,H){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var z=g;g=_;try{return H()}finally{g=z}},n.unstable_scheduleCallback=function(_,H,z){var Q=n.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?Q+z:Q):z=Q,_){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=z+ee,_={id:p++,callback:H,priorityLevel:_,startTime:z,expirationTime:ee,sortIndex:-1},z>Q?(_.sortIndex=z,e(d,_),t(f)===null&&_===t(d)&&(w?(k(M),M=-1):w=!0,$(O,z-Q))):(_.sortIndex=ee,e(f,_),x||v||(x=!0,N||(N=!0,I()))),_},n.unstable_shouldYield=U,n.unstable_wrapCallback=function(_){var H=g;return function(){var z=g;g=H;try{return _.apply(this,arguments)}finally{g=z}}}})(qg)),qg}var zw;function u6(){return zw||(zw=1,jg.exports=a6()),jg.exports}var Hw;function c6(){if(Hw)return Du;Hw=1;var n=u6(),e=Tc(),t=PC();function i(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)l+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function o(s){var l=s,c=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(c=l.return),s=l.return;while(s)}return l.tag===3?c:null}function a(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function u(s){if(s.tag===31){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function f(s){if(o(s)!==s)throw Error(i(188))}function d(s){var l=s.alternate;if(!l){if(l=o(s),l===null)throw Error(i(188));return l!==s?null:s}for(var c=s,h=l;;){var y=c.return;if(y===null)break;var b=y.alternate;if(b===null){if(h=y.return,h!==null){c=h;continue}break}if(y.child===b.child){for(b=y.child;b;){if(b===c)return f(y),s;if(b===h)return f(y),l;b=b.sibling}throw Error(i(188))}if(c.return!==h.return)c=y,h=b;else{for(var R=!1,L=y.child;L;){if(L===c){R=!0,c=y,h=b;break}if(L===h){R=!0,h=y,c=b;break}L=L.sibling}if(!R){for(L=b.child;L;){if(L===c){R=!0,c=b,h=y;break}if(L===h){R=!0,h=b,c=y;break}L=L.sibling}if(!R)throw Error(i(189))}}if(c.alternate!==h)throw Error(i(190))}if(c.tag!==3)throw Error(i(188));return c.stateNode.current===c?s:l}function p(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=p(s),l!==null)return l;s=s.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),T=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),j=Symbol.iterator;function I(s){return s===null||typeof s!="object"?null:(s=j&&s[j]||s["@@iterator"],typeof s=="function"?s:null)}var q=Symbol.for("react.client.reference");function P(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===q?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case w:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case O:return"Suspense";case N:return"SuspenseList";case V:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case x:return"Portal";case T:return s.displayName||"Context";case k:return(s._context.displayName||"Context")+".Consumer";case A:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case M:return l=s.displayName||null,l!==null?l:P(s.type)||"Memo";case D:l=s._payload,s=s._init;try{return P(s(l))}catch{}}return null}var $=Array.isArray,_=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},Q=[],ee=-1;function B(s){return{current:s}}function K(s){0>ee||(s.current=Q[ee],Q[ee]=null,ee--)}function X(s,l){ee++,Q[ee]=s.current,s.current=l}var J=B(null),W=B(null),re=B(null),ae=B(null);function fe(s,l){switch(X(re,l),X(W,s),X(J,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?NS(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=NS(l),s=LS(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}K(J),X(J,s)}function pe(){K(J),K(W),K(re)}function Te(s){s.memoizedState!==null&&X(ae,s);var l=J.current,c=LS(l,s.type);l!==c&&(X(W,s),X(J,c))}function le(s){W.current===s&&(K(J),K(W)),ae.current===s&&(K(ae),Su._currentValue=z)}var Ee,Ce;function Ue(s){if(Ee===void 0)try{throw Error()}catch(c){var l=c.stack.trim().match(/\n( *(at )?)/);Ee=l&&l[1]||"",Ce=-1<c.stack.indexOf(`
|
|
3
|
+
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
+
`+Ee+s+Ce}var me=!1;function ve(s,l){if(!s||me)return"";me=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(l){var he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(se){var ie=se}Reflect.construct(s,[],he)}else{try{he.call()}catch(se){ie=se}s.call(he.prototype)}}else{try{throw Error()}catch(se){ie=se}(he=s())&&typeof he.catch=="function"&&he.catch(function(){})}}catch(se){if(se&&ie&&typeof se.stack=="string")return[se.stack,ie.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=h.DetermineComponentFrameRoot(),R=b[0],L=b[1];if(R&&L){var F=R.split(`
|
|
5
|
+
`),ne=L.split(`
|
|
6
|
+
`);for(y=h=0;h<F.length&&!F[h].includes("DetermineComponentFrameRoot");)h++;for(;y<ne.length&&!ne[y].includes("DetermineComponentFrameRoot");)y++;if(h===F.length||y===ne.length)for(h=F.length-1,y=ne.length-1;1<=h&&0<=y&&F[h]!==ne[y];)y--;for(;1<=h&&0<=y;h--,y--)if(F[h]!==ne[y]){if(h!==1||y!==1)do if(h--,y--,0>y||F[h]!==ne[y]){var ue=`
|
|
7
|
+
`+F[h].replace(" at new "," at ");return s.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",s.displayName)),ue}while(1<=h&&0<=y);break}}}finally{me=!1,Error.prepareStackTrace=c}return(c=s?s.displayName||s.name:"")?Ue(c):""}function ge(s,l){switch(s.tag){case 26:case 27:case 5:return Ue(s.type);case 16:return Ue("Lazy");case 13:return s.child!==l&&l!==null?Ue("Suspense Fallback"):Ue("Suspense");case 19:return Ue("SuspenseList");case 0:case 15:return ve(s.type,!1);case 11:return ve(s.type.render,!1);case 1:return ve(s.type,!0);case 31:return Ue("Activity");default:return""}}function Ae(s){try{var l="",c=null;do l+=ge(s,c),c=s,s=s.return;while(s);return l}catch(h){return`
|
|
8
|
+
Error generating stack: `+h.message+`
|
|
9
|
+
`+h.stack}}var Oe=Object.prototype.hasOwnProperty,Ye=n.unstable_scheduleCallback,de=n.unstable_cancelCallback,ke=n.unstable_shouldYield,we=n.unstable_requestPaint,ye=n.unstable_now,De=n.unstable_getCurrentPriorityLevel,Ne=n.unstable_ImmediatePriority,Ge=n.unstable_UserBlockingPriority,je=n.unstable_NormalPriority,mt=n.unstable_LowPriority,Dt=n.unstable_IdlePriority,Qt=n.log,st=n.unstable_setDisableYieldValue,kt=null,xe=null;function He(s){if(typeof Qt=="function"&&st(s),xe&&typeof xe.setStrictMode=="function")try{xe.setStrictMode(kt,s)}catch{}}var Xe=Math.clz32?Math.clz32:vn,On=Math.log,hn=Math.LN2;function vn(s){return s>>>=0,s===0?32:31-(On(s)/hn|0)|0}var bn=256,Mn=262144,Bt=4194304;function dn(s){var l=s&42;if(l!==0)return l;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function lr(s,l,c){var h=s.pendingLanes;if(h===0)return 0;var y=0,b=s.suspendedLanes,R=s.pingedLanes;s=s.warmLanes;var L=h&134217727;return L!==0?(h=L&~b,h!==0?y=dn(h):(R&=L,R!==0?y=dn(R):c||(c=L&~s,c!==0&&(y=dn(c))))):(L=h&~b,L!==0?y=dn(L):R!==0?y=dn(R):c||(c=h&~s,c!==0&&(y=dn(c)))),y===0?0:l!==0&&l!==y&&(l&b)===0&&(b=y&-y,c=l&-l,b>=c||b===32&&(c&4194048)!==0)?l:y}function $i(s,l){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&l)===0}function oo(s,l){switch(s){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function tt(){var s=Bt;return Bt<<=1,(Bt&62914560)===0&&(Bt=4194304),s}function Vt(s){for(var l=[],c=0;31>c;c++)l.push(s);return l}function xn(s,l){s.pendingLanes|=l,l!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function ar(s,l,c,h,y,b){var R=s.pendingLanes;s.pendingLanes=c,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=c,s.entangledLanes&=c,s.errorRecoveryDisabledLanes&=c,s.shellSuspendCounter=0;var L=s.entanglements,F=s.expirationTimes,ne=s.hiddenUpdates;for(c=R&~c;0<c;){var ue=31-Xe(c),he=1<<ue;L[ue]=0,F[ue]=-1;var ie=ne[ue];if(ie!==null)for(ne[ue]=null,ue=0;ue<ie.length;ue++){var se=ie[ue];se!==null&&(se.lane&=-536870913)}c&=~he}h!==0&&un(s,h,0),b!==0&&y===0&&s.tag!==0&&(s.suspendedLanes|=b&~(R&~l))}function un(s,l,c){s.pendingLanes|=l,s.suspendedLanes&=~l;var h=31-Xe(l);s.entangledLanes|=l,s.entanglements[h]=s.entanglements[h]|1073741824|c&261930}function sl(s,l){var c=s.entangledLanes|=l;for(s=s.entanglements;c;){var h=31-Xe(c),y=1<<h;y&l|s[h]&l&&(s[h]|=l),c&=~y}}function Uc(s,l){var c=l&-l;return c=(c&42)!==0?1:Ba(c),(c&(s.suspendedLanes|l))!==0?0:c}function Ba(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function pp(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function yb(){var s=H.p;return s!==0?s:(s=window.event,s===void 0?32:nw(s.type))}function vb(s,l){var c=H.p;try{return H.p=s,l()}finally{H.p=c}}var ls=Math.random().toString(36).slice(2),Sn="__reactFiber$"+ls,jn="__reactProps$"+ls,ol="__reactContainer$"+ls,mp="__reactEvents$"+ls,eO="__reactListeners$"+ls,tO="__reactHandles$"+ls,bb="__reactResources$"+ls,_a="__reactMarker$"+ls;function gp(s){delete s[Sn],delete s[jn],delete s[mp],delete s[eO],delete s[tO]}function ll(s){var l=s[Sn];if(l)return l;for(var c=s.parentNode;c;){if(l=c[ol]||c[Sn]){if(c=l.alternate,l.child!==null||c!==null&&c.child!==null)for(s=VS(s);s!==null;){if(c=s[Sn])return c;s=VS(s)}return l}s=c,c=s.parentNode}return null}function al(s){if(s=s[Sn]||s[ol]){var l=s.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return s}return null}function Pa(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s.stateNode;throw Error(i(33))}function ul(s){var l=s[bb];return l||(l=s[bb]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function pn(s){s[_a]=!0}var xb=new Set,Sb={};function lo(s,l){cl(s,l),cl(s+"Capture",l)}function cl(s,l){for(Sb[s]=l,s=0;s<l.length;s++)xb.add(l[s])}var nO=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),wb={},Eb={};function iO(s){return Oe.call(Eb,s)?!0:Oe.call(wb,s)?!1:nO.test(s)?Eb[s]=!0:(wb[s]=!0,!1)}function jc(s,l,c){if(iO(l))if(c===null)s.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":s.removeAttribute(l);return;case"boolean":var h=l.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){s.removeAttribute(l);return}}s.setAttribute(l,""+c)}}function qc(s,l,c){if(c===null)s.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(l);return}s.setAttribute(l,""+c)}}function kr(s,l,c,h){if(h===null)s.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(c);return}s.setAttributeNS(l,c,""+h)}}function Si(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Cb(s){var l=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function rO(s,l,c){var h=Object.getOwnPropertyDescriptor(s.constructor.prototype,l);if(!s.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var y=h.get,b=h.set;return Object.defineProperty(s,l,{configurable:!0,get:function(){return y.call(this)},set:function(R){c=""+R,b.call(this,R)}}),Object.defineProperty(s,l,{enumerable:h.enumerable}),{getValue:function(){return c},setValue:function(R){c=""+R},stopTracking:function(){s._valueTracker=null,delete s[l]}}}}function yp(s){if(!s._valueTracker){var l=Cb(s)?"checked":"value";s._valueTracker=rO(s,l,""+s[l])}}function Rb(s){if(!s)return!1;var l=s._valueTracker;if(!l)return!0;var c=l.getValue(),h="";return s&&(h=Cb(s)?s.checked?"true":"false":s.value),s=h,s!==c?(l.setValue(s),!0):!1}function Fc(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var sO=/[\n"\\]/g;function wi(s){return s.replace(sO,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function vp(s,l,c,h,y,b,R,L){s.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?s.type=R:s.removeAttribute("type"),l!=null?R==="number"?(l===0&&s.value===""||s.value!=l)&&(s.value=""+Si(l)):s.value!==""+Si(l)&&(s.value=""+Si(l)):R!=="submit"&&R!=="reset"||s.removeAttribute("value"),l!=null?bp(s,R,Si(l)):c!=null?bp(s,R,Si(c)):h!=null&&s.removeAttribute("value"),y==null&&b!=null&&(s.defaultChecked=!!b),y!=null&&(s.checked=y&&typeof y!="function"&&typeof y!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?s.name=""+Si(L):s.removeAttribute("name")}function kb(s,l,c,h,y,b,R,L){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(s.type=b),l!=null||c!=null){if(!(b!=="submit"&&b!=="reset"||l!=null)){yp(s);return}c=c!=null?""+Si(c):"",l=l!=null?""+Si(l):c,L||l===s.value||(s.value=l),s.defaultValue=l}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,s.checked=L?s.checked:!!h,s.defaultChecked=!!h,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(s.name=R),yp(s)}function bp(s,l,c){l==="number"&&Fc(s.ownerDocument)===s||s.defaultValue===""+c||(s.defaultValue=""+c)}function fl(s,l,c,h){if(s=s.options,l){l={};for(var y=0;y<c.length;y++)l["$"+c[y]]=!0;for(c=0;c<s.length;c++)y=l.hasOwnProperty("$"+s[c].value),s[c].selected!==y&&(s[c].selected=y),y&&h&&(s[c].defaultSelected=!0)}else{for(c=""+Si(c),l=null,y=0;y<s.length;y++){if(s[y].value===c){s[y].selected=!0,h&&(s[y].defaultSelected=!0);return}l!==null||s[y].disabled||(l=s[y])}l!==null&&(l.selected=!0)}}function Tb(s,l,c){if(l!=null&&(l=""+Si(l),l!==s.value&&(s.value=l),c==null)){s.defaultValue!==l&&(s.defaultValue=l);return}s.defaultValue=c!=null?""+Si(c):""}function Ab(s,l,c,h){if(l==null){if(h!=null){if(c!=null)throw Error(i(92));if($(h)){if(1<h.length)throw Error(i(93));h=h[0]}c=h}c==null&&(c=""),l=c}c=Si(l),s.defaultValue=c,h=s.textContent,h===c&&h!==""&&h!==null&&(s.value=h),yp(s)}function hl(s,l){if(l){var c=s.firstChild;if(c&&c===s.lastChild&&c.nodeType===3){c.nodeValue=l;return}}s.textContent=l}var oO=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ob(s,l,c){var h=l.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?h?s.setProperty(l,""):l==="float"?s.cssFloat="":s[l]="":h?s.setProperty(l,c):typeof c!="number"||c===0||oO.has(l)?l==="float"?s.cssFloat=c:s[l]=(""+c).trim():s[l]=c+"px"}function Mb(s,l,c){if(l!=null&&typeof l!="object")throw Error(i(62));if(s=s.style,c!=null){for(var h in c)!c.hasOwnProperty(h)||l!=null&&l.hasOwnProperty(h)||(h.indexOf("--")===0?s.setProperty(h,""):h==="float"?s.cssFloat="":s[h]="");for(var y in l)h=l[y],l.hasOwnProperty(y)&&c[y]!==h&&Ob(s,y,h)}else for(var b in l)l.hasOwnProperty(b)&&Ob(s,b,l[b])}function xp(s){if(s.indexOf("-")===-1)return!1;switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var lO=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),aO=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function $c(s){return aO.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Tr(){}var Sp=null;function wp(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var dl=null,pl=null;function Db(s){var l=al(s);if(l&&(s=l.stateNode)){var c=s[jn]||null;e:switch(s=l.stateNode,l.type){case"input":if(vp(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),l=c.name,c.type==="radio"&&l!=null){for(c=s;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+wi(""+l)+'"][type="radio"]'),l=0;l<c.length;l++){var h=c[l];if(h!==s&&h.form===s.form){var y=h[jn]||null;if(!y)throw Error(i(90));vp(h,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(l=0;l<c.length;l++)h=c[l],h.form===s.form&&Rb(h)}break e;case"textarea":Tb(s,c.value,c.defaultValue);break e;case"select":l=c.value,l!=null&&fl(s,!!c.multiple,l,!1)}}}var Ep=!1;function Nb(s,l,c){if(Ep)return s(l,c);Ep=!0;try{var h=s(l);return h}finally{if(Ep=!1,(dl!==null||pl!==null)&&(Lf(),dl&&(l=dl,s=pl,pl=dl=null,Db(l),s)))for(l=0;l<s.length;l++)Db(s[l])}}function za(s,l){var c=s.stateNode;if(c===null)return null;var h=c[jn]||null;if(h===null)return null;c=h[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(s=s.type,h=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!h;break e;default:s=!1}if(s)return null;if(c&&typeof c!="function")throw Error(i(231,l,typeof c));return c}var Ar=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cp=!1;if(Ar)try{var Ha={};Object.defineProperty(Ha,"passive",{get:function(){Cp=!0}}),window.addEventListener("test",Ha,Ha),window.removeEventListener("test",Ha,Ha)}catch{Cp=!1}var as=null,Rp=null,Kc=null;function Lb(){if(Kc)return Kc;var s,l=Rp,c=l.length,h,y="value"in as?as.value:as.textContent,b=y.length;for(s=0;s<c&&l[s]===y[s];s++);var R=c-s;for(h=1;h<=R&&l[c-h]===y[b-h];h++);return Kc=y.slice(s,1<h?1-h:void 0)}function Yc(s){var l=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&l===13&&(s=13)):s=l,s===10&&(s=13),32<=s||s===13?s:0}function Gc(){return!0}function Ib(){return!1}function qn(s){function l(c,h,y,b,R){this._reactName=c,this._targetInst=y,this.type=h,this.nativeEvent=b,this.target=R,this.currentTarget=null;for(var L in s)s.hasOwnProperty(L)&&(c=s[L],this[L]=c?c(b):b[L]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?Gc:Ib,this.isPropagationStopped=Ib,this}return m(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Gc)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Gc)},persist:function(){},isPersistent:Gc}),l}var ao={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qc=qn(ao),Va=m({},ao,{view:0,detail:0}),uO=qn(Va),kp,Tp,Ua,Xc=m({},Va,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Op,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Ua&&(Ua&&s.type==="mousemove"?(kp=s.screenX-Ua.screenX,Tp=s.screenY-Ua.screenY):Tp=kp=0,Ua=s),kp)},movementY:function(s){return"movementY"in s?s.movementY:Tp}}),Bb=qn(Xc),cO=m({},Xc,{dataTransfer:0}),fO=qn(cO),hO=m({},Va,{relatedTarget:0}),Ap=qn(hO),dO=m({},ao,{animationName:0,elapsedTime:0,pseudoElement:0}),pO=qn(dO),mO=m({},ao,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),gO=qn(mO),yO=m({},ao,{data:0}),_b=qn(yO),vO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bO={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},xO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function SO(s){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(s):(s=xO[s])?!!l[s]:!1}function Op(){return SO}var wO=m({},Va,{key:function(s){if(s.key){var l=vO[s.key]||s.key;if(l!=="Unidentified")return l}return s.type==="keypress"?(s=Yc(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?bO[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Op,charCode:function(s){return s.type==="keypress"?Yc(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Yc(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),EO=qn(wO),CO=m({},Xc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pb=qn(CO),RO=m({},Va,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Op}),kO=qn(RO),TO=m({},ao,{propertyName:0,elapsedTime:0,pseudoElement:0}),AO=qn(TO),OO=m({},Xc,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),MO=qn(OO),DO=m({},ao,{newState:0,oldState:0}),NO=qn(DO),LO=[9,13,27,32],Mp=Ar&&"CompositionEvent"in window,ja=null;Ar&&"documentMode"in document&&(ja=document.documentMode);var IO=Ar&&"TextEvent"in window&&!ja,zb=Ar&&(!Mp||ja&&8<ja&&11>=ja),Hb=" ",Vb=!1;function Ub(s,l){switch(s){case"keyup":return LO.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jb(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var ml=!1;function BO(s,l){switch(s){case"compositionend":return jb(l);case"keypress":return l.which!==32?null:(Vb=!0,Hb);case"textInput":return s=l.data,s===Hb&&Vb?null:s;default:return null}}function _O(s,l){if(ml)return s==="compositionend"||!Mp&&Ub(s,l)?(s=Lb(),Kc=Rp=as=null,ml=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return zb&&l.locale!=="ko"?null:l.data;default:return null}}var PO={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function qb(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l==="input"?!!PO[s.type]:l==="textarea"}function Fb(s,l,c,h){dl?pl?pl.push(h):pl=[h]:dl=h,l=Vf(l,"onChange"),0<l.length&&(c=new Qc("onChange","change",null,c,h),s.push({event:c,listeners:l}))}var qa=null,Fa=null;function zO(s){kS(s,0)}function Wc(s){var l=Pa(s);if(Rb(l))return s}function $b(s,l){if(s==="change")return l}var Kb=!1;if(Ar){var Dp;if(Ar){var Np="oninput"in document;if(!Np){var Yb=document.createElement("div");Yb.setAttribute("oninput","return;"),Np=typeof Yb.oninput=="function"}Dp=Np}else Dp=!1;Kb=Dp&&(!document.documentMode||9<document.documentMode)}function Gb(){qa&&(qa.detachEvent("onpropertychange",Qb),Fa=qa=null)}function Qb(s){if(s.propertyName==="value"&&Wc(Fa)){var l=[];Fb(l,Fa,s,wp(s)),Nb(zO,l)}}function HO(s,l,c){s==="focusin"?(Gb(),qa=l,Fa=c,qa.attachEvent("onpropertychange",Qb)):s==="focusout"&&Gb()}function VO(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Wc(Fa)}function UO(s,l){if(s==="click")return Wc(l)}function jO(s,l){if(s==="input"||s==="change")return Wc(l)}function qO(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var ri=typeof Object.is=="function"?Object.is:qO;function $a(s,l){if(ri(s,l))return!0;if(typeof s!="object"||s===null||typeof l!="object"||l===null)return!1;var c=Object.keys(s),h=Object.keys(l);if(c.length!==h.length)return!1;for(h=0;h<c.length;h++){var y=c[h];if(!Oe.call(l,y)||!ri(s[y],l[y]))return!1}return!0}function Xb(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function Wb(s,l){var c=Xb(s);s=0;for(var h;c;){if(c.nodeType===3){if(h=s+c.textContent.length,s<=l&&h>=l)return{node:c,offset:l-s};s=h}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Xb(c)}}function Zb(s,l){return s&&l?s===l?!0:s&&s.nodeType===3?!1:l&&l.nodeType===3?Zb(s,l.parentNode):"contains"in s?s.contains(l):s.compareDocumentPosition?!!(s.compareDocumentPosition(l)&16):!1:!1}function Jb(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var l=Fc(s.document);l instanceof s.HTMLIFrameElement;){try{var c=typeof l.contentWindow.location.href=="string"}catch{c=!1}if(c)s=l.contentWindow;else break;l=Fc(s.document)}return l}function Lp(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l&&(l==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||l==="textarea"||s.contentEditable==="true")}var FO=Ar&&"documentMode"in document&&11>=document.documentMode,gl=null,Ip=null,Ka=null,Bp=!1;function e1(s,l,c){var h=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Bp||gl==null||gl!==Fc(h)||(h=gl,"selectionStart"in h&&Lp(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Ka&&$a(Ka,h)||(Ka=h,h=Vf(Ip,"onSelect"),0<h.length&&(l=new Qc("onSelect","select",null,l,c),s.push({event:l,listeners:h}),l.target=gl)))}function uo(s,l){var c={};return c[s.toLowerCase()]=l.toLowerCase(),c["Webkit"+s]="webkit"+l,c["Moz"+s]="moz"+l,c}var yl={animationend:uo("Animation","AnimationEnd"),animationiteration:uo("Animation","AnimationIteration"),animationstart:uo("Animation","AnimationStart"),transitionrun:uo("Transition","TransitionRun"),transitionstart:uo("Transition","TransitionStart"),transitioncancel:uo("Transition","TransitionCancel"),transitionend:uo("Transition","TransitionEnd")},_p={},t1={};Ar&&(t1=document.createElement("div").style,"AnimationEvent"in window||(delete yl.animationend.animation,delete yl.animationiteration.animation,delete yl.animationstart.animation),"TransitionEvent"in window||delete yl.transitionend.transition);function co(s){if(_p[s])return _p[s];if(!yl[s])return s;var l=yl[s],c;for(c in l)if(l.hasOwnProperty(c)&&c in t1)return _p[s]=l[c];return s}var n1=co("animationend"),i1=co("animationiteration"),r1=co("animationstart"),$O=co("transitionrun"),KO=co("transitionstart"),YO=co("transitioncancel"),s1=co("transitionend"),o1=new Map,Pp="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Pp.push("scrollEnd");function Ki(s,l){o1.set(s,l),lo(l,[s])}var Zc=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Ei=[],vl=0,zp=0;function Jc(){for(var s=vl,l=zp=vl=0;l<s;){var c=Ei[l];Ei[l++]=null;var h=Ei[l];Ei[l++]=null;var y=Ei[l];Ei[l++]=null;var b=Ei[l];if(Ei[l++]=null,h!==null&&y!==null){var R=h.pending;R===null?y.next=y:(y.next=R.next,R.next=y),h.pending=y}b!==0&&l1(c,y,b)}}function ef(s,l,c,h){Ei[vl++]=s,Ei[vl++]=l,Ei[vl++]=c,Ei[vl++]=h,zp|=h,s.lanes|=h,s=s.alternate,s!==null&&(s.lanes|=h)}function Hp(s,l,c,h){return ef(s,l,c,h),tf(s)}function fo(s,l){return ef(s,null,null,l),tf(s)}function l1(s,l,c){s.lanes|=c;var h=s.alternate;h!==null&&(h.lanes|=c);for(var y=!1,b=s.return;b!==null;)b.childLanes|=c,h=b.alternate,h!==null&&(h.childLanes|=c),b.tag===22&&(s=b.stateNode,s===null||s._visibility&1||(y=!0)),s=b,b=b.return;return s.tag===3?(b=s.stateNode,y&&l!==null&&(y=31-Xe(c),s=b.hiddenUpdates,h=s[y],h===null?s[y]=[l]:h.push(l),l.lane=c|536870912),b):null}function tf(s){if(50<pu)throw pu=0,Gm=null,Error(i(185));for(var l=s.return;l!==null;)s=l,l=s.return;return s.tag===3?s.stateNode:null}var bl={};function GO(s,l,c,h){this.tag=s,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function si(s,l,c,h){return new GO(s,l,c,h)}function Vp(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Or(s,l){var c=s.alternate;return c===null?(c=si(s.tag,l,s.key,s.mode),c.elementType=s.elementType,c.type=s.type,c.stateNode=s.stateNode,c.alternate=s,s.alternate=c):(c.pendingProps=l,c.type=s.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=s.flags&65011712,c.childLanes=s.childLanes,c.lanes=s.lanes,c.child=s.child,c.memoizedProps=s.memoizedProps,c.memoizedState=s.memoizedState,c.updateQueue=s.updateQueue,l=s.dependencies,c.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},c.sibling=s.sibling,c.index=s.index,c.ref=s.ref,c.refCleanup=s.refCleanup,c}function a1(s,l){s.flags&=65011714;var c=s.alternate;return c===null?(s.childLanes=0,s.lanes=l,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,l=c.dependencies,s.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),s}function nf(s,l,c,h,y,b){var R=0;if(h=s,typeof s=="function")Vp(s)&&(R=1);else if(typeof s=="string")R=JM(s,c,J.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case V:return s=si(31,c,l,y),s.elementType=V,s.lanes=b,s;case w:return ho(c.children,y,b,l);case C:R=8,y|=24;break;case E:return s=si(12,c,l,y|2),s.elementType=E,s.lanes=b,s;case O:return s=si(13,c,l,y),s.elementType=O,s.lanes=b,s;case N:return s=si(19,c,l,y),s.elementType=N,s.lanes=b,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case T:R=10;break e;case k:R=9;break e;case A:R=11;break e;case M:R=14;break e;case D:R=16,h=null;break e}R=29,c=Error(i(130,s===null?"null":typeof s,"")),h=null}return l=si(R,c,l,y),l.elementType=s,l.type=h,l.lanes=b,l}function ho(s,l,c,h){return s=si(7,s,h,l),s.lanes=c,s}function Up(s,l,c){return s=si(6,s,null,l),s.lanes=c,s}function u1(s){var l=si(18,null,null,0);return l.stateNode=s,l}function jp(s,l,c){return l=si(4,s.children!==null?s.children:[],s.key,l),l.lanes=c,l.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},l}var c1=new WeakMap;function Ci(s,l){if(typeof s=="object"&&s!==null){var c=c1.get(s);return c!==void 0?c:(l={value:s,source:l,stack:Ae(l)},c1.set(s,l),l)}return{value:s,source:l,stack:Ae(l)}}var xl=[],Sl=0,rf=null,Ya=0,Ri=[],ki=0,us=null,ur=1,cr="";function Mr(s,l){xl[Sl++]=Ya,xl[Sl++]=rf,rf=s,Ya=l}function f1(s,l,c){Ri[ki++]=ur,Ri[ki++]=cr,Ri[ki++]=us,us=s;var h=ur;s=cr;var y=32-Xe(h)-1;h&=~(1<<y),c+=1;var b=32-Xe(l)+y;if(30<b){var R=y-y%5;b=(h&(1<<R)-1).toString(32),h>>=R,y-=R,ur=1<<32-Xe(l)+y|c<<y|h,cr=b+s}else ur=1<<b|c<<y|h,cr=s}function qp(s){s.return!==null&&(Mr(s,1),f1(s,1,0))}function Fp(s){for(;s===rf;)rf=xl[--Sl],xl[Sl]=null,Ya=xl[--Sl],xl[Sl]=null;for(;s===us;)us=Ri[--ki],Ri[ki]=null,cr=Ri[--ki],Ri[ki]=null,ur=Ri[--ki],Ri[ki]=null}function h1(s,l){Ri[ki++]=ur,Ri[ki++]=cr,Ri[ki++]=us,ur=l.id,cr=l.overflow,us=s}var wn=null,Nt=null,ct=!1,cs=null,Ti=!1,$p=Error(i(519));function fs(s){var l=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ga(Ci(l,s)),$p}function d1(s){var l=s.stateNode,c=s.type,h=s.memoizedProps;switch(l[Sn]=s,l[jn]=h,c){case"dialog":lt("cancel",l),lt("close",l);break;case"iframe":case"object":case"embed":lt("load",l);break;case"video":case"audio":for(c=0;c<gu.length;c++)lt(gu[c],l);break;case"source":lt("error",l);break;case"img":case"image":case"link":lt("error",l),lt("load",l);break;case"details":lt("toggle",l);break;case"input":lt("invalid",l),kb(l,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":lt("invalid",l);break;case"textarea":lt("invalid",l),Ab(l,h.value,h.defaultValue,h.children)}c=h.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||l.textContent===""+c||h.suppressHydrationWarning===!0||MS(l.textContent,c)?(h.popover!=null&&(lt("beforetoggle",l),lt("toggle",l)),h.onScroll!=null&<("scroll",l),h.onScrollEnd!=null&<("scrollend",l),h.onClick!=null&&(l.onclick=Tr),l=!0):l=!1,l||fs(s,!0)}function p1(s){for(wn=s.return;wn;)switch(wn.tag){case 5:case 31:case 13:Ti=!1;return;case 27:case 3:Ti=!0;return;default:wn=wn.return}}function wl(s){if(s!==wn)return!1;if(!ct)return p1(s),ct=!0,!1;var l=s.tag,c;if((c=l!==3&&l!==27)&&((c=l===5)&&(c=s.type,c=!(c!=="form"&&c!=="button")||ug(s.type,s.memoizedProps)),c=!c),c&&Nt&&fs(s),p1(s),l===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));Nt=HS(s)}else if(l===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));Nt=HS(s)}else l===27?(l=Nt,Rs(s.type)?(s=pg,pg=null,Nt=s):Nt=l):Nt=wn?Oi(s.stateNode.nextSibling):null;return!0}function po(){Nt=wn=null,ct=!1}function Kp(){var s=cs;return s!==null&&(Yn===null?Yn=s:Yn.push.apply(Yn,s),cs=null),s}function Ga(s){cs===null?cs=[s]:cs.push(s)}var Yp=B(null),mo=null,Dr=null;function hs(s,l,c){X(Yp,l._currentValue),l._currentValue=c}function Nr(s){s._currentValue=Yp.current,K(Yp)}function Gp(s,l,c){for(;s!==null;){var h=s.alternate;if((s.childLanes&l)!==l?(s.childLanes|=l,h!==null&&(h.childLanes|=l)):h!==null&&(h.childLanes&l)!==l&&(h.childLanes|=l),s===c)break;s=s.return}}function Qp(s,l,c,h){var y=s.child;for(y!==null&&(y.return=s);y!==null;){var b=y.dependencies;if(b!==null){var R=y.child;b=b.firstContext;e:for(;b!==null;){var L=b;b=y;for(var F=0;F<l.length;F++)if(L.context===l[F]){b.lanes|=c,L=b.alternate,L!==null&&(L.lanes|=c),Gp(b.return,c,s),h||(R=null);break e}b=L.next}}else if(y.tag===18){if(R=y.return,R===null)throw Error(i(341));R.lanes|=c,b=R.alternate,b!==null&&(b.lanes|=c),Gp(R,c,s),R=null}else R=y.child;if(R!==null)R.return=y;else for(R=y;R!==null;){if(R===s){R=null;break}if(y=R.sibling,y!==null){y.return=R.return,R=y;break}R=R.return}y=R}}function El(s,l,c,h){s=null;for(var y=l,b=!1;y!==null;){if(!b){if((y.flags&524288)!==0)b=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var R=y.alternate;if(R===null)throw Error(i(387));if(R=R.memoizedProps,R!==null){var L=y.type;ri(y.pendingProps.value,R.value)||(s!==null?s.push(L):s=[L])}}else if(y===ae.current){if(R=y.alternate,R===null)throw Error(i(387));R.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(s!==null?s.push(Su):s=[Su])}y=y.return}s!==null&&Qp(l,s,c,h),l.flags|=262144}function sf(s){for(s=s.firstContext;s!==null;){if(!ri(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function go(s){mo=s,Dr=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function En(s){return m1(mo,s)}function of(s,l){return mo===null&&go(s),m1(s,l)}function m1(s,l){var c=l._currentValue;if(l={context:l,memoizedValue:c,next:null},Dr===null){if(s===null)throw Error(i(308));Dr=l,s.dependencies={lanes:0,firstContext:l},s.flags|=524288}else Dr=Dr.next=l;return c}var QO=typeof AbortController<"u"?AbortController:function(){var s=[],l=this.signal={aborted:!1,addEventListener:function(c,h){s.push(h)}};this.abort=function(){l.aborted=!0,s.forEach(function(c){return c()})}},XO=n.unstable_scheduleCallback,WO=n.unstable_NormalPriority,nn={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xp(){return{controller:new QO,data:new Map,refCount:0}}function Qa(s){s.refCount--,s.refCount===0&&XO(WO,function(){s.controller.abort()})}var Xa=null,Wp=0,Cl=0,Rl=null;function ZO(s,l){if(Xa===null){var c=Xa=[];Wp=0,Cl=eg(),Rl={status:"pending",value:void 0,then:function(h){c.push(h)}}}return Wp++,l.then(g1,g1),l}function g1(){if(--Wp===0&&Xa!==null){Rl!==null&&(Rl.status="fulfilled");var s=Xa;Xa=null,Cl=0,Rl=null;for(var l=0;l<s.length;l++)(0,s[l])()}}function JO(s,l){var c=[],h={status:"pending",value:null,reason:null,then:function(y){c.push(y)}};return s.then(function(){h.status="fulfilled",h.value=l;for(var y=0;y<c.length;y++)(0,c[y])(l)},function(y){for(h.status="rejected",h.reason=y,y=0;y<c.length;y++)(0,c[y])(void 0)}),h}var y1=_.S;_.S=function(s,l){eS=ye(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&ZO(s,l),y1!==null&&y1(s,l)};var yo=B(null);function Zp(){var s=yo.current;return s!==null?s:Tt.pooledCache}function lf(s,l){l===null?X(yo,yo.current):X(yo,l.pool)}function v1(){var s=Zp();return s===null?null:{parent:nn._currentValue,pool:s}}var kl=Error(i(460)),Jp=Error(i(474)),af=Error(i(542)),uf={then:function(){}};function b1(s){return s=s.status,s==="fulfilled"||s==="rejected"}function x1(s,l,c){switch(c=s[c],c===void 0?s.push(l):c!==l&&(l.then(Tr,Tr),l=c),l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,w1(s),s;default:if(typeof l.status=="string")l.then(Tr,Tr);else{if(s=Tt,s!==null&&100<s.shellSuspendCounter)throw Error(i(482));s=l,s.status="pending",s.then(function(h){if(l.status==="pending"){var y=l;y.status="fulfilled",y.value=h}},function(h){if(l.status==="pending"){var y=l;y.status="rejected",y.reason=h}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,w1(s),s}throw bo=l,kl}}function vo(s){try{var l=s._init;return l(s._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(bo=c,kl):c}}var bo=null;function S1(){if(bo===null)throw Error(i(459));var s=bo;return bo=null,s}function w1(s){if(s===kl||s===af)throw Error(i(483))}var Tl=null,Wa=0;function cf(s){var l=Wa;return Wa+=1,Tl===null&&(Tl=[]),x1(Tl,s,l)}function Za(s,l){l=l.props.ref,s.ref=l!==void 0?l:null}function ff(s,l){throw l.$$typeof===g?Error(i(525)):(s=Object.prototype.toString.call(l),Error(i(31,s==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":s)))}function E1(s){function l(Z,G){if(s){var te=Z.deletions;te===null?(Z.deletions=[G],Z.flags|=16):te.push(G)}}function c(Z,G){if(!s)return null;for(;G!==null;)l(Z,G),G=G.sibling;return null}function h(Z){for(var G=new Map;Z!==null;)Z.key!==null?G.set(Z.key,Z):G.set(Z.index,Z),Z=Z.sibling;return G}function y(Z,G){return Z=Or(Z,G),Z.index=0,Z.sibling=null,Z}function b(Z,G,te){return Z.index=te,s?(te=Z.alternate,te!==null?(te=te.index,te<G?(Z.flags|=67108866,G):te):(Z.flags|=67108866,G)):(Z.flags|=1048576,G)}function R(Z){return s&&Z.alternate===null&&(Z.flags|=67108866),Z}function L(Z,G,te,ce){return G===null||G.tag!==6?(G=Up(te,Z.mode,ce),G.return=Z,G):(G=y(G,te),G.return=Z,G)}function F(Z,G,te,ce){var qe=te.type;return qe===w?ue(Z,G,te.props.children,ce,te.key):G!==null&&(G.elementType===qe||typeof qe=="object"&&qe!==null&&qe.$$typeof===D&&vo(qe)===G.type)?(G=y(G,te.props),Za(G,te),G.return=Z,G):(G=nf(te.type,te.key,te.props,null,Z.mode,ce),Za(G,te),G.return=Z,G)}function ne(Z,G,te,ce){return G===null||G.tag!==4||G.stateNode.containerInfo!==te.containerInfo||G.stateNode.implementation!==te.implementation?(G=jp(te,Z.mode,ce),G.return=Z,G):(G=y(G,te.children||[]),G.return=Z,G)}function ue(Z,G,te,ce,qe){return G===null||G.tag!==7?(G=ho(te,Z.mode,ce,qe),G.return=Z,G):(G=y(G,te),G.return=Z,G)}function he(Z,G,te){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Up(""+G,Z.mode,te),G.return=Z,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case v:return te=nf(G.type,G.key,G.props,null,Z.mode,te),Za(te,G),te.return=Z,te;case x:return G=jp(G,Z.mode,te),G.return=Z,G;case D:return G=vo(G),he(Z,G,te)}if($(G)||I(G))return G=ho(G,Z.mode,te,null),G.return=Z,G;if(typeof G.then=="function")return he(Z,cf(G),te);if(G.$$typeof===T)return he(Z,of(Z,G),te);ff(Z,G)}return null}function ie(Z,G,te,ce){var qe=G!==null?G.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return qe!==null?null:L(Z,G,""+te,ce);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return te.key===qe?F(Z,G,te,ce):null;case x:return te.key===qe?ne(Z,G,te,ce):null;case D:return te=vo(te),ie(Z,G,te,ce)}if($(te)||I(te))return qe!==null?null:ue(Z,G,te,ce,null);if(typeof te.then=="function")return ie(Z,G,cf(te),ce);if(te.$$typeof===T)return ie(Z,G,of(Z,te),ce);ff(Z,te)}return null}function se(Z,G,te,ce,qe){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Z=Z.get(te)||null,L(G,Z,""+ce,qe);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case v:return Z=Z.get(ce.key===null?te:ce.key)||null,F(G,Z,ce,qe);case x:return Z=Z.get(ce.key===null?te:ce.key)||null,ne(G,Z,ce,qe);case D:return ce=vo(ce),se(Z,G,te,ce,qe)}if($(ce)||I(ce))return Z=Z.get(te)||null,ue(G,Z,ce,qe,null);if(typeof ce.then=="function")return se(Z,G,te,cf(ce),qe);if(ce.$$typeof===T)return se(Z,G,te,of(G,ce),qe);ff(G,ce)}return null}function Le(Z,G,te,ce){for(var qe=null,dt=null,ze=G,et=G=0,ut=null;ze!==null&&et<te.length;et++){ze.index>et?(ut=ze,ze=null):ut=ze.sibling;var pt=ie(Z,ze,te[et],ce);if(pt===null){ze===null&&(ze=ut);break}s&&ze&&pt.alternate===null&&l(Z,ze),G=b(pt,G,et),dt===null?qe=pt:dt.sibling=pt,dt=pt,ze=ut}if(et===te.length)return c(Z,ze),ct&&Mr(Z,et),qe;if(ze===null){for(;et<te.length;et++)ze=he(Z,te[et],ce),ze!==null&&(G=b(ze,G,et),dt===null?qe=ze:dt.sibling=ze,dt=ze);return ct&&Mr(Z,et),qe}for(ze=h(ze);et<te.length;et++)ut=se(ze,Z,et,te[et],ce),ut!==null&&(s&&ut.alternate!==null&&ze.delete(ut.key===null?et:ut.key),G=b(ut,G,et),dt===null?qe=ut:dt.sibling=ut,dt=ut);return s&&ze.forEach(function(Ms){return l(Z,Ms)}),ct&&Mr(Z,et),qe}function $e(Z,G,te,ce){if(te==null)throw Error(i(151));for(var qe=null,dt=null,ze=G,et=G=0,ut=null,pt=te.next();ze!==null&&!pt.done;et++,pt=te.next()){ze.index>et?(ut=ze,ze=null):ut=ze.sibling;var Ms=ie(Z,ze,pt.value,ce);if(Ms===null){ze===null&&(ze=ut);break}s&&ze&&Ms.alternate===null&&l(Z,ze),G=b(Ms,G,et),dt===null?qe=Ms:dt.sibling=Ms,dt=Ms,ze=ut}if(pt.done)return c(Z,ze),ct&&Mr(Z,et),qe;if(ze===null){for(;!pt.done;et++,pt=te.next())pt=he(Z,pt.value,ce),pt!==null&&(G=b(pt,G,et),dt===null?qe=pt:dt.sibling=pt,dt=pt);return ct&&Mr(Z,et),qe}for(ze=h(ze);!pt.done;et++,pt=te.next())pt=se(ze,Z,et,pt.value,ce),pt!==null&&(s&&pt.alternate!==null&&ze.delete(pt.key===null?et:pt.key),G=b(pt,G,et),dt===null?qe=pt:dt.sibling=pt,dt=pt);return s&&ze.forEach(function(c3){return l(Z,c3)}),ct&&Mr(Z,et),qe}function Rt(Z,G,te,ce){if(typeof te=="object"&&te!==null&&te.type===w&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case v:e:{for(var qe=te.key;G!==null;){if(G.key===qe){if(qe=te.type,qe===w){if(G.tag===7){c(Z,G.sibling),ce=y(G,te.props.children),ce.return=Z,Z=ce;break e}}else if(G.elementType===qe||typeof qe=="object"&&qe!==null&&qe.$$typeof===D&&vo(qe)===G.type){c(Z,G.sibling),ce=y(G,te.props),Za(ce,te),ce.return=Z,Z=ce;break e}c(Z,G);break}else l(Z,G);G=G.sibling}te.type===w?(ce=ho(te.props.children,Z.mode,ce,te.key),ce.return=Z,Z=ce):(ce=nf(te.type,te.key,te.props,null,Z.mode,ce),Za(ce,te),ce.return=Z,Z=ce)}return R(Z);case x:e:{for(qe=te.key;G!==null;){if(G.key===qe)if(G.tag===4&&G.stateNode.containerInfo===te.containerInfo&&G.stateNode.implementation===te.implementation){c(Z,G.sibling),ce=y(G,te.children||[]),ce.return=Z,Z=ce;break e}else{c(Z,G);break}else l(Z,G);G=G.sibling}ce=jp(te,Z.mode,ce),ce.return=Z,Z=ce}return R(Z);case D:return te=vo(te),Rt(Z,G,te,ce)}if($(te))return Le(Z,G,te,ce);if(I(te)){if(qe=I(te),typeof qe!="function")throw Error(i(150));return te=qe.call(te),$e(Z,G,te,ce)}if(typeof te.then=="function")return Rt(Z,G,cf(te),ce);if(te.$$typeof===T)return Rt(Z,G,of(Z,te),ce);ff(Z,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,G!==null&&G.tag===6?(c(Z,G.sibling),ce=y(G,te),ce.return=Z,Z=ce):(c(Z,G),ce=Up(te,Z.mode,ce),ce.return=Z,Z=ce),R(Z)):c(Z,G)}return function(Z,G,te,ce){try{Wa=0;var qe=Rt(Z,G,te,ce);return Tl=null,qe}catch(ze){if(ze===kl||ze===af)throw ze;var dt=si(29,ze,null,Z.mode);return dt.lanes=ce,dt.return=Z,dt}}}var xo=E1(!0),C1=E1(!1),ds=!1;function em(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function tm(s,l){s=s.updateQueue,l.updateQueue===s&&(l.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function ps(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function ms(s,l,c){var h=s.updateQueue;if(h===null)return null;if(h=h.shared,(gt&2)!==0){var y=h.pending;return y===null?l.next=l:(l.next=y.next,y.next=l),h.pending=l,l=tf(s),l1(s,null,c),l}return ef(s,h,l,c),tf(s)}function Ja(s,l,c){if(l=l.updateQueue,l!==null&&(l=l.shared,(c&4194048)!==0)){var h=l.lanes;h&=s.pendingLanes,c|=h,l.lanes=c,sl(s,c)}}function nm(s,l){var c=s.updateQueue,h=s.alternate;if(h!==null&&(h=h.updateQueue,c===h)){var y=null,b=null;if(c=c.firstBaseUpdate,c!==null){do{var R={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};b===null?y=b=R:b=b.next=R,c=c.next}while(c!==null);b===null?y=b=l:b=b.next=l}else y=b=l;c={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:b,shared:h.shared,callbacks:h.callbacks},s.updateQueue=c;return}s=c.lastBaseUpdate,s===null?c.firstBaseUpdate=l:s.next=l,c.lastBaseUpdate=l}var im=!1;function eu(){if(im){var s=Rl;if(s!==null)throw s}}function tu(s,l,c,h){im=!1;var y=s.updateQueue;ds=!1;var b=y.firstBaseUpdate,R=y.lastBaseUpdate,L=y.shared.pending;if(L!==null){y.shared.pending=null;var F=L,ne=F.next;F.next=null,R===null?b=ne:R.next=ne,R=F;var ue=s.alternate;ue!==null&&(ue=ue.updateQueue,L=ue.lastBaseUpdate,L!==R&&(L===null?ue.firstBaseUpdate=ne:L.next=ne,ue.lastBaseUpdate=F))}if(b!==null){var he=y.baseState;R=0,ue=ne=F=null,L=b;do{var ie=L.lane&-536870913,se=ie!==L.lane;if(se?(at&ie)===ie:(h&ie)===ie){ie!==0&&ie===Cl&&(im=!0),ue!==null&&(ue=ue.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Le=s,$e=L;ie=l;var Rt=c;switch($e.tag){case 1:if(Le=$e.payload,typeof Le=="function"){he=Le.call(Rt,he,ie);break e}he=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=$e.payload,ie=typeof Le=="function"?Le.call(Rt,he,ie):Le,ie==null)break e;he=m({},he,ie);break e;case 2:ds=!0}}ie=L.callback,ie!==null&&(s.flags|=64,se&&(s.flags|=8192),se=y.callbacks,se===null?y.callbacks=[ie]:se.push(ie))}else se={lane:ie,tag:L.tag,payload:L.payload,callback:L.callback,next:null},ue===null?(ne=ue=se,F=he):ue=ue.next=se,R|=ie;if(L=L.next,L===null){if(L=y.shared.pending,L===null)break;se=L,L=se.next,se.next=null,y.lastBaseUpdate=se,y.shared.pending=null}}while(!0);ue===null&&(F=he),y.baseState=F,y.firstBaseUpdate=ne,y.lastBaseUpdate=ue,b===null&&(y.shared.lanes=0),xs|=R,s.lanes=R,s.memoizedState=he}}function R1(s,l){if(typeof s!="function")throw Error(i(191,s));s.call(l)}function k1(s,l){var c=s.callbacks;if(c!==null)for(s.callbacks=null,s=0;s<c.length;s++)R1(c[s],l)}var Al=B(null),hf=B(0);function T1(s,l){s=Ur,X(hf,s),X(Al,l),Ur=s|l.baseLanes}function rm(){X(hf,Ur),X(Al,Al.current)}function sm(){Ur=hf.current,K(Al),K(hf)}var oi=B(null),Ai=null;function gs(s){var l=s.alternate;X(Xt,Xt.current&1),X(oi,s),Ai===null&&(l===null||Al.current!==null||l.memoizedState!==null)&&(Ai=s)}function om(s){X(Xt,Xt.current),X(oi,s),Ai===null&&(Ai=s)}function A1(s){s.tag===22?(X(Xt,Xt.current),X(oi,s),Ai===null&&(Ai=s)):ys()}function ys(){X(Xt,Xt.current),X(oi,oi.current)}function li(s){K(oi),Ai===s&&(Ai=null),K(Xt)}var Xt=B(0);function df(s){for(var l=s;l!==null;){if(l.tag===13){var c=l.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||hg(c)||dg(c)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Lr=0,Je=null,Et=null,rn=null,pf=!1,Ol=!1,So=!1,mf=0,nu=0,Ml=null,eM=0;function Ut(){throw Error(i(321))}function lm(s,l){if(l===null)return!1;for(var c=0;c<l.length&&c<s.length;c++)if(!ri(s[c],l[c]))return!1;return!0}function am(s,l,c,h,y,b){return Lr=b,Je=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,_.H=s===null||s.memoizedState===null?fx:Em,So=!1,b=c(h,y),So=!1,Ol&&(b=M1(l,c,h,y)),O1(s),b}function O1(s){_.H=su;var l=Et!==null&&Et.next!==null;if(Lr=0,rn=Et=Je=null,pf=!1,nu=0,Ml=null,l)throw Error(i(300));s===null||sn||(s=s.dependencies,s!==null&&sf(s)&&(sn=!0))}function M1(s,l,c,h){Je=s;var y=0;do{if(Ol&&(Ml=null),nu=0,Ol=!1,25<=y)throw Error(i(301));if(y+=1,rn=Et=null,s.updateQueue!=null){var b=s.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}_.H=hx,b=l(c,h)}while(Ol);return b}function tM(){var s=_.H,l=s.useState()[0];return l=typeof l.then=="function"?iu(l):l,s=s.useState()[0],(Et!==null?Et.memoizedState:null)!==s&&(Je.flags|=1024),l}function um(){var s=mf!==0;return mf=0,s}function cm(s,l,c){l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~c}function fm(s){if(pf){for(s=s.memoizedState;s!==null;){var l=s.queue;l!==null&&(l.pending=null),s=s.next}pf=!1}Lr=0,rn=Et=Je=null,Ol=!1,nu=mf=0,Ml=null}function _n(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?Je.memoizedState=rn=s:rn=rn.next=s,rn}function Wt(){if(Et===null){var s=Je.alternate;s=s!==null?s.memoizedState:null}else s=Et.next;var l=rn===null?Je.memoizedState:rn.next;if(l!==null)rn=l,Et=s;else{if(s===null)throw Je.alternate===null?Error(i(467)):Error(i(310));Et=s,s={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},rn===null?Je.memoizedState=rn=s:rn=rn.next=s}return rn}function gf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function iu(s){var l=nu;return nu+=1,Ml===null&&(Ml=[]),s=x1(Ml,s,l),l=Je,(rn===null?l.memoizedState:rn.next)===null&&(l=l.alternate,_.H=l===null||l.memoizedState===null?fx:Em),s}function yf(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return iu(s);if(s.$$typeof===T)return En(s)}throw Error(i(438,String(s)))}function hm(s){var l=null,c=Je.updateQueue;if(c!==null&&(l=c.memoCache),l==null){var h=Je.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(l={data:h.data.map(function(y){return y.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),c===null&&(c=gf(),Je.updateQueue=c),c.memoCache=l,c=l.data[l.index],c===void 0)for(c=l.data[l.index]=Array(s),h=0;h<s;h++)c[h]=U;return l.index++,c}function Ir(s,l){return typeof l=="function"?l(s):l}function vf(s){var l=Wt();return dm(l,Et,s)}function dm(s,l,c){var h=s.queue;if(h===null)throw Error(i(311));h.lastRenderedReducer=c;var y=s.baseQueue,b=h.pending;if(b!==null){if(y!==null){var R=y.next;y.next=b.next,b.next=R}l.baseQueue=y=b,h.pending=null}if(b=s.baseState,y===null)s.memoizedState=b;else{l=y.next;var L=R=null,F=null,ne=l,ue=!1;do{var he=ne.lane&-536870913;if(he!==ne.lane?(at&he)===he:(Lr&he)===he){var ie=ne.revertLane;if(ie===0)F!==null&&(F=F.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),he===Cl&&(ue=!0);else if((Lr&ie)===ie){ne=ne.next,ie===Cl&&(ue=!0);continue}else he={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},F===null?(L=F=he,R=b):F=F.next=he,Je.lanes|=ie,xs|=ie;he=ne.action,So&&c(b,he),b=ne.hasEagerState?ne.eagerState:c(b,he)}else ie={lane:he,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},F===null?(L=F=ie,R=b):F=F.next=ie,Je.lanes|=he,xs|=he;ne=ne.next}while(ne!==null&&ne!==l);if(F===null?R=b:F.next=L,!ri(b,s.memoizedState)&&(sn=!0,ue&&(c=Rl,c!==null)))throw c;s.memoizedState=b,s.baseState=R,s.baseQueue=F,h.lastRenderedState=b}return y===null&&(h.lanes=0),[s.memoizedState,h.dispatch]}function pm(s){var l=Wt(),c=l.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=s;var h=c.dispatch,y=c.pending,b=l.memoizedState;if(y!==null){c.pending=null;var R=y=y.next;do b=s(b,R.action),R=R.next;while(R!==y);ri(b,l.memoizedState)||(sn=!0),l.memoizedState=b,l.baseQueue===null&&(l.baseState=b),c.lastRenderedState=b}return[b,h]}function D1(s,l,c){var h=Je,y=Wt(),b=ct;if(b){if(c===void 0)throw Error(i(407));c=c()}else c=l();var R=!ri((Et||y).memoizedState,c);if(R&&(y.memoizedState=c,sn=!0),y=y.queue,ym(I1.bind(null,h,y,s),[s]),y.getSnapshot!==l||R||rn!==null&&rn.memoizedState.tag&1){if(h.flags|=2048,Dl(9,{destroy:void 0},L1.bind(null,h,y,c,l),null),Tt===null)throw Error(i(349));b||(Lr&127)!==0||N1(h,l,c)}return c}function N1(s,l,c){s.flags|=16384,s={getSnapshot:l,value:c},l=Je.updateQueue,l===null?(l=gf(),Je.updateQueue=l,l.stores=[s]):(c=l.stores,c===null?l.stores=[s]:c.push(s))}function L1(s,l,c,h){l.value=c,l.getSnapshot=h,B1(l)&&_1(s)}function I1(s,l,c){return c(function(){B1(l)&&_1(s)})}function B1(s){var l=s.getSnapshot;s=s.value;try{var c=l();return!ri(s,c)}catch{return!0}}function _1(s){var l=fo(s,2);l!==null&&Gn(l,s,2)}function mm(s){var l=_n();if(typeof s=="function"){var c=s;if(s=c(),So){He(!0);try{c()}finally{He(!1)}}}return l.memoizedState=l.baseState=s,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:s},l}function P1(s,l,c,h){return s.baseState=c,dm(s,Et,typeof h=="function"?h:Ir)}function nM(s,l,c,h,y){if(Sf(s))throw Error(i(485));if(s=l.action,s!==null){var b={payload:y,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){b.listeners.push(R)}};_.T!==null?c(!0):b.isTransition=!1,h(b),c=l.pending,c===null?(b.next=l.pending=b,z1(l,b)):(b.next=c.next,l.pending=c.next=b)}}function z1(s,l){var c=l.action,h=l.payload,y=s.state;if(l.isTransition){var b=_.T,R={};_.T=R;try{var L=c(y,h),F=_.S;F!==null&&F(R,L),H1(s,l,L)}catch(ne){gm(s,l,ne)}finally{b!==null&&R.types!==null&&(b.types=R.types),_.T=b}}else try{b=c(y,h),H1(s,l,b)}catch(ne){gm(s,l,ne)}}function H1(s,l,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(h){V1(s,l,h)},function(h){return gm(s,l,h)}):V1(s,l,c)}function V1(s,l,c){l.status="fulfilled",l.value=c,U1(l),s.state=c,l=s.pending,l!==null&&(c=l.next,c===l?s.pending=null:(c=c.next,l.next=c,z1(s,c)))}function gm(s,l,c){var h=s.pending;if(s.pending=null,h!==null){h=h.next;do l.status="rejected",l.reason=c,U1(l),l=l.next;while(l!==h)}s.action=null}function U1(s){s=s.listeners;for(var l=0;l<s.length;l++)(0,s[l])()}function j1(s,l){return l}function q1(s,l){if(ct){var c=Tt.formState;if(c!==null){e:{var h=Je;if(ct){if(Nt){t:{for(var y=Nt,b=Ti;y.nodeType!==8;){if(!b){y=null;break t}if(y=Oi(y.nextSibling),y===null){y=null;break t}}b=y.data,y=b==="F!"||b==="F"?y:null}if(y){Nt=Oi(y.nextSibling),h=y.data==="F!";break e}}fs(h)}h=!1}h&&(l=c[0])}}return c=_n(),c.memoizedState=c.baseState=l,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:j1,lastRenderedState:l},c.queue=h,c=ax.bind(null,Je,h),h.dispatch=c,h=mm(!1),b=wm.bind(null,Je,!1,h.queue),h=_n(),y={state:l,dispatch:null,action:s,pending:null},h.queue=y,c=nM.bind(null,Je,y,b,c),y.dispatch=c,h.memoizedState=s,[l,c,!1]}function F1(s){var l=Wt();return $1(l,Et,s)}function $1(s,l,c){if(l=dm(s,l,j1)[0],s=vf(Ir)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var h=iu(l)}catch(R){throw R===kl?af:R}else h=l;l=Wt();var y=l.queue,b=y.dispatch;return c!==l.memoizedState&&(Je.flags|=2048,Dl(9,{destroy:void 0},iM.bind(null,y,c),null)),[h,b,s]}function iM(s,l){s.action=l}function K1(s){var l=Wt(),c=Et;if(c!==null)return $1(l,c,s);Wt(),l=l.memoizedState,c=Wt();var h=c.queue.dispatch;return c.memoizedState=s,[l,h,!1]}function Dl(s,l,c,h){return s={tag:s,create:c,deps:h,inst:l,next:null},l=Je.updateQueue,l===null&&(l=gf(),Je.updateQueue=l),c=l.lastEffect,c===null?l.lastEffect=s.next=s:(h=c.next,c.next=s,s.next=h,l.lastEffect=s),s}function Y1(){return Wt().memoizedState}function bf(s,l,c,h){var y=_n();Je.flags|=s,y.memoizedState=Dl(1|l,{destroy:void 0},c,h===void 0?null:h)}function xf(s,l,c,h){var y=Wt();h=h===void 0?null:h;var b=y.memoizedState.inst;Et!==null&&h!==null&&lm(h,Et.memoizedState.deps)?y.memoizedState=Dl(l,b,c,h):(Je.flags|=s,y.memoizedState=Dl(1|l,b,c,h))}function G1(s,l){bf(8390656,8,s,l)}function ym(s,l){xf(2048,8,s,l)}function rM(s){Je.flags|=4;var l=Je.updateQueue;if(l===null)l=gf(),Je.updateQueue=l,l.events=[s];else{var c=l.events;c===null?l.events=[s]:c.push(s)}}function Q1(s){var l=Wt().memoizedState;return rM({ref:l,nextImpl:s}),function(){if((gt&2)!==0)throw Error(i(440));return l.impl.apply(void 0,arguments)}}function X1(s,l){return xf(4,2,s,l)}function W1(s,l){return xf(4,4,s,l)}function Z1(s,l){if(typeof l=="function"){s=s();var c=l(s);return function(){typeof c=="function"?c():l(null)}}if(l!=null)return s=s(),l.current=s,function(){l.current=null}}function J1(s,l,c){c=c!=null?c.concat([s]):null,xf(4,4,Z1.bind(null,l,s),c)}function vm(){}function ex(s,l){var c=Wt();l=l===void 0?null:l;var h=c.memoizedState;return l!==null&&lm(l,h[1])?h[0]:(c.memoizedState=[s,l],s)}function tx(s,l){var c=Wt();l=l===void 0?null:l;var h=c.memoizedState;if(l!==null&&lm(l,h[1]))return h[0];if(h=s(),So){He(!0);try{s()}finally{He(!1)}}return c.memoizedState=[h,l],h}function bm(s,l,c){return c===void 0||(Lr&1073741824)!==0&&(at&261930)===0?s.memoizedState=l:(s.memoizedState=c,s=nS(),Je.lanes|=s,xs|=s,c)}function nx(s,l,c,h){return ri(c,l)?c:Al.current!==null?(s=bm(s,c,h),ri(s,l)||(sn=!0),s):(Lr&42)===0||(Lr&1073741824)!==0&&(at&261930)===0?(sn=!0,s.memoizedState=c):(s=nS(),Je.lanes|=s,xs|=s,l)}function ix(s,l,c,h,y){var b=H.p;H.p=b!==0&&8>b?b:8;var R=_.T,L={};_.T=L,wm(s,!1,l,c);try{var F=y(),ne=_.S;if(ne!==null&&ne(L,F),F!==null&&typeof F=="object"&&typeof F.then=="function"){var ue=JO(F,h);ru(s,l,ue,ci(s))}else ru(s,l,h,ci(s))}catch(he){ru(s,l,{then:function(){},status:"rejected",reason:he},ci())}finally{H.p=b,R!==null&&L.types!==null&&(R.types=L.types),_.T=R}}function sM(){}function xm(s,l,c,h){if(s.tag!==5)throw Error(i(476));var y=rx(s).queue;ix(s,y,l,z,c===null?sM:function(){return sx(s),c(h)})}function rx(s){var l=s.memoizedState;if(l!==null)return l;l={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:z},next:null};var c={};return l.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:c},next:null},s.memoizedState=l,s=s.alternate,s!==null&&(s.memoizedState=l),l}function sx(s){var l=rx(s);l.next===null&&(l=s.alternate.memoizedState),ru(s,l.next.queue,{},ci())}function Sm(){return En(Su)}function ox(){return Wt().memoizedState}function lx(){return Wt().memoizedState}function oM(s){for(var l=s.return;l!==null;){switch(l.tag){case 24:case 3:var c=ci();s=ps(c);var h=ms(l,s,c);h!==null&&(Gn(h,l,c),Ja(h,l,c)),l={cache:Xp()},s.payload=l;return}l=l.return}}function lM(s,l,c){var h=ci();c={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Sf(s)?ux(l,c):(c=Hp(s,l,c,h),c!==null&&(Gn(c,s,h),cx(c,l,h)))}function ax(s,l,c){var h=ci();ru(s,l,c,h)}function ru(s,l,c,h){var y={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Sf(s))ux(l,y);else{var b=s.alternate;if(s.lanes===0&&(b===null||b.lanes===0)&&(b=l.lastRenderedReducer,b!==null))try{var R=l.lastRenderedState,L=b(R,c);if(y.hasEagerState=!0,y.eagerState=L,ri(L,R))return ef(s,l,y,0),Tt===null&&Jc(),!1}catch{}if(c=Hp(s,l,y,h),c!==null)return Gn(c,s,h),cx(c,l,h),!0}return!1}function wm(s,l,c,h){if(h={lane:2,revertLane:eg(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Sf(s)){if(l)throw Error(i(479))}else l=Hp(s,c,h,2),l!==null&&Gn(l,s,2)}function Sf(s){var l=s.alternate;return s===Je||l!==null&&l===Je}function ux(s,l){Ol=pf=!0;var c=s.pending;c===null?l.next=l:(l.next=c.next,c.next=l),s.pending=l}function cx(s,l,c){if((c&4194048)!==0){var h=l.lanes;h&=s.pendingLanes,c|=h,l.lanes=c,sl(s,c)}}var su={readContext:En,use:yf,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useLayoutEffect:Ut,useInsertionEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useSyncExternalStore:Ut,useId:Ut,useHostTransitionStatus:Ut,useFormState:Ut,useActionState:Ut,useOptimistic:Ut,useMemoCache:Ut,useCacheRefresh:Ut};su.useEffectEvent=Ut;var fx={readContext:En,use:yf,useCallback:function(s,l){return _n().memoizedState=[s,l===void 0?null:l],s},useContext:En,useEffect:G1,useImperativeHandle:function(s,l,c){c=c!=null?c.concat([s]):null,bf(4194308,4,Z1.bind(null,l,s),c)},useLayoutEffect:function(s,l){return bf(4194308,4,s,l)},useInsertionEffect:function(s,l){bf(4,2,s,l)},useMemo:function(s,l){var c=_n();l=l===void 0?null:l;var h=s();if(So){He(!0);try{s()}finally{He(!1)}}return c.memoizedState=[h,l],h},useReducer:function(s,l,c){var h=_n();if(c!==void 0){var y=c(l);if(So){He(!0);try{c(l)}finally{He(!1)}}}else y=l;return h.memoizedState=h.baseState=y,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:y},h.queue=s,s=s.dispatch=lM.bind(null,Je,s),[h.memoizedState,s]},useRef:function(s){var l=_n();return s={current:s},l.memoizedState=s},useState:function(s){s=mm(s);var l=s.queue,c=ax.bind(null,Je,l);return l.dispatch=c,[s.memoizedState,c]},useDebugValue:vm,useDeferredValue:function(s,l){var c=_n();return bm(c,s,l)},useTransition:function(){var s=mm(!1);return s=ix.bind(null,Je,s.queue,!0,!1),_n().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,l,c){var h=Je,y=_n();if(ct){if(c===void 0)throw Error(i(407));c=c()}else{if(c=l(),Tt===null)throw Error(i(349));(at&127)!==0||N1(h,l,c)}y.memoizedState=c;var b={value:c,getSnapshot:l};return y.queue=b,G1(I1.bind(null,h,b,s),[s]),h.flags|=2048,Dl(9,{destroy:void 0},L1.bind(null,h,b,c,l),null),c},useId:function(){var s=_n(),l=Tt.identifierPrefix;if(ct){var c=cr,h=ur;c=(h&~(1<<32-Xe(h)-1)).toString(32)+c,l="_"+l+"R_"+c,c=mf++,0<c&&(l+="H"+c.toString(32)),l+="_"}else c=eM++,l="_"+l+"r_"+c.toString(32)+"_";return s.memoizedState=l},useHostTransitionStatus:Sm,useFormState:q1,useActionState:q1,useOptimistic:function(s){var l=_n();l.memoizedState=l.baseState=s;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=c,l=wm.bind(null,Je,!0,c),c.dispatch=l,[s,l]},useMemoCache:hm,useCacheRefresh:function(){return _n().memoizedState=oM.bind(null,Je)},useEffectEvent:function(s){var l=_n(),c={impl:s};return l.memoizedState=c,function(){if((gt&2)!==0)throw Error(i(440));return c.impl.apply(void 0,arguments)}}},Em={readContext:En,use:yf,useCallback:ex,useContext:En,useEffect:ym,useImperativeHandle:J1,useInsertionEffect:X1,useLayoutEffect:W1,useMemo:tx,useReducer:vf,useRef:Y1,useState:function(){return vf(Ir)},useDebugValue:vm,useDeferredValue:function(s,l){var c=Wt();return nx(c,Et.memoizedState,s,l)},useTransition:function(){var s=vf(Ir)[0],l=Wt().memoizedState;return[typeof s=="boolean"?s:iu(s),l]},useSyncExternalStore:D1,useId:ox,useHostTransitionStatus:Sm,useFormState:F1,useActionState:F1,useOptimistic:function(s,l){var c=Wt();return P1(c,Et,s,l)},useMemoCache:hm,useCacheRefresh:lx};Em.useEffectEvent=Q1;var hx={readContext:En,use:yf,useCallback:ex,useContext:En,useEffect:ym,useImperativeHandle:J1,useInsertionEffect:X1,useLayoutEffect:W1,useMemo:tx,useReducer:pm,useRef:Y1,useState:function(){return pm(Ir)},useDebugValue:vm,useDeferredValue:function(s,l){var c=Wt();return Et===null?bm(c,s,l):nx(c,Et.memoizedState,s,l)},useTransition:function(){var s=pm(Ir)[0],l=Wt().memoizedState;return[typeof s=="boolean"?s:iu(s),l]},useSyncExternalStore:D1,useId:ox,useHostTransitionStatus:Sm,useFormState:K1,useActionState:K1,useOptimistic:function(s,l){var c=Wt();return Et!==null?P1(c,Et,s,l):(c.baseState=s,[s,c.queue.dispatch])},useMemoCache:hm,useCacheRefresh:lx};hx.useEffectEvent=Q1;function Cm(s,l,c,h){l=s.memoizedState,c=c(h,l),c=c==null?l:m({},l,c),s.memoizedState=c,s.lanes===0&&(s.updateQueue.baseState=c)}var Rm={enqueueSetState:function(s,l,c){s=s._reactInternals;var h=ci(),y=ps(h);y.payload=l,c!=null&&(y.callback=c),l=ms(s,y,h),l!==null&&(Gn(l,s,h),Ja(l,s,h))},enqueueReplaceState:function(s,l,c){s=s._reactInternals;var h=ci(),y=ps(h);y.tag=1,y.payload=l,c!=null&&(y.callback=c),l=ms(s,y,h),l!==null&&(Gn(l,s,h),Ja(l,s,h))},enqueueForceUpdate:function(s,l){s=s._reactInternals;var c=ci(),h=ps(c);h.tag=2,l!=null&&(h.callback=l),l=ms(s,h,c),l!==null&&(Gn(l,s,c),Ja(l,s,c))}};function dx(s,l,c,h,y,b,R){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(h,b,R):l.prototype&&l.prototype.isPureReactComponent?!$a(c,h)||!$a(y,b):!0}function px(s,l,c,h){s=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(c,h),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(c,h),l.state!==s&&Rm.enqueueReplaceState(l,l.state,null)}function wo(s,l){var c=l;if("ref"in l){c={};for(var h in l)h!=="ref"&&(c[h]=l[h])}if(s=s.defaultProps){c===l&&(c=m({},c));for(var y in s)c[y]===void 0&&(c[y]=s[y])}return c}function mx(s){Zc(s)}function gx(s){console.error(s)}function yx(s){Zc(s)}function wf(s,l){try{var c=s.onUncaughtError;c(l.value,{componentStack:l.stack})}catch(h){setTimeout(function(){throw h})}}function vx(s,l,c){try{var h=s.onCaughtError;h(c.value,{componentStack:c.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function km(s,l,c){return c=ps(c),c.tag=3,c.payload={element:null},c.callback=function(){wf(s,l)},c}function bx(s){return s=ps(s),s.tag=3,s}function xx(s,l,c,h){var y=c.type.getDerivedStateFromError;if(typeof y=="function"){var b=h.value;s.payload=function(){return y(b)},s.callback=function(){vx(l,c,h)}}var R=c.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(s.callback=function(){vx(l,c,h),typeof y!="function"&&(Ss===null?Ss=new Set([this]):Ss.add(this));var L=h.stack;this.componentDidCatch(h.value,{componentStack:L!==null?L:""})})}function aM(s,l,c,h,y){if(c.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(l=c.alternate,l!==null&&El(l,c,y,!0),c=oi.current,c!==null){switch(c.tag){case 31:case 13:return Ai===null?If():c.alternate===null&&jt===0&&(jt=3),c.flags&=-257,c.flags|=65536,c.lanes=y,h===uf?c.flags|=16384:(l=c.updateQueue,l===null?c.updateQueue=new Set([h]):l.add(h),Wm(s,h,y)),!1;case 22:return c.flags|=65536,h===uf?c.flags|=16384:(l=c.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([h])},c.updateQueue=l):(c=l.retryQueue,c===null?l.retryQueue=new Set([h]):c.add(h)),Wm(s,h,y)),!1}throw Error(i(435,c.tag))}return Wm(s,h,y),If(),!1}if(ct)return l=oi.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=y,h!==$p&&(s=Error(i(422),{cause:h}),Ga(Ci(s,c)))):(h!==$p&&(l=Error(i(423),{cause:h}),Ga(Ci(l,c))),s=s.current.alternate,s.flags|=65536,y&=-y,s.lanes|=y,h=Ci(h,c),y=km(s.stateNode,h,y),nm(s,y),jt!==4&&(jt=2)),!1;var b=Error(i(520),{cause:h});if(b=Ci(b,c),du===null?du=[b]:du.push(b),jt!==4&&(jt=2),l===null)return!0;h=Ci(h,c),c=l;do{switch(c.tag){case 3:return c.flags|=65536,s=y&-y,c.lanes|=s,s=km(c.stateNode,h,s),nm(c,s),!1;case 1:if(l=c.type,b=c.stateNode,(c.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Ss===null||!Ss.has(b))))return c.flags|=65536,y&=-y,c.lanes|=y,y=bx(y),xx(y,s,c,h),nm(c,y),!1}c=c.return}while(c!==null);return!1}var Tm=Error(i(461)),sn=!1;function Cn(s,l,c,h){l.child=s===null?C1(l,null,c,h):xo(l,s.child,c,h)}function Sx(s,l,c,h,y){c=c.render;var b=l.ref;if("ref"in h){var R={};for(var L in h)L!=="ref"&&(R[L]=h[L])}else R=h;return go(l),h=am(s,l,c,R,b,y),L=um(),s!==null&&!sn?(cm(s,l,y),Br(s,l,y)):(ct&&L&&qp(l),l.flags|=1,Cn(s,l,h,y),l.child)}function wx(s,l,c,h,y){if(s===null){var b=c.type;return typeof b=="function"&&!Vp(b)&&b.defaultProps===void 0&&c.compare===null?(l.tag=15,l.type=b,Ex(s,l,b,h,y)):(s=nf(c.type,null,h,l,l.mode,y),s.ref=l.ref,s.return=l,l.child=s)}if(b=s.child,!Bm(s,y)){var R=b.memoizedProps;if(c=c.compare,c=c!==null?c:$a,c(R,h)&&s.ref===l.ref)return Br(s,l,y)}return l.flags|=1,s=Or(b,h),s.ref=l.ref,s.return=l,l.child=s}function Ex(s,l,c,h,y){if(s!==null){var b=s.memoizedProps;if($a(b,h)&&s.ref===l.ref)if(sn=!1,l.pendingProps=h=b,Bm(s,y))(s.flags&131072)!==0&&(sn=!0);else return l.lanes=s.lanes,Br(s,l,y)}return Am(s,l,c,h,y)}function Cx(s,l,c,h){var y=h.children,b=s!==null?s.memoizedState:null;if(s===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((l.flags&128)!==0){if(b=b!==null?b.baseLanes|c:c,s!==null){for(h=l.child=s.child,y=0;h!==null;)y=y|h.lanes|h.childLanes,h=h.sibling;h=y&~b}else h=0,l.child=null;return Rx(s,l,b,c,h)}if((c&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},s!==null&&lf(l,b!==null?b.cachePool:null),b!==null?T1(l,b):rm(),A1(l);else return h=l.lanes=536870912,Rx(s,l,b!==null?b.baseLanes|c:c,c,h)}else b!==null?(lf(l,b.cachePool),T1(l,b),ys(),l.memoizedState=null):(s!==null&&lf(l,null),rm(),ys());return Cn(s,l,y,c),l.child}function ou(s,l){return s!==null&&s.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function Rx(s,l,c,h,y){var b=Zp();return b=b===null?null:{parent:nn._currentValue,pool:b},l.memoizedState={baseLanes:c,cachePool:b},s!==null&&lf(l,null),rm(),A1(l),s!==null&&El(s,l,h,!0),l.childLanes=y,null}function Ef(s,l){return l=Rf({mode:l.mode,children:l.children},s.mode),l.ref=s.ref,s.child=l,l.return=s,l}function kx(s,l,c){return xo(l,s.child,null,c),s=Ef(l,l.pendingProps),s.flags|=2,li(l),l.memoizedState=null,s}function uM(s,l,c){var h=l.pendingProps,y=(l.flags&128)!==0;if(l.flags&=-129,s===null){if(ct){if(h.mode==="hidden")return s=Ef(l,h),l.lanes=536870912,ou(null,s);if(om(l),(s=Nt)?(s=zS(s,Ti),s=s!==null&&s.data==="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:us!==null?{id:ur,overflow:cr}:null,retryLane:536870912,hydrationErrors:null},c=u1(s),c.return=l,l.child=c,wn=l,Nt=null)):s=null,s===null)throw fs(l);return l.lanes=536870912,null}return Ef(l,h)}var b=s.memoizedState;if(b!==null){var R=b.dehydrated;if(om(l),y)if(l.flags&256)l.flags&=-257,l=kx(s,l,c);else if(l.memoizedState!==null)l.child=s.child,l.flags|=128,l=null;else throw Error(i(558));else if(sn||El(s,l,c,!1),y=(c&s.childLanes)!==0,sn||y){if(h=Tt,h!==null&&(R=Uc(h,c),R!==0&&R!==b.retryLane))throw b.retryLane=R,fo(s,R),Gn(h,s,R),Tm;If(),l=kx(s,l,c)}else s=b.treeContext,Nt=Oi(R.nextSibling),wn=l,ct=!0,cs=null,Ti=!1,s!==null&&h1(l,s),l=Ef(l,h),l.flags|=4096;return l}return s=Or(s.child,{mode:h.mode,children:h.children}),s.ref=l.ref,l.child=s,s.return=l,s}function Cf(s,l){var c=l.ref;if(c===null)s!==null&&s.ref!==null&&(l.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(i(284));(s===null||s.ref!==c)&&(l.flags|=4194816)}}function Am(s,l,c,h,y){return go(l),c=am(s,l,c,h,void 0,y),h=um(),s!==null&&!sn?(cm(s,l,y),Br(s,l,y)):(ct&&h&&qp(l),l.flags|=1,Cn(s,l,c,y),l.child)}function Tx(s,l,c,h,y,b){return go(l),l.updateQueue=null,c=M1(l,h,c,y),O1(s),h=um(),s!==null&&!sn?(cm(s,l,b),Br(s,l,b)):(ct&&h&&qp(l),l.flags|=1,Cn(s,l,c,b),l.child)}function Ax(s,l,c,h,y){if(go(l),l.stateNode===null){var b=bl,R=c.contextType;typeof R=="object"&&R!==null&&(b=En(R)),b=new c(h,b),l.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=Rm,l.stateNode=b,b._reactInternals=l,b=l.stateNode,b.props=h,b.state=l.memoizedState,b.refs={},em(l),R=c.contextType,b.context=typeof R=="object"&&R!==null?En(R):bl,b.state=l.memoizedState,R=c.getDerivedStateFromProps,typeof R=="function"&&(Cm(l,c,R,h),b.state=l.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(R=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),R!==b.state&&Rm.enqueueReplaceState(b,b.state,null),tu(l,h,b,y),eu(),b.state=l.memoizedState),typeof b.componentDidMount=="function"&&(l.flags|=4194308),h=!0}else if(s===null){b=l.stateNode;var L=l.memoizedProps,F=wo(c,L);b.props=F;var ne=b.context,ue=c.contextType;R=bl,typeof ue=="object"&&ue!==null&&(R=En(ue));var he=c.getDerivedStateFromProps;ue=typeof he=="function"||typeof b.getSnapshotBeforeUpdate=="function",L=l.pendingProps!==L,ue||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(L||ne!==R)&&px(l,b,h,R),ds=!1;var ie=l.memoizedState;b.state=ie,tu(l,h,b,y),eu(),ne=l.memoizedState,L||ie!==ne||ds?(typeof he=="function"&&(Cm(l,c,he,h),ne=l.memoizedState),(F=ds||dx(l,c,F,h,ie,ne,R))?(ue||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(l.flags|=4194308)):(typeof b.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=h,l.memoizedState=ne),b.props=h,b.state=ne,b.context=R,h=F):(typeof b.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{b=l.stateNode,tm(s,l),R=l.memoizedProps,ue=wo(c,R),b.props=ue,he=l.pendingProps,ie=b.context,ne=c.contextType,F=bl,typeof ne=="object"&&ne!==null&&(F=En(ne)),L=c.getDerivedStateFromProps,(ne=typeof L=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(R!==he||ie!==F)&&px(l,b,h,F),ds=!1,ie=l.memoizedState,b.state=ie,tu(l,h,b,y),eu();var se=l.memoizedState;R!==he||ie!==se||ds||s!==null&&s.dependencies!==null&&sf(s.dependencies)?(typeof L=="function"&&(Cm(l,c,L,h),se=l.memoizedState),(ue=ds||dx(l,c,ue,h,ie,se,F)||s!==null&&s.dependencies!==null&&sf(s.dependencies))?(ne||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(h,se,F),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(h,se,F)),typeof b.componentDidUpdate=="function"&&(l.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof b.componentDidUpdate!="function"||R===s.memoizedProps&&ie===s.memoizedState||(l.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||R===s.memoizedProps&&ie===s.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=se),b.props=h,b.state=se,b.context=F,h=ue):(typeof b.componentDidUpdate!="function"||R===s.memoizedProps&&ie===s.memoizedState||(l.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||R===s.memoizedProps&&ie===s.memoizedState||(l.flags|=1024),h=!1)}return b=h,Cf(s,l),h=(l.flags&128)!==0,b||h?(b=l.stateNode,c=h&&typeof c.getDerivedStateFromError!="function"?null:b.render(),l.flags|=1,s!==null&&h?(l.child=xo(l,s.child,null,y),l.child=xo(l,null,c,y)):Cn(s,l,c,y),l.memoizedState=b.state,s=l.child):s=Br(s,l,y),s}function Ox(s,l,c,h){return po(),l.flags|=256,Cn(s,l,c,h),l.child}var Om={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Mm(s){return{baseLanes:s,cachePool:v1()}}function Dm(s,l,c){return s=s!==null?s.childLanes&~c:0,l&&(s|=ui),s}function Mx(s,l,c){var h=l.pendingProps,y=!1,b=(l.flags&128)!==0,R;if((R=b)||(R=s!==null&&s.memoizedState===null?!1:(Xt.current&2)!==0),R&&(y=!0,l.flags&=-129),R=(l.flags&32)!==0,l.flags&=-33,s===null){if(ct){if(y?gs(l):ys(),(s=Nt)?(s=zS(s,Ti),s=s!==null&&s.data!=="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:us!==null?{id:ur,overflow:cr}:null,retryLane:536870912,hydrationErrors:null},c=u1(s),c.return=l,l.child=c,wn=l,Nt=null)):s=null,s===null)throw fs(l);return dg(s)?l.lanes=32:l.lanes=536870912,null}var L=h.children;return h=h.fallback,y?(ys(),y=l.mode,L=Rf({mode:"hidden",children:L},y),h=ho(h,y,c,null),L.return=l,h.return=l,L.sibling=h,l.child=L,h=l.child,h.memoizedState=Mm(c),h.childLanes=Dm(s,R,c),l.memoizedState=Om,ou(null,h)):(gs(l),Nm(l,L))}var F=s.memoizedState;if(F!==null&&(L=F.dehydrated,L!==null)){if(b)l.flags&256?(gs(l),l.flags&=-257,l=Lm(s,l,c)):l.memoizedState!==null?(ys(),l.child=s.child,l.flags|=128,l=null):(ys(),L=h.fallback,y=l.mode,h=Rf({mode:"visible",children:h.children},y),L=ho(L,y,c,null),L.flags|=2,h.return=l,L.return=l,h.sibling=L,l.child=h,xo(l,s.child,null,c),h=l.child,h.memoizedState=Mm(c),h.childLanes=Dm(s,R,c),l.memoizedState=Om,l=ou(null,h));else if(gs(l),dg(L)){if(R=L.nextSibling&&L.nextSibling.dataset,R)var ne=R.dgst;R=ne,h=Error(i(419)),h.stack="",h.digest=R,Ga({value:h,source:null,stack:null}),l=Lm(s,l,c)}else if(sn||El(s,l,c,!1),R=(c&s.childLanes)!==0,sn||R){if(R=Tt,R!==null&&(h=Uc(R,c),h!==0&&h!==F.retryLane))throw F.retryLane=h,fo(s,h),Gn(R,s,h),Tm;hg(L)||If(),l=Lm(s,l,c)}else hg(L)?(l.flags|=192,l.child=s.child,l=null):(s=F.treeContext,Nt=Oi(L.nextSibling),wn=l,ct=!0,cs=null,Ti=!1,s!==null&&h1(l,s),l=Nm(l,h.children),l.flags|=4096);return l}return y?(ys(),L=h.fallback,y=l.mode,F=s.child,ne=F.sibling,h=Or(F,{mode:"hidden",children:h.children}),h.subtreeFlags=F.subtreeFlags&65011712,ne!==null?L=Or(ne,L):(L=ho(L,y,c,null),L.flags|=2),L.return=l,h.return=l,h.sibling=L,l.child=h,ou(null,h),h=l.child,L=s.child.memoizedState,L===null?L=Mm(c):(y=L.cachePool,y!==null?(F=nn._currentValue,y=y.parent!==F?{parent:F,pool:F}:y):y=v1(),L={baseLanes:L.baseLanes|c,cachePool:y}),h.memoizedState=L,h.childLanes=Dm(s,R,c),l.memoizedState=Om,ou(s.child,h)):(gs(l),c=s.child,s=c.sibling,c=Or(c,{mode:"visible",children:h.children}),c.return=l,c.sibling=null,s!==null&&(R=l.deletions,R===null?(l.deletions=[s],l.flags|=16):R.push(s)),l.child=c,l.memoizedState=null,c)}function Nm(s,l){return l=Rf({mode:"visible",children:l},s.mode),l.return=s,s.child=l}function Rf(s,l){return s=si(22,s,null,l),s.lanes=0,s}function Lm(s,l,c){return xo(l,s.child,null,c),s=Nm(l,l.pendingProps.children),s.flags|=2,l.memoizedState=null,s}function Dx(s,l,c){s.lanes|=l;var h=s.alternate;h!==null&&(h.lanes|=l),Gp(s.return,l,c)}function Im(s,l,c,h,y,b){var R=s.memoizedState;R===null?s.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:y,treeForkCount:b}:(R.isBackwards=l,R.rendering=null,R.renderingStartTime=0,R.last=h,R.tail=c,R.tailMode=y,R.treeForkCount=b)}function Nx(s,l,c){var h=l.pendingProps,y=h.revealOrder,b=h.tail;h=h.children;var R=Xt.current,L=(R&2)!==0;if(L?(R=R&1|2,l.flags|=128):R&=1,X(Xt,R),Cn(s,l,h,c),h=ct?Ya:0,!L&&s!==null&&(s.flags&128)!==0)e:for(s=l.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&Dx(s,c,l);else if(s.tag===19)Dx(s,c,l);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===l)break e;for(;s.sibling===null;){if(s.return===null||s.return===l)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(y){case"forwards":for(c=l.child,y=null;c!==null;)s=c.alternate,s!==null&&df(s)===null&&(y=c),c=c.sibling;c=y,c===null?(y=l.child,l.child=null):(y=c.sibling,c.sibling=null),Im(l,!1,y,c,b,h);break;case"backwards":case"unstable_legacy-backwards":for(c=null,y=l.child,l.child=null;y!==null;){if(s=y.alternate,s!==null&&df(s)===null){l.child=y;break}s=y.sibling,y.sibling=c,c=y,y=s}Im(l,!0,c,null,b,h);break;case"together":Im(l,!1,null,null,void 0,h);break;default:l.memoizedState=null}return l.child}function Br(s,l,c){if(s!==null&&(l.dependencies=s.dependencies),xs|=l.lanes,(c&l.childLanes)===0)if(s!==null){if(El(s,l,c,!1),(c&l.childLanes)===0)return null}else return null;if(s!==null&&l.child!==s.child)throw Error(i(153));if(l.child!==null){for(s=l.child,c=Or(s,s.pendingProps),l.child=c,c.return=l;s.sibling!==null;)s=s.sibling,c=c.sibling=Or(s,s.pendingProps),c.return=l;c.sibling=null}return l.child}function Bm(s,l){return(s.lanes&l)!==0?!0:(s=s.dependencies,!!(s!==null&&sf(s)))}function cM(s,l,c){switch(l.tag){case 3:fe(l,l.stateNode.containerInfo),hs(l,nn,s.memoizedState.cache),po();break;case 27:case 5:Te(l);break;case 4:fe(l,l.stateNode.containerInfo);break;case 10:hs(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,om(l),null;break;case 13:var h=l.memoizedState;if(h!==null)return h.dehydrated!==null?(gs(l),l.flags|=128,null):(c&l.child.childLanes)!==0?Mx(s,l,c):(gs(l),s=Br(s,l,c),s!==null?s.sibling:null);gs(l);break;case 19:var y=(s.flags&128)!==0;if(h=(c&l.childLanes)!==0,h||(El(s,l,c,!1),h=(c&l.childLanes)!==0),y){if(h)return Nx(s,l,c);l.flags|=128}if(y=l.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),X(Xt,Xt.current),h)break;return null;case 22:return l.lanes=0,Cx(s,l,c,l.pendingProps);case 24:hs(l,nn,s.memoizedState.cache)}return Br(s,l,c)}function Lx(s,l,c){if(s!==null)if(s.memoizedProps!==l.pendingProps)sn=!0;else{if(!Bm(s,c)&&(l.flags&128)===0)return sn=!1,cM(s,l,c);sn=(s.flags&131072)!==0}else sn=!1,ct&&(l.flags&1048576)!==0&&f1(l,Ya,l.index);switch(l.lanes=0,l.tag){case 16:e:{var h=l.pendingProps;if(s=vo(l.elementType),l.type=s,typeof s=="function")Vp(s)?(h=wo(s,h),l.tag=1,l=Ax(null,l,s,h,c)):(l.tag=0,l=Am(null,l,s,h,c));else{if(s!=null){var y=s.$$typeof;if(y===A){l.tag=11,l=Sx(null,l,s,h,c);break e}else if(y===M){l.tag=14,l=wx(null,l,s,h,c);break e}}throw l=P(s)||s,Error(i(306,l,""))}}return l;case 0:return Am(s,l,l.type,l.pendingProps,c);case 1:return h=l.type,y=wo(h,l.pendingProps),Ax(s,l,h,y,c);case 3:e:{if(fe(l,l.stateNode.containerInfo),s===null)throw Error(i(387));h=l.pendingProps;var b=l.memoizedState;y=b.element,tm(s,l),tu(l,h,null,c);var R=l.memoizedState;if(h=R.cache,hs(l,nn,h),h!==b.cache&&Qp(l,[nn],c,!0),eu(),h=R.element,b.isDehydrated)if(b={element:h,isDehydrated:!1,cache:R.cache},l.updateQueue.baseState=b,l.memoizedState=b,l.flags&256){l=Ox(s,l,h,c);break e}else if(h!==y){y=Ci(Error(i(424)),l),Ga(y),l=Ox(s,l,h,c);break e}else for(s=l.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,Nt=Oi(s.firstChild),wn=l,ct=!0,cs=null,Ti=!0,c=C1(l,null,h,c),l.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(po(),h===y){l=Br(s,l,c);break e}Cn(s,l,h,c)}l=l.child}return l;case 26:return Cf(s,l),s===null?(c=FS(l.type,null,l.pendingProps,null))?l.memoizedState=c:ct||(c=l.type,s=l.pendingProps,h=Uf(re.current).createElement(c),h[Sn]=l,h[jn]=s,Rn(h,c,s),pn(h),l.stateNode=h):l.memoizedState=FS(l.type,s.memoizedProps,l.pendingProps,s.memoizedState),null;case 27:return Te(l),s===null&&ct&&(h=l.stateNode=US(l.type,l.pendingProps,re.current),wn=l,Ti=!0,y=Nt,Rs(l.type)?(pg=y,Nt=Oi(h.firstChild)):Nt=y),Cn(s,l,l.pendingProps.children,c),Cf(s,l),s===null&&(l.flags|=4194304),l.child;case 5:return s===null&&ct&&((y=h=Nt)&&(h=VM(h,l.type,l.pendingProps,Ti),h!==null?(l.stateNode=h,wn=l,Nt=Oi(h.firstChild),Ti=!1,y=!0):y=!1),y||fs(l)),Te(l),y=l.type,b=l.pendingProps,R=s!==null?s.memoizedProps:null,h=b.children,ug(y,b)?h=null:R!==null&&ug(y,R)&&(l.flags|=32),l.memoizedState!==null&&(y=am(s,l,tM,null,null,c),Su._currentValue=y),Cf(s,l),Cn(s,l,h,c),l.child;case 6:return s===null&&ct&&((s=c=Nt)&&(c=UM(c,l.pendingProps,Ti),c!==null?(l.stateNode=c,wn=l,Nt=null,s=!0):s=!1),s||fs(l)),null;case 13:return Mx(s,l,c);case 4:return fe(l,l.stateNode.containerInfo),h=l.pendingProps,s===null?l.child=xo(l,null,h,c):Cn(s,l,h,c),l.child;case 11:return Sx(s,l,l.type,l.pendingProps,c);case 7:return Cn(s,l,l.pendingProps,c),l.child;case 8:return Cn(s,l,l.pendingProps.children,c),l.child;case 12:return Cn(s,l,l.pendingProps.children,c),l.child;case 10:return h=l.pendingProps,hs(l,l.type,h.value),Cn(s,l,h.children,c),l.child;case 9:return y=l.type._context,h=l.pendingProps.children,go(l),y=En(y),h=h(y),l.flags|=1,Cn(s,l,h,c),l.child;case 14:return wx(s,l,l.type,l.pendingProps,c);case 15:return Ex(s,l,l.type,l.pendingProps,c);case 19:return Nx(s,l,c);case 31:return uM(s,l,c);case 22:return Cx(s,l,c,l.pendingProps);case 24:return go(l),h=En(nn),s===null?(y=Zp(),y===null&&(y=Tt,b=Xp(),y.pooledCache=b,b.refCount++,b!==null&&(y.pooledCacheLanes|=c),y=b),l.memoizedState={parent:h,cache:y},em(l),hs(l,nn,y)):((s.lanes&c)!==0&&(tm(s,l),tu(l,null,null,c),eu()),y=s.memoizedState,b=l.memoizedState,y.parent!==h?(y={parent:h,cache:h},l.memoizedState=y,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=y),hs(l,nn,h)):(h=b.cache,hs(l,nn,h),h!==y.cache&&Qp(l,[nn],c,!0))),Cn(s,l,l.pendingProps.children,c),l.child;case 29:throw l.pendingProps}throw Error(i(156,l.tag))}function _r(s){s.flags|=4}function _m(s,l,c,h,y){if((l=(s.mode&32)!==0)&&(l=!1),l){if(s.flags|=16777216,(y&335544128)===y)if(s.stateNode.complete)s.flags|=8192;else if(oS())s.flags|=8192;else throw bo=uf,Jp}else s.flags&=-16777217}function Ix(s,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!QS(l))if(oS())s.flags|=8192;else throw bo=uf,Jp}function kf(s,l){l!==null&&(s.flags|=4),s.flags&16384&&(l=s.tag!==22?tt():536870912,s.lanes|=l,Bl|=l)}function lu(s,l){if(!ct)switch(s.tailMode){case"hidden":l=s.tail;for(var c=null;l!==null;)l.alternate!==null&&(c=l),l=l.sibling;c===null?s.tail=null:c.sibling=null;break;case"collapsed":c=s.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?l||s.tail===null?s.tail=null:s.tail.sibling=null:h.sibling=null}}function Lt(s){var l=s.alternate!==null&&s.alternate.child===s.child,c=0,h=0;if(l)for(var y=s.child;y!==null;)c|=y.lanes|y.childLanes,h|=y.subtreeFlags&65011712,h|=y.flags&65011712,y.return=s,y=y.sibling;else for(y=s.child;y!==null;)c|=y.lanes|y.childLanes,h|=y.subtreeFlags,h|=y.flags,y.return=s,y=y.sibling;return s.subtreeFlags|=h,s.childLanes=c,l}function fM(s,l,c){var h=l.pendingProps;switch(Fp(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lt(l),null;case 1:return Lt(l),null;case 3:return c=l.stateNode,h=null,s!==null&&(h=s.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),Nr(nn),pe(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(s===null||s.child===null)&&(wl(l)?_r(l):s===null||s.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Kp())),Lt(l),null;case 26:var y=l.type,b=l.memoizedState;return s===null?(_r(l),b!==null?(Lt(l),Ix(l,b)):(Lt(l),_m(l,y,null,h,c))):b?b!==s.memoizedState?(_r(l),Lt(l),Ix(l,b)):(Lt(l),l.flags&=-16777217):(s=s.memoizedProps,s!==h&&_r(l),Lt(l),_m(l,y,s,h,c)),null;case 27:if(le(l),c=re.current,y=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==h&&_r(l);else{if(!h){if(l.stateNode===null)throw Error(i(166));return Lt(l),null}s=J.current,wl(l)?d1(l):(s=US(y,h,c),l.stateNode=s,_r(l))}return Lt(l),null;case 5:if(le(l),y=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==h&&_r(l);else{if(!h){if(l.stateNode===null)throw Error(i(166));return Lt(l),null}if(b=J.current,wl(l))d1(l);else{var R=Uf(re.current);switch(b){case 1:b=R.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:b=R.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":b=R.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":b=R.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":b=R.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof h.is=="string"?R.createElement("select",{is:h.is}):R.createElement("select"),h.multiple?b.multiple=!0:h.size&&(b.size=h.size);break;default:b=typeof h.is=="string"?R.createElement(y,{is:h.is}):R.createElement(y)}}b[Sn]=l,b[jn]=h;e:for(R=l.child;R!==null;){if(R.tag===5||R.tag===6)b.appendChild(R.stateNode);else if(R.tag!==4&&R.tag!==27&&R.child!==null){R.child.return=R,R=R.child;continue}if(R===l)break e;for(;R.sibling===null;){if(R.return===null||R.return===l)break e;R=R.return}R.sibling.return=R.return,R=R.sibling}l.stateNode=b;e:switch(Rn(b,y,h),y){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&_r(l)}}return Lt(l),_m(l,l.type,s===null?null:s.memoizedProps,l.pendingProps,c),null;case 6:if(s&&l.stateNode!=null)s.memoizedProps!==h&&_r(l);else{if(typeof h!="string"&&l.stateNode===null)throw Error(i(166));if(s=re.current,wl(l)){if(s=l.stateNode,c=l.memoizedProps,h=null,y=wn,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}s[Sn]=l,s=!!(s.nodeValue===c||h!==null&&h.suppressHydrationWarning===!0||MS(s.nodeValue,c)),s||fs(l,!0)}else s=Uf(s).createTextNode(h),s[Sn]=l,l.stateNode=s}return Lt(l),null;case 31:if(c=l.memoizedState,s===null||s.memoizedState!==null){if(h=wl(l),c!==null){if(s===null){if(!h)throw Error(i(318));if(s=l.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(557));s[Sn]=l}else po(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Lt(l),s=!1}else c=Kp(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=c),s=!0;if(!s)return l.flags&256?(li(l),l):(li(l),null);if((l.flags&128)!==0)throw Error(i(558))}return Lt(l),null;case 13:if(h=l.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(y=wl(l),h!==null&&h.dehydrated!==null){if(s===null){if(!y)throw Error(i(318));if(y=l.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(i(317));y[Sn]=l}else po(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Lt(l),y=!1}else y=Kp(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=y),y=!0;if(!y)return l.flags&256?(li(l),l):(li(l),null)}return li(l),(l.flags&128)!==0?(l.lanes=c,l):(c=h!==null,s=s!==null&&s.memoizedState!==null,c&&(h=l.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool),b=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(b=h.memoizedState.cachePool.pool),b!==y&&(h.flags|=2048)),c!==s&&c&&(l.child.flags|=8192),kf(l,l.updateQueue),Lt(l),null);case 4:return pe(),s===null&&rg(l.stateNode.containerInfo),Lt(l),null;case 10:return Nr(l.type),Lt(l),null;case 19:if(K(Xt),h=l.memoizedState,h===null)return Lt(l),null;if(y=(l.flags&128)!==0,b=h.rendering,b===null)if(y)lu(h,!1);else{if(jt!==0||s!==null&&(s.flags&128)!==0)for(s=l.child;s!==null;){if(b=df(s),b!==null){for(l.flags|=128,lu(h,!1),s=b.updateQueue,l.updateQueue=s,kf(l,s),l.subtreeFlags=0,s=c,c=l.child;c!==null;)a1(c,s),c=c.sibling;return X(Xt,Xt.current&1|2),ct&&Mr(l,h.treeForkCount),l.child}s=s.sibling}h.tail!==null&&ye()>Df&&(l.flags|=128,y=!0,lu(h,!1),l.lanes=4194304)}else{if(!y)if(s=df(b),s!==null){if(l.flags|=128,y=!0,s=s.updateQueue,l.updateQueue=s,kf(l,s),lu(h,!0),h.tail===null&&h.tailMode==="hidden"&&!b.alternate&&!ct)return Lt(l),null}else 2*ye()-h.renderingStartTime>Df&&c!==536870912&&(l.flags|=128,y=!0,lu(h,!1),l.lanes=4194304);h.isBackwards?(b.sibling=l.child,l.child=b):(s=h.last,s!==null?s.sibling=b:l.child=b,h.last=b)}return h.tail!==null?(s=h.tail,h.rendering=s,h.tail=s.sibling,h.renderingStartTime=ye(),s.sibling=null,c=Xt.current,X(Xt,y?c&1|2:c&1),ct&&Mr(l,h.treeForkCount),s):(Lt(l),null);case 22:case 23:return li(l),sm(),h=l.memoizedState!==null,s!==null?s.memoizedState!==null!==h&&(l.flags|=8192):h&&(l.flags|=8192),h?(c&536870912)!==0&&(l.flags&128)===0&&(Lt(l),l.subtreeFlags&6&&(l.flags|=8192)):Lt(l),c=l.updateQueue,c!==null&&kf(l,c.retryQueue),c=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==c&&(l.flags|=2048),s!==null&&K(yo),null;case 24:return c=null,s!==null&&(c=s.memoizedState.cache),l.memoizedState.cache!==c&&(l.flags|=2048),Nr(nn),Lt(l),null;case 25:return null;case 30:return null}throw Error(i(156,l.tag))}function hM(s,l){switch(Fp(l),l.tag){case 1:return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 3:return Nr(nn),pe(),s=l.flags,(s&65536)!==0&&(s&128)===0?(l.flags=s&-65537|128,l):null;case 26:case 27:case 5:return le(l),null;case 31:if(l.memoizedState!==null){if(li(l),l.alternate===null)throw Error(i(340));po()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 13:if(li(l),s=l.memoizedState,s!==null&&s.dehydrated!==null){if(l.alternate===null)throw Error(i(340));po()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 19:return K(Xt),null;case 4:return pe(),null;case 10:return Nr(l.type),null;case 22:case 23:return li(l),sm(),s!==null&&K(yo),s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 24:return Nr(nn),null;case 25:return null;default:return null}}function Bx(s,l){switch(Fp(l),l.tag){case 3:Nr(nn),pe();break;case 26:case 27:case 5:le(l);break;case 4:pe();break;case 31:l.memoizedState!==null&&li(l);break;case 13:li(l);break;case 19:K(Xt);break;case 10:Nr(l.type);break;case 22:case 23:li(l),sm(),s!==null&&K(yo);break;case 24:Nr(nn)}}function au(s,l){try{var c=l.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var y=h.next;c=y;do{if((c.tag&s)===s){h=void 0;var b=c.create,R=c.inst;h=b(),R.destroy=h}c=c.next}while(c!==y)}}catch(L){St(l,l.return,L)}}function vs(s,l,c){try{var h=l.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var b=y.next;h=b;do{if((h.tag&s)===s){var R=h.inst,L=R.destroy;if(L!==void 0){R.destroy=void 0,y=l;var F=c,ne=L;try{ne()}catch(ue){St(y,F,ue)}}}h=h.next}while(h!==b)}}catch(ue){St(l,l.return,ue)}}function _x(s){var l=s.updateQueue;if(l!==null){var c=s.stateNode;try{k1(l,c)}catch(h){St(s,s.return,h)}}}function Px(s,l,c){c.props=wo(s.type,s.memoizedProps),c.state=s.memoizedState;try{c.componentWillUnmount()}catch(h){St(s,l,h)}}function uu(s,l){try{var c=s.ref;if(c!==null){switch(s.tag){case 26:case 27:case 5:var h=s.stateNode;break;case 30:h=s.stateNode;break;default:h=s.stateNode}typeof c=="function"?s.refCleanup=c(h):c.current=h}}catch(y){St(s,l,y)}}function fr(s,l){var c=s.ref,h=s.refCleanup;if(c!==null)if(typeof h=="function")try{h()}catch(y){St(s,l,y)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(y){St(s,l,y)}else c.current=null}function zx(s){var l=s.type,c=s.memoizedProps,h=s.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":c.autoFocus&&h.focus();break e;case"img":c.src?h.src=c.src:c.srcSet&&(h.srcset=c.srcSet)}}catch(y){St(s,s.return,y)}}function Pm(s,l,c){try{var h=s.stateNode;IM(h,s.type,c,l),h[jn]=l}catch(y){St(s,s.return,y)}}function Hx(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Rs(s.type)||s.tag===4}function zm(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Hx(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Rs(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Hm(s,l,c){var h=s.tag;if(h===5||h===6)s=s.stateNode,l?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(s,l):(l=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,l.appendChild(s),c=c._reactRootContainer,c!=null||l.onclick!==null||(l.onclick=Tr));else if(h!==4&&(h===27&&Rs(s.type)&&(c=s.stateNode,l=null),s=s.child,s!==null))for(Hm(s,l,c),s=s.sibling;s!==null;)Hm(s,l,c),s=s.sibling}function Tf(s,l,c){var h=s.tag;if(h===5||h===6)s=s.stateNode,l?c.insertBefore(s,l):c.appendChild(s);else if(h!==4&&(h===27&&Rs(s.type)&&(c=s.stateNode),s=s.child,s!==null))for(Tf(s,l,c),s=s.sibling;s!==null;)Tf(s,l,c),s=s.sibling}function Vx(s){var l=s.stateNode,c=s.memoizedProps;try{for(var h=s.type,y=l.attributes;y.length;)l.removeAttributeNode(y[0]);Rn(l,h,c),l[Sn]=s,l[jn]=c}catch(b){St(s,s.return,b)}}var Pr=!1,on=!1,Vm=!1,Ux=typeof WeakSet=="function"?WeakSet:Set,mn=null;function dM(s,l){if(s=s.containerInfo,lg=Gf,s=Jb(s),Lp(s)){if("selectionStart"in s)var c={start:s.selectionStart,end:s.selectionEnd};else e:{c=(c=s.ownerDocument)&&c.defaultView||window;var h=c.getSelection&&c.getSelection();if(h&&h.rangeCount!==0){c=h.anchorNode;var y=h.anchorOffset,b=h.focusNode;h=h.focusOffset;try{c.nodeType,b.nodeType}catch{c=null;break e}var R=0,L=-1,F=-1,ne=0,ue=0,he=s,ie=null;t:for(;;){for(var se;he!==c||y!==0&&he.nodeType!==3||(L=R+y),he!==b||h!==0&&he.nodeType!==3||(F=R+h),he.nodeType===3&&(R+=he.nodeValue.length),(se=he.firstChild)!==null;)ie=he,he=se;for(;;){if(he===s)break t;if(ie===c&&++ne===y&&(L=R),ie===b&&++ue===h&&(F=R),(se=he.nextSibling)!==null)break;he=ie,ie=he.parentNode}he=se}c=L===-1||F===-1?null:{start:L,end:F}}else c=null}c=c||{start:0,end:0}}else c=null;for(ag={focusedElem:s,selectionRange:c},Gf=!1,mn=l;mn!==null;)if(l=mn,s=l.child,(l.subtreeFlags&1028)!==0&&s!==null)s.return=l,mn=s;else for(;mn!==null;){switch(l=mn,b=l.alternate,s=l.flags,l.tag){case 0:if((s&4)!==0&&(s=l.updateQueue,s=s!==null?s.events:null,s!==null))for(c=0;c<s.length;c++)y=s[c],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&b!==null){s=void 0,c=l,y=b.memoizedProps,b=b.memoizedState,h=c.stateNode;try{var Le=wo(c.type,y);s=h.getSnapshotBeforeUpdate(Le,b),h.__reactInternalSnapshotBeforeUpdate=s}catch($e){St(c,c.return,$e)}}break;case 3:if((s&1024)!==0){if(s=l.stateNode.containerInfo,c=s.nodeType,c===9)fg(s);else if(c===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":fg(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(i(163))}if(s=l.sibling,s!==null){s.return=l.return,mn=s;break}mn=l.return}}function jx(s,l,c){var h=c.flags;switch(c.tag){case 0:case 11:case 15:Hr(s,c),h&4&&au(5,c);break;case 1:if(Hr(s,c),h&4)if(s=c.stateNode,l===null)try{s.componentDidMount()}catch(R){St(c,c.return,R)}else{var y=wo(c.type,l.memoizedProps);l=l.memoizedState;try{s.componentDidUpdate(y,l,s.__reactInternalSnapshotBeforeUpdate)}catch(R){St(c,c.return,R)}}h&64&&_x(c),h&512&&uu(c,c.return);break;case 3:if(Hr(s,c),h&64&&(s=c.updateQueue,s!==null)){if(l=null,c.child!==null)switch(c.child.tag){case 27:case 5:l=c.child.stateNode;break;case 1:l=c.child.stateNode}try{k1(s,l)}catch(R){St(c,c.return,R)}}break;case 27:l===null&&h&4&&Vx(c);case 26:case 5:Hr(s,c),l===null&&h&4&&zx(c),h&512&&uu(c,c.return);break;case 12:Hr(s,c);break;case 31:Hr(s,c),h&4&&$x(s,c);break;case 13:Hr(s,c),h&4&&Kx(s,c),h&64&&(s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(c=wM.bind(null,c),jM(s,c))));break;case 22:if(h=c.memoizedState!==null||Pr,!h){l=l!==null&&l.memoizedState!==null||on,y=Pr;var b=on;Pr=h,(on=l)&&!b?Vr(s,c,(c.subtreeFlags&8772)!==0):Hr(s,c),Pr=y,on=b}break;case 30:break;default:Hr(s,c)}}function qx(s){var l=s.alternate;l!==null&&(s.alternate=null,qx(l)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(l=s.stateNode,l!==null&&gp(l)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var It=null,Fn=!1;function zr(s,l,c){for(c=c.child;c!==null;)Fx(s,l,c),c=c.sibling}function Fx(s,l,c){if(xe&&typeof xe.onCommitFiberUnmount=="function")try{xe.onCommitFiberUnmount(kt,c)}catch{}switch(c.tag){case 26:on||fr(c,l),zr(s,l,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:on||fr(c,l);var h=It,y=Fn;Rs(c.type)&&(It=c.stateNode,Fn=!1),zr(s,l,c),vu(c.stateNode),It=h,Fn=y;break;case 5:on||fr(c,l);case 6:if(h=It,y=Fn,It=null,zr(s,l,c),It=h,Fn=y,It!==null)if(Fn)try{(It.nodeType===9?It.body:It.nodeName==="HTML"?It.ownerDocument.body:It).removeChild(c.stateNode)}catch(b){St(c,l,b)}else try{It.removeChild(c.stateNode)}catch(b){St(c,l,b)}break;case 18:It!==null&&(Fn?(s=It,_S(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,c.stateNode),ql(s)):_S(It,c.stateNode));break;case 4:h=It,y=Fn,It=c.stateNode.containerInfo,Fn=!0,zr(s,l,c),It=h,Fn=y;break;case 0:case 11:case 14:case 15:vs(2,c,l),on||vs(4,c,l),zr(s,l,c);break;case 1:on||(fr(c,l),h=c.stateNode,typeof h.componentWillUnmount=="function"&&Px(c,l,h)),zr(s,l,c);break;case 21:zr(s,l,c);break;case 22:on=(h=on)||c.memoizedState!==null,zr(s,l,c),on=h;break;default:zr(s,l,c)}}function $x(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{ql(s)}catch(c){St(l,l.return,c)}}}function Kx(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{ql(s)}catch(c){St(l,l.return,c)}}function pM(s){switch(s.tag){case 31:case 13:case 19:var l=s.stateNode;return l===null&&(l=s.stateNode=new Ux),l;case 22:return s=s.stateNode,l=s._retryCache,l===null&&(l=s._retryCache=new Ux),l;default:throw Error(i(435,s.tag))}}function Af(s,l){var c=pM(s);l.forEach(function(h){if(!c.has(h)){c.add(h);var y=EM.bind(null,s,h);h.then(y,y)}})}function $n(s,l){var c=l.deletions;if(c!==null)for(var h=0;h<c.length;h++){var y=c[h],b=s,R=l,L=R;e:for(;L!==null;){switch(L.tag){case 27:if(Rs(L.type)){It=L.stateNode,Fn=!1;break e}break;case 5:It=L.stateNode,Fn=!1;break e;case 3:case 4:It=L.stateNode.containerInfo,Fn=!0;break e}L=L.return}if(It===null)throw Error(i(160));Fx(b,R,y),It=null,Fn=!1,b=y.alternate,b!==null&&(b.return=null),y.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)Yx(l,s),l=l.sibling}var Yi=null;function Yx(s,l){var c=s.alternate,h=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:$n(l,s),Kn(s),h&4&&(vs(3,s,s.return),au(3,s),vs(5,s,s.return));break;case 1:$n(l,s),Kn(s),h&512&&(on||c===null||fr(c,c.return)),h&64&&Pr&&(s=s.updateQueue,s!==null&&(h=s.callbacks,h!==null&&(c=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=c===null?h:c.concat(h))));break;case 26:var y=Yi;if($n(l,s),Kn(s),h&512&&(on||c===null||fr(c,c.return)),h&4){var b=c!==null?c.memoizedState:null;if(h=s.memoizedState,c===null)if(h===null)if(s.stateNode===null){e:{h=s.type,c=s.memoizedProps,y=y.ownerDocument||y;t:switch(h){case"title":b=y.getElementsByTagName("title")[0],(!b||b[_a]||b[Sn]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=y.createElement(h),y.head.insertBefore(b,y.querySelector("head > title"))),Rn(b,h,c),b[Sn]=s,pn(b),h=b;break e;case"link":var R=YS("link","href",y).get(h+(c.href||""));if(R){for(var L=0;L<R.length;L++)if(b=R[L],b.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&b.getAttribute("rel")===(c.rel==null?null:c.rel)&&b.getAttribute("title")===(c.title==null?null:c.title)&&b.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){R.splice(L,1);break t}}b=y.createElement(h),Rn(b,h,c),y.head.appendChild(b);break;case"meta":if(R=YS("meta","content",y).get(h+(c.content||""))){for(L=0;L<R.length;L++)if(b=R[L],b.getAttribute("content")===(c.content==null?null:""+c.content)&&b.getAttribute("name")===(c.name==null?null:c.name)&&b.getAttribute("property")===(c.property==null?null:c.property)&&b.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&b.getAttribute("charset")===(c.charSet==null?null:c.charSet)){R.splice(L,1);break t}}b=y.createElement(h),Rn(b,h,c),y.head.appendChild(b);break;default:throw Error(i(468,h))}b[Sn]=s,pn(b),h=b}s.stateNode=h}else GS(y,s.type,s.stateNode);else s.stateNode=KS(y,h,s.memoizedProps);else b!==h?(b===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):b.count--,h===null?GS(y,s.type,s.stateNode):KS(y,h,s.memoizedProps)):h===null&&s.stateNode!==null&&Pm(s,s.memoizedProps,c.memoizedProps)}break;case 27:$n(l,s),Kn(s),h&512&&(on||c===null||fr(c,c.return)),c!==null&&h&4&&Pm(s,s.memoizedProps,c.memoizedProps);break;case 5:if($n(l,s),Kn(s),h&512&&(on||c===null||fr(c,c.return)),s.flags&32){y=s.stateNode;try{hl(y,"")}catch(Le){St(s,s.return,Le)}}h&4&&s.stateNode!=null&&(y=s.memoizedProps,Pm(s,y,c!==null?c.memoizedProps:y)),h&1024&&(Vm=!0);break;case 6:if($n(l,s),Kn(s),h&4){if(s.stateNode===null)throw Error(i(162));h=s.memoizedProps,c=s.stateNode;try{c.nodeValue=h}catch(Le){St(s,s.return,Le)}}break;case 3:if(Ff=null,y=Yi,Yi=jf(l.containerInfo),$n(l,s),Yi=y,Kn(s),h&4&&c!==null&&c.memoizedState.isDehydrated)try{ql(l.containerInfo)}catch(Le){St(s,s.return,Le)}Vm&&(Vm=!1,Gx(s));break;case 4:h=Yi,Yi=jf(s.stateNode.containerInfo),$n(l,s),Kn(s),Yi=h;break;case 12:$n(l,s),Kn(s);break;case 31:$n(l,s),Kn(s),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,Af(s,h)));break;case 13:$n(l,s),Kn(s),s.child.flags&8192&&s.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Mf=ye()),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,Af(s,h)));break;case 22:y=s.memoizedState!==null;var F=c!==null&&c.memoizedState!==null,ne=Pr,ue=on;if(Pr=ne||y,on=ue||F,$n(l,s),on=ue,Pr=ne,Kn(s),h&8192)e:for(l=s.stateNode,l._visibility=y?l._visibility&-2:l._visibility|1,y&&(c===null||F||Pr||on||Eo(s)),c=null,l=s;;){if(l.tag===5||l.tag===26){if(c===null){F=c=l;try{if(b=F.stateNode,y)R=b.style,typeof R.setProperty=="function"?R.setProperty("display","none","important"):R.display="none";else{L=F.stateNode;var he=F.memoizedProps.style,ie=he!=null&&he.hasOwnProperty("display")?he.display:null;L.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(Le){St(F,F.return,Le)}}}else if(l.tag===6){if(c===null){F=l;try{F.stateNode.nodeValue=y?"":F.memoizedProps}catch(Le){St(F,F.return,Le)}}}else if(l.tag===18){if(c===null){F=l;try{var se=F.stateNode;y?PS(se,!0):PS(F.stateNode,!1)}catch(Le){St(F,F.return,Le)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===s)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break e;for(;l.sibling===null;){if(l.return===null||l.return===s)break e;c===l&&(c=null),l=l.return}c===l&&(c=null),l.sibling.return=l.return,l=l.sibling}h&4&&(h=s.updateQueue,h!==null&&(c=h.retryQueue,c!==null&&(h.retryQueue=null,Af(s,c))));break;case 19:$n(l,s),Kn(s),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,Af(s,h)));break;case 30:break;case 21:break;default:$n(l,s),Kn(s)}}function Kn(s){var l=s.flags;if(l&2){try{for(var c,h=s.return;h!==null;){if(Hx(h)){c=h;break}h=h.return}if(c==null)throw Error(i(160));switch(c.tag){case 27:var y=c.stateNode,b=zm(s);Tf(s,b,y);break;case 5:var R=c.stateNode;c.flags&32&&(hl(R,""),c.flags&=-33);var L=zm(s);Tf(s,L,R);break;case 3:case 4:var F=c.stateNode.containerInfo,ne=zm(s);Hm(s,ne,F);break;default:throw Error(i(161))}}catch(ue){St(s,s.return,ue)}s.flags&=-3}l&4096&&(s.flags&=-4097)}function Gx(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var l=s;Gx(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),s=s.sibling}}function Hr(s,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)jx(s,l.alternate,l),l=l.sibling}function Eo(s){for(s=s.child;s!==null;){var l=s;switch(l.tag){case 0:case 11:case 14:case 15:vs(4,l,l.return),Eo(l);break;case 1:fr(l,l.return);var c=l.stateNode;typeof c.componentWillUnmount=="function"&&Px(l,l.return,c),Eo(l);break;case 27:vu(l.stateNode);case 26:case 5:fr(l,l.return),Eo(l);break;case 22:l.memoizedState===null&&Eo(l);break;case 30:Eo(l);break;default:Eo(l)}s=s.sibling}}function Vr(s,l,c){for(c=c&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var h=l.alternate,y=s,b=l,R=b.flags;switch(b.tag){case 0:case 11:case 15:Vr(y,b,c),au(4,b);break;case 1:if(Vr(y,b,c),h=b,y=h.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(ne){St(h,h.return,ne)}if(h=b,y=h.updateQueue,y!==null){var L=h.stateNode;try{var F=y.shared.hiddenCallbacks;if(F!==null)for(y.shared.hiddenCallbacks=null,y=0;y<F.length;y++)R1(F[y],L)}catch(ne){St(h,h.return,ne)}}c&&R&64&&_x(b),uu(b,b.return);break;case 27:Vx(b);case 26:case 5:Vr(y,b,c),c&&h===null&&R&4&&zx(b),uu(b,b.return);break;case 12:Vr(y,b,c);break;case 31:Vr(y,b,c),c&&R&4&&$x(y,b);break;case 13:Vr(y,b,c),c&&R&4&&Kx(y,b);break;case 22:b.memoizedState===null&&Vr(y,b,c),uu(b,b.return);break;case 30:break;default:Vr(y,b,c)}l=l.sibling}}function Um(s,l){var c=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==c&&(s!=null&&s.refCount++,c!=null&&Qa(c))}function jm(s,l){s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&Qa(s))}function Gi(s,l,c,h){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Qx(s,l,c,h),l=l.sibling}function Qx(s,l,c,h){var y=l.flags;switch(l.tag){case 0:case 11:case 15:Gi(s,l,c,h),y&2048&&au(9,l);break;case 1:Gi(s,l,c,h);break;case 3:Gi(s,l,c,h),y&2048&&(s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&Qa(s)));break;case 12:if(y&2048){Gi(s,l,c,h),s=l.stateNode;try{var b=l.memoizedProps,R=b.id,L=b.onPostCommit;typeof L=="function"&&L(R,l.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(F){St(l,l.return,F)}}else Gi(s,l,c,h);break;case 31:Gi(s,l,c,h);break;case 13:Gi(s,l,c,h);break;case 23:break;case 22:b=l.stateNode,R=l.alternate,l.memoizedState!==null?b._visibility&2?Gi(s,l,c,h):cu(s,l):b._visibility&2?Gi(s,l,c,h):(b._visibility|=2,Nl(s,l,c,h,(l.subtreeFlags&10256)!==0||!1)),y&2048&&Um(R,l);break;case 24:Gi(s,l,c,h),y&2048&&jm(l.alternate,l);break;default:Gi(s,l,c,h)}}function Nl(s,l,c,h,y){for(y=y&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var b=s,R=l,L=c,F=h,ne=R.flags;switch(R.tag){case 0:case 11:case 15:Nl(b,R,L,F,y),au(8,R);break;case 23:break;case 22:var ue=R.stateNode;R.memoizedState!==null?ue._visibility&2?Nl(b,R,L,F,y):cu(b,R):(ue._visibility|=2,Nl(b,R,L,F,y)),y&&ne&2048&&Um(R.alternate,R);break;case 24:Nl(b,R,L,F,y),y&&ne&2048&&jm(R.alternate,R);break;default:Nl(b,R,L,F,y)}l=l.sibling}}function cu(s,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var c=s,h=l,y=h.flags;switch(h.tag){case 22:cu(c,h),y&2048&&Um(h.alternate,h);break;case 24:cu(c,h),y&2048&&jm(h.alternate,h);break;default:cu(c,h)}l=l.sibling}}var fu=8192;function Ll(s,l,c){if(s.subtreeFlags&fu)for(s=s.child;s!==null;)Xx(s,l,c),s=s.sibling}function Xx(s,l,c){switch(s.tag){case 26:Ll(s,l,c),s.flags&fu&&s.memoizedState!==null&&e3(c,Yi,s.memoizedState,s.memoizedProps);break;case 5:Ll(s,l,c);break;case 3:case 4:var h=Yi;Yi=jf(s.stateNode.containerInfo),Ll(s,l,c),Yi=h;break;case 22:s.memoizedState===null&&(h=s.alternate,h!==null&&h.memoizedState!==null?(h=fu,fu=16777216,Ll(s,l,c),fu=h):Ll(s,l,c));break;default:Ll(s,l,c)}}function Wx(s){var l=s.alternate;if(l!==null&&(s=l.child,s!==null)){l.child=null;do l=s.sibling,s.sibling=null,s=l;while(s!==null)}}function hu(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var c=0;c<l.length;c++){var h=l[c];mn=h,Jx(h,s)}Wx(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Zx(s),s=s.sibling}function Zx(s){switch(s.tag){case 0:case 11:case 15:hu(s),s.flags&2048&&vs(9,s,s.return);break;case 3:hu(s);break;case 12:hu(s);break;case 22:var l=s.stateNode;s.memoizedState!==null&&l._visibility&2&&(s.return===null||s.return.tag!==13)?(l._visibility&=-3,Of(s)):hu(s);break;default:hu(s)}}function Of(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var c=0;c<l.length;c++){var h=l[c];mn=h,Jx(h,s)}Wx(s)}for(s=s.child;s!==null;){switch(l=s,l.tag){case 0:case 11:case 15:vs(8,l,l.return),Of(l);break;case 22:c=l.stateNode,c._visibility&2&&(c._visibility&=-3,Of(l));break;default:Of(l)}s=s.sibling}}function Jx(s,l){for(;mn!==null;){var c=mn;switch(c.tag){case 0:case 11:case 15:vs(8,c,l);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var h=c.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Qa(c.memoizedState.cache)}if(h=c.child,h!==null)h.return=c,mn=h;else e:for(c=s;mn!==null;){h=mn;var y=h.sibling,b=h.return;if(qx(h),h===c){mn=null;break e}if(y!==null){y.return=b,mn=y;break e}mn=b}}}var mM={getCacheForType:function(s){var l=En(nn),c=l.data.get(s);return c===void 0&&(c=s(),l.data.set(s,c)),c},cacheSignal:function(){return En(nn).controller.signal}},gM=typeof WeakMap=="function"?WeakMap:Map,gt=0,Tt=null,ot=null,at=0,xt=0,ai=null,bs=!1,Il=!1,qm=!1,Ur=0,jt=0,xs=0,Co=0,Fm=0,ui=0,Bl=0,du=null,Yn=null,$m=!1,Mf=0,eS=0,Df=1/0,Nf=null,Ss=null,cn=0,ws=null,_l=null,jr=0,Km=0,Ym=null,tS=null,pu=0,Gm=null;function ci(){return(gt&2)!==0&&at!==0?at&-at:_.T!==null?eg():yb()}function nS(){if(ui===0)if((at&536870912)===0||ct){var s=Mn;Mn<<=1,(Mn&3932160)===0&&(Mn=262144),ui=s}else ui=536870912;return s=oi.current,s!==null&&(s.flags|=32),ui}function Gn(s,l,c){(s===Tt&&(xt===2||xt===9)||s.cancelPendingCommit!==null)&&(Pl(s,0),Es(s,at,ui,!1)),xn(s,c),((gt&2)===0||s!==Tt)&&(s===Tt&&((gt&2)===0&&(Co|=c),jt===4&&Es(s,at,ui,!1)),hr(s))}function iS(s,l,c){if((gt&6)!==0)throw Error(i(327));var h=!c&&(l&127)===0&&(l&s.expiredLanes)===0||$i(s,l),y=h?bM(s,l):Xm(s,l,!0),b=h;do{if(y===0){Il&&!h&&Es(s,l,0,!1);break}else{if(c=s.current.alternate,b&&!yM(c)){y=Xm(s,l,!1),b=!1;continue}if(y===2){if(b=l,s.errorRecoveryDisabledLanes&b)var R=0;else R=s.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){l=R;e:{var L=s;y=du;var F=L.current.memoizedState.isDehydrated;if(F&&(Pl(L,R).flags|=256),R=Xm(L,R,!1),R!==2){if(qm&&!F){L.errorRecoveryDisabledLanes|=b,Co|=b,y=4;break e}b=Yn,Yn=y,b!==null&&(Yn===null?Yn=b:Yn.push.apply(Yn,b))}y=R}if(b=!1,y!==2)continue}}if(y===1){Pl(s,0),Es(s,l,0,!0);break}e:{switch(h=s,b=y,b){case 0:case 1:throw Error(i(345));case 4:if((l&4194048)!==l)break;case 6:Es(h,l,ui,!bs);break e;case 2:Yn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((l&62914560)===l&&(y=Mf+300-ye(),10<y)){if(Es(h,l,ui,!bs),lr(h,0,!0)!==0)break e;jr=l,h.timeoutHandle=IS(rS.bind(null,h,c,Yn,Nf,$m,l,ui,Co,Bl,bs,b,"Throttled",-0,0),y);break e}rS(h,c,Yn,Nf,$m,l,ui,Co,Bl,bs,b,null,-0,0)}}break}while(!0);hr(s)}function rS(s,l,c,h,y,b,R,L,F,ne,ue,he,ie,se){if(s.timeoutHandle=-1,he=l.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Tr},Xx(l,b,he);var Le=(b&62914560)===b?Mf-ye():(b&4194048)===b?eS-ye():0;if(Le=t3(he,Le),Le!==null){jr=b,s.cancelPendingCommit=Le(hS.bind(null,s,l,b,c,h,y,R,L,F,ue,he,null,ie,se)),Es(s,b,R,!ne);return}}hS(s,l,b,c,h,y,R,L,F)}function yM(s){for(var l=s;;){var c=l.tag;if((c===0||c===11||c===15)&&l.flags&16384&&(c=l.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var h=0;h<c.length;h++){var y=c[h],b=y.getSnapshot;y=y.value;try{if(!ri(b(),y))return!1}catch{return!1}}if(c=l.child,l.subtreeFlags&16384&&c!==null)c.return=l,l=c;else{if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Es(s,l,c,h){l&=~Fm,l&=~Co,s.suspendedLanes|=l,s.pingedLanes&=~l,h&&(s.warmLanes|=l),h=s.expirationTimes;for(var y=l;0<y;){var b=31-Xe(y),R=1<<b;h[b]=-1,y&=~R}c!==0&&un(s,c,l)}function Lf(){return(gt&6)===0?(mu(0),!1):!0}function Qm(){if(ot!==null){if(xt===0)var s=ot.return;else s=ot,Dr=mo=null,fm(s),Tl=null,Wa=0,s=ot;for(;s!==null;)Bx(s.alternate,s),s=s.return;ot=null}}function Pl(s,l){var c=s.timeoutHandle;c!==-1&&(s.timeoutHandle=-1,PM(c)),c=s.cancelPendingCommit,c!==null&&(s.cancelPendingCommit=null,c()),jr=0,Qm(),Tt=s,ot=c=Or(s.current,null),at=l,xt=0,ai=null,bs=!1,Il=$i(s,l),qm=!1,Bl=ui=Fm=Co=xs=jt=0,Yn=du=null,$m=!1,(l&8)!==0&&(l|=l&32);var h=s.entangledLanes;if(h!==0)for(s=s.entanglements,h&=l;0<h;){var y=31-Xe(h),b=1<<y;l|=s[y],h&=~b}return Ur=l,Jc(),c}function sS(s,l){Je=null,_.H=su,l===kl||l===af?(l=S1(),xt=3):l===Jp?(l=S1(),xt=4):xt=l===Tm?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,ai=l,ot===null&&(jt=1,wf(s,Ci(l,s.current)))}function oS(){var s=oi.current;return s===null?!0:(at&4194048)===at?Ai===null:(at&62914560)===at||(at&536870912)!==0?s===Ai:!1}function lS(){var s=_.H;return _.H=su,s===null?su:s}function aS(){var s=_.A;return _.A=mM,s}function If(){jt=4,bs||(at&4194048)!==at&&oi.current!==null||(Il=!0),(xs&134217727)===0&&(Co&134217727)===0||Tt===null||Es(Tt,at,ui,!1)}function Xm(s,l,c){var h=gt;gt|=2;var y=lS(),b=aS();(Tt!==s||at!==l)&&(Nf=null,Pl(s,l)),l=!1;var R=jt;e:do try{if(xt!==0&&ot!==null){var L=ot,F=ai;switch(xt){case 8:Qm(),R=6;break e;case 3:case 2:case 9:case 6:oi.current===null&&(l=!0);var ne=xt;if(xt=0,ai=null,zl(s,L,F,ne),c&&Il){R=0;break e}break;default:ne=xt,xt=0,ai=null,zl(s,L,F,ne)}}vM(),R=jt;break}catch(ue){sS(s,ue)}while(!0);return l&&s.shellSuspendCounter++,Dr=mo=null,gt=h,_.H=y,_.A=b,ot===null&&(Tt=null,at=0,Jc()),R}function vM(){for(;ot!==null;)uS(ot)}function bM(s,l){var c=gt;gt|=2;var h=lS(),y=aS();Tt!==s||at!==l?(Nf=null,Df=ye()+500,Pl(s,l)):Il=$i(s,l);e:do try{if(xt!==0&&ot!==null){l=ot;var b=ai;t:switch(xt){case 1:xt=0,ai=null,zl(s,l,b,1);break;case 2:case 9:if(b1(b)){xt=0,ai=null,cS(l);break}l=function(){xt!==2&&xt!==9||Tt!==s||(xt=7),hr(s)},b.then(l,l);break e;case 3:xt=7;break e;case 4:xt=5;break e;case 7:b1(b)?(xt=0,ai=null,cS(l)):(xt=0,ai=null,zl(s,l,b,7));break;case 5:var R=null;switch(ot.tag){case 26:R=ot.memoizedState;case 5:case 27:var L=ot;if(R?QS(R):L.stateNode.complete){xt=0,ai=null;var F=L.sibling;if(F!==null)ot=F;else{var ne=L.return;ne!==null?(ot=ne,Bf(ne)):ot=null}break t}}xt=0,ai=null,zl(s,l,b,5);break;case 6:xt=0,ai=null,zl(s,l,b,6);break;case 8:Qm(),jt=6;break e;default:throw Error(i(462))}}xM();break}catch(ue){sS(s,ue)}while(!0);return Dr=mo=null,_.H=h,_.A=y,gt=c,ot!==null?0:(Tt=null,at=0,Jc(),jt)}function xM(){for(;ot!==null&&!ke();)uS(ot)}function uS(s){var l=Lx(s.alternate,s,Ur);s.memoizedProps=s.pendingProps,l===null?Bf(s):ot=l}function cS(s){var l=s,c=l.alternate;switch(l.tag){case 15:case 0:l=Tx(c,l,l.pendingProps,l.type,void 0,at);break;case 11:l=Tx(c,l,l.pendingProps,l.type.render,l.ref,at);break;case 5:fm(l);default:Bx(c,l),l=ot=a1(l,Ur),l=Lx(c,l,Ur)}s.memoizedProps=s.pendingProps,l===null?Bf(s):ot=l}function zl(s,l,c,h){Dr=mo=null,fm(l),Tl=null,Wa=0;var y=l.return;try{if(aM(s,y,l,c,at)){jt=1,wf(s,Ci(c,s.current)),ot=null;return}}catch(b){if(y!==null)throw ot=y,b;jt=1,wf(s,Ci(c,s.current)),ot=null;return}l.flags&32768?(ct||h===1?s=!0:Il||(at&536870912)!==0?s=!1:(bs=s=!0,(h===2||h===9||h===3||h===6)&&(h=oi.current,h!==null&&h.tag===13&&(h.flags|=16384))),fS(l,s)):Bf(l)}function Bf(s){var l=s;do{if((l.flags&32768)!==0){fS(l,bs);return}s=l.return;var c=fM(l.alternate,l,Ur);if(c!==null){ot=c;return}if(l=l.sibling,l!==null){ot=l;return}ot=l=s}while(l!==null);jt===0&&(jt=5)}function fS(s,l){do{var c=hM(s.alternate,s);if(c!==null){c.flags&=32767,ot=c;return}if(c=s.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!l&&(s=s.sibling,s!==null)){ot=s;return}ot=s=c}while(s!==null);jt=6,ot=null}function hS(s,l,c,h,y,b,R,L,F){s.cancelPendingCommit=null;do _f();while(cn!==0);if((gt&6)!==0)throw Error(i(327));if(l!==null){if(l===s.current)throw Error(i(177));if(b=l.lanes|l.childLanes,b|=zp,ar(s,c,b,R,L,F),s===Tt&&(ot=Tt=null,at=0),_l=l,ws=s,jr=c,Km=b,Ym=y,tS=h,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,CM(je,function(){return yS(),null})):(s.callbackNode=null,s.callbackPriority=0),h=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||h){h=_.T,_.T=null,y=H.p,H.p=2,R=gt,gt|=4;try{dM(s,l,c)}finally{gt=R,H.p=y,_.T=h}}cn=1,dS(),pS(),mS()}}function dS(){if(cn===1){cn=0;var s=ws,l=_l,c=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||c){c=_.T,_.T=null;var h=H.p;H.p=2;var y=gt;gt|=4;try{Yx(l,s);var b=ag,R=Jb(s.containerInfo),L=b.focusedElem,F=b.selectionRange;if(R!==L&&L&&L.ownerDocument&&Zb(L.ownerDocument.documentElement,L)){if(F!==null&&Lp(L)){var ne=F.start,ue=F.end;if(ue===void 0&&(ue=ne),"selectionStart"in L)L.selectionStart=ne,L.selectionEnd=Math.min(ue,L.value.length);else{var he=L.ownerDocument||document,ie=he&&he.defaultView||window;if(ie.getSelection){var se=ie.getSelection(),Le=L.textContent.length,$e=Math.min(F.start,Le),Rt=F.end===void 0?$e:Math.min(F.end,Le);!se.extend&&$e>Rt&&(R=Rt,Rt=$e,$e=R);var Z=Wb(L,$e),G=Wb(L,Rt);if(Z&&G&&(se.rangeCount!==1||se.anchorNode!==Z.node||se.anchorOffset!==Z.offset||se.focusNode!==G.node||se.focusOffset!==G.offset)){var te=he.createRange();te.setStart(Z.node,Z.offset),se.removeAllRanges(),$e>Rt?(se.addRange(te),se.extend(G.node,G.offset)):(te.setEnd(G.node,G.offset),se.addRange(te))}}}}for(he=[],se=L;se=se.parentNode;)se.nodeType===1&&he.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<he.length;L++){var ce=he[L];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}Gf=!!lg,ag=lg=null}finally{gt=y,H.p=h,_.T=c}}s.current=l,cn=2}}function pS(){if(cn===2){cn=0;var s=ws,l=_l,c=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||c){c=_.T,_.T=null;var h=H.p;H.p=2;var y=gt;gt|=4;try{jx(s,l.alternate,l)}finally{gt=y,H.p=h,_.T=c}}cn=3}}function mS(){if(cn===4||cn===3){cn=0,we();var s=ws,l=_l,c=jr,h=tS;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?cn=5:(cn=0,_l=ws=null,gS(s,s.pendingLanes));var y=s.pendingLanes;if(y===0&&(Ss=null),pp(c),l=l.stateNode,xe&&typeof xe.onCommitFiberRoot=="function")try{xe.onCommitFiberRoot(kt,l,void 0,(l.current.flags&128)===128)}catch{}if(h!==null){l=_.T,y=H.p,H.p=2,_.T=null;try{for(var b=s.onRecoverableError,R=0;R<h.length;R++){var L=h[R];b(L.value,{componentStack:L.stack})}}finally{_.T=l,H.p=y}}(jr&3)!==0&&_f(),hr(s),y=s.pendingLanes,(c&261930)!==0&&(y&42)!==0?s===Gm?pu++:(pu=0,Gm=s):pu=0,mu(0)}}function gS(s,l){(s.pooledCacheLanes&=l)===0&&(l=s.pooledCache,l!=null&&(s.pooledCache=null,Qa(l)))}function _f(){return dS(),pS(),mS(),yS()}function yS(){if(cn!==5)return!1;var s=ws,l=Km;Km=0;var c=pp(jr),h=_.T,y=H.p;try{H.p=32>c?32:c,_.T=null,c=Ym,Ym=null;var b=ws,R=jr;if(cn=0,_l=ws=null,jr=0,(gt&6)!==0)throw Error(i(331));var L=gt;if(gt|=4,Zx(b.current),Qx(b,b.current,R,c),gt=L,mu(0,!1),xe&&typeof xe.onPostCommitFiberRoot=="function")try{xe.onPostCommitFiberRoot(kt,b)}catch{}return!0}finally{H.p=y,_.T=h,gS(s,l)}}function vS(s,l,c){l=Ci(c,l),l=km(s.stateNode,l,2),s=ms(s,l,2),s!==null&&(xn(s,2),hr(s))}function St(s,l,c){if(s.tag===3)vS(s,s,c);else for(;l!==null;){if(l.tag===3){vS(l,s,c);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ss===null||!Ss.has(h))){s=Ci(c,s),c=bx(2),h=ms(l,c,2),h!==null&&(xx(c,h,l,s),xn(h,2),hr(h));break}}l=l.return}}function Wm(s,l,c){var h=s.pingCache;if(h===null){h=s.pingCache=new gM;var y=new Set;h.set(l,y)}else y=h.get(l),y===void 0&&(y=new Set,h.set(l,y));y.has(c)||(qm=!0,y.add(c),s=SM.bind(null,s,l,c),l.then(s,s))}function SM(s,l,c){var h=s.pingCache;h!==null&&h.delete(l),s.pingedLanes|=s.suspendedLanes&c,s.warmLanes&=~c,Tt===s&&(at&c)===c&&(jt===4||jt===3&&(at&62914560)===at&&300>ye()-Mf?(gt&2)===0&&Pl(s,0):Fm|=c,Bl===at&&(Bl=0)),hr(s)}function bS(s,l){l===0&&(l=tt()),s=fo(s,l),s!==null&&(xn(s,l),hr(s))}function wM(s){var l=s.memoizedState,c=0;l!==null&&(c=l.retryLane),bS(s,c)}function EM(s,l){var c=0;switch(s.tag){case 31:case 13:var h=s.stateNode,y=s.memoizedState;y!==null&&(c=y.retryLane);break;case 19:h=s.stateNode;break;case 22:h=s.stateNode._retryCache;break;default:throw Error(i(314))}h!==null&&h.delete(l),bS(s,c)}function CM(s,l){return Ye(s,l)}var Pf=null,Hl=null,Zm=!1,zf=!1,Jm=!1,Cs=0;function hr(s){s!==Hl&&s.next===null&&(Hl===null?Pf=Hl=s:Hl=Hl.next=s),zf=!0,Zm||(Zm=!0,kM())}function mu(s,l){if(!Jm&&zf){Jm=!0;do for(var c=!1,h=Pf;h!==null;){if(s!==0){var y=h.pendingLanes;if(y===0)var b=0;else{var R=h.suspendedLanes,L=h.pingedLanes;b=(1<<31-Xe(42|s)+1)-1,b&=y&~(R&~L),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(c=!0,ES(h,b))}else b=at,b=lr(h,h===Tt?b:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(b&3)===0||$i(h,b)||(c=!0,ES(h,b));h=h.next}while(c);Jm=!1}}function RM(){xS()}function xS(){zf=Zm=!1;var s=0;Cs!==0&&_M()&&(s=Cs);for(var l=ye(),c=null,h=Pf;h!==null;){var y=h.next,b=SS(h,l);b===0?(h.next=null,c===null?Pf=y:c.next=y,y===null&&(Hl=c)):(c=h,(s!==0||(b&3)!==0)&&(zf=!0)),h=y}cn!==0&&cn!==5||mu(s),Cs!==0&&(Cs=0)}function SS(s,l){for(var c=s.suspendedLanes,h=s.pingedLanes,y=s.expirationTimes,b=s.pendingLanes&-62914561;0<b;){var R=31-Xe(b),L=1<<R,F=y[R];F===-1?((L&c)===0||(L&h)!==0)&&(y[R]=oo(L,l)):F<=l&&(s.expiredLanes|=L),b&=~L}if(l=Tt,c=at,c=lr(s,s===l?c:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h=s.callbackNode,c===0||s===l&&(xt===2||xt===9)||s.cancelPendingCommit!==null)return h!==null&&h!==null&&de(h),s.callbackNode=null,s.callbackPriority=0;if((c&3)===0||$i(s,c)){if(l=c&-c,l===s.callbackPriority)return l;switch(h!==null&&de(h),pp(c)){case 2:case 8:c=Ge;break;case 32:c=je;break;case 268435456:c=Dt;break;default:c=je}return h=wS.bind(null,s),c=Ye(c,h),s.callbackPriority=l,s.callbackNode=c,l}return h!==null&&h!==null&&de(h),s.callbackPriority=2,s.callbackNode=null,2}function wS(s,l){if(cn!==0&&cn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var c=s.callbackNode;if(_f()&&s.callbackNode!==c)return null;var h=at;return h=lr(s,s===Tt?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h===0?null:(iS(s,h,l),SS(s,ye()),s.callbackNode!=null&&s.callbackNode===c?wS.bind(null,s):null)}function ES(s,l){if(_f())return null;iS(s,l,!0)}function kM(){zM(function(){(gt&6)!==0?Ye(Ne,RM):xS()})}function eg(){if(Cs===0){var s=Cl;s===0&&(s=bn,bn<<=1,(bn&261888)===0&&(bn=256)),Cs=s}return Cs}function CS(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:$c(""+s)}function RS(s,l){var c=l.ownerDocument.createElement("input");return c.name=l.name,c.value=l.value,s.id&&c.setAttribute("form",s.id),l.parentNode.insertBefore(c,l),s=new FormData(s),c.parentNode.removeChild(c),s}function TM(s,l,c,h,y){if(l==="submit"&&c&&c.stateNode===y){var b=CS((y[jn]||null).action),R=h.submitter;R&&(l=(l=R[jn]||null)?CS(l.formAction):R.getAttribute("formAction"),l!==null&&(b=l,R=null));var L=new Qc("action","action",null,h,y);s.push({event:L,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Cs!==0){var F=R?RS(y,R):new FormData(y);xm(c,{pending:!0,data:F,method:y.method,action:b},null,F)}}else typeof b=="function"&&(L.preventDefault(),F=R?RS(y,R):new FormData(y),xm(c,{pending:!0,data:F,method:y.method,action:b},b,F))},currentTarget:y}]})}}for(var tg=0;tg<Pp.length;tg++){var ng=Pp[tg],AM=ng.toLowerCase(),OM=ng[0].toUpperCase()+ng.slice(1);Ki(AM,"on"+OM)}Ki(n1,"onAnimationEnd"),Ki(i1,"onAnimationIteration"),Ki(r1,"onAnimationStart"),Ki("dblclick","onDoubleClick"),Ki("focusin","onFocus"),Ki("focusout","onBlur"),Ki($O,"onTransitionRun"),Ki(KO,"onTransitionStart"),Ki(YO,"onTransitionCancel"),Ki(s1,"onTransitionEnd"),cl("onMouseEnter",["mouseout","mouseover"]),cl("onMouseLeave",["mouseout","mouseover"]),cl("onPointerEnter",["pointerout","pointerover"]),cl("onPointerLeave",["pointerout","pointerover"]),lo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),lo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),lo("onBeforeInput",["compositionend","keypress","textInput","paste"]),lo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),lo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),lo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),MM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(gu));function kS(s,l){l=(l&4)!==0;for(var c=0;c<s.length;c++){var h=s[c],y=h.event;h=h.listeners;e:{var b=void 0;if(l)for(var R=h.length-1;0<=R;R--){var L=h[R],F=L.instance,ne=L.currentTarget;if(L=L.listener,F!==b&&y.isPropagationStopped())break e;b=L,y.currentTarget=ne;try{b(y)}catch(ue){Zc(ue)}y.currentTarget=null,b=F}else for(R=0;R<h.length;R++){if(L=h[R],F=L.instance,ne=L.currentTarget,L=L.listener,F!==b&&y.isPropagationStopped())break e;b=L,y.currentTarget=ne;try{b(y)}catch(ue){Zc(ue)}y.currentTarget=null,b=F}}}}function lt(s,l){var c=l[mp];c===void 0&&(c=l[mp]=new Set);var h=s+"__bubble";c.has(h)||(TS(l,s,2,!1),c.add(h))}function ig(s,l,c){var h=0;l&&(h|=4),TS(c,s,h,l)}var Hf="_reactListening"+Math.random().toString(36).slice(2);function rg(s){if(!s[Hf]){s[Hf]=!0,xb.forEach(function(c){c!=="selectionchange"&&(MM.has(c)||ig(c,!1,s),ig(c,!0,s))});var l=s.nodeType===9?s:s.ownerDocument;l===null||l[Hf]||(l[Hf]=!0,ig("selectionchange",!1,l))}}function TS(s,l,c,h){switch(nw(l)){case 2:var y=r3;break;case 8:y=s3;break;default:y=bg}c=y.bind(null,l,c,s),y=void 0,!Cp||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(y=!0),h?y!==void 0?s.addEventListener(l,c,{capture:!0,passive:y}):s.addEventListener(l,c,!0):y!==void 0?s.addEventListener(l,c,{passive:y}):s.addEventListener(l,c,!1)}function sg(s,l,c,h,y){var b=h;if((l&1)===0&&(l&2)===0&&h!==null)e:for(;;){if(h===null)return;var R=h.tag;if(R===3||R===4){var L=h.stateNode.containerInfo;if(L===y)break;if(R===4)for(R=h.return;R!==null;){var F=R.tag;if((F===3||F===4)&&R.stateNode.containerInfo===y)return;R=R.return}for(;L!==null;){if(R=ll(L),R===null)return;if(F=R.tag,F===5||F===6||F===26||F===27){h=b=R;continue e}L=L.parentNode}}h=h.return}Nb(function(){var ne=b,ue=wp(c),he=[];e:{var ie=o1.get(s);if(ie!==void 0){var se=Qc,Le=s;switch(s){case"keypress":if(Yc(c)===0)break e;case"keydown":case"keyup":se=EO;break;case"focusin":Le="focus",se=Ap;break;case"focusout":Le="blur",se=Ap;break;case"beforeblur":case"afterblur":se=Ap;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=Bb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=fO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=kO;break;case n1:case i1:case r1:se=pO;break;case s1:se=AO;break;case"scroll":case"scrollend":se=uO;break;case"wheel":se=MO;break;case"copy":case"cut":case"paste":se=gO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=Pb;break;case"toggle":case"beforetoggle":se=NO}var $e=(l&4)!==0,Rt=!$e&&(s==="scroll"||s==="scrollend"),Z=$e?ie!==null?ie+"Capture":null:ie;$e=[];for(var G=ne,te;G!==null;){var ce=G;if(te=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||te===null||Z===null||(ce=za(G,Z),ce!=null&&$e.push(yu(G,ce,te))),Rt)break;G=G.return}0<$e.length&&(ie=new se(ie,Le,null,c,ue),he.push({event:ie,listeners:$e}))}}if((l&7)===0){e:{if(ie=s==="mouseover"||s==="pointerover",se=s==="mouseout"||s==="pointerout",ie&&c!==Sp&&(Le=c.relatedTarget||c.fromElement)&&(ll(Le)||Le[ol]))break e;if((se||ie)&&(ie=ue.window===ue?ue:(ie=ue.ownerDocument)?ie.defaultView||ie.parentWindow:window,se?(Le=c.relatedTarget||c.toElement,se=ne,Le=Le?ll(Le):null,Le!==null&&(Rt=o(Le),$e=Le.tag,Le!==Rt||$e!==5&&$e!==27&&$e!==6)&&(Le=null)):(se=null,Le=ne),se!==Le)){if($e=Bb,ce="onMouseLeave",Z="onMouseEnter",G="mouse",(s==="pointerout"||s==="pointerover")&&($e=Pb,ce="onPointerLeave",Z="onPointerEnter",G="pointer"),Rt=se==null?ie:Pa(se),te=Le==null?ie:Pa(Le),ie=new $e(ce,G+"leave",se,c,ue),ie.target=Rt,ie.relatedTarget=te,ce=null,ll(ue)===ne&&($e=new $e(Z,G+"enter",Le,c,ue),$e.target=te,$e.relatedTarget=Rt,ce=$e),Rt=ce,se&&Le)t:{for($e=DM,Z=se,G=Le,te=0,ce=Z;ce;ce=$e(ce))te++;ce=0;for(var qe=G;qe;qe=$e(qe))ce++;for(;0<te-ce;)Z=$e(Z),te--;for(;0<ce-te;)G=$e(G),ce--;for(;te--;){if(Z===G||G!==null&&Z===G.alternate){$e=Z;break t}Z=$e(Z),G=$e(G)}$e=null}else $e=null;se!==null&&AS(he,ie,se,$e,!1),Le!==null&&Rt!==null&&AS(he,Rt,Le,$e,!0)}}e:{if(ie=ne?Pa(ne):window,se=ie.nodeName&&ie.nodeName.toLowerCase(),se==="select"||se==="input"&&ie.type==="file")var dt=$b;else if(qb(ie))if(Kb)dt=jO;else{dt=VO;var ze=HO}else se=ie.nodeName,!se||se.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?ne&&xp(ne.elementType)&&(dt=$b):dt=UO;if(dt&&(dt=dt(s,ne))){Fb(he,dt,c,ue);break e}ze&&ze(s,ie,ne),s==="focusout"&&ne&&ie.type==="number"&&ne.memoizedProps.value!=null&&bp(ie,"number",ie.value)}switch(ze=ne?Pa(ne):window,s){case"focusin":(qb(ze)||ze.contentEditable==="true")&&(gl=ze,Ip=ne,Ka=null);break;case"focusout":Ka=Ip=gl=null;break;case"mousedown":Bp=!0;break;case"contextmenu":case"mouseup":case"dragend":Bp=!1,e1(he,c,ue);break;case"selectionchange":if(FO)break;case"keydown":case"keyup":e1(he,c,ue)}var et;if(Mp)e:{switch(s){case"compositionstart":var ut="onCompositionStart";break e;case"compositionend":ut="onCompositionEnd";break e;case"compositionupdate":ut="onCompositionUpdate";break e}ut=void 0}else ml?Ub(s,c)&&(ut="onCompositionEnd"):s==="keydown"&&c.keyCode===229&&(ut="onCompositionStart");ut&&(zb&&c.locale!=="ko"&&(ml||ut!=="onCompositionStart"?ut==="onCompositionEnd"&&ml&&(et=Lb()):(as=ue,Rp="value"in as?as.value:as.textContent,ml=!0)),ze=Vf(ne,ut),0<ze.length&&(ut=new _b(ut,s,null,c,ue),he.push({event:ut,listeners:ze}),et?ut.data=et:(et=jb(c),et!==null&&(ut.data=et)))),(et=IO?BO(s,c):_O(s,c))&&(ut=Vf(ne,"onBeforeInput"),0<ut.length&&(ze=new _b("onBeforeInput","beforeinput",null,c,ue),he.push({event:ze,listeners:ut}),ze.data=et)),TM(he,s,ne,c,ue)}kS(he,l)})}function yu(s,l,c){return{instance:s,listener:l,currentTarget:c}}function Vf(s,l){for(var c=l+"Capture",h=[];s!==null;){var y=s,b=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||b===null||(y=za(s,c),y!=null&&h.unshift(yu(s,y,b)),y=za(s,l),y!=null&&h.push(yu(s,y,b))),s.tag===3)return h;s=s.return}return[]}function DM(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function AS(s,l,c,h,y){for(var b=l._reactName,R=[];c!==null&&c!==h;){var L=c,F=L.alternate,ne=L.stateNode;if(L=L.tag,F!==null&&F===h)break;L!==5&&L!==26&&L!==27||ne===null||(F=ne,y?(ne=za(c,b),ne!=null&&R.unshift(yu(c,ne,F))):y||(ne=za(c,b),ne!=null&&R.push(yu(c,ne,F)))),c=c.return}R.length!==0&&s.push({event:l,listeners:R})}var NM=/\r\n?/g,LM=/\u0000|\uFFFD/g;function OS(s){return(typeof s=="string"?s:""+s).replace(NM,`
|
|
10
|
+
`).replace(LM,"")}function MS(s,l){return l=OS(l),OS(s)===l}function Ct(s,l,c,h,y,b){switch(c){case"children":typeof h=="string"?l==="body"||l==="textarea"&&h===""||hl(s,h):(typeof h=="number"||typeof h=="bigint")&&l!=="body"&&hl(s,""+h);break;case"className":qc(s,"class",h);break;case"tabIndex":qc(s,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":qc(s,c,h);break;case"style":Mb(s,h,b);break;case"data":if(l!=="object"){qc(s,"data",h);break}case"src":case"href":if(h===""&&(l!=="a"||c!=="href")){s.removeAttribute(c);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(c);break}h=$c(""+h),s.setAttribute(c,h);break;case"action":case"formAction":if(typeof h=="function"){s.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof b=="function"&&(c==="formAction"?(l!=="input"&&Ct(s,l,"name",y.name,y,null),Ct(s,l,"formEncType",y.formEncType,y,null),Ct(s,l,"formMethod",y.formMethod,y,null),Ct(s,l,"formTarget",y.formTarget,y,null)):(Ct(s,l,"encType",y.encType,y,null),Ct(s,l,"method",y.method,y,null),Ct(s,l,"target",y.target,y,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(c);break}h=$c(""+h),s.setAttribute(c,h);break;case"onClick":h!=null&&(s.onclick=Tr);break;case"onScroll":h!=null&<("scroll",s);break;case"onScrollEnd":h!=null&<("scrollend",s);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(c=h.__html,c!=null){if(y.children!=null)throw Error(i(60));s.innerHTML=c}}break;case"multiple":s.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":s.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){s.removeAttribute("xlink:href");break}c=$c(""+h),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(c,""+h):s.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(c,""):s.removeAttribute(c);break;case"capture":case"download":h===!0?s.setAttribute(c,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(c,h):s.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?s.setAttribute(c,h):s.removeAttribute(c);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?s.removeAttribute(c):s.setAttribute(c,h);break;case"popover":lt("beforetoggle",s),lt("toggle",s),jc(s,"popover",h);break;case"xlinkActuate":kr(s,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":kr(s,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":kr(s,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":kr(s,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":kr(s,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":kr(s,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":kr(s,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":kr(s,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":kr(s,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":jc(s,"is",h);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=lO.get(c)||c,jc(s,c,h))}}function og(s,l,c,h,y,b){switch(c){case"style":Mb(s,h,b);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(c=h.__html,c!=null){if(y.children!=null)throw Error(i(60));s.innerHTML=c}}break;case"children":typeof h=="string"?hl(s,h):(typeof h=="number"||typeof h=="bigint")&&hl(s,""+h);break;case"onScroll":h!=null&<("scroll",s);break;case"onScrollEnd":h!=null&<("scrollend",s);break;case"onClick":h!=null&&(s.onclick=Tr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Sb.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(y=c.endsWith("Capture"),l=c.slice(2,y?c.length-7:void 0),b=s[jn]||null,b=b!=null?b[c]:null,typeof b=="function"&&s.removeEventListener(l,b,y),typeof h=="function")){typeof b!="function"&&b!==null&&(c in s?s[c]=null:s.hasAttribute(c)&&s.removeAttribute(c)),s.addEventListener(l,h,y);break e}c in s?s[c]=h:h===!0?s.setAttribute(c,""):jc(s,c,h)}}}function Rn(s,l,c){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":lt("error",s),lt("load",s);var h=!1,y=!1,b;for(b in c)if(c.hasOwnProperty(b)){var R=c[b];if(R!=null)switch(b){case"src":h=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:Ct(s,l,b,R,c,null)}}y&&Ct(s,l,"srcSet",c.srcSet,c,null),h&&Ct(s,l,"src",c.src,c,null);return;case"input":lt("invalid",s);var L=b=R=y=null,F=null,ne=null;for(h in c)if(c.hasOwnProperty(h)){var ue=c[h];if(ue!=null)switch(h){case"name":y=ue;break;case"type":R=ue;break;case"checked":F=ue;break;case"defaultChecked":ne=ue;break;case"value":b=ue;break;case"defaultValue":L=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(i(137,l));break;default:Ct(s,l,h,ue,c,null)}}kb(s,b,L,F,ne,R,y,!1);return;case"select":lt("invalid",s),h=R=b=null;for(y in c)if(c.hasOwnProperty(y)&&(L=c[y],L!=null))switch(y){case"value":b=L;break;case"defaultValue":R=L;break;case"multiple":h=L;default:Ct(s,l,y,L,c,null)}l=b,c=R,s.multiple=!!h,l!=null?fl(s,!!h,l,!1):c!=null&&fl(s,!!h,c,!0);return;case"textarea":lt("invalid",s),b=y=h=null;for(R in c)if(c.hasOwnProperty(R)&&(L=c[R],L!=null))switch(R){case"value":h=L;break;case"defaultValue":y=L;break;case"children":b=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(i(91));break;default:Ct(s,l,R,L,c,null)}Ab(s,h,y,b);return;case"option":for(F in c)c.hasOwnProperty(F)&&(h=c[F],h!=null)&&(F==="selected"?s.selected=h&&typeof h!="function"&&typeof h!="symbol":Ct(s,l,F,h,c,null));return;case"dialog":lt("beforetoggle",s),lt("toggle",s),lt("cancel",s),lt("close",s);break;case"iframe":case"object":lt("load",s);break;case"video":case"audio":for(h=0;h<gu.length;h++)lt(gu[h],s);break;case"image":lt("error",s),lt("load",s);break;case"details":lt("toggle",s);break;case"embed":case"source":case"link":lt("error",s),lt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in c)if(c.hasOwnProperty(ne)&&(h=c[ne],h!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:Ct(s,l,ne,h,c,null)}return;default:if(xp(l)){for(ue in c)c.hasOwnProperty(ue)&&(h=c[ue],h!==void 0&&og(s,l,ue,h,c,void 0));return}}for(L in c)c.hasOwnProperty(L)&&(h=c[L],h!=null&&Ct(s,l,L,h,c,null))}function IM(s,l,c,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,b=null,R=null,L=null,F=null,ne=null,ue=null;for(se in c){var he=c[se];if(c.hasOwnProperty(se)&&he!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":F=he;default:h.hasOwnProperty(se)||Ct(s,l,se,null,h,he)}}for(var ie in h){var se=h[ie];if(he=c[ie],h.hasOwnProperty(ie)&&(se!=null||he!=null))switch(ie){case"type":b=se;break;case"name":y=se;break;case"checked":ne=se;break;case"defaultChecked":ue=se;break;case"value":R=se;break;case"defaultValue":L=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(i(137,l));break;default:se!==he&&Ct(s,l,ie,se,h,he)}}vp(s,R,L,F,ne,ue,b,y);return;case"select":se=R=L=ie=null;for(b in c)if(F=c[b],c.hasOwnProperty(b)&&F!=null)switch(b){case"value":break;case"multiple":se=F;default:h.hasOwnProperty(b)||Ct(s,l,b,null,h,F)}for(y in h)if(b=h[y],F=c[y],h.hasOwnProperty(y)&&(b!=null||F!=null))switch(y){case"value":ie=b;break;case"defaultValue":L=b;break;case"multiple":R=b;default:b!==F&&Ct(s,l,y,b,h,F)}l=L,c=R,h=se,ie!=null?fl(s,!!c,ie,!1):!!h!=!!c&&(l!=null?fl(s,!!c,l,!0):fl(s,!!c,c?[]:"",!1));return;case"textarea":se=ie=null;for(L in c)if(y=c[L],c.hasOwnProperty(L)&&y!=null&&!h.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Ct(s,l,L,null,h,y)}for(R in h)if(y=h[R],b=c[R],h.hasOwnProperty(R)&&(y!=null||b!=null))switch(R){case"value":ie=y;break;case"defaultValue":se=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(i(91));break;default:y!==b&&Ct(s,l,R,y,h,b)}Tb(s,ie,se);return;case"option":for(var Le in c)ie=c[Le],c.hasOwnProperty(Le)&&ie!=null&&!h.hasOwnProperty(Le)&&(Le==="selected"?s.selected=!1:Ct(s,l,Le,null,h,ie));for(F in h)ie=h[F],se=c[F],h.hasOwnProperty(F)&&ie!==se&&(ie!=null||se!=null)&&(F==="selected"?s.selected=ie&&typeof ie!="function"&&typeof ie!="symbol":Ct(s,l,F,ie,h,se));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var $e in c)ie=c[$e],c.hasOwnProperty($e)&&ie!=null&&!h.hasOwnProperty($e)&&Ct(s,l,$e,null,h,ie);for(ne in h)if(ie=h[ne],se=c[ne],h.hasOwnProperty(ne)&&ie!==se&&(ie!=null||se!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(i(137,l));break;default:Ct(s,l,ne,ie,h,se)}return;default:if(xp(l)){for(var Rt in c)ie=c[Rt],c.hasOwnProperty(Rt)&&ie!==void 0&&!h.hasOwnProperty(Rt)&&og(s,l,Rt,void 0,h,ie);for(ue in h)ie=h[ue],se=c[ue],!h.hasOwnProperty(ue)||ie===se||ie===void 0&&se===void 0||og(s,l,ue,ie,h,se);return}}for(var Z in c)ie=c[Z],c.hasOwnProperty(Z)&&ie!=null&&!h.hasOwnProperty(Z)&&Ct(s,l,Z,null,h,ie);for(he in h)ie=h[he],se=c[he],!h.hasOwnProperty(he)||ie===se||ie==null&&se==null||Ct(s,l,he,ie,h,se)}function DS(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function BM(){if(typeof performance.getEntriesByType=="function"){for(var s=0,l=0,c=performance.getEntriesByType("resource"),h=0;h<c.length;h++){var y=c[h],b=y.transferSize,R=y.initiatorType,L=y.duration;if(b&&L&&DS(R)){for(R=0,L=y.responseEnd,h+=1;h<c.length;h++){var F=c[h],ne=F.startTime;if(ne>L)break;var ue=F.transferSize,he=F.initiatorType;ue&&DS(he)&&(F=F.responseEnd,R+=ue*(F<L?1:(L-ne)/(F-ne)))}if(--h,l+=8*(b+R)/(y.duration/1e3),s++,10<s)break}}if(0<s)return l/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var lg=null,ag=null;function Uf(s){return s.nodeType===9?s:s.ownerDocument}function NS(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function LS(s,l){if(s===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&l==="foreignObject"?0:s}function ug(s,l){return s==="textarea"||s==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var cg=null;function _M(){var s=window.event;return s&&s.type==="popstate"?s===cg?!1:(cg=s,!0):(cg=null,!1)}var IS=typeof setTimeout=="function"?setTimeout:void 0,PM=typeof clearTimeout=="function"?clearTimeout:void 0,BS=typeof Promise=="function"?Promise:void 0,zM=typeof queueMicrotask=="function"?queueMicrotask:typeof BS<"u"?function(s){return BS.resolve(null).then(s).catch(HM)}:IS;function HM(s){setTimeout(function(){throw s})}function Rs(s){return s==="head"}function _S(s,l){var c=l,h=0;do{var y=c.nextSibling;if(s.removeChild(c),y&&y.nodeType===8)if(c=y.data,c==="/$"||c==="/&"){if(h===0){s.removeChild(y),ql(l);return}h--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")h++;else if(c==="html")vu(s.ownerDocument.documentElement);else if(c==="head"){c=s.ownerDocument.head,vu(c);for(var b=c.firstChild;b;){var R=b.nextSibling,L=b.nodeName;b[_a]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&b.rel.toLowerCase()==="stylesheet"||c.removeChild(b),b=R}}else c==="body"&&vu(s.ownerDocument.body);c=y}while(c);ql(l)}function PS(s,l){var c=s;s=0;do{var h=c.nextSibling;if(c.nodeType===1?l?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(l?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),h&&h.nodeType===8)if(c=h.data,c==="/$"){if(s===0)break;s--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||s++;c=h}while(c)}function fg(s){var l=s.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var c=l;switch(l=l.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":fg(c),gp(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}s.removeChild(c)}}function VM(s,l,c,h){for(;s.nodeType===1;){var y=c;if(s.nodeName.toLowerCase()!==l.toLowerCase()){if(!h&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(h){if(!s[_a])switch(l){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(b=s.getAttribute("rel"),b==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(b!==y.rel||s.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||s.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||s.getAttribute("title")!==(y.title==null?null:y.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(b=s.getAttribute("src"),(b!==(y.src==null?null:y.src)||s.getAttribute("type")!==(y.type==null?null:y.type)||s.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&b&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(l==="input"&&s.type==="hidden"){var b=y.name==null?null:""+y.name;if(y.type==="hidden"&&s.getAttribute("name")===b)return s}else return s;if(s=Oi(s.nextSibling),s===null)break}return null}function UM(s,l,c){if(l==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!c||(s=Oi(s.nextSibling),s===null))return null;return s}function zS(s,l){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!l||(s=Oi(s.nextSibling),s===null))return null;return s}function hg(s){return s.data==="$?"||s.data==="$~"}function dg(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function jM(s,l){var c=s.ownerDocument;if(s.data==="$~")s._reactRetry=l;else if(s.data!=="$?"||c.readyState!=="loading")l();else{var h=function(){l(),c.removeEventListener("DOMContentLoaded",h)};c.addEventListener("DOMContentLoaded",h),s._reactRetry=h}}function Oi(s){for(;s!=null;s=s.nextSibling){var l=s.nodeType;if(l===1||l===3)break;if(l===8){if(l=s.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return s}var pg=null;function HS(s){s=s.nextSibling;for(var l=0;s;){if(s.nodeType===8){var c=s.data;if(c==="/$"||c==="/&"){if(l===0)return Oi(s.nextSibling);l--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||l++}s=s.nextSibling}return null}function VS(s){s=s.previousSibling;for(var l=0;s;){if(s.nodeType===8){var c=s.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(l===0)return s;l--}else c!=="/$"&&c!=="/&"||l++}s=s.previousSibling}return null}function US(s,l,c){switch(l=Uf(c),s){case"html":if(s=l.documentElement,!s)throw Error(i(452));return s;case"head":if(s=l.head,!s)throw Error(i(453));return s;case"body":if(s=l.body,!s)throw Error(i(454));return s;default:throw Error(i(451))}}function vu(s){for(var l=s.attributes;l.length;)s.removeAttributeNode(l[0]);gp(s)}var Mi=new Map,jS=new Set;function jf(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var qr=H.d;H.d={f:qM,r:FM,D:$M,C:KM,L:YM,m:GM,X:XM,S:QM,M:WM};function qM(){var s=qr.f(),l=Lf();return s||l}function FM(s){var l=al(s);l!==null&&l.tag===5&&l.type==="form"?sx(l):qr.r(s)}var Vl=typeof document>"u"?null:document;function qS(s,l,c){var h=Vl;if(h&&typeof l=="string"&&l){var y=wi(l);y='link[rel="'+s+'"][href="'+y+'"]',typeof c=="string"&&(y+='[crossorigin="'+c+'"]'),jS.has(y)||(jS.add(y),s={rel:s,crossOrigin:c,href:l},h.querySelector(y)===null&&(l=h.createElement("link"),Rn(l,"link",s),pn(l),h.head.appendChild(l)))}}function $M(s){qr.D(s),qS("dns-prefetch",s,null)}function KM(s,l){qr.C(s,l),qS("preconnect",s,l)}function YM(s,l,c){qr.L(s,l,c);var h=Vl;if(h&&s&&l){var y='link[rel="preload"][as="'+wi(l)+'"]';l==="image"&&c&&c.imageSrcSet?(y+='[imagesrcset="'+wi(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(y+='[imagesizes="'+wi(c.imageSizes)+'"]')):y+='[href="'+wi(s)+'"]';var b=y;switch(l){case"style":b=Ul(s);break;case"script":b=jl(s)}Mi.has(b)||(s=m({rel:"preload",href:l==="image"&&c&&c.imageSrcSet?void 0:s,as:l},c),Mi.set(b,s),h.querySelector(y)!==null||l==="style"&&h.querySelector(bu(b))||l==="script"&&h.querySelector(xu(b))||(l=h.createElement("link"),Rn(l,"link",s),pn(l),h.head.appendChild(l)))}}function GM(s,l){qr.m(s,l);var c=Vl;if(c&&s){var h=l&&typeof l.as=="string"?l.as:"script",y='link[rel="modulepreload"][as="'+wi(h)+'"][href="'+wi(s)+'"]',b=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=jl(s)}if(!Mi.has(b)&&(s=m({rel:"modulepreload",href:s},l),Mi.set(b,s),c.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(xu(b)))return}h=c.createElement("link"),Rn(h,"link",s),pn(h),c.head.appendChild(h)}}}function QM(s,l,c){qr.S(s,l,c);var h=Vl;if(h&&s){var y=ul(h).hoistableStyles,b=Ul(s);l=l||"default";var R=y.get(b);if(!R){var L={loading:0,preload:null};if(R=h.querySelector(bu(b)))L.loading=5;else{s=m({rel:"stylesheet",href:s,"data-precedence":l},c),(c=Mi.get(b))&&mg(s,c);var F=R=h.createElement("link");pn(F),Rn(F,"link",s),F._p=new Promise(function(ne,ue){F.onload=ne,F.onerror=ue}),F.addEventListener("load",function(){L.loading|=1}),F.addEventListener("error",function(){L.loading|=2}),L.loading|=4,qf(R,l,h)}R={type:"stylesheet",instance:R,count:1,state:L},y.set(b,R)}}}function XM(s,l){qr.X(s,l);var c=Vl;if(c&&s){var h=ul(c).hoistableScripts,y=jl(s),b=h.get(y);b||(b=c.querySelector(xu(y)),b||(s=m({src:s,async:!0},l),(l=Mi.get(y))&&gg(s,l),b=c.createElement("script"),pn(b),Rn(b,"link",s),c.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},h.set(y,b))}}function WM(s,l){qr.M(s,l);var c=Vl;if(c&&s){var h=ul(c).hoistableScripts,y=jl(s),b=h.get(y);b||(b=c.querySelector(xu(y)),b||(s=m({src:s,async:!0,type:"module"},l),(l=Mi.get(y))&&gg(s,l),b=c.createElement("script"),pn(b),Rn(b,"link",s),c.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},h.set(y,b))}}function FS(s,l,c,h){var y=(y=re.current)?jf(y):null;if(!y)throw Error(i(446));switch(s){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(l=Ul(c.href),c=ul(y).hoistableStyles,h=c.get(l),h||(h={type:"style",instance:null,count:0,state:null},c.set(l,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){s=Ul(c.href);var b=ul(y).hoistableStyles,R=b.get(s);if(R||(y=y.ownerDocument||y,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(s,R),(b=y.querySelector(bu(s)))&&!b._p&&(R.instance=b,R.state.loading=5),Mi.has(s)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Mi.set(s,c),b||ZM(y,s,c,R.state))),l&&h===null)throw Error(i(528,""));return R}if(l&&h!==null)throw Error(i(529,""));return null;case"script":return l=c.async,c=c.src,typeof c=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=jl(c),c=ul(y).hoistableScripts,h=c.get(l),h||(h={type:"script",instance:null,count:0,state:null},c.set(l,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,s))}}function Ul(s){return'href="'+wi(s)+'"'}function bu(s){return'link[rel="stylesheet"]['+s+"]"}function $S(s){return m({},s,{"data-precedence":s.precedence,precedence:null})}function ZM(s,l,c,h){s.querySelector('link[rel="preload"][as="style"]['+l+"]")?h.loading=1:(l=s.createElement("link"),h.preload=l,l.addEventListener("load",function(){return h.loading|=1}),l.addEventListener("error",function(){return h.loading|=2}),Rn(l,"link",c),pn(l),s.head.appendChild(l))}function jl(s){return'[src="'+wi(s)+'"]'}function xu(s){return"script[async]"+s}function KS(s,l,c){if(l.count++,l.instance===null)switch(l.type){case"style":var h=s.querySelector('style[data-href~="'+wi(c.href)+'"]');if(h)return l.instance=h,pn(h),h;var y=m({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return h=(s.ownerDocument||s).createElement("style"),pn(h),Rn(h,"style",y),qf(h,c.precedence,s),l.instance=h;case"stylesheet":y=Ul(c.href);var b=s.querySelector(bu(y));if(b)return l.state.loading|=4,l.instance=b,pn(b),b;h=$S(c),(y=Mi.get(y))&&mg(h,y),b=(s.ownerDocument||s).createElement("link"),pn(b);var R=b;return R._p=new Promise(function(L,F){R.onload=L,R.onerror=F}),Rn(b,"link",h),l.state.loading|=4,qf(b,c.precedence,s),l.instance=b;case"script":return b=jl(c.src),(y=s.querySelector(xu(b)))?(l.instance=y,pn(y),y):(h=c,(y=Mi.get(b))&&(h=m({},c),gg(h,y)),s=s.ownerDocument||s,y=s.createElement("script"),pn(y),Rn(y,"link",h),s.head.appendChild(y),l.instance=y);case"void":return null;default:throw Error(i(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(h=l.instance,l.state.loading|=4,qf(h,c.precedence,s));return l.instance}function qf(s,l,c){for(var h=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,b=y,R=0;R<h.length;R++){var L=h[R];if(L.dataset.precedence===l)b=L;else if(b!==y)break}b?b.parentNode.insertBefore(s,b.nextSibling):(l=c.nodeType===9?c.head:c,l.insertBefore(s,l.firstChild))}function mg(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.title==null&&(s.title=l.title)}function gg(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.integrity==null&&(s.integrity=l.integrity)}var Ff=null;function YS(s,l,c){if(Ff===null){var h=new Map,y=Ff=new Map;y.set(c,h)}else y=Ff,h=y.get(c),h||(h=new Map,y.set(c,h));if(h.has(s))return h;for(h.set(s,null),c=c.getElementsByTagName(s),y=0;y<c.length;y++){var b=c[y];if(!(b[_a]||b[Sn]||s==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var R=b.getAttribute(l)||"";R=s+R;var L=h.get(R);L?L.push(b):h.set(R,[b])}}return h}function GS(s,l,c){s=s.ownerDocument||s,s.head.insertBefore(c,l==="title"?s.querySelector("head > title"):null)}function JM(s,l,c){if(c===1||l.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;return l.rel==="stylesheet"?(s=l.disabled,typeof l.precedence=="string"&&s==null):!0;case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function QS(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function e3(s,l,c,h){if(c.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var y=Ul(h.href),b=l.querySelector(bu(y));if(b){l=b._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(s.count++,s=$f.bind(s),l.then(s,s)),c.state.loading|=4,c.instance=b,pn(b);return}b=l.ownerDocument||l,h=$S(h),(y=Mi.get(y))&&mg(h,y),b=b.createElement("link"),pn(b);var R=b;R._p=new Promise(function(L,F){R.onload=L,R.onerror=F}),Rn(b,"link",h),c.instance=b}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(c,l),(l=c.state.preload)&&(c.state.loading&3)===0&&(s.count++,c=$f.bind(s),l.addEventListener("load",c),l.addEventListener("error",c))}}var yg=0;function t3(s,l){return s.stylesheets&&s.count===0&&Yf(s,s.stylesheets),0<s.count||0<s.imgCount?function(c){var h=setTimeout(function(){if(s.stylesheets&&Yf(s,s.stylesheets),s.unsuspend){var b=s.unsuspend;s.unsuspend=null,b()}},6e4+l);0<s.imgBytes&&yg===0&&(yg=62500*BM());var y=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Yf(s,s.stylesheets),s.unsuspend)){var b=s.unsuspend;s.unsuspend=null,b()}},(s.imgBytes>yg?50:800)+l);return s.unsuspend=c,function(){s.unsuspend=null,clearTimeout(h),clearTimeout(y)}}:null}function $f(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yf(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Kf=null;function Yf(s,l){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Kf=new Map,l.forEach(n3,s),Kf=null,$f.call(s))}function n3(s,l){if(!(l.state.loading&4)){var c=Kf.get(s);if(c)var h=c.get(null);else{c=new Map,Kf.set(s,c);for(var y=s.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<y.length;b++){var R=y[b];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(c.set(R.dataset.precedence,R),h=R)}h&&c.set(null,h)}y=l.instance,R=y.getAttribute("data-precedence"),b=c.get(R)||h,b===h&&c.set(null,y),c.set(R,y),this.count++,h=$f.bind(this),y.addEventListener("load",h),y.addEventListener("error",h),b?b.parentNode.insertBefore(y,b.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(y,s.firstChild)),l.state.loading|=4}}var Su={$$typeof:T,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function i3(s,l,c,h,y,b,R,L,F){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Vt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vt(0),this.hiddenUpdates=Vt(null),this.identifierPrefix=h,this.onUncaughtError=y,this.onCaughtError=b,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=F,this.incompleteTransitions=new Map}function XS(s,l,c,h,y,b,R,L,F,ne,ue,he){return s=new i3(s,l,c,R,F,ne,ue,he,L),l=1,b===!0&&(l|=24),b=si(3,null,null,l),s.current=b,b.stateNode=s,l=Xp(),l.refCount++,s.pooledCache=l,l.refCount++,b.memoizedState={element:h,isDehydrated:c,cache:l},em(b),s}function WS(s){return s?(s=bl,s):bl}function ZS(s,l,c,h,y,b){y=WS(y),h.context===null?h.context=y:h.pendingContext=y,h=ps(l),h.payload={element:c},b=b===void 0?null:b,b!==null&&(h.callback=b),c=ms(s,h,l),c!==null&&(Gn(c,s,l),Ja(c,s,l))}function JS(s,l){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var c=s.retryLane;s.retryLane=c!==0&&c<l?c:l}}function vg(s,l){JS(s,l),(s=s.alternate)&&JS(s,l)}function ew(s){if(s.tag===13||s.tag===31){var l=fo(s,67108864);l!==null&&Gn(l,s,67108864),vg(s,67108864)}}function tw(s){if(s.tag===13||s.tag===31){var l=ci();l=Ba(l);var c=fo(s,l);c!==null&&Gn(c,s,l),vg(s,l)}}var Gf=!0;function r3(s,l,c,h){var y=_.T;_.T=null;var b=H.p;try{H.p=2,bg(s,l,c,h)}finally{H.p=b,_.T=y}}function s3(s,l,c,h){var y=_.T;_.T=null;var b=H.p;try{H.p=8,bg(s,l,c,h)}finally{H.p=b,_.T=y}}function bg(s,l,c,h){if(Gf){var y=xg(h);if(y===null)sg(s,l,h,Qf,c),iw(s,h);else if(l3(y,s,l,c,h))h.stopPropagation();else if(iw(s,h),l&4&&-1<o3.indexOf(s)){for(;y!==null;){var b=al(y);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var R=dn(b.pendingLanes);if(R!==0){var L=b;for(L.pendingLanes|=2,L.entangledLanes|=2;R;){var F=1<<31-Xe(R);L.entanglements[1]|=F,R&=~F}hr(b),(gt&6)===0&&(Df=ye()+500,mu(0))}}break;case 31:case 13:L=fo(b,2),L!==null&&Gn(L,b,2),Lf(),vg(b,2)}if(b=xg(h),b===null&&sg(s,l,h,Qf,c),b===y)break;y=b}y!==null&&h.stopPropagation()}else sg(s,l,h,null,c)}}function xg(s){return s=wp(s),Sg(s)}var Qf=null;function Sg(s){if(Qf=null,s=ll(s),s!==null){var l=o(s);if(l===null)s=null;else{var c=l.tag;if(c===13){if(s=a(l),s!==null)return s;s=null}else if(c===31){if(s=u(l),s!==null)return s;s=null}else if(c===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;s=null}else l!==s&&(s=null)}}return Qf=s,null}function nw(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(De()){case Ne:return 2;case Ge:return 8;case je:case mt:return 32;case Dt:return 268435456;default:return 32}default:return 32}}var wg=!1,ks=null,Ts=null,As=null,wu=new Map,Eu=new Map,Os=[],o3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function iw(s,l){switch(s){case"focusin":case"focusout":ks=null;break;case"dragenter":case"dragleave":Ts=null;break;case"mouseover":case"mouseout":As=null;break;case"pointerover":case"pointerout":wu.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Eu.delete(l.pointerId)}}function Cu(s,l,c,h,y,b){return s===null||s.nativeEvent!==b?(s={blockedOn:l,domEventName:c,eventSystemFlags:h,nativeEvent:b,targetContainers:[y]},l!==null&&(l=al(l),l!==null&&ew(l)),s):(s.eventSystemFlags|=h,l=s.targetContainers,y!==null&&l.indexOf(y)===-1&&l.push(y),s)}function l3(s,l,c,h,y){switch(l){case"focusin":return ks=Cu(ks,s,l,c,h,y),!0;case"dragenter":return Ts=Cu(Ts,s,l,c,h,y),!0;case"mouseover":return As=Cu(As,s,l,c,h,y),!0;case"pointerover":var b=y.pointerId;return wu.set(b,Cu(wu.get(b)||null,s,l,c,h,y)),!0;case"gotpointercapture":return b=y.pointerId,Eu.set(b,Cu(Eu.get(b)||null,s,l,c,h,y)),!0}return!1}function rw(s){var l=ll(s.target);if(l!==null){var c=o(l);if(c!==null){if(l=c.tag,l===13){if(l=a(c),l!==null){s.blockedOn=l,vb(s.priority,function(){tw(c)});return}}else if(l===31){if(l=u(c),l!==null){s.blockedOn=l,vb(s.priority,function(){tw(c)});return}}else if(l===3&&c.stateNode.current.memoizedState.isDehydrated){s.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Xf(s){if(s.blockedOn!==null)return!1;for(var l=s.targetContainers;0<l.length;){var c=xg(s.nativeEvent);if(c===null){c=s.nativeEvent;var h=new c.constructor(c.type,c);Sp=h,c.target.dispatchEvent(h),Sp=null}else return l=al(c),l!==null&&ew(l),s.blockedOn=c,!1;l.shift()}return!0}function sw(s,l,c){Xf(s)&&c.delete(l)}function a3(){wg=!1,ks!==null&&Xf(ks)&&(ks=null),Ts!==null&&Xf(Ts)&&(Ts=null),As!==null&&Xf(As)&&(As=null),wu.forEach(sw),Eu.forEach(sw)}function Wf(s,l){s.blockedOn===l&&(s.blockedOn=null,wg||(wg=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,a3)))}var Zf=null;function ow(s){Zf!==s&&(Zf=s,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Zf===s&&(Zf=null);for(var l=0;l<s.length;l+=3){var c=s[l],h=s[l+1],y=s[l+2];if(typeof h!="function"){if(Sg(h||c)===null)continue;break}var b=al(c);b!==null&&(s.splice(l,3),l-=3,xm(b,{pending:!0,data:y,method:c.method,action:h},h,y))}}))}function ql(s){function l(F){return Wf(F,s)}ks!==null&&Wf(ks,s),Ts!==null&&Wf(Ts,s),As!==null&&Wf(As,s),wu.forEach(l),Eu.forEach(l);for(var c=0;c<Os.length;c++){var h=Os[c];h.blockedOn===s&&(h.blockedOn=null)}for(;0<Os.length&&(c=Os[0],c.blockedOn===null);)rw(c),c.blockedOn===null&&Os.shift();if(c=(s.ownerDocument||s).$$reactFormReplay,c!=null)for(h=0;h<c.length;h+=3){var y=c[h],b=c[h+1],R=y[jn]||null;if(typeof b=="function")R||ow(c);else if(R){var L=null;if(b&&b.hasAttribute("formAction")){if(y=b,R=b[jn]||null)L=R.formAction;else if(Sg(y)!==null)continue}else L=R.action;typeof L=="function"?c[h+1]=L:(c.splice(h,3),h-=3),ow(c)}}}function lw(){function s(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(R){return y=R})},focusReset:"manual",scroll:"manual"})}function l(){y!==null&&(y(),y=null),h||setTimeout(c,20)}function c(){if(!h&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,y=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(c,100),function(){h=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),y!==null&&(y(),y=null)}}}function Eg(s){this._internalRoot=s}Jf.prototype.render=Eg.prototype.render=function(s){var l=this._internalRoot;if(l===null)throw Error(i(409));var c=l.current,h=ci();ZS(c,h,s,l,null,null)},Jf.prototype.unmount=Eg.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var l=s.containerInfo;ZS(s.current,2,null,s,null,null),Lf(),l[ol]=null}};function Jf(s){this._internalRoot=s}Jf.prototype.unstable_scheduleHydration=function(s){if(s){var l=yb();s={blockedOn:null,target:s,priority:l};for(var c=0;c<Os.length&&l!==0&&l<Os[c].priority;c++);Os.splice(c,0,s),c===0&&rw(s)}};var aw=e.version;if(aw!=="19.2.4")throw Error(i(527,aw,"19.2.4"));H.findDOMNode=function(s){var l=s._reactInternals;if(l===void 0)throw typeof s.render=="function"?Error(i(188)):(s=Object.keys(s).join(","),Error(i(268,s)));return s=d(l),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var u3={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var eh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!eh.isDisabled&&eh.supportsFiber)try{kt=eh.inject(u3),xe=eh}catch{}}return Du.createRoot=function(s,l){if(!r(s))throw Error(i(299));var c=!1,h="",y=mx,b=gx,R=yx;return l!=null&&(l.unstable_strictMode===!0&&(c=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(b=l.onCaughtError),l.onRecoverableError!==void 0&&(R=l.onRecoverableError)),l=XS(s,1,!1,null,null,c,h,null,y,b,R,lw),s[ol]=l.current,rg(s),new Eg(l)},Du.hydrateRoot=function(s,l,c){if(!r(s))throw Error(i(299));var h=!1,y="",b=mx,R=gx,L=yx,F=null;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onUncaughtError!==void 0&&(b=c.onUncaughtError),c.onCaughtError!==void 0&&(R=c.onCaughtError),c.onRecoverableError!==void 0&&(L=c.onRecoverableError),c.formState!==void 0&&(F=c.formState)),l=XS(s,1,!0,l,c??null,h,y,F,b,R,L,lw),l.context=WS(null),c=l.current,h=ci(),h=Ba(h),y=ps(h),y.callback=null,ms(c,y,h),c=h,l.current.lanes=c,xn(l,c),hr(l),s[ol]=l.current,rg(s),new Jf(l)},Du.version="19.2.4",Du}var Vw;function f6(){if(Vw)return Ug.exports;Vw=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),Ug.exports=c6(),Ug.exports}var h6=f6();const d6=n=>({...n,baseUrl:"/cdn-cgi/explorer/api",throwOnError:!0}),p6={bodySerializer:n=>JSON.stringify(n,(e,t)=>typeof t=="bigint"?t.toString():t)},m6=({onRequest:n,onSseError:e,onSseEvent:t,responseTransformer:i,responseValidator:r,sseDefaultRetryDelay:o,sseMaxRetryAttempts:a,sseMaxRetryDelay:u,sseSleepFn:f,url:d,...p})=>{let m;const g=f??(w=>new Promise(C=>setTimeout(C,w)));return{stream:async function*(){let w=o??3e3,C=0;const E=p.signal??new AbortController().signal;for(;!E.aborted;){C++;const k=p.headers instanceof Headers?p.headers:new Headers(p.headers);m!==void 0&&k.set("Last-Event-ID",m);try{const T={redirect:"follow",...p,body:p.serializedBody,headers:k,signal:E};let A=new Request(d,T);n&&(A=await n(d,T));const N=await(p.fetch??globalThis.fetch)(A);if(!N.ok)throw new Error(`SSE failed: ${N.status} ${N.statusText}`);if(!N.body)throw new Error("No body in SSE response");const M=N.body.pipeThrough(new TextDecoderStream).getReader();let D="";const V=()=>{try{M.cancel()}catch{}};E.addEventListener("abort",V);try{for(;;){const{done:U,value:j}=await M.read();if(U)break;D+=j,D=D.replace(/\r\n/g,`
|
|
11
|
+
`).replace(/\r/g,`
|
|
12
|
+
`);const I=D.split(`
|
|
13
|
+
|
|
14
|
+
`);D=I.pop()??"";for(const q of I){const P=q.split(`
|
|
15
|
+
`),$=[];let _;for(const Q of P)if(Q.startsWith("data:"))$.push(Q.replace(/^data:\s*/,""));else if(Q.startsWith("event:"))_=Q.replace(/^event:\s*/,"");else if(Q.startsWith("id:"))m=Q.replace(/^id:\s*/,"");else if(Q.startsWith("retry:")){const ee=Number.parseInt(Q.replace(/^retry:\s*/,""),10);Number.isNaN(ee)||(w=ee)}let H,z=!1;if($.length){const Q=$.join(`
|
|
16
|
+
`);try{H=JSON.parse(Q),z=!0}catch{H=Q}}z&&(r&&await r(H),i&&(H=await i(H))),t?.({data:H,event:_,id:m,retry:w}),$.length&&(yield H)}}}finally{E.removeEventListener("abort",V),M.releaseLock()}break}catch(T){if(e?.(T),a!==void 0&&C>=a)break;const A=Math.min(w*2**(C-1),u??3e4);await g(A)}}}()}},g6=n=>{switch(n){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},y6=n=>{switch(n){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},v6=n=>{switch(n){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},UC=({allowReserved:n,explode:e,name:t,style:i,value:r})=>{if(!e){const u=(n?r:r.map(f=>encodeURIComponent(f))).join(y6(i));switch(i){case"label":return`.${u}`;case"matrix":return`;${t}=${u}`;case"simple":return u;default:return`${t}=${u}`}}const o=g6(i),a=r.map(u=>i==="label"||i==="simple"?n?u:encodeURIComponent(u):jd({allowReserved:n,name:t,value:u})).join(o);return i==="label"||i==="matrix"?o+a:a},jd=({allowReserved:n,name:e,value:t})=>{if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${n?t:encodeURIComponent(t)}`},jC=({allowReserved:n,explode:e,name:t,style:i,value:r,valueOnly:o})=>{if(r instanceof Date)return o?r.toISOString():`${t}=${r.toISOString()}`;if(i!=="deepObject"&&!e){let f=[];Object.entries(r).forEach(([p,m])=>{f=[...f,p,n?m:encodeURIComponent(m)]});const d=f.join(",");switch(i){case"form":return`${t}=${d}`;case"label":return`.${d}`;case"matrix":return`;${t}=${d}`;default:return d}}const a=v6(i),u=Object.entries(r).map(([f,d])=>jd({allowReserved:n,name:i==="deepObject"?`${t}[${f}]`:f,value:d})).join(a);return i==="label"||i==="matrix"?a+u:u},b6=/\{[^{}]+\}/g,x6=({path:n,url:e})=>{let t=e;const i=e.match(b6);if(i)for(const r of i){let o=!1,a=r.substring(1,r.length-1),u="simple";a.endsWith("*")&&(o=!0,a=a.substring(0,a.length-1)),a.startsWith(".")?(a=a.substring(1),u="label"):a.startsWith(";")&&(a=a.substring(1),u="matrix");const f=n[a];if(f==null)continue;if(Array.isArray(f)){t=t.replace(r,UC({explode:o,name:a,style:u,value:f}));continue}if(typeof f=="object"){t=t.replace(r,jC({explode:o,name:a,style:u,value:f,valueOnly:!0}));continue}if(u==="matrix"){t=t.replace(r,`;${jd({name:a,value:f})}`);continue}const d=encodeURIComponent(u==="label"?`.${f}`:f);t=t.replace(r,d)}return t},S6=({baseUrl:n,path:e,query:t,querySerializer:i,url:r})=>{const o=r.startsWith("/")?r:`/${r}`;let a=(n??"")+o;e&&(a=x6({path:e,url:a}));let u=t?i(t):"";return u.startsWith("?")&&(u=u.substring(1)),u&&(a+=`?${u}`),a};function Uw(n){const e=n.body!==void 0;if(e&&n.bodySerializer)return"serializedBody"in n?n.serializedBody!==void 0&&n.serializedBody!==""?n.serializedBody:null:n.body!==""?n.body:null;if(e)return n.body}const w6=async(n,e)=>{const t=typeof e=="function"?await e(n):e;if(t)return n.scheme==="bearer"?`Bearer ${t}`:n.scheme==="basic"?`Basic ${btoa(t)}`:t},qC=({parameters:n={},...e}={})=>i=>{const r=[];if(i&&typeof i=="object")for(const o in i){const a=i[o];if(a==null)continue;const u=n[o]||e;if(Array.isArray(a)){const f=UC({allowReserved:u.allowReserved,explode:!0,name:o,style:"form",value:a,...u.array});f&&r.push(f)}else if(typeof a=="object"){const f=jC({allowReserved:u.allowReserved,explode:!0,name:o,style:"deepObject",value:a,...u.object});f&&r.push(f)}else{const f=jd({allowReserved:u.allowReserved,name:o,value:a});f&&r.push(f)}}return r.join("&")},E6=n=>{if(!n)return"stream";const e=n.split(";")[0]?.trim();if(e){if(e.startsWith("application/json")||e.endsWith("+json"))return"json";if(e==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(t=>e.startsWith(t)))return"blob";if(e.startsWith("text/"))return"text"}},C6=(n,e)=>e?!!(n.headers.has(e)||n.query?.[e]||n.headers.get("Cookie")?.includes(`${e}=`)):!1,R6=async({security:n,...e})=>{for(const t of n){if(C6(e,t.name))continue;const i=await w6(t,e.auth);if(!i)continue;const r=t.name??"Authorization";switch(t.in){case"query":e.query||(e.query={}),e.query[r]=i;break;case"cookie":e.headers.append("Cookie",`${r}=${i}`);break;default:e.headers.set(r,i);break}}},jw=n=>S6({baseUrl:n.baseUrl,path:n.path,query:n.query,querySerializer:typeof n.querySerializer=="function"?n.querySerializer:qC(n.querySerializer),url:n.url}),qw=(n,e)=>{const t={...n,...e};return t.baseUrl?.endsWith("/")&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=FC(n.headers,e.headers),t},k6=n=>{const e=[];return n.forEach((t,i)=>{e.push([i,t])}),e},FC=(...n)=>{const e=new Headers;for(const t of n){if(!t)continue;const i=t instanceof Headers?k6(t):Object.entries(t);for(const[r,o]of i)if(o===null)e.delete(r);else if(Array.isArray(o))for(const a of o)e.append(r,a);else o!==void 0&&e.set(r,typeof o=="object"?JSON.stringify(o):o)}return e};class Fg{fns=[];clear(){this.fns=[]}eject(e){const t=this.getInterceptorIndex(e);this.fns[t]&&(this.fns[t]=null)}exists(e){const t=this.getInterceptorIndex(e);return!!this.fns[t]}getInterceptorIndex(e){return typeof e=="number"?this.fns[e]?e:-1:this.fns.indexOf(e)}update(e,t){const i=this.getInterceptorIndex(e);return this.fns[i]?(this.fns[i]=t,e):!1}use(e){return this.fns.push(e),this.fns.length-1}}const T6=()=>({error:new Fg,request:new Fg,response:new Fg}),A6=qC({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),O6={"Content-Type":"application/json"},$C=(n={})=>({...p6,headers:O6,parseAs:"auto",querySerializer:A6,...n}),M6=(n={})=>{let e=qw($C(),n);const t=()=>({...e}),i=p=>(e=qw(e,p),t()),r=T6(),o=async p=>{const m={...e,...p,fetch:p.fetch??e.fetch??globalThis.fetch,headers:FC(e.headers,p.headers),serializedBody:void 0};m.security&&await R6({...m,security:m.security}),m.requestValidator&&await m.requestValidator(m),m.body!==void 0&&m.bodySerializer&&(m.serializedBody=m.bodySerializer(m.body)),(m.body===void 0||m.serializedBody==="")&&m.headers.delete("Content-Type");const g=jw(m);return{opts:m,url:g}},a=async p=>{const{opts:m,url:g}=await o(p),v={redirect:"follow",...m,body:Uw(m)};let x=new Request(g,v);for(const N of r.request.fns)N&&(x=await N(x,m));const w=m.fetch;let C;try{C=await w(x)}catch(N){let M=N;for(const D of r.error.fns)D&&(M=await D(N,void 0,x,m));if(M=M||{},m.throwOnError)throw M;return m.responseStyle==="data"?void 0:{error:M,request:x,response:void 0}}for(const N of r.response.fns)N&&(C=await N(C,x,m));const E={request:x,response:C};if(C.ok){const N=(m.parseAs==="auto"?E6(C.headers.get("Content-Type")):m.parseAs)??"json";if(C.status===204||C.headers.get("Content-Length")==="0"){let D;switch(N){case"arrayBuffer":case"blob":case"text":D=await C[N]();break;case"formData":D=new FormData;break;case"stream":D=C.body;break;default:D={};break}return m.responseStyle==="data"?D:{data:D,...E}}let M;switch(N){case"arrayBuffer":case"blob":case"formData":case"text":M=await C[N]();break;case"json":{const D=await C.text();M=D?JSON.parse(D):{};break}case"stream":return m.responseStyle==="data"?C.body:{data:C.body,...E}}return N==="json"&&(m.responseValidator&&await m.responseValidator(M),m.responseTransformer&&(M=await m.responseTransformer(M))),m.responseStyle==="data"?M:{data:M,...E}}const k=await C.text();let T;try{T=JSON.parse(k)}catch{}const A=T??k;let O=A;for(const N of r.error.fns)N&&(O=await N(A,C,x,m));if(O=O||{},m.throwOnError)throw O;return m.responseStyle==="data"?void 0:{error:O,...E}},u=p=>m=>a({...m,method:p}),f=p=>async m=>{const{opts:g,url:v}=await o(m);return m6({...g,body:g.body,headers:g.headers,method:p,onRequest:async(x,w)=>{let C=new Request(x,w);for(const E of r.request.fns)E&&(C=await E(C,g));return C},serializedBody:Uw(g),url:v})};return{buildUrl:p=>jw({...e,...p}),connect:u("CONNECT"),delete:u("DELETE"),get:u("GET"),getConfig:t,head:u("HEAD"),interceptors:r,options:u("OPTIONS"),patch:u("PATCH"),post:u("POST"),put:u("PUT"),request:a,setConfig:i,sse:{connect:f("CONNECT"),delete:f("DELETE"),get:f("GET"),head:f("HEAD"),options:f("OPTIONS"),patch:f("PATCH"),post:f("POST"),put:f("PUT"),trace:f("TRACE")},trace:u("TRACE")}},rr=M6(d6($C({baseUrl:"/cdn-cgi/explorer/api"}))),D6=n=>rr.get({url:"/storage/kv/namespaces",...n}),N6=n=>(n.client??rr).get({url:"/storage/kv/namespaces/{namespace_id}/keys",...n}),wH=n=>(n.client??rr).delete({url:"/storage/kv/namespaces/{namespace_id}/values/{key_name}",...n,headers:{"Content-Type":"application/json",...n.headers}}),EH=n=>(n.client??rr).get({url:"/storage/kv/namespaces/{namespace_id}/values/{key_name}",...n}),CH=n=>(n.client??rr).put({bodySerializer:null,url:"/storage/kv/namespaces/{namespace_id}/values/{key_name}",...n,headers:{"Content-Type":"application/octet-stream",...n.headers}}),L6=n=>(n.client??rr).post({url:"/storage/kv/namespaces/{namespace_id}/bulk/get",...n,headers:{"Content-Type":"application/json",...n.headers}}),I6=n=>rr.get({url:"/d1/database",...n}),B6=n=>(n.client??rr).post({url:"/d1/database/{database_id}/raw",...n,headers:{"Content-Type":"application/json",...n.headers}}),qd=n=>(n?.client??rr).get({url:"/workers/durable_objects/namespaces",...n}),_6=n=>(n.client??rr).get({url:"/workers/durable_objects/namespaces/{id}/objects",...n}),P6=n=>(n.client??rr).post({url:"/workers/durable_objects/namespaces/{namespace_id}/query",...n,headers:{"Content-Type":"application/json",...n.headers}});function KC(n){var e,t,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var r=n.length;for(e=0;e<r;e++)n[e]&&(t=KC(n[e]))&&(i&&(i+=" "),i+=t)}else for(t in n)n[t]&&(i&&(i+=" "),i+=t);return i}function z6(){for(var n,e,t=0,i="",r=arguments.length;t<r;t++)(n=arguments[t])&&(e=KC(n))&&(i&&(i+=" "),i+=e);return i}const H6=(n,e)=>{const t=new Array(n.length+e.length);for(let i=0;i<n.length;i++)t[i]=n[i];for(let i=0;i<e.length;i++)t[n.length+i]=e[i];return t},V6=(n,e)=>({classGroupId:n,validator:e}),YC=(n=new Map,e=null,t)=>({nextPart:n,validators:e,classGroupId:t}),sd="-",Fw=[],U6="arbitrary..",j6=n=>{const e=F6(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:i}=n;return{getClassGroupId:r=>{if(r.startsWith("[")&&r.endsWith("]"))return q6(r);const o=r.split(sd),a=o[0]===""&&o.length>1?1:0;return GC(o,a,e)},getConflictingClassGroupIds:(r,o)=>{if(o){const a=i[r],u=t[r];return a?u?H6(u,a):a:u||Fw}return t[r]||Fw}}},GC=(n,e,t)=>{if(n.length-e===0)return t.classGroupId;const i=n[e],r=t.nextPart.get(i);if(r){const f=GC(n,e+1,r);if(f)return f}const o=t.validators;if(o===null)return;const a=e===0?n.join(sd):n.slice(e).join(sd),u=o.length;for(let f=0;f<u;f++){const d=o[f];if(d.validator(a))return d.classGroupId}},q6=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=n.slice(1,-1),t=e.indexOf(":"),i=e.slice(0,t);return i?U6+i:void 0})(),F6=n=>{const{theme:e,classGroups:t}=n;return $6(t,e)},$6=(n,e)=>{const t=YC();for(const i in n){const r=n[i];tv(r,t,i,e)}return t},tv=(n,e,t,i)=>{const r=n.length;for(let o=0;o<r;o++){const a=n[o];K6(a,e,t,i)}},K6=(n,e,t,i)=>{if(typeof n=="string"){Y6(n,e,t);return}if(typeof n=="function"){G6(n,e,t,i);return}Q6(n,e,t,i)},Y6=(n,e,t)=>{const i=n===""?e:QC(e,n);i.classGroupId=t},G6=(n,e,t,i)=>{if(X6(n)){tv(n(i),e,t,i);return}e.validators===null&&(e.validators=[]),e.validators.push(V6(t,n))},Q6=(n,e,t,i)=>{const r=Object.entries(n),o=r.length;for(let a=0;a<o;a++){const[u,f]=r[a];tv(f,QC(e,u),t,i)}},QC=(n,e)=>{let t=n;const i=e.split(sd),r=i.length;for(let o=0;o<r;o++){const a=i[o];let u=t.nextPart.get(a);u||(u=YC(),t.nextPart.set(a,u)),t=u}return t},X6=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,W6=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=Object.create(null),i=Object.create(null);const r=(o,a)=>{t[o]=a,e++,e>n&&(e=0,i=t,t=Object.create(null))};return{get(o){let a=t[o];if(a!==void 0)return a;if((a=i[o])!==void 0)return r(o,a),a},set(o,a){o in t?t[o]=a:r(o,a)}}},V0="!",$w=":",Z6=[],Kw=(n,e,t,i,r)=>({modifiers:n,hasImportantModifier:e,baseClassName:t,maybePostfixModifierPosition:i,isExternal:r}),J6=n=>{const{prefix:e,experimentalParseClassName:t}=n;let i=r=>{const o=[];let a=0,u=0,f=0,d;const p=r.length;for(let w=0;w<p;w++){const C=r[w];if(a===0&&u===0){if(C===$w){o.push(r.slice(f,w)),f=w+1;continue}if(C==="/"){d=w;continue}}C==="["?a++:C==="]"?a--:C==="("?u++:C===")"&&u--}const m=o.length===0?r:r.slice(f);let g=m,v=!1;m.endsWith(V0)?(g=m.slice(0,-1),v=!0):m.startsWith(V0)&&(g=m.slice(1),v=!0);const x=d&&d>f?d-f:void 0;return Kw(o,v,g,x)};if(e){const r=e+$w,o=i;i=a=>a.startsWith(r)?o(a.slice(r.length)):Kw(Z6,!1,a,void 0,!0)}if(t){const r=i;i=o=>t({className:o,parseClassName:r})}return i},eD=n=>{const e=new Map;return n.orderSensitiveModifiers.forEach((t,i)=>{e.set(t,1e6+i)}),t=>{const i=[];let r=[];for(let o=0;o<t.length;o++){const a=t[o],u=a[0]==="[",f=e.has(a);u||f?(r.length>0&&(r.sort(),i.push(...r),r=[]),i.push(a)):r.push(a)}return r.length>0&&(r.sort(),i.push(...r)),i}},tD=n=>({cache:W6(n.cacheSize),parseClassName:J6(n),sortModifiers:eD(n),...j6(n)}),nD=/\s+/,iD=(n,e)=>{const{parseClassName:t,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:o}=e,a=[],u=n.trim().split(nD);let f="";for(let d=u.length-1;d>=0;d-=1){const p=u[d],{isExternal:m,modifiers:g,hasImportantModifier:v,baseClassName:x,maybePostfixModifierPosition:w}=t(p);if(m){f=p+(f.length>0?" "+f:f);continue}let C=!!w,E=i(C?x.substring(0,w):x);if(!E){if(!C){f=p+(f.length>0?" "+f:f);continue}if(E=i(x),!E){f=p+(f.length>0?" "+f:f);continue}C=!1}const k=g.length===0?"":g.length===1?g[0]:o(g).join(":"),T=v?k+V0:k,A=T+E;if(a.indexOf(A)>-1)continue;a.push(A);const O=r(E,C);for(let N=0;N<O.length;++N){const M=O[N];a.push(T+M)}f=p+(f.length>0?" "+f:f)}return f},rD=(...n)=>{let e=0,t,i,r="";for(;e<n.length;)(t=n[e++])&&(i=XC(t))&&(r&&(r+=" "),r+=i);return r},XC=n=>{if(typeof n=="string")return n;let e,t="";for(let i=0;i<n.length;i++)n[i]&&(e=XC(n[i]))&&(t&&(t+=" "),t+=e);return t},sD=(n,...e)=>{let t,i,r,o;const a=f=>{const d=e.reduce((p,m)=>m(p),n());return t=tD(d),i=t.cache.get,r=t.cache.set,o=u,u(f)},u=f=>{const d=i(f);if(d)return d;const p=iD(f,t);return r(f,p),p};return o=a,(...f)=>o(rD(...f))},oD=[],fn=n=>{const e=t=>t[n]||oD;return e.isThemeGetter=!0,e},WC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ZC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,lD=/^\d+\/\d+$/,aD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,uD=/\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$/,cD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fl=n=>lD.test(n),it=n=>!!n&&!Number.isNaN(Number(n)),Ds=n=>!!n&&Number.isInteger(Number(n)),$g=n=>n.endsWith("%")&&it(n.slice(0,-1)),Fr=n=>aD.test(n),dD=()=>!0,pD=n=>uD.test(n)&&!cD.test(n),JC=()=>!1,mD=n=>fD.test(n),gD=n=>hD.test(n),yD=n=>!Ie(n)&&!Be(n),vD=n=>Aa(n,nR,JC),Ie=n=>WC.test(n),Ro=n=>Aa(n,iR,pD),Kg=n=>Aa(n,ED,it),Yw=n=>Aa(n,eR,JC),bD=n=>Aa(n,tR,gD),rh=n=>Aa(n,rR,mD),Be=n=>ZC.test(n),Nu=n=>Oa(n,iR),xD=n=>Oa(n,CD),Gw=n=>Oa(n,eR),SD=n=>Oa(n,nR),wD=n=>Oa(n,tR),sh=n=>Oa(n,rR,!0),Aa=(n,e,t)=>{const i=WC.exec(n);return i?i[1]?e(i[1]):t(i[2]):!1},Oa=(n,e,t=!1)=>{const i=ZC.exec(n);return i?i[1]?e(i[1]):t:!1},eR=n=>n==="position"||n==="percentage",tR=n=>n==="image"||n==="url",nR=n=>n==="length"||n==="size"||n==="bg-size",iR=n=>n==="length",ED=n=>n==="number",CD=n=>n==="family-name",rR=n=>n==="shadow",RD=()=>{const n=fn("color"),e=fn("font"),t=fn("text"),i=fn("font-weight"),r=fn("tracking"),o=fn("leading"),a=fn("breakpoint"),u=fn("container"),f=fn("spacing"),d=fn("radius"),p=fn("shadow"),m=fn("inset-shadow"),g=fn("text-shadow"),v=fn("drop-shadow"),x=fn("blur"),w=fn("perspective"),C=fn("aspect"),E=fn("ease"),k=fn("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...A(),Be,Ie],N=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],D=()=>[Be,Ie,f],V=()=>[Fl,"full","auto",...D()],U=()=>[Ds,"none","subgrid",Be,Ie],j=()=>["auto",{span:["full",Ds,Be,Ie]},Ds,Be,Ie],I=()=>[Ds,"auto",Be,Ie],q=()=>["auto","min","max","fr",Be,Ie],P=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],_=()=>["auto",...D()],H=()=>[Fl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],z=()=>[n,Be,Ie],Q=()=>[...A(),Gw,Yw,{position:[Be,Ie]}],ee=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",SD,vD,{size:[Be,Ie]}],K=()=>[$g,Nu,Ro],X=()=>["","none","full",d,Be,Ie],J=()=>["",it,Nu,Ro],W=()=>["solid","dashed","dotted","double"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[it,$g,Gw,Yw],fe=()=>["","none",x,Be,Ie],pe=()=>["none",it,Be,Ie],Te=()=>["none",it,Be,Ie],le=()=>[it,Be,Ie],Ee=()=>[Fl,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fr],breakpoint:[Fr],color:[dD],container:[Fr],"drop-shadow":[Fr],ease:["in","out","in-out"],font:[yD],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fr],shadow:[Fr],spacing:["px",it],text:[Fr],"text-shadow":[Fr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Fl,Ie,Be,C]}],container:["container"],columns:[{columns:[it,Ie,Be,u]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:O()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{start:V()}],end:[{end:V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[Ds,"auto",Be,Ie]}],basis:[{basis:[Fl,"full","auto",u,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[it,Fl,"auto","initial","none",Ie]}],grow:[{grow:["",it,Be,Ie]}],shrink:[{shrink:["",it,Be,Ie]}],order:[{order:[Ds,"first","last","none",Be,Ie]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...P(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...P()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":P()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[u,"screen",...H()]}],"min-w":[{"min-w":[u,"screen","none",...H()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[a]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",t,Nu,Ro]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,Be,Kg]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$g,Ie]}],"font-family":[{font:[xD,Ie,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,Be,Ie]}],"line-clamp":[{"line-clamp":[it,"none",Be,Kg]}],leading:[{leading:[o,...D()]}],"list-image":[{"list-image":["none",Be,Ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Be,Ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:[it,"from-font","auto",Be,Ro]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[it,"auto",Be,Ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Be,Ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Be,Ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Q()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ds,Be,Ie],radial:["",Be,Ie],conic:[Ds,Be,Ie]},wD,bD]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...W(),"hidden","none"]}],"divide-style":[{divide:[...W(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...W(),"none","hidden"]}],"outline-offset":[{"outline-offset":[it,Be,Ie]}],"outline-w":[{outline:["",it,Nu,Ro]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",p,sh,rh]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",m,sh,rh]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[it,Ro]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",g,sh,rh]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[it,Be,Ie]}],"mix-blend":[{"mix-blend":[...re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":re()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[it]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[Be,Ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[it]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Q()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Be,Ie]}],filter:[{filter:["","none",Be,Ie]}],blur:[{blur:fe()}],brightness:[{brightness:[it,Be,Ie]}],contrast:[{contrast:[it,Be,Ie]}],"drop-shadow":[{"drop-shadow":["","none",v,sh,rh]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",it,Be,Ie]}],"hue-rotate":[{"hue-rotate":[it,Be,Ie]}],invert:[{invert:["",it,Be,Ie]}],saturate:[{saturate:[it,Be,Ie]}],sepia:[{sepia:["",it,Be,Ie]}],"backdrop-filter":[{"backdrop-filter":["","none",Be,Ie]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[it,Be,Ie]}],"backdrop-contrast":[{"backdrop-contrast":[it,Be,Ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",it,Be,Ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[it,Be,Ie]}],"backdrop-invert":[{"backdrop-invert":["",it,Be,Ie]}],"backdrop-opacity":[{"backdrop-opacity":[it,Be,Ie]}],"backdrop-saturate":[{"backdrop-saturate":[it,Be,Ie]}],"backdrop-sepia":[{"backdrop-sepia":["",it,Be,Ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Be,Ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[it,"initial",Be,Ie]}],ease:[{ease:["linear","initial",E,Be,Ie]}],delay:[{delay:[it,Be,Ie]}],animate:[{animate:["none",k,Be,Ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Be,Ie]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[Be,Ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ee()}],"translate-x":[{"translate-x":Ee()}],"translate-y":[{"translate-y":Ee()}],"translate-z":[{"translate-z":Ee()}],"translate-none":["translate-none"],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Be,Ie]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",Be,Ie]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[it,Nu,Ro,Kg]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},kD=sD(RD);function $o(...n){return kD(z6(n))}const TD=new Map([["bold",S.createElement(S.Fragment,null,S.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",S.createElement(S.Fragment,null,S.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),S.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",S.createElement(S.Fragment,null,S.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",S.createElement(S.Fragment,null,S.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",S.createElement(S.Fragment,null,S.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",S.createElement(S.Fragment,null,S.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]),AD=new Map([["bold",S.createElement(S.Fragment,null,S.createElement("path",{d:"M248,160a40,40,0,1,0-52.64,37.94A28,28,0,0,1,168,220H144a28,28,0,0,1-28-28V154.9c31.73-5.78,56-34.09,56-67.73V40a12,12,0,0,0-12-12H136a12,12,0,0,0,0,24h12V87.17c0,24.4-19.47,44.52-43.41,44.83A44,44,0,0,1,60,88V52H72a12,12,0,0,0,0-24H48A12,12,0,0,0,36,40V88a68,68,0,0,0,56,66.93V192a52.06,52.06,0,0,0,52,52h24a52.06,52.06,0,0,0,51.61-45.72A40.08,40.08,0,0,0,248,160Zm-40,16a16,16,0,1,1,16-16A16,16,0,0,1,208,176Z"}))],["duotone",S.createElement(S.Fragment,null,S.createElement("path",{d:"M240,160a32,32,0,1,1-32-32A32,32,0,0,1,240,160Z",opacity:"0.2"}),S.createElement("path",{d:"M220,160a12,12,0,1,1-12-12A12,12,0,0,1,220,160Zm-4.55,39.29A48.08,48.08,0,0,1,168,240H144a48.05,48.05,0,0,1-48-48V151.49A64,64,0,0,1,40,88V40a8,8,0,0,1,8-8H72a8,8,0,0,1,0,16H56V88a48,48,0,0,0,48.64,48c26.11-.34,47.36-22.25,47.36-48.83V48H136a8,8,0,0,1,0-16h24a8,8,0,0,1,8,8V87.17c0,32.84-24.53,60.29-56,64.31V192a32,32,0,0,0,32,32h24a32.06,32.06,0,0,0,31.22-25,40,40,0,1,1,16.23.27ZM232,160a24,24,0,1,0-24,24A24,24,0,0,0,232,160Z"}))],["fill",S.createElement(S.Fragment,null,S.createElement("path",{d:"M240,160a32,32,0,1,0-39.93,31,8,8,0,0,0-.07,1,32,32,0,0,1-32,32H144a32,32,0,0,1-32-32V151.48c31.47-4,56-31.47,56-64.31V40a8,8,0,0,0-8-8H136a8,8,0,0,0,0,16h16V87.17c0,26.58-21.25,48.49-47.36,48.83A48,48,0,0,1,56,88V48H72a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V88a64,64,0,0,0,56,63.49V192a48.05,48.05,0,0,0,48,48h24a48.05,48.05,0,0,0,48-48,8,8,0,0,0-.07-1A32,32,0,0,0,240,160Zm-32,8a8,8,0,1,1,8-8A8,8,0,0,1,208,168Z"}))],["light",S.createElement(S.Fragment,null,S.createElement("path",{d:"M218,160a10,10,0,1,1-10-10A10,10,0,0,1,218,160Zm-4.35,37.58A46.05,46.05,0,0,1,168,238H144a46.06,46.06,0,0,1-46-46V149.71A62,62,0,0,1,42,88V40a6,6,0,0,1,6-6H72a6,6,0,0,1,0,12H54V88a50,50,0,0,0,50,50h.67c27.2-.36,49.33-23.16,49.33-50.83V46H136a6,6,0,0,1,0-12h24a6,6,0,0,1,6,6V87.17c0,32.43-24.68,59.44-56,62.52V192a34,34,0,0,0,34,34h24a34.05,34.05,0,0,0,33.56-28.56,38,38,0,1,1,12.09.14ZM234,160a26,26,0,1,0-26,26A26,26,0,0,0,234,160Z"}))],["regular",S.createElement(S.Fragment,null,S.createElement("path",{d:"M220,160a12,12,0,1,1-12-12A12,12,0,0,1,220,160Zm-4.55,39.29A48.08,48.08,0,0,1,168,240H144a48.05,48.05,0,0,1-48-48V151.49A64,64,0,0,1,40,88V40a8,8,0,0,1,8-8H72a8,8,0,0,1,0,16H56V88a48,48,0,0,0,48.64,48c26.11-.34,47.36-22.25,47.36-48.83V48H136a8,8,0,0,1,0-16h24a8,8,0,0,1,8,8V87.17c0,32.84-24.53,60.29-56,64.31V192a32,32,0,0,0,32,32h24a32.06,32.06,0,0,0,31.22-25,40,40,0,1,1,16.23.27ZM232,160a24,24,0,1,0-24,24A24,24,0,0,0,232,160Z"}))],["thin",S.createElement(S.Fragment,null,S.createElement("path",{d:"M216,160a8,8,0,1,1-8-8A8,8,0,0,1,216,160Zm-4.17,35.79A44.06,44.06,0,0,1,168,236H144a44.05,44.05,0,0,1-44-44V147.85A60,60,0,0,1,44,88V40a4,4,0,0,1,4-4H72a4,4,0,0,1,0,8H52V88a52,52,0,0,0,52.69,52C133,139.63,156,115.93,156,87.17V44H136a4,4,0,0,1,0-8h24a4,4,0,0,1,4,4V87.17c0,32-24.84,58.59-56,60.69V192a36,36,0,0,0,36,36h24a36.05,36.05,0,0,0,35.8-32.25,36,36,0,1,1,8,0ZM236,160a28,28,0,1,0-28,28A28,28,0,0,0,236,160Z"}))]]),OD=new Map([["bold",S.createElement(S.Fragment,null,S.createElement("path",{d:"M224,44H32A12,12,0,0,0,20,56V192a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A12,12,0,0,0,224,44ZM44,116H76v24H44Zm56,0H212v24H100ZM212,68V92H44V68ZM44,164H76v24H44Zm56,24V164H212v24Z"}))],["duotone",S.createElement(S.Fragment,null,S.createElement("path",{d:"M88,104v96H32V104Z",opacity:"0.2"}),S.createElement("path",{d:"M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM40,112H80v32H40Zm56,0H216v32H96ZM216,64V96H40V64ZM40,160H80v32H40Zm176,32H96V160H216v32Z"}))],["fill",S.createElement(S.Fragment,null,S.createElement("path",{d:"M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM40,112H80v32H40Zm56,0H216v32H96ZM40,160H80v32H40Zm176,32H96V160H216v32Z"}))],["light",S.createElement(S.Fragment,null,S.createElement("path",{d:"M224,50H32a6,6,0,0,0-6,6V192a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A6,6,0,0,0,224,50ZM38,110H82v36H38Zm56,0H218v36H94ZM218,62V98H38V62ZM38,192V158H82v36H40A2,2,0,0,1,38,192Zm178,2H94V158H218v34A2,2,0,0,1,216,194Z"}))],["regular",S.createElement(S.Fragment,null,S.createElement("path",{d:"M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM40,112H80v32H40Zm56,0H216v32H96ZM216,64V96H40V64ZM40,160H80v32H40Zm176,32H96V160H216v32Z"}))],["thin",S.createElement(S.Fragment,null,S.createElement("path",{d:"M224,52H32a4,4,0,0,0-4,4V192a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A4,4,0,0,0,224,52ZM36,108H84v40H36Zm56,0H220v40H92ZM220,60v40H36V60ZM36,192V156H84v40H40A4,4,0,0,1,36,192Zm180,4H92V156H220v36A4,4,0,0,1,216,196Z"}))]]),MD=S.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),Fd=S.forwardRef((n,e)=>{const{alt:t,color:i,size:r,weight:o,mirrored:a,children:u,weights:f,...d}=n,{color:p="currentColor",size:m,weight:g="regular",mirrored:v=!1,...x}=S.useContext(MD);return S.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:r??m,height:r??m,fill:i??p,viewBox:"0 0 256 256",transform:a||v?"scale(-1, 1)":void 0,...x,...d},!!t&&S.createElement("title",null,t),u,f.get(o??g))});Fd.displayName="IconBase";const sR=S.forwardRef((n,e)=>S.createElement(Fd,{ref:e,...n,weights:TD}));sR.displayName="CaretRightIcon";const oR=S.forwardRef((n,e)=>S.createElement(Fd,{ref:e,...n,weights:AD}));oR.displayName="StethoscopeIcon";const lR=S.forwardRef((n,e)=>S.createElement(Fd,{ref:e,...n,weights:OD}));lR.displayName="TableIcon";function $d(){return typeof window<"u"}function eo(n){return nv(n)?(n.nodeName||"").toLowerCase():"#document"}function Yt(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function Rr(n){var e;return(e=(nv(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function nv(n){return $d()?n instanceof Node||n instanceof Yt(n).Node:!1}function yt(n){return $d()?n instanceof Element||n instanceof Yt(n).Element:!1}function _t(n){return $d()?n instanceof HTMLElement||n instanceof Yt(n).HTMLElement:!1}function U0(n){return!$d()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Yt(n).ShadowRoot}const DD=new Set(["inline","contents"]);function Jo(n){const{overflow:e,overflowX:t,overflowY:i,display:r}=ti(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!DD.has(r)}const ND=new Set(["table","td","th"]);function LD(n){return ND.has(eo(n))}const ID=[":popover-open",":modal"];function Kd(n){return ID.some(e=>{try{return n.matches(e)}catch{return!1}})}const BD=["transform","translate","scale","rotate","perspective"],_D=["transform","translate","scale","rotate","perspective","filter"],PD=["paint","layout","strict","content"];function iv(n){const e=Yd(),t=yt(n)?ti(n):n;return BD.some(i=>t[i]?t[i]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||_D.some(i=>(t.willChange||"").includes(i))||PD.some(i=>(t.contain||"").includes(i))}function zD(n){let e=Er(n);for(;_t(e)&&!Sr(e);){if(iv(e))return e;if(Kd(e))return null;e=Er(e)}return null}function Yd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const HD=new Set(["html","body","#document"]);function Sr(n){return HD.has(eo(n))}function ti(n){return Yt(n).getComputedStyle(n)}function Gd(n){return yt(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Er(n){if(eo(n)==="html")return n;const e=n.assignedSlot||n.parentNode||U0(n)&&n.host||Rr(n);return U0(e)?e.host:e}function aR(n){const e=Er(n);return Sr(e)?n.ownerDocument?n.ownerDocument.body:n.body:_t(e)&&Jo(e)?e:aR(e)}function js(n,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const r=aR(n),o=r===((i=n.ownerDocument)==null?void 0:i.body),a=Yt(r);if(o){const u=j0(a);return e.concat(a,a.visualViewport||[],Jo(r)?r:[],u&&t?js(u):[])}return e.concat(r,js(r,[],t))}function j0(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}const VD=["top","right","bottom","left"],pa=Math.min,gi=Math.max,ma=Math.round,Ql=Math.floor,wr=n=>({x:n,y:n}),UD={left:"right",right:"left",bottom:"top",top:"bottom"},jD={start:"end",end:"start"};function q0(n,e,t){return gi(n,pa(e,t))}function ts(n,e){return typeof n=="function"?n(e):n}function Wn(n){return n.split("-")[0]}function to(n){return n.split("-")[1]}function rv(n){return n==="x"?"y":"x"}function sv(n){return n==="y"?"height":"width"}const qD=new Set(["top","bottom"]);function Ii(n){return qD.has(Wn(n))?"y":"x"}function ov(n){return rv(Ii(n))}function FD(n,e,t){t===void 0&&(t=!1);const i=to(n),r=ov(n),o=sv(r);let a=r==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(a=od(a)),[a,od(a)]}function $D(n){const e=od(n);return[F0(n),e,F0(e)]}function F0(n){return n.replace(/start|end/g,e=>jD[e])}const Qw=["left","right"],Xw=["right","left"],KD=["top","bottom"],YD=["bottom","top"];function GD(n,e,t){switch(n){case"top":case"bottom":return t?e?Xw:Qw:e?Qw:Xw;case"left":case"right":return e?KD:YD;default:return[]}}function QD(n,e,t,i){const r=to(n);let o=GD(Wn(n),t==="start",i);return r&&(o=o.map(a=>a+"-"+r),e&&(o=o.concat(o.map(F0)))),o}function od(n){return n.replace(/left|right|bottom|top/g,e=>UD[e])}function XD(n){return{top:0,right:0,bottom:0,left:0,...n}}function uR(n){return typeof n!="number"?XD(n):{top:n,right:n,bottom:n,left:n}}function ld(n){const{x:e,y:t,width:i,height:r}=n;return{width:i,height:r,top:t,left:e,right:e+i,bottom:t+r,x:e,y:t}}function Ww(n,e,t){let{reference:i,floating:r}=n;const o=Ii(e),a=ov(e),u=sv(a),f=Wn(e),d=o==="y",p=i.x+i.width/2-r.width/2,m=i.y+i.height/2-r.height/2,g=i[u]/2-r[u]/2;let v;switch(f){case"top":v={x:p,y:i.y-r.height};break;case"bottom":v={x:p,y:i.y+i.height};break;case"right":v={x:i.x+i.width,y:m};break;case"left":v={x:i.x-r.width,y:m};break;default:v={x:i.x,y:i.y}}switch(to(e)){case"start":v[a]-=g*(t&&d?-1:1);break;case"end":v[a]+=g*(t&&d?-1:1);break}return v}const WD=async(n,e,t)=>{const{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:a}=t,u=o.filter(Boolean),f=await(a.isRTL==null?void 0:a.isRTL(e));let d=await a.getElementRects({reference:n,floating:e,strategy:r}),{x:p,y:m}=Ww(d,i,f),g=i,v={},x=0;for(let w=0;w<u.length;w++){const{name:C,fn:E}=u[w],{x:k,y:T,data:A,reset:O}=await E({x:p,y:m,initialPlacement:i,placement:g,strategy:r,middlewareData:v,rects:d,platform:a,elements:{reference:n,floating:e}});p=k??p,m=T??m,v={...v,[C]:{...v[C],...A}},O&&x<=50&&(x++,typeof O=="object"&&(O.placement&&(g=O.placement),O.rects&&(d=O.rects===!0?await a.getElementRects({reference:n,floating:e,strategy:r}):O.rects),{x:p,y:m}=Ww(d,g,f)),w=-1)}return{x:p,y:m,placement:g,strategy:r,middlewareData:v}};async function ac(n,e){var t;e===void 0&&(e={});const{x:i,y:r,platform:o,rects:a,elements:u,strategy:f}=n,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:g=!1,padding:v=0}=ts(e,n),x=uR(v),w=u[g?m==="floating"?"reference":"floating":m],C=ld(await o.getClippingRect({element:(t=await(o.isElement==null?void 0:o.isElement(w)))==null||t?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:d,rootBoundary:p,strategy:f})),E=m==="floating"?{x:i,y:r,width:a.floating.width,height:a.floating.height}:a.reference,k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),T=await(o.isElement==null?void 0:o.isElement(k))?await(o.getScale==null?void 0:o.getScale(k))||{x:1,y:1}:{x:1,y:1},A=ld(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:E,offsetParent:k,strategy:f}):E);return{top:(C.top-A.top+x.top)/T.y,bottom:(A.bottom-C.bottom+x.bottom)/T.y,left:(C.left-A.left+x.left)/T.x,right:(A.right-C.right+x.right)/T.x}}const ZD=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,i;const{placement:r,middlewareData:o,rects:a,initialPlacement:u,platform:f,elements:d}=e,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:w=!0,...C}=ts(n,e);if((t=o.arrow)!=null&&t.alignmentOffset)return{};const E=Wn(r),k=Ii(u),T=Wn(u)===u,A=await(f.isRTL==null?void 0:f.isRTL(d.floating)),O=g||(T||!w?[od(u)]:$D(u)),N=x!=="none";!g&&N&&O.push(...QD(u,w,x,A));const M=[u,...O],D=await ac(e,C),V=[];let U=((i=o.flip)==null?void 0:i.overflows)||[];if(p&&V.push(D[E]),m){const P=FD(r,a,A);V.push(D[P[0]],D[P[1]])}if(U=[...U,{placement:r,overflows:V}],!V.every(P=>P<=0)){var j,I;const P=(((j=o.flip)==null?void 0:j.index)||0)+1,$=M[P];if($&&(!(m==="alignment"&&k!==Ii($))||U.every(H=>Ii(H.placement)===k?H.overflows[0]>0:!0)))return{data:{index:P,overflows:U},reset:{placement:$}};let _=(I=U.filter(H=>H.overflows[0]<=0).sort((H,z)=>H.overflows[1]-z.overflows[1])[0])==null?void 0:I.placement;if(!_)switch(v){case"bestFit":{var q;const H=(q=U.filter(z=>{if(N){const Q=Ii(z.placement);return Q===k||Q==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(Q=>Q>0).reduce((Q,ee)=>Q+ee,0)]).sort((z,Q)=>z[1]-Q[1])[0])==null?void 0:q[0];H&&(_=H);break}case"initialPlacement":_=u;break}if(r!==_)return{reset:{placement:_}}}return{}}}};function Zw(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function Jw(n){return VD.some(e=>n[e]>=0)}const JD=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t}=e,{strategy:i="referenceHidden",...r}=ts(n,e);switch(i){case"referenceHidden":{const o=await ac(e,{...r,elementContext:"reference"}),a=Zw(o,t.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Jw(a)}}}case"escaped":{const o=await ac(e,{...r,altBoundary:!0}),a=Zw(o,t.floating);return{data:{escapedOffsets:a,escaped:Jw(a)}}}default:return{}}}}},cR=new Set(["left","top"]);async function eN(n,e){const{placement:t,platform:i,elements:r}=n,o=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=Wn(t),u=to(t),f=Ii(t)==="y",d=cR.has(a)?-1:1,p=o&&f?-1:1,m=ts(e,n);let{mainAxis:g,crossAxis:v,alignmentAxis:x}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof x=="number"&&(v=u==="end"?x*-1:x),f?{x:v*p,y:g*d}:{x:g*d,y:v*p}}const tN=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,i;const{x:r,y:o,placement:a,middlewareData:u}=e,f=await eN(e,n);return a===((t=u.offset)==null?void 0:t.placement)&&(i=u.arrow)!=null&&i.alignmentOffset?{}:{x:r+f.x,y:o+f.y,data:{...f,placement:a}}}}},nN=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:i,placement:r}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:u={fn:C=>{let{x:E,y:k}=C;return{x:E,y:k}}},...f}=ts(n,e),d={x:t,y:i},p=await ac(e,f),m=Ii(Wn(r)),g=rv(m);let v=d[g],x=d[m];if(o){const C=g==="y"?"top":"left",E=g==="y"?"bottom":"right",k=v+p[C],T=v-p[E];v=q0(k,v,T)}if(a){const C=m==="y"?"top":"left",E=m==="y"?"bottom":"right",k=x+p[C],T=x-p[E];x=q0(k,x,T)}const w=u.fn({...e,[g]:v,[m]:x});return{...w,data:{x:w.x-t,y:w.y-i,enabled:{[g]:o,[m]:a}}}}}},iN=function(n){return n===void 0&&(n={}),{options:n,fn(e){const{x:t,y:i,placement:r,rects:o,middlewareData:a}=e,{offset:u=0,mainAxis:f=!0,crossAxis:d=!0}=ts(n,e),p={x:t,y:i},m=Ii(r),g=rv(m);let v=p[g],x=p[m];const w=ts(u,e),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(f){const T=g==="y"?"height":"width",A=o.reference[g]-o.floating[T]+C.mainAxis,O=o.reference[g]+o.reference[T]-C.mainAxis;v<A?v=A:v>O&&(v=O)}if(d){var E,k;const T=g==="y"?"width":"height",A=cR.has(Wn(r)),O=o.reference[m]-o.floating[T]+(A&&((E=a.offset)==null?void 0:E[m])||0)+(A?0:C.crossAxis),N=o.reference[m]+o.reference[T]+(A?0:((k=a.offset)==null?void 0:k[m])||0)-(A?C.crossAxis:0);x<O?x=O:x>N&&(x=N)}return{[g]:v,[m]:x}}}},rN=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,i;const{placement:r,rects:o,platform:a,elements:u}=e,{apply:f=()=>{},...d}=ts(n,e),p=await ac(e,d),m=Wn(r),g=to(r),v=Ii(r)==="y",{width:x,height:w}=o.floating;let C,E;m==="top"||m==="bottom"?(C=m,E=g===(await(a.isRTL==null?void 0:a.isRTL(u.floating))?"start":"end")?"left":"right"):(E=m,C=g==="end"?"top":"bottom");const k=w-p.top-p.bottom,T=x-p.left-p.right,A=pa(w-p[C],k),O=pa(x-p[E],T),N=!e.middlewareData.shift;let M=A,D=O;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(D=T),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(M=k),N&&!g){const U=gi(p.left,0),j=gi(p.right,0),I=gi(p.top,0),q=gi(p.bottom,0);v?D=x-2*(U!==0||j!==0?U+j:gi(p.left,p.right)):M=w-2*(I!==0||q!==0?I+q:gi(p.top,p.bottom))}await f({...e,availableWidth:D,availableHeight:M});const V=await a.getDimensions(u.floating);return x!==V.width||w!==V.height?{reset:{rects:!0}}:{}}}};function fR(n){const e=ti(n);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=_t(n),o=r?n.offsetWidth:t,a=r?n.offsetHeight:i,u=ma(t)!==o||ma(i)!==a;return u&&(t=o,i=a),{width:t,height:i,$:u}}function lv(n){return yt(n)?n:n.contextElement}function na(n){const e=lv(n);if(!_t(e))return wr(1);const t=e.getBoundingClientRect(),{width:i,height:r,$:o}=fR(e);let a=(o?ma(t.width):t.width)/i,u=(o?ma(t.height):t.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const sN=wr(0);function hR(n){const e=Yt(n);return!Yd()||!e.visualViewport?sN:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function oN(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==Yt(n)?!1:e}function Ko(n,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const r=n.getBoundingClientRect(),o=lv(n);let a=wr(1);e&&(i?yt(i)&&(a=na(i)):a=na(n));const u=oN(o,t,i)?hR(o):wr(0);let f=(r.left+u.x)/a.x,d=(r.top+u.y)/a.y,p=r.width/a.x,m=r.height/a.y;if(o){const g=Yt(o),v=i&&yt(i)?Yt(i):i;let x=g,w=j0(x);for(;w&&i&&v!==x;){const C=na(w),E=w.getBoundingClientRect(),k=ti(w),T=E.left+(w.clientLeft+parseFloat(k.paddingLeft))*C.x,A=E.top+(w.clientTop+parseFloat(k.paddingTop))*C.y;f*=C.x,d*=C.y,p*=C.x,m*=C.y,f+=T,d+=A,x=Yt(w),w=j0(x)}}return ld({width:p,height:m,x:f,y:d})}function Qd(n,e){const t=Gd(n).scrollLeft;return e?e.left+t:Ko(Rr(n)).left+t}function dR(n,e){const t=n.getBoundingClientRect(),i=t.left+e.scrollLeft-Qd(n,t),r=t.top+e.scrollTop;return{x:i,y:r}}function lN(n){let{elements:e,rect:t,offsetParent:i,strategy:r}=n;const o=r==="fixed",a=Rr(i),u=e?Kd(e.floating):!1;if(i===a||u&&o)return t;let f={scrollLeft:0,scrollTop:0},d=wr(1);const p=wr(0),m=_t(i);if((m||!m&&!o)&&((eo(i)!=="body"||Jo(a))&&(f=Gd(i)),_t(i))){const v=Ko(i);d=na(i),p.x=v.x+i.clientLeft,p.y=v.y+i.clientTop}const g=a&&!m&&!o?dR(a,f):wr(0);return{width:t.width*d.x,height:t.height*d.y,x:t.x*d.x-f.scrollLeft*d.x+p.x+g.x,y:t.y*d.y-f.scrollTop*d.y+p.y+g.y}}function aN(n){return Array.from(n.getClientRects())}function uN(n){const e=Rr(n),t=Gd(n),i=n.ownerDocument.body,r=gi(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=gi(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let a=-t.scrollLeft+Qd(n);const u=-t.scrollTop;return ti(i).direction==="rtl"&&(a+=gi(e.clientWidth,i.clientWidth)-r),{width:r,height:o,x:a,y:u}}const e2=25;function cN(n,e){const t=Yt(n),i=Rr(n),r=t.visualViewport;let o=i.clientWidth,a=i.clientHeight,u=0,f=0;if(r){o=r.width,a=r.height;const p=Yd();(!p||p&&e==="fixed")&&(u=r.offsetLeft,f=r.offsetTop)}const d=Qd(i);if(d<=0){const p=i.ownerDocument,m=p.body,g=getComputedStyle(m),v=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,x=Math.abs(i.clientWidth-m.clientWidth-v);x<=e2&&(o-=x)}else d<=e2&&(o+=d);return{width:o,height:a,x:u,y:f}}const fN=new Set(["absolute","fixed"]);function hN(n,e){const t=Ko(n,!0,e==="fixed"),i=t.top+n.clientTop,r=t.left+n.clientLeft,o=_t(n)?na(n):wr(1),a=n.clientWidth*o.x,u=n.clientHeight*o.y,f=r*o.x,d=i*o.y;return{width:a,height:u,x:f,y:d}}function t2(n,e,t){let i;if(e==="viewport")i=cN(n,t);else if(e==="document")i=uN(Rr(n));else if(yt(e))i=hN(e,t);else{const r=hR(n);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return ld(i)}function pR(n,e){const t=Er(n);return t===e||!yt(t)||Sr(t)?!1:ti(t).position==="fixed"||pR(t,e)}function dN(n,e){const t=e.get(n);if(t)return t;let i=js(n,[],!1).filter(u=>yt(u)&&eo(u)!=="body"),r=null;const o=ti(n).position==="fixed";let a=o?Er(n):n;for(;yt(a)&&!Sr(a);){const u=ti(a),f=iv(a);!f&&u.position==="fixed"&&(r=null),(o?!f&&!r:!f&&u.position==="static"&&r&&fN.has(r.position)||Jo(a)&&!f&&pR(n,a))?i=i.filter(d=>d!==a):r=u,a=Er(a)}return e.set(n,i),i}function pN(n){let{element:e,boundary:t,rootBoundary:i,strategy:r}=n;const o=[...t==="clippingAncestors"?Kd(e)?[]:dN(e,this._c):[].concat(t),i],a=o[0],u=o.reduce((f,d)=>{const p=t2(e,d,r);return f.top=gi(p.top,f.top),f.right=pa(p.right,f.right),f.bottom=pa(p.bottom,f.bottom),f.left=gi(p.left,f.left),f},t2(e,a,r));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function mN(n){const{width:e,height:t}=fR(n);return{width:e,height:t}}function gN(n,e,t){const i=_t(e),r=Rr(e),o=t==="fixed",a=Ko(n,!0,o,e);let u={scrollLeft:0,scrollTop:0};const f=wr(0);function d(){f.x=Qd(r)}if(i||!i&&!o)if((eo(e)!=="body"||Jo(r))&&(u=Gd(e)),i){const v=Ko(e,!0,o,e);f.x=v.x+e.clientLeft,f.y=v.y+e.clientTop}else r&&d();o&&!i&&r&&d();const p=r&&!i&&!o?dR(r,u):wr(0),m=a.left+u.scrollLeft-f.x-p.x,g=a.top+u.scrollTop-f.y-p.y;return{x:m,y:g,width:a.width,height:a.height}}function Yg(n){return ti(n).position==="static"}function n2(n,e){if(!_t(n)||ti(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return Rr(n)===t&&(t=t.ownerDocument.body),t}function mR(n,e){const t=Yt(n);if(Kd(n))return t;if(!_t(n)){let r=Er(n);for(;r&&!Sr(r);){if(yt(r)&&!Yg(r))return r;r=Er(r)}return t}let i=n2(n,e);for(;i&&LD(i)&&Yg(i);)i=n2(i,e);return i&&Sr(i)&&Yg(i)&&!iv(i)?t:i||zD(n)||t}const yN=async function(n){const e=this.getOffsetParent||mR,t=this.getDimensions,i=await t(n.floating);return{reference:gN(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function vN(n){return ti(n).direction==="rtl"}const bN={convertOffsetParentRelativeRectToViewportRelativeRect:lN,getDocumentElement:Rr,getClippingRect:pN,getOffsetParent:mR,getElementRects:yN,getClientRects:aN,getDimensions:mN,getScale:na,isElement:yt,isRTL:vN};function gR(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function xN(n,e){let t=null,i;const r=Rr(n);function o(){var u;clearTimeout(i),(u=t)==null||u.disconnect(),t=null}function a(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),o();const d=n.getBoundingClientRect(),{left:p,top:m,width:g,height:v}=d;if(u||e(),!g||!v)return;const x=Ql(m),w=Ql(r.clientWidth-(p+g)),C=Ql(r.clientHeight-(m+v)),E=Ql(p),k={rootMargin:-x+"px "+-w+"px "+-C+"px "+-E+"px",threshold:gi(0,pa(1,f))||1};let T=!0;function A(O){const N=O[0].intersectionRatio;if(N!==f){if(!T)return a();N?a(!1,N):i=setTimeout(()=>{a(!1,1e-7)},1e3)}N===1&&!gR(d,n.getBoundingClientRect())&&a(),T=!1}try{t=new IntersectionObserver(A,{...k,root:r.ownerDocument})}catch{t=new IntersectionObserver(A,k)}t.observe(n)}return a(!0),o}function i2(n,e,t,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=i,d=lv(n),p=r||o?[...d?js(d):[],...js(e)]:[];p.forEach(E=>{r&&E.addEventListener("scroll",t,{passive:!0}),o&&E.addEventListener("resize",t)});const m=d&&u?xN(d,t):null;let g=-1,v=null;a&&(v=new ResizeObserver(E=>{let[k]=E;k&&k.target===d&&v&&(v.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var T;(T=v)==null||T.observe(e)})),t()}),d&&!f&&v.observe(d),v.observe(e));let x,w=f?Ko(n):null;f&&C();function C(){const E=Ko(n);w&&!gR(w,E)&&t(),w=E,x=requestAnimationFrame(C)}return t(),()=>{var E;p.forEach(k=>{r&&k.removeEventListener("scroll",t),o&&k.removeEventListener("resize",t)}),m?.(),(E=v)==null||E.disconnect(),v=null,f&&cancelAnimationFrame(x)}}const SN=tN,wN=nN,EN=ZD,CN=rN,RN=JD,kN=iN,TN=(n,e,t)=>{const i=new Map,r={platform:bN,...t},o={...r.platform,_c:i};return WD(n,e,{...r,platform:o})};var AN=typeof document<"u",ON=function(){},Hh=AN?S.useLayoutEffect:ON;function ad(n,e){if(n===e)return!0;if(typeof n!=typeof e)return!1;if(typeof n=="function"&&n.toString()===e.toString())return!0;let t,i,r;if(n&&e&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==e.length)return!1;for(i=t;i--!==0;)if(!ad(n[i],e[i]))return!1;return!0}if(r=Object.keys(n),t=r.length,t!==Object.keys(e).length)return!1;for(i=t;i--!==0;)if(!{}.hasOwnProperty.call(e,r[i]))return!1;for(i=t;i--!==0;){const o=r[i];if(!(o==="_owner"&&n.$$typeof)&&!ad(n[o],e[o]))return!1}return!0}return n!==n&&e!==e}function yR(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function r2(n,e){const t=yR(n);return Math.round(e*t)/t}function Gg(n){const e=S.useRef(n);return Hh(()=>{e.current=n}),e}function MN(n){n===void 0&&(n={});const{placement:e="bottom",strategy:t="absolute",middleware:i=[],platform:r,elements:{reference:o,floating:a}={},transform:u=!0,whileElementsMounted:f,open:d}=n,[p,m]=S.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[g,v]=S.useState(i);ad(g,i)||v(i);const[x,w]=S.useState(null),[C,E]=S.useState(null),k=S.useCallback(z=>{z!==N.current&&(N.current=z,w(z))},[]),T=S.useCallback(z=>{z!==M.current&&(M.current=z,E(z))},[]),A=o||x,O=a||C,N=S.useRef(null),M=S.useRef(null),D=S.useRef(p),V=f!=null,U=Gg(f),j=Gg(r),I=Gg(d),q=S.useCallback(()=>{if(!N.current||!M.current)return;const z={placement:e,strategy:t,middleware:g};j.current&&(z.platform=j.current),TN(N.current,M.current,z).then(Q=>{const ee={...Q,isPositioned:I.current!==!1};P.current&&!ad(D.current,ee)&&(D.current=ee,ei.flushSync(()=>{m(ee)}))})},[g,e,t,j,I]);Hh(()=>{d===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,m(z=>({...z,isPositioned:!1})))},[d]);const P=S.useRef(!1);Hh(()=>(P.current=!0,()=>{P.current=!1}),[]),Hh(()=>{if(A&&(N.current=A),O&&(M.current=O),A&&O){if(U.current)return U.current(A,O,q);q()}},[A,O,q,U,V]);const $=S.useMemo(()=>({reference:N,floating:M,setReference:k,setFloating:T}),[k,T]),_=S.useMemo(()=>({reference:A,floating:O}),[A,O]),H=S.useMemo(()=>{const z={position:t,left:0,top:0};if(!_.floating)return z;const Q=r2(_.floating,p.x),ee=r2(_.floating,p.y);return u?{...z,transform:"translate("+Q+"px, "+ee+"px)",...yR(_.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:Q,top:ee}},[t,u,_.floating,p.x,p.y]);return S.useMemo(()=>({...p,update:q,refs:$,elements:_,floatingStyles:H}),[p,q,$,_,H])}const DN=(n,e)=>({...SN(n),options:[n,e]}),NN=(n,e)=>({...wN(n),options:[n,e]}),LN=(n,e)=>({...kN(n),options:[n,e]}),IN=(n,e)=>({...EN(n),options:[n,e]}),BN=(n,e)=>({...CN(n),options:[n,e]}),_N=(n,e)=>({...RN(n),options:[n,e]});var PN=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],ud=PN.join(","),vR=typeof Element>"u",ga=vR?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,cd=!vR&&Element.prototype.getRootNode?function(n){var e;return n==null||(e=n.getRootNode)===null||e===void 0?void 0:e.call(n)}:function(n){return n?.ownerDocument},uc=function(n,e){var t;e===void 0&&(e=!0);var i=n==null||(t=n.getAttribute)===null||t===void 0?void 0:t.call(n,"inert"),r=i===""||i==="true",o=r||e&&n&&uc(n.parentNode);return o},zN=function(n){var e,t=n==null||(e=n.getAttribute)===null||e===void 0?void 0:e.call(n,"contenteditable");return t===""||t==="true"},bR=function(n,e,t){if(uc(n))return[];var i=Array.prototype.slice.apply(n.querySelectorAll(ud));return e&&ga.call(n,ud)&&i.unshift(n),i=i.filter(t),i},fd=function(n,e,t){for(var i=[],r=Array.from(n);r.length;){var o=r.shift();if(!uc(o,!1))if(o.tagName==="SLOT"){var a=o.assignedElements(),u=a.length?a:o.children,f=fd(u,!0,t);t.flatten?i.push.apply(i,f):i.push({scopeParent:o,candidates:f})}else{var d=ga.call(o,ud);d&&t.filter(o)&&(e||!n.includes(o))&&i.push(o);var p=o.shadowRoot||typeof t.getShadowRoot=="function"&&t.getShadowRoot(o),m=!uc(p,!1)&&(!t.shadowRootFilter||t.shadowRootFilter(o));if(p&&m){var g=fd(p===!0?o.children:p.children,!0,t);t.flatten?i.push.apply(i,g):i.push({scopeParent:o,candidates:g})}else r.unshift.apply(r,o.children)}}return i},xR=function(n){return!isNaN(parseInt(n.getAttribute("tabindex"),10))},SR=function(n){if(!n)throw new Error("No node provided");return n.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||zN(n))&&!xR(n)?0:n.tabIndex},HN=function(n,e){var t=SR(n);return t<0&&e&&!xR(n)?0:t},VN=function(n,e){return n.tabIndex===e.tabIndex?n.documentOrder-e.documentOrder:n.tabIndex-e.tabIndex},wR=function(n){return n.tagName==="INPUT"},UN=function(n){return wR(n)&&n.type==="hidden"},jN=function(n){var e=n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(t){return t.tagName==="SUMMARY"});return e},qN=function(n,e){for(var t=0;t<n.length;t++)if(n[t].checked&&n[t].form===e)return n[t]},FN=function(n){if(!n.name)return!0;var e=n.form||cd(n),t=function(o){return e.querySelectorAll('input[type="radio"][name="'+o+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=t(window.CSS.escape(n.name));else try{i=t(n.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var r=qN(i,n.form);return!r||r===n},$N=function(n){return wR(n)&&n.type==="radio"},KN=function(n){return $N(n)&&!FN(n)},YN=function(n){var e,t=n&&cd(n),i=(e=t)===null||e===void 0?void 0:e.host,r=!1;if(t&&t!==n){var o,a,u;for(r=!!((o=i)!==null&&o!==void 0&&(a=o.ownerDocument)!==null&&a!==void 0&&a.contains(i)||n!=null&&(u=n.ownerDocument)!==null&&u!==void 0&&u.contains(n));!r&&i;){var f,d,p;t=cd(i),i=(f=t)===null||f===void 0?void 0:f.host,r=!!((d=i)!==null&&d!==void 0&&(p=d.ownerDocument)!==null&&p!==void 0&&p.contains(i))}}return r},s2=function(n){var e=n.getBoundingClientRect(),t=e.width,i=e.height;return t===0&&i===0},GN=function(n,e){var t=e.displayCheck,i=e.getShadowRoot;if(t==="full-native"&&"checkVisibility"in n){var r=n.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!r}if(getComputedStyle(n).visibility==="hidden")return!0;var o=ga.call(n,"details>summary:first-of-type"),a=o?n.parentElement:n;if(ga.call(a,"details:not([open]) *"))return!0;if(!t||t==="full"||t==="full-native"||t==="legacy-full"){if(typeof i=="function"){for(var u=n;n;){var f=n.parentElement,d=cd(n);if(f&&!f.shadowRoot&&i(f)===!0)return s2(n);n.assignedSlot?n=n.assignedSlot:!f&&d!==n.ownerDocument?n=d.host:n=f}n=u}if(YN(n))return!n.getClientRects().length;if(t!=="legacy-full")return!0}else if(t==="non-zero-area")return s2(n);return!1},QN=function(n){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName))for(var e=n.parentElement;e;){if(e.tagName==="FIELDSET"&&e.disabled){for(var t=0;t<e.children.length;t++){var i=e.children.item(t);if(i.tagName==="LEGEND")return ga.call(e,"fieldset[disabled] *")?!0:!i.contains(n)}return!0}e=e.parentElement}return!1},$0=function(n,e){return!(e.disabled||uc(e)||UN(e)||GN(e,n)||jN(e)||QN(e))},K0=function(n,e){return!(KN(e)||SR(e)<0||!$0(n,e))},XN=function(n){var e=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},ER=function(n){var e=[],t=[];return n.forEach(function(i,r){var o=!!i.scopeParent,a=o?i.scopeParent:i,u=HN(a,o),f=o?ER(i.candidates):a;u===0?o?e.push.apply(e,f):e.push(a):t.push({documentOrder:r,tabIndex:u,item:i,isScope:o,content:f})}),t.sort(VN).reduce(function(i,r){return r.isScope?i.push.apply(i,r.content):i.push(r.content),i},[]).concat(e)},Ac=function(n,e){e=e||{};var t;return e.getShadowRoot?t=fd([n],e.includeContainer,{filter:K0.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:XN}):t=bR(n,e.includeContainer,K0.bind(null,e)),ER(t)},WN=function(n,e){e=e||{};var t;return e.getShadowRoot?t=fd([n],e.includeContainer,{filter:$0.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):t=bR(n,e.includeContainer,$0.bind(null,e)),t},CR=function(n,e){if(e=e||{},!n)throw new Error("No node provided");return ga.call(n,ud)===!1?!1:K0(e,n)},hd=Symbol("NOT_FOUND");function ZN(n,e=`expected a function, instead received ${typeof n}`){if(typeof n!="function")throw new TypeError(e)}function JN(n,e=`expected an object, instead received ${typeof n}`){if(typeof n!="object")throw new TypeError(e)}function e8(n,e="expected all items to be functions, instead received the following types: "){if(!n.every(t=>typeof t=="function")){const t=n.map(i=>typeof i=="function"?`function ${i.name||"unnamed"}()`:typeof i).join(", ");throw new TypeError(`${e}[${t}]`)}}var o2=n=>Array.isArray(n)?n:[n];function t8(n){const e=Array.isArray(n[0])?n[0]:n;return e8(e,"createSelector expects all input-selectors to be functions, but received the following types: "),e}function n8(n,e){const t=[],{length:i}=n;for(let r=0;r<i;r++)t.push(n[r].apply(null,e));return t}function i8(n){let e;return{get(t){return e&&n(e.key,t)?e.value:hd},put(t,i){e={key:t,value:i}},getEntries(){return e?[e]:[]},clear(){e=void 0}}}function r8(n,e){let t=[];function i(u){const f=t.findIndex(d=>e(u,d.key));if(f>-1){const d=t[f];return f>0&&(t.splice(f,1),t.unshift(d)),d.value}return hd}function r(u,f){i(u)===hd&&(t.unshift({key:u,value:f}),t.length>n&&t.pop())}function o(){return t}function a(){t=[]}return{get:i,put:r,getEntries:o,clear:a}}var s8=(n,e)=>n===e;function o8(n){return function(e,t){if(e===null||t===null||e.length!==t.length)return!1;const{length:i}=e;for(let r=0;r<i;r++)if(!n(e[r],t[r]))return!1;return!0}}function l8(n,e){const t=typeof e=="object"?e:{equalityCheck:e},{equalityCheck:i=s8,maxSize:r=1,resultEqualityCheck:o}=t,a=o8(i);let u=0;const f=r<=1?i8(a):r8(r,a);function d(){let p=f.get(arguments);if(p===hd){if(p=n.apply(null,arguments),u++,o){const m=f.getEntries().find(g=>o(g.value,p));m&&(p=m.value,u!==0&&u--)}f.put(arguments,p)}return p}return d.clearCache=()=>{f.clear(),d.resetResultsCount()},d.resultsCount=()=>u,d.resetResultsCount=()=>{u=0},d}var a8=class{constructor(n){this.value=n}deref(){return this.value}},u8=typeof WeakRef<"u"?WeakRef:a8,c8=0,l2=1;function oh(){return{s:c8,v:void 0,o:null,p:null}}function RR(n,e={}){let t=oh();const{resultEqualityCheck:i}=e;let r,o=0;function a(){let u=t;const{length:f}=arguments;for(let m=0,g=f;m<g;m++){const v=arguments[m];if(typeof v=="function"||typeof v=="object"&&v!==null){let x=u.o;x===null&&(u.o=x=new WeakMap);const w=x.get(v);w===void 0?(u=oh(),x.set(v,u)):u=w}else{let x=u.p;x===null&&(u.p=x=new Map);const w=x.get(v);w===void 0?(u=oh(),x.set(v,u)):u=w}}const d=u;let p;if(u.s===l2)p=u.v;else if(p=n.apply(null,arguments),o++,i){const m=r?.deref?.()??r;m!=null&&i(m,p)&&(p=m,o!==0&&o--),r=typeof p=="object"&&p!==null||typeof p=="function"?new u8(p):p}return d.s=l2,d.v=p,p}return a.clearCache=()=>{t=oh(),a.resetResultsCount()},a.resultsCount=()=>o,a.resetResultsCount=()=>{o=0},a}function kR(n,...e){const t=typeof n=="function"?{memoize:n,memoizeOptions:e}:n,i=(...r)=>{let o=0,a=0,u,f={},d=r.pop();typeof d=="object"&&(f=d,d=r.pop()),ZN(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const p={...t,...f},{memoize:m,memoizeOptions:g=[],argsMemoize:v=RR,argsMemoizeOptions:x=[]}=p,w=o2(g),C=o2(x),E=t8(r),k=m(function(){return o++,d.apply(null,arguments)},...w),T=v(function(){a++;const A=n8(E,arguments);return u=k.apply(null,A),u},...C);return Object.assign(T,{resultFunc:d,memoizedResultFunc:k,dependencies:E,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>u,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:m,argsMemoize:v})};return Object.assign(i,{withTypes:()=>i}),i}var f8=kR(RR),h8=Object.assign((n,e=f8)=>{JN(n,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof n}`);const t=Object.keys(n),i=t.map(r=>n[r]);return e(i,(...r)=>r.reduce((o,a,u)=>(o[t[u]]=a,o),{}))},{withTypes:()=>h8}),a2={exports:{}},Qg={},u2;function d8(){if(u2)return Qg;u2=1;var n=es;function e(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var t=typeof Object.is=="function"?Object.is:e,i=n.useState,r=n.useEffect,o=n.useLayoutEffect,a=n.useDebugValue;function u(m,g){var v=g(),x=i({inst:{value:v,getSnapshot:g}}),w=x[0].inst,C=x[1];return o(function(){w.value=v,w.getSnapshot=g,f(w)&&C({inst:w})},[m,v,g]),r(function(){return f(w)&&C({inst:w}),m(function(){f(w)&&C({inst:w})})},[m]),a(v),v}function f(m){var g=m.getSnapshot;m=m.value;try{var v=g();return!t(m,v)}catch{return!0}}function d(m,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:u;return Qg.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:p,Qg}var c2;function TR(){return c2||(c2=1,a2.exports=d8()),a2.exports}var p8=TR(),f2={exports:{}},Xg={},h2;function m8(){if(h2)return Xg;h2=1;var n=es,e=TR();function t(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var i=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=n.useRef,a=n.useEffect,u=n.useMemo,f=n.useDebugValue;return Xg.useSyncExternalStoreWithSelector=function(d,p,m,g,v){var x=o(null);if(x.current===null){var w={hasValue:!1,value:null};x.current=w}else w=x.current;x=u(function(){function E(N){if(!k){if(k=!0,T=N,N=g(N),v!==void 0&&w.hasValue){var M=w.value;if(v(M,N))return A=M}return A=N}if(M=A,i(T,N))return M;var D=g(N);return v!==void 0&&v(M,D)?(T=N,M):(T=N,A=D)}var k=!1,T,A,O=m===void 0?null:m;return[function(){return E(p())},O===null?void 0:function(){return E(O())}]},[p,m,g,v]);var C=r(d,x[0],x[1]);return a(function(){w.hasValue=!0,w.value=C},[C]),f(C),C},Xg}var d2;function g8(){return d2||(d2=1,f2.exports=m8()),f2.exports}var y8=g8();const v8=()=>{},be=typeof document<"u"?S.useLayoutEffect:v8;function bt(n,...e){const t=new URL(`https://base-ui.com/production-error/${n}`);return e.forEach(i=>t.searchParams.append("args[]",i)),`Base UI error #${n}; visit ${t} for the full message.`}const AR=S.createContext(void 0);function Oc(n){const e=S.useContext(AR);if(e===void 0&&!n)throw new Error(bt(72));return e}const p2={};function Un(n,e){const t=S.useRef(p2);return t.current===p2&&(t.current=n(e)),t}const b8=[];function av(n){S.useEffect(n,b8)}const Lu=0;class Ks{static create(){return new Ks}currentId=Lu;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Lu,t()},e)}isStarted(){return this.currentId!==Lu}clear=()=>{this.currentId!==Lu&&(clearTimeout(this.currentId),this.currentId=Lu)};disposeEffect=()=>this.clear}function en(){const n=Un(Ks.create).current;return av(n.disposeEffect),n}function ln(n){const e=Un(x8,n).current;return e.next=n,be(e.effect),e}function x8(n){const e={current:n,next:n,effect:()=>{e.current=e.next}};return e}const Wg=Zy[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],S8=Wg&&Wg!==S.useLayoutEffect?Wg:n=>n();function Se(n){const e=Un(w8).current;return e.next=n,S8(e.effect),e.trampoline}function w8(){const n={next:void 0,callback:E8,trampoline:(...e)=>n.callback?.(...e),effect:()=>{n.callback=n.next}};return n}function E8(){}const Ma=typeof navigator<"u",Zg=k8(),OR=A8(),MR=T8(),DR=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),C8=Zg.platform==="MacIntel"&&Zg.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Zg.platform),NR=Ma&&/apple/i.test(navigator.vendor),Y0=Ma&&/android/i.test(OR)||/android/i.test(MR),R8=Ma&&OR.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,LR=MR.includes("jsdom/");function k8(){if(!Ma)return{platform:"",maxTouchPoints:-1};const n=navigator.userAgentData;return n?.platform?{platform:n.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function T8(){if(!Ma)return"";const n=navigator.userAgentData;return n&&Array.isArray(n.brands)?n.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(" "):navigator.userAgent}function A8(){if(!Ma)return"";const n=navigator.userAgentData;return n?.platform?n.platform:navigator.platform??""}const G0="data-base-ui-focusable",IR="active",BR="selected",_R="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",qs="ArrowLeft",Fs="ArrowRight",uv="ArrowUp",Mc="ArrowDown";function yr(n){let e=n.activeElement;for(;e?.shadowRoot?.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function rt(n,e){if(!n||!e)return!1;const t=e.getRootNode?.();if(n.contains(e))return!0;if(t&&U0(t)){let i=e;for(;i;){if(n===i)return!0;i=i.parentNode||i.host}}return!1}function Tn(n){return"composedPath"in n?n.composedPath()[0]:n.target}function Qi(n,e){if(e==null)return!1;if("composedPath"in n)return n.composedPath().includes(e);const t=n;return t.target!=null&&e.contains(t.target)}function O8(n){return n.matches("html,body")}function Jt(n){return n?.ownerDocument||document}function cv(n){return _t(n)&&n.matches(_R)}function Q0(n){return n?n.getAttribute("role")==="combobox"&&cv(n):!1}function M8(n){if(!n||LR)return!0;try{return n.matches(":focus-visible")}catch{return!0}}function cc(n){return n?n.hasAttribute(G0)?n:n.querySelector(`[${G0}]`)||n:null}function Ho(n,e,t=!0){return n.filter(i=>i.parentId===e&&(!t||i.context?.open)).flatMap(i=>[i,...Ho(n,i.id,t)])}function m2(n,e){let t=[],i=n.find(r=>r.id===e)?.parentId;for(;i;){const r=n.find(o=>o.id===i);i=r?.parentId,r&&(t=t.concat(r))}return t}function Ln(n){n.preventDefault(),n.stopPropagation()}function D8(n){return"nativeEvent"in n}function PR(n){return n.mozInputSource===0&&n.isTrusted?!0:Y0&&n.pointerType?n.type==="click"&&n.buttons===1:n.detail===0&&!n.pointerType}function zR(n){return LR?!1:!Y0&&n.width===0&&n.height===0||Y0&&n.width===1&&n.height===1&&n.pressure===0&&n.detail===0&&n.pointerType==="mouse"||n.width<1&&n.height<1&&n.pressure===0&&n.detail===0&&n.pointerType==="touch"}function Yo(n,e){const t=["mouse","pen"];return e||t.push("",void 0),t.includes(n)}function HR(n){const e=n.type;return e==="click"||e==="mousedown"||e==="keydown"||e==="keyup"}function lh(n,e,t){return Math.floor(n/e)!==t}function Qu(n,e){return e<0||e>=n.current.length}function Jg(n,e){return Nn(n,{disabledIndices:e})}function g2(n,e){return Nn(n,{decrement:!0,startingIndex:n.current.length,disabledIndices:e})}function Nn(n,{startingIndex:e=-1,decrement:t=!1,disabledIndices:i,amount:r=1}={}){let o=e;do o+=t?-r:r;while(o>=0&&o<=n.current.length-1&&Xu(n,o,i));return o}function N8(n,{event:e,orientation:t,loopFocus:i,rtl:r,cols:o,disabledIndices:a,minIndex:u,maxIndex:f,prevIndex:d,stopEvent:p=!1}){let m=d;const g=[],v={};let x=!1;{let E=null,k=-1;n.current.forEach((T,A)=>{if(T==null)return;const O=T.closest('[role="row"]');O&&(x=!0),(O!==E||k===-1)&&(E=O,k+=1,g[k]=[]),g[k].push(A),v[A]=k})}const w=x&&g.length>0&&g.some(E=>E.length!==o);function C(E){if(!w||d===-1)return;const k=v[d];if(k==null)return;const T=g[k].indexOf(d);let A=E==="up"?k-1:k+1;i&&(A<0?A=g.length-1:A>=g.length&&(A=0));const O=new Set;for(;A>=0&&A<g.length&&!O.has(A);){O.add(A);const N=g[A];if(N.length===0){A=E==="up"?A-1:A+1;continue}const M=Math.min(T,N.length-1);for(let D=M;D>=0;D-=1){const V=N[D];if(!Xu(n,V,a))return V}A=E==="up"?A-1:A+1,i&&(A<0?A=g.length-1:A>=g.length&&(A=0))}}if(e.key===uv){const E=C("up");if(E!==void 0)p&&Ln(e),m=E;else{if(p&&Ln(e),d===-1)m=f;else if(m=Nn(n,{startingIndex:m,amount:o,decrement:!0,disabledIndices:a}),i&&(d-o<u||m<0)){const k=d%o,T=f%o,A=f-(T-k);T===k?m=f:m=T>k?A:A-o}Qu(n,m)&&(m=d)}}if(e.key===Mc){const E=C("down");E!==void 0?(p&&Ln(e),m=E):(p&&Ln(e),d===-1?m=u:(m=Nn(n,{startingIndex:d,amount:o,disabledIndices:a}),i&&d+o>f&&(m=Nn(n,{startingIndex:d%o-o,amount:o,disabledIndices:a}))),Qu(n,m)&&(m=d))}if(t==="both"){const E=Ql(d/o);e.key===(r?qs:Fs)&&(p&&Ln(e),d%o!==o-1?(m=Nn(n,{startingIndex:d,disabledIndices:a}),i&&lh(m,o,E)&&(m=Nn(n,{startingIndex:d-d%o-1,disabledIndices:a}))):i&&(m=Nn(n,{startingIndex:d-d%o-1,disabledIndices:a})),lh(m,o,E)&&(m=d)),e.key===(r?Fs:qs)&&(p&&Ln(e),d%o!==0?(m=Nn(n,{startingIndex:d,decrement:!0,disabledIndices:a}),i&&lh(m,o,E)&&(m=Nn(n,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:a}))):i&&(m=Nn(n,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:a})),lh(m,o,E)&&(m=d));const k=Ql(f/o)===E;Qu(n,m)&&(i&&k?m=e.key===(r?Fs:qs)?f:Nn(n,{startingIndex:d-d%o-1,disabledIndices:a}):m=d)}return m}function L8(n,e,t){const i=[];let r=0;return n.forEach(({width:o,height:a},u)=>{let f=!1;for(t&&(r=0);!f;){const d=[];for(let p=0;p<o;p+=1)for(let m=0;m<a;m+=1)d.push(r+p+m*e);r%e+o<=e&&d.every(p=>i[p]==null)?(d.forEach(p=>{i[p]=u}),f=!0):r+=1}}),[...i]}function I8(n,e,t,i,r){if(n===-1)return-1;const o=t.indexOf(n),a=e[n];switch(r){case"tl":return o;case"tr":return a?o+a.width-1:o;case"bl":return a?o+(a.height-1)*i:o;case"br":return t.lastIndexOf(n);default:return-1}}function B8(n,e){return e.flatMap((t,i)=>n.includes(t)?[i]:[])}function Xu(n,e,t){if(typeof t=="function")return t(e);if(t)return t.includes(e);const i=n.current[e];return i?i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true":!1}const Da=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function VR(n,e){const t=Ac(n,Da()),i=t.length;if(i===0)return;const r=yr(Jt(n)),o=t.indexOf(r),a=o===-1?e===1?0:i-1:o+e;return t[a]}function fv(n){return VR(Jt(n).body,1)||n}function UR(n){return VR(Jt(n).body,-1)||n}function jR(n,e){if(!n)return null;const t=Ac(Jt(n).body,Da()),i=t.length;if(i===0)return null;const r=t.indexOf(n);if(r===-1)return null;const o=(r+e+i)%i;return t[o]}function _8(n){return jR(n,1)}function P8(n){return jR(n,-1)}function ia(n,e){const t=e||n.currentTarget,i=n.relatedTarget;return!i||!rt(t,i)}function z8(n){Ac(n,Da()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function y2(n){n.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}const H8={...Zy};let v2=0;function V8(n,e="mui"){const[t,i]=S.useState(n),r=n||t;return S.useEffect(()=>{t==null&&(v2+=1,i(`${e}-${v2}`))},[t,e]),r}const b2=H8.useId;function el(n,e){if(b2!==void 0){const t=b2();return n??(e?`${e}-${t}`:t)}return V8(n,e)}function qR(){const n=new Map;return{emit(e,t){n.get(e)?.forEach(i=>i(t))},on(e,t){n.has(e)||n.set(e,new Set),n.get(e).add(t)},off(e,t){n.get(e)?.delete(t)}}}class hv{nodesRef={current:[]};events=qR();addNode(e){this.nodesRef.current.push(e)}removeNode(e){const t=this.nodesRef.current.findIndex(i=>i===e);t!==-1&&this.nodesRef.current.splice(t,1)}}const FR=S.createContext(null),$R=S.createContext(null),rs=()=>S.useContext(FR)?.id||null,no=n=>{const e=S.useContext($R);return n??e};function KR(n){const e=el(),t=no(n),i=rs();return be(()=>{if(!e)return;const r={id:e,parentId:i};return t?.addNode(r),()=>{t?.removeNode(r)}},[t,e,i]),e}function U8(n){const{children:e,id:t}=n,i=rs();return Y.jsx(FR.Provider,{value:S.useMemo(()=>({id:t,parentId:i}),[t,i]),children:e})}function j8(n){const{children:e,externalTree:t}=n,i=Un(()=>t??new hv).current;return Y.jsx($R.Provider,{value:i,children:e})}function Qn(){}const Ys=Object.freeze([]),Pt=Object.freeze({}),q8=500,F8=500,$8={style:{transition:"none"}},YR="data-base-ui-click-trigger",GR={fallbackAxisSide:"none"},QR={fallbackAxisSide:"end"},K8={clipPath:"inset(50%)",position:"fixed",top:0,left:0},ss="none",Xr="trigger-press",Hn="trigger-hover",fc="trigger-focus",dv="outside-press",Vo="item-press",Y8="close-press",Go="focus-out",Xd="escape-key",Vh="list-navigation",XR="cancel-open",Vu="sibling-open",G8="disabled",pv="imperative-action",Q8="window-resize";function Ke(n,e,t,i){let r=!1,o=!1;const a=Pt;return{reason:n,event:e??new Event("base-ui"),cancel(){r=!0},allowPropagation(){o=!0},get isCanceled(){return r},get isPropagationAllowed(){return o},trigger:t,...a}}function ya(n){return`data-base-ui-${n}`}function Uh(n,e,t){if(t&&!Yo(t))return 0;if(typeof n=="number")return n;if(typeof n=="function"){const i=n();return typeof i=="number"?i:i?.[e]}return n?.[e]}const X8=S.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Ks,currentIdRef:{current:null},currentContextRef:{current:null}});function W8(n,e={open:!1}){const t="rootStore"in n?n.rootStore:n,i=t.useState("floatingId"),{enabled:r=!0,open:o}=e,a=S.useContext(X8),{currentIdRef:u,delayRef:f,timeoutMs:d,initialDelayRef:p,currentContextRef:m,hasProvider:g,timeout:v}=a,[x,w]=S.useState(!1);return be(()=>{function C(){w(!1),m.current?.setIsInstantPhase(!1),u.current=null,m.current=null,f.current=p.current}if(r&&u.current&&!o&&u.current===i){if(w(!1),d){const E=i;return v.start(d,()=>{t.select("open")||u.current&&u.current!==E||C()}),()=>{v.clear()}}C()}},[r,o,i,u,f,d,p,m,v,t]),be(()=>{if(!r||!o)return;const C=m.current,E=u.current;v.clear(),m.current={onOpenChange:t.setOpen,setIsInstantPhase:w},u.current=i,f.current={open:0,close:Uh(p.current,"close")},E!==null&&E!==i?(w(!0),C?.setIsInstantPhase(!0),C?.onOpenChange(!1,Ke(ss))):(w(!1),C?.setIsInstantPhase(!1))},[r,o,i,t,u,f,d,p,m,v]),be(()=>()=>{m.current=null},[m]),S.useMemo(()=>({hasProvider:g,delayRef:f,isInstantPhase:x}),[g,f,x])}function tr(n,e,t,i){const r=Un(WR).current;return J8(r,n,e,t,i)&&ZR(r,[n,e,t,i]),r.callback}function Z8(n){const e=Un(WR).current;return eL(e,n)&&ZR(e,n),e.callback}function WR(){return{callback:null,cleanup:null,refs:[]}}function J8(n,e,t,i,r){return n.refs[0]!==e||n.refs[1]!==t||n.refs[2]!==i||n.refs[3]!==r}function eL(n,e){return n.refs.length!==e.length||n.refs.some((t,i)=>t!==e[i])}function ZR(n,e){if(n.refs=e,e.every(t=>t==null)){n.callback=null;return}n.callback=t=>{if(n.cleanup&&(n.cleanup(),n.cleanup=null),t!=null){const i=Array(e.length).fill(null);for(let r=0;r<e.length;r+=1){const o=e[r];if(o!=null)switch(typeof o){case"function":{const a=o(t);typeof a=="function"&&(i[r]=a);break}case"object":{o.current=t;break}}}n.cleanup=()=>{for(let r=0;r<e.length;r+=1){const o=e[r];if(o!=null)switch(typeof o){case"function":{const a=i[r];typeof a=="function"?a():o(null);break}case"object":{o.current=null;break}}}}}}}const Dc={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1},ah=null;class tL{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;const t=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let r=0;r<t.length;r+=1)t[r]?.(e)};request(e){const t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){const t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,this.callbacksCount-=1)}}const uh=new tL;class qt{static create(){return new qt}static request(e){return uh.request(e)}static cancel(e){return uh.cancel(e)}currentId=ah;request(e){this.cancel(),this.currentId=uh.request(()=>{this.currentId=ah,e()})}cancel=()=>{this.currentId!==ah&&(uh.cancel(this.currentId),this.currentId=ah)};disposeEffect=()=>this.cancel}function tl(){const n=Un(qt.create).current;return av(n.disposeEffect),n}function Hi(n){return n?.ownerDocument||document}const va=S.forwardRef(function(n,e){const[t,i]=S.useState();return be(()=>{NR&&i("button")},[]),Y.jsx("span",{...n,ref:e,style:Dc,"aria-hidden":t?void 0:!0,tabIndex:0,role:t,"data-base-ui-focus-guard":""})});let x2=0;function jh(n,e={}){const{preventScroll:t=!1,cancelPrevious:i=!0,sync:r=!1}=e;i&&cancelAnimationFrame(x2);const o=()=>n?.focus({preventScroll:t});r?o():x2=requestAnimationFrame(o)}const ra={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function S2(n){return n==="inert"?ra.inert:n==="aria-hidden"?ra["aria-hidden"]:ra.none}let ch=new WeakSet,fh={},e0=0;const JR=n=>n&&(n.host||JR(n.parentNode)),nL=(n,e)=>e.map(t=>{if(n.contains(t))return t;const i=JR(t);return n.contains(i)?i:null}).filter(t=>t!=null);function iL(n,e,t,i){const r="data-base-ui-inert",o=i?"inert":t?"aria-hidden":null,a=nL(e,n),u=new Set,f=new Set(a),d=[];fh[r]||(fh[r]=new WeakMap);const p=fh[r];a.forEach(m),g(e),u.clear();function m(v){!v||u.has(v)||(u.add(v),v.parentNode&&m(v.parentNode))}function g(v){!v||f.has(v)||[].forEach.call(v.children,x=>{if(eo(x)!=="script")if(u.has(x))g(x);else{const w=o?x.getAttribute(o):null,C=w!==null&&w!=="false",E=S2(o),k=(E.get(x)||0)+1,T=(p.get(x)||0)+1;E.set(x,k),p.set(x,T),d.push(x),k===1&&C&&ch.add(x),T===1&&x.setAttribute(r,""),!C&&o&&x.setAttribute(o,o==="inert"?"":"true")}})}return e0+=1,()=>{d.forEach(v=>{const x=S2(o),w=(x.get(v)||0)-1,C=(p.get(v)||0)-1;x.set(v,w),p.set(v,C),w||(!ch.has(v)&&o&&v.removeAttribute(o),ch.delete(v)),C||v.removeAttribute(r)}),e0-=1,e0||(ra.inert=new WeakMap,ra["aria-hidden"]=new WeakMap,ra.none=new WeakMap,ch=new WeakSet,fh={})}}function rL(n,e=!1,t=!1){const i=Jt(n[0]).body;return iL(n.concat(Array.from(i.querySelectorAll("[aria-live]"))),i,e,t)}const sL=parseInt(S.version,10);function mv(n){return sL>=n}function w2(n){if(!S.isValidElement(n))return null;const e=n,t=e.props;return(mv(19)?t?.ref:e.ref)??null}function X0(n,e){if(n&&!e)return n;if(!n&&e)return e;if(n||e)return{...n,...e}}function oL(n,e){const t={};for(const i in n){const r=n[i];if(e?.hasOwnProperty(i)){const o=e[i](r);o!=null&&Object.assign(t,o);continue}r===!0?t[`data-${i.toLowerCase()}`]="":r&&(t[`data-${i.toLowerCase()}`]=r.toString())}return t}function lL(n,e){return typeof n=="function"?n(e):n}function aL(n,e){return typeof n=="function"?n(e):n}const Wu={};function Vi(n,e,t,i,r){let o={...W0(n,Wu)};return e&&(o=Uu(o,e)),t&&(o=Uu(o,t)),i&&(o=Uu(o,i)),r&&(o=Uu(o,r)),o}function uL(n){if(n.length===0)return Wu;if(n.length===1)return W0(n[0],Wu);let e={...W0(n[0],Wu)};for(let t=1;t<n.length;t+=1)e=Uu(e,n[t]);return e}function Uu(n,e){return ek(e)?e(n):cL(n,e)}function cL(n,e){if(!e)return n;for(const t in e){const i=e[t];switch(t){case"style":{n[t]=X0(n.style,i);break}case"className":{n[t]=tk(n.className,i);break}default:fL(t,i)?n[t]=hL(n[t],i):n[t]=i}}return n}function fL(n,e){const t=n.charCodeAt(0),i=n.charCodeAt(1),r=n.charCodeAt(2);return t===111&&i===110&&r>=65&&r<=90&&(typeof e=="function"||typeof e>"u")}function ek(n){return typeof n=="function"}function W0(n,e){return ek(n)?n(e):n??Wu}function hL(n,e){return e?n?t=>{if(dL(t)){const r=t;Z0(r);const o=e(r);return r.baseUIHandlerPrevented||n?.(r),o}const i=e(t);return n?.(t),i}:e:n}function Z0(n){return n.preventBaseUIHandler=()=>{n.baseUIHandlerPrevented=!0},n}function tk(n,e){return e?n?e+" "+n:e:n}function dL(n){return n!=null&&typeof n=="object"&&"nativeEvent"in n}function Fe(n,e,t={}){const i=e.render,r=pL(e,t);if(t.enabled===!1)return null;const o=t.state??Pt;return mL(n,i,r,o)}function pL(n,e={}){const{className:t,style:i,render:r}=n,{state:o=Pt,ref:a,props:u,stateAttributesMapping:f,enabled:d=!0}=e,p=d?lL(t,o):void 0,m=d?aL(i,o):void 0,g=d?oL(o,f):Pt,v=d?X0(g,Array.isArray(u)?uL(u):u)??Pt:Pt;return typeof document<"u"&&(d?Array.isArray(a)?v.ref=Z8([v.ref,w2(r),...a]):v.ref=tr(v.ref,w2(r),a):tr(null,null)),d?(p!==void 0&&(v.className=tk(v.className,p)),m!==void 0&&(v.style=X0(v.style,m)),v):Pt}function mL(n,e,t,i){if(e){if(typeof e=="function")return e(t,i);const r=Vi(t,e.props);return r.ref=t.ref,S.cloneElement(e,r)}if(n&&typeof n=="string")return gL(n,t);throw new Error(bt(8))}function gL(n,e){return n==="button"?S.createElement("button",{type:"button",...e,key:e.key}):n==="img"?S.createElement("img",{alt:"",...e,key:e.key}):S.createElement(n,e)}const nk=S.createContext(null),ik=()=>S.useContext(nk),yL=ya("portal");function rk(n={}){const{ref:e,container:t,componentProps:i=Pt,elementProps:r,elementState:o}=n,a=el(),u=ik()?.portalNode,[f,d]=S.useState(null),[p,m]=S.useState(null),g=S.useRef(null);be(()=>{if(t===null){g.current&&(g.current=null,m(null),d(null));return}if(a==null)return;const x=(t&&(nv(t)?t:t.current))??u??document.body;if(x==null){g.current&&(g.current=null,m(null),d(null));return}g.current!==x&&(g.current=x,m(null),d(x))},[t,u,a]);const v=Fe("div",i,{ref:[e,m],state:o,props:[{id:a,[yL]:""},r]});return{portalNode:p,portalSubtree:f&&v?ei.createPortal(v,f):null}}const gv=S.forwardRef(function(n,e){const{children:t,container:i,className:r,render:o,renderGuards:a,...u}=n,{portalNode:f,portalSubtree:d}=rk({container:i,ref:e,componentProps:n,elementProps:u}),p=S.useRef(null),m=S.useRef(null),g=S.useRef(null),v=S.useRef(null),[x,w]=S.useState(null),C=x?.modal,E=x?.open,k=typeof a=="boolean"?a:!!x&&!x.modal&&x.open&&!!f;S.useEffect(()=>{if(!f||C)return;function A(O){f&&ia(O)&&(O.type==="focusin"?y2:z8)(f)}return f.addEventListener("focusin",A,!0),f.addEventListener("focusout",A,!0),()=>{f.removeEventListener("focusin",A,!0),f.removeEventListener("focusout",A,!0)}},[f,C]),S.useEffect(()=>{!f||E||y2(f)},[E,f]);const T=S.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:m,beforeInsideRef:g,afterInsideRef:v,portalNode:f,setFocusManagerState:w}),[f]);return Y.jsxs(S.Fragment,{children:[d,Y.jsxs(nk.Provider,{value:T,children:[k&&f&&Y.jsx(va,{"data-type":"outside",ref:p,onFocus:A=>{if(ia(A,f))g.current?.focus();else{const O=x?x.domReference:null;UR(O)?.focus()}}}),k&&f&&Y.jsx("span",{"aria-owns":f.id,style:K8}),f&&ei.createPortal(t,f),k&&f&&Y.jsx(va,{"data-type":"outside",ref:m,onFocus:A=>{if(ia(A,f))v.current?.focus();else{const O=x?x.domReference:null;fv(O)?.focus(),x?.closeOnFocusOut&&x?.onOpenChange(!1,Ke(Go,A.nativeEvent))}}})]})]})});function Ao(n){return n==null?n:"current"in n?n.current:n}function vL(n,e){const t=Yt(n.target);return n instanceof t.KeyboardEvent?"keyboard":n instanceof t.FocusEvent?e||"keyboard":"pointerType"in n?n.pointerType||"keyboard":"touches"in n?"touch":n instanceof t.MouseEvent?e||(n.detail===0?"keyboard":"mouse"):""}const E2=20;let zs=[];function yv(){zs=zs.filter(n=>n.isConnected)}function bL(n){yv(),n&&eo(n)!=="body"&&(zs.push(n),zs.length>E2&&(zs=zs.slice(-E2)))}function t0(){return yv(),zs[zs.length-1]}function xL(n){if(!n)return null;const e=Da();return CR(n,e)?n:Ac(n,e)[0]||n}function SL(n){return!n||!n.isConnected?!1:typeof n.checkVisibility=="function"?n.checkVisibility():ti(n).display!=="none"}function C2(n,e){if(!e.current.includes("floating")&&!n.getAttribute("role")?.includes("dialog"))return;const t=Da(),i=WN(n,t).filter(o=>{const a=o.getAttribute("data-tabindex")||"";return CR(o,t)||o.hasAttribute("data-tabindex")&&!a.startsWith("-")}),r=n.getAttribute("tabindex");e.current.includes("floating")||i.length===0?r!=="0"&&n.setAttribute("tabindex","0"):(r!=="-1"||n.hasAttribute("data-tabindex")&&n.getAttribute("data-tabindex")!=="-1")&&(n.setAttribute("tabindex","-1"),n.setAttribute("data-tabindex","-1"))}function vv(n){const{context:e,children:t,disabled:i=!1,order:r=["content"],initialFocus:o=!0,returnFocus:a=!0,restoreFocus:u=!1,modal:f=!0,closeOnFocusOut:d=!0,openInteractionType:p="",getInsideElements:m=()=>[],nextFocusableElement:g,previousFocusableElement:v,beforeContentFocusGuardRef:x,externalTree:w}=n,C="rootStore"in e?e.rootStore:e,E=C.useState("open"),k=C.useState("domReferenceElement"),T=C.useState("floatingElement"),{events:A,dataRef:O}=C.context,N=Se(()=>O.current.floatingContext?.nodeId),M=Se(m),D=o===!1,V=Q0(k)&&D,U=ln(r),j=ln(o),I=ln(a),q=ln(p),P=no(w),$=ik(),_=S.useRef(null),H=S.useRef(null),z=S.useRef(!1),Q=S.useRef(!1),ee=S.useRef(!1),B=S.useRef(-1),K=S.useRef(""),X=S.useRef(""),J=en(),W=en(),re=tl(),ae=$!=null,fe=cc(T),pe=Se((ve=fe)=>ve?Ac(ve,Da()):[]),Te=Se(ve=>{const ge=pe(ve);return U.current.map(()=>ge).filter(Boolean).flat()});S.useEffect(()=>{if(i||!f)return;function ve(Ae){Ae.key==="Tab"&&rt(fe,yr(Jt(fe)))&&pe().length===0&&!V&&Ln(Ae)}const ge=Jt(fe);return ge.addEventListener("keydown",ve),()=>{ge.removeEventListener("keydown",ve)}},[i,k,fe,f,U,V,pe,Te]),S.useEffect(()=>{if(i||!T)return;function ve(ge){const Ae=Tn(ge),Oe=pe().indexOf(Ae);Oe!==-1&&(B.current=Oe)}return T.addEventListener("focusin",ve),()=>{T.removeEventListener("focusin",ve)}},[i,T,pe]),S.useEffect(()=>{if(i||!E)return;const ve=Jt(fe);function ge(){ee.current=!1}function Ae(Ye){const de=Tn(Ye),ke=rt(T,de)||rt(k,de)||rt($?.portalNode,de);ee.current=!ke,X.current=Ye.pointerType||"keyboard"}function Oe(){X.current="keyboard"}return ve.addEventListener("pointerdown",Ae,!0),ve.addEventListener("pointerup",ge,!0),ve.addEventListener("pointercancel",ge,!0),ve.addEventListener("keydown",Oe,!0),()=>{ve.removeEventListener("pointerdown",Ae,!0),ve.removeEventListener("pointerup",ge,!0),ve.removeEventListener("pointercancel",ge,!0),ve.removeEventListener("keydown",Oe,!0)}},[i,T,k,fe,E,$]),S.useEffect(()=>{if(i||!d)return;function ve(){Q.current=!0,W.start(0,()=>{Q.current=!1})}function ge(de){const ke=de.relatedTarget,we=de.currentTarget,ye=Tn(de);queueMicrotask(()=>{const De=N(),Ne=C.context.triggerElements,Ge=!(rt(k,ke)||rt(T,ke)||rt(ke,T)||rt($?.portalNode,ke)||ke!=null&&Ne.hasElement(ke)||Ne.hasMatchingElement(je=>rt(je,ke))||ke?.hasAttribute(ya("focus-guard"))||P&&(Ho(P.nodesRef.current,De).find(je=>rt(je.context?.elements.floating,ke)||rt(je.context?.elements.domReference,ke))||m2(P.nodesRef.current,De).find(je=>[je.context?.elements.floating,cc(je.context?.elements.floating)].includes(ke)||je.context?.elements.domReference===ke)));if(we===k&&fe&&C2(fe,U),u&&we!==k&&!SL(ye)&&yr(Jt(fe))===Jt(fe).body){if(_t(fe)&&(fe.focus(),u==="popup")){re.request(()=>{fe.focus()});return}const je=B.current,mt=pe(),Dt=mt[je]||mt[mt.length-1]||fe;_t(Dt)&&Dt.focus()}if(O.current.insideReactTree){O.current.insideReactTree=!1;return}(V||!f)&&ke&&Ge&&!Q.current&&(V||ke!==t0())&&(z.current=!0,C.setOpen(!1,Ke(Go,de)))})}function Ae(){ee.current||(O.current.insideReactTree=!0,J.start(0,()=>{O.current.insideReactTree=!1}))}const Oe=_t(k)?k:null,Ye=[];if(!(!T&&!Oe))return Oe&&(Oe.addEventListener("focusout",ge),Oe.addEventListener("pointerdown",ve),Ye.push(()=>{Oe.removeEventListener("focusout",ge),Oe.removeEventListener("pointerdown",ve)})),T&&(T.addEventListener("focusout",ge),$&&(T.addEventListener("focusout",Ae,!0),Ye.push(()=>{T.removeEventListener("focusout",Ae,!0)})),Ye.push(()=>{T.removeEventListener("focusout",ge)})),()=>{Ye.forEach(de=>{de()})}},[i,k,T,fe,f,P,$,C,d,u,pe,V,N,U,O,J,W,re]);const le=S.useRef(null),Ee=S.useRef(null),Ce=tr(le,x,$?.beforeInsideRef),Ue=tr(Ee,$?.afterInsideRef);S.useEffect(()=>{if(i||!T||!E)return;const ve=Array.from($?.portalNode?.querySelectorAll(`[${ya("portal")}]`)||[]),ge=(P?m2(P.nodesRef.current,N()):[]).find(Ye=>Q0(Ye.context?.elements.domReference||null))?.context?.elements.domReference,Ae=[T,ge,...ve,...M(),_.current,H.current,le.current,Ee.current,$?.beforeOutsideRef.current,$?.afterOutsideRef.current,Ao(v),Ao(g),V?k:null].filter(Ye=>Ye!=null),Oe=rL(Ae,f||V);return()=>{Oe()}},[E,i,k,T,f,U,$,V,P,N,M,g,v]),be(()=>{if(!E||i||!_t(fe))return;const ve=Jt(fe),ge=yr(ve);queueMicrotask(()=>{const Ae=Te(fe),Oe=j.current,Ye=typeof Oe=="function"?Oe(q.current||""):Oe;if(Ye===void 0||Ye===!1)return;let de;Ye===!0||Ye===null?de=Ae[0]||fe:de=Ao(Ye),de=de||Ae[0]||fe,!rt(fe,ge)&&jh(de,{preventScroll:de===fe})})},[i,E,fe,D,Te,j,q]),be(()=>{if(i||!fe)return;const ve=Jt(fe),ge=yr(ve);bL(ge);function Ae(de){if(de.open||(K.current=vL(de.nativeEvent,X.current)),de.reason===Hn&&de.nativeEvent.type==="mouseleave"&&(z.current=!0),de.reason===dv)if(de.nested)z.current=!1;else if(PR(de.nativeEvent)||zR(de.nativeEvent))z.current=!1;else{let ke=!1;document.createElement("div").focus({get preventScroll(){return ke=!0,!1}}),ke?z.current=!1:z.current=!0}}A.on("openchange",Ae);const Oe=ve.createElement("span");Oe.setAttribute("tabindex","-1"),Oe.setAttribute("aria-hidden","true"),Object.assign(Oe.style,Dc),ae&&k&&k.insertAdjacentElement("afterend",Oe);function Ye(){const de=I.current;let ke=typeof de=="function"?de(K.current):de;if(ke===void 0||ke===!1)return null;if(ke===null&&(ke=!0),typeof ke=="boolean"){const ye=k||t0();return ye&&ye.isConnected?ye:Oe}const we=k||t0()||Oe;return Ao(ke)||we}return()=>{A.off("openchange",Ae);const de=yr(ve),ke=rt(T,de)||P&&Ho(P.nodesRef.current,N(),!1).some(ye=>rt(ye.context?.elements.floating,de)),we=Ye();queueMicrotask(()=>{const ye=xL(we),De=typeof I.current!="boolean";I.current&&!z.current&&_t(ye)&&(!(!De&&ye!==de&&de!==ve.body)||ke)&&ye.focus({preventScroll:!0}),Oe.remove()})}},[i,T,fe,I,O,A,P,ae,k,N]),S.useEffect(()=>{queueMicrotask(()=>{z.current=!1})},[i]),S.useEffect(()=>{if(i||!E)return;function ve(Ae){Tn(Ae)?.closest(`[${YR}]`)&&(Q.current=!0)}const ge=Jt(fe);return ge.addEventListener("pointerdown",ve,!0),()=>{ge.removeEventListener("pointerdown",ve,!0)}},[i,E,fe]),be(()=>{if(!i&&$)return $.setFocusManagerState({modal:f,closeOnFocusOut:d,open:E,onOpenChange:C.setOpen,domReference:k}),()=>{$.setFocusManagerState(null)}},[i,$,f,E,C,d,k]),be(()=>{if(!(i||!fe))return C2(fe,U),()=>{queueMicrotask(yv)}},[i,fe,U]);const me=!i&&(f?!V:!0)&&(ae||f);return Y.jsxs(S.Fragment,{children:[me&&Y.jsx(va,{"data-type":"inside",ref:Ce,onFocus:ve=>{if(f){const ge=Te();jh(ge[ge.length-1])}else $?.portalNode&&(z.current=!1,ia(ve,$.portalNode)?fv(k)?.focus():Ao(v??$.beforeOutsideRef)?.focus())}}),t,me&&Y.jsx(va,{"data-type":"inside",ref:Ue,onFocus:ve=>{f?jh(Te()[0]):$?.portalNode&&(d&&(z.current=!0),ia(ve,$.portalNode)?UR(k)?.focus():Ao(g??$.afterOutsideRef)?.focus())}})]})}function Wd(n,e={}){const t="rootStore"in n?n.rootStore:n,i=t.context.dataRef,{enabled:r=!0,event:o="click",toggle:a=!0,ignoreMouse:u=!1,stickIfOpen:f=!0,touchOpenDelay:d=0}=e,p=S.useRef(void 0),m=tl(),g=en(),v=S.useMemo(()=>({onPointerDown(x){p.current=x.pointerType},onMouseDown(x){const w=p.current,C=x.nativeEvent,E=t.select("open");if(x.button!==0||o==="click"||Yo(w,!0)&&u)return;const k=i.current.openEvent,T=k?.type,A=t.select("domReferenceElement")!==x.currentTarget,O=E&&A||!(E&&a&&(!(k&&f)||T==="click"||T==="mousedown"));if(cv(C.target)){const M=Ke(Xr,C,C.target);O&&w==="touch"&&d>0?g.start(d,()=>{t.setOpen(!0,M)}):t.setOpen(O,M);return}const N=x.currentTarget;m.request(()=>{const M=Ke(Xr,C,N);O&&w==="touch"&&d>0?g.start(d,()=>{t.setOpen(!0,M)}):t.setOpen(O,M)})},onClick(x){if(o==="mousedown-only")return;const w=p.current;if(o==="mousedown"&&w){p.current=void 0;return}if(Yo(w,!0)&&u)return;const C=t.select("open"),E=i.current.openEvent,k=t.select("domReferenceElement")!==x.currentTarget,T=C&&k||!(C&&a&&(!(E&&f)||HR(E))),A=Ke(Xr,x.nativeEvent,x.currentTarget);T&&w==="touch"&&d>0?g.start(d,()=>{t.setOpen(!0,A)}):t.setOpen(T,A)},onKeyDown(){p.current=void 0}}),[i,o,u,t,f,a,m,g,d]);return S.useMemo(()=>r?{reference:v}:Pt,[r,v])}function wL(n,e){let t=null,i=null,r=!1;return{contextElement:n||void 0,getBoundingClientRect(){const o=n?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},a=e.axis==="x"||e.axis==="both",u=e.axis==="y"||e.axis==="both",f=["mouseenter","mousemove"].includes(e.dataRef.current.openEvent?.type||"")&&e.pointerType!=="touch";let d=o.width,p=o.height,m=o.x,g=o.y;return t==null&&e.x&&a&&(t=o.x-e.x),i==null&&e.y&&u&&(i=o.y-e.y),m-=t||0,g-=i||0,d=0,p=0,!r||f?(d=e.axis==="y"?o.width:0,p=e.axis==="x"?o.height:0,m=a&&e.x!=null?e.x:m,g=u&&e.y!=null?e.y:g):r&&!f&&(p=e.axis==="x"?o.height:p,d=e.axis==="y"?o.width:d),r=!0,{width:d,height:p,x:m,y:g,top:g,right:m+d,bottom:g+p,left:m}}}}function R2(n){return n!=null&&n.clientX!=null}function EL(n,e={}){const t="rootStore"in n?n.rootStore:n,i=t.useState("open"),r=t.useState("floatingElement"),o=t.useState("domReferenceElement"),a=t.context.dataRef,{enabled:u=!0,axis:f="both",x:d=null,y:p=null}=e,m=S.useRef(!1),g=S.useRef(null),[v,x]=S.useState(),[w,C]=S.useState([]),E=Se((N,M)=>{m.current||a.current.openEvent&&!R2(a.current.openEvent)||t.set("positionReference",wL(o,{x:N,y:M,axis:f,dataRef:a,pointerType:v}))}),k=Se(N=>{d!=null||p!=null||(i?g.current||C([]):E(N.clientX,N.clientY))}),T=Yo(v)?r:i,A=S.useCallback(()=>{if(!T||!u||d!=null||p!=null)return;const N=Yt(r);function M(D){const V=Tn(D);rt(r,V)?(N.removeEventListener("mousemove",M),g.current=null):E(D.clientX,D.clientY)}if(!a.current.openEvent||R2(a.current.openEvent)){N.addEventListener("mousemove",M);const D=()=>{N.removeEventListener("mousemove",M),g.current=null};return g.current=D,D}t.set("positionReference",o)},[T,u,d,p,r,a,o,t,E]);S.useEffect(()=>A(),[A,w]),S.useEffect(()=>{u&&!r&&(m.current=!1)},[u,r]),S.useEffect(()=>{!u&&i&&(m.current=!0)},[u,i]),be(()=>{u&&(d!=null||p!=null)&&(m.current=!1,E(d,p))},[u,d,p,E]);const O=S.useMemo(()=>{function N(M){x(M.pointerType)}return{onPointerDown:N,onPointerEnter:N,onMouseMove:k,onMouseEnter:k}},[k]);return S.useMemo(()=>u?{reference:O}:{},[u,O])}const CL={intentional:"onClick",sloppy:"onPointerDown"};function RL(n){return{escapeKey:typeof n=="boolean"?n:n?.escapeKey??!1,outsidePress:typeof n=="boolean"?n:n?.outsidePress??!0}}function Zd(n,e={}){const t="rootStore"in n?n.rootStore:n,i=t.useState("open"),r=t.useState("floatingElement"),o=t.useState("referenceElement"),a=t.useState("domReferenceElement"),{onOpenChange:u,dataRef:f}=t.context,{enabled:d=!0,escapeKey:p=!0,outsidePress:m=!0,outsidePressEvent:g="sloppy",referencePress:v=!1,referencePressEvent:x="sloppy",ancestorScroll:w=!1,bubbles:C,externalTree:E}=e,k=no(E),T=Se(typeof m=="function"?m:()=>!1),A=typeof m=="function"?T:m,O=S.useRef(!1),{escapeKey:N,outsidePress:M}=RL(C),D=S.useRef(null),V=en(),U=en(),j=Se(()=>{U.clear(),f.current.insideReactTree=!1}),I=S.useRef(!1),q=S.useRef(""),P=Se(le=>{q.current=le.pointerType}),$=Se(()=>{const le=q.current,Ee=le==="pen"||!le?"mouse":le,Ce=typeof g=="function"?g():g;return typeof Ce=="string"?Ce:Ce[Ee]}),_=Se(le=>{if(!i||!d||!p||le.key!=="Escape"||I.current)return;const Ee=f.current.floatingContext?.nodeId,Ce=k?Ho(k.nodesRef.current,Ee):[];if(!N&&Ce.length>0){let ve=!0;if(Ce.forEach(ge=>{ge.context?.open&&!ge.context.dataRef.current.__escapeKeyBubbles&&(ve=!1)}),!ve)return}const Ue=D8(le)?le.nativeEvent:le,me=Ke(Xd,Ue);t.setOpen(!1,me),!N&&!me.isPropagationAllowed&&le.stopPropagation()}),H=Se(le=>{const Ee=$();return Ee==="intentional"&&le.type!=="click"||Ee==="sloppy"&&le.type==="click"}),z=Se(()=>{f.current.insideReactTree=!0,U.start(0,j)}),Q=Se((le,Ee=!1)=>{if(H(le)){j();return}if(f.current.insideReactTree){j();return}if($()==="intentional"&&Ee||typeof A=="function"&&!A(le))return;const Ce=Tn(le),Ue=`[${ya("inert")}]`,me=Jt(t.select("floatingElement")).querySelectorAll(Ue),ve=t.context.triggerElements;if(Ce&&(ve.hasElement(Ce)||ve.hasMatchingElement(de=>rt(de,Ce))))return;let ge=yt(Ce)?Ce:null;for(;ge&&!Sr(ge);){const de=Er(ge);if(Sr(de)||!yt(de))break;ge=de}if(me.length&&yt(Ce)&&!O8(Ce)&&!rt(Ce,t.select("floatingElement"))&&Array.from(me).every(de=>!rt(ge,de)))return;if(_t(Ce)&&!("touches"in le)){const de=Sr(Ce),ke=ti(Ce),we=/auto|scroll/,ye=de||we.test(ke.overflowX),De=de||we.test(ke.overflowY),Ne=ye&&Ce.clientWidth>0&&Ce.scrollWidth>Ce.clientWidth,Ge=De&&Ce.clientHeight>0&&Ce.scrollHeight>Ce.clientHeight,je=ke.direction==="rtl",mt=Ge&&(je?le.offsetX<=Ce.offsetWidth-Ce.clientWidth:le.offsetX>Ce.clientWidth),Dt=Ne&&le.offsetY>Ce.clientHeight;if(mt||Dt)return}const Ae=f.current.floatingContext?.nodeId,Oe=k&&Ho(k.nodesRef.current,Ae).some(de=>Qi(le,de.context?.elements.floating));if(Qi(le,t.select("floatingElement"))||Qi(le,t.select("domReferenceElement"))||Oe)return;const Ye=k?Ho(k.nodesRef.current,Ae):[];if(Ye.length>0){let de=!0;if(Ye.forEach(ke=>{ke.context?.open&&!ke.context.dataRef.current.__outsidePressBubbles&&(de=!1)}),!de)return}t.setOpen(!1,Ke(dv,le)),j()}),ee=Se(le=>{$()!=="sloppy"||le.pointerType==="touch"||!t.select("open")||!d||Qi(le,t.select("floatingElement"))||Qi(le,t.select("domReferenceElement"))||Q(le)}),B=Se(le=>{if($()!=="sloppy"||!t.select("open")||!d||Qi(le,t.select("floatingElement"))||Qi(le,t.select("domReferenceElement")))return;const Ee=le.touches[0];Ee&&(D.current={startTime:Date.now(),startX:Ee.clientX,startY:Ee.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},V.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}),K=Se(le=>{const Ee=Tn(le);function Ce(){B(le),Ee?.removeEventListener(le.type,Ce)}Ee?.addEventListener(le.type,Ce)}),X=Se(le=>{const Ee=O.current;if(O.current=!1,V.clear(),le.type==="mousedown"&&D.current&&!D.current.dismissOnMouseDown)return;const Ce=Tn(le);function Ue(){le.type==="pointerdown"?ee(le):Q(le,Ee),Ce?.removeEventListener(le.type,Ue)}Ce?.addEventListener(le.type,Ue)}),J=Se(le=>{if($()!=="sloppy"||!D.current||Qi(le,t.select("floatingElement"))||Qi(le,t.select("domReferenceElement")))return;const Ee=le.touches[0];if(!Ee)return;const Ce=Math.abs(Ee.clientX-D.current.startX),Ue=Math.abs(Ee.clientY-D.current.startY),me=Math.sqrt(Ce*Ce+Ue*Ue);me>5&&(D.current.dismissOnTouchEnd=!0),me>10&&(Q(le),V.clear(),D.current=null)}),W=Se(le=>{const Ee=Tn(le);function Ce(){J(le),Ee?.removeEventListener(le.type,Ce)}Ee?.addEventListener(le.type,Ce)}),re=Se(le=>{$()!=="sloppy"||!D.current||Qi(le,t.select("floatingElement"))||Qi(le,t.select("domReferenceElement"))||(D.current.dismissOnTouchEnd&&Q(le),V.clear(),D.current=null)}),ae=Se(le=>{const Ee=Tn(le);function Ce(){re(le),Ee?.removeEventListener(le.type,Ce)}Ee?.addEventListener(le.type,Ce)});S.useEffect(()=>{if(!i||!d)return;f.current.__escapeKeyBubbles=N,f.current.__outsidePressBubbles=M;const le=new Ks;function Ee(ge){t.setOpen(!1,Ke(ss,ge))}function Ce(){le.clear(),I.current=!0}function Ue(){le.start(Yd()?5:0,()=>{I.current=!1})}const me=Jt(r);me.addEventListener("pointerdown",P,!0),p&&(me.addEventListener("keydown",_),me.addEventListener("compositionstart",Ce),me.addEventListener("compositionend",Ue)),A&&(me.addEventListener("click",X,!0),me.addEventListener("pointerdown",X,!0),me.addEventListener("touchstart",K,!0),me.addEventListener("touchmove",W,!0),me.addEventListener("touchend",ae,!0),me.addEventListener("mousedown",X,!0));let ve=[];return w&&(yt(a)&&(ve=js(a)),yt(r)&&(ve=ve.concat(js(r))),!yt(o)&&o&&o.contextElement&&(ve=ve.concat(js(o.contextElement)))),ve=ve.filter(ge=>ge!==me.defaultView?.visualViewport),ve.forEach(ge=>{ge.addEventListener("scroll",Ee,{passive:!0})}),()=>{me.removeEventListener("pointerdown",P,!0),p&&(me.removeEventListener("keydown",_),me.removeEventListener("compositionstart",Ce),me.removeEventListener("compositionend",Ue)),A&&(me.removeEventListener("click",X,!0),me.removeEventListener("pointerdown",X,!0),me.removeEventListener("touchstart",K,!0),me.removeEventListener("touchmove",W,!0),me.removeEventListener("touchend",ae,!0),me.removeEventListener("mousedown",X,!0)),ve.forEach(ge=>{ge.removeEventListener("scroll",Ee)}),le.clear()}},[f,r,o,a,p,A,i,u,w,d,N,M,_,Q,X,ee,K,W,ae,P,t]),S.useEffect(j,[A,j]);const fe=S.useMemo(()=>({onKeyDown:_,...v&&{[CL[x]]:le=>{t.setOpen(!1,Ke(Xr,le.nativeEvent))},...x!=="intentional"&&{onClick(le){t.setOpen(!1,Ke(Xr,le.nativeEvent))}}}}),[_,t,v,x]),pe=Se(le=>{const Ee=Tn(le.nativeEvent);!rt(t.select("floatingElement"),Ee)||le.button!==0||(O.current=!0)}),Te=S.useMemo(()=>({onKeyDown:_,onPointerDown:pe,onMouseDown:pe,onMouseUp:pe,onClickCapture:z,onMouseDownCapture:z,onPointerDownCapture:z,onMouseUpCapture:z,onTouchEndCapture:z,onTouchMoveCapture:z}),[_,pe,z]);return S.useMemo(()=>d?{reference:fe,floating:Te,trigger:fe}:{},[d,fe,Te])}kR({memoize:l8,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const oe=(n,e,t,i,r,o,...a)=>{if(a.length>0)throw new Error(bt(1));let u;if(n)u=n;else throw new Error("Missing arguments");return u},kL=mv(19),TL=kL?AL:OL;function We(n,e,t,i,r){return TL(n,e,t,i,r)}function AL(n,e,t,i,r){const o=S.useCallback(()=>e(n.getSnapshot(),t,i,r),[n,e,t,i,r]);return p8.useSyncExternalStore(n.subscribe,o,o)}function OL(n,e,t,i,r){return y8.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getSnapshot,o=>e(o,t,i,r))}class sa{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const t=this.updateTick;for(const i of this.listeners){if(t!==this.updateTick)return;i(e)}}update(e){for(const t in e)if(!Object.is(this.state[t],e[t])){sa.prototype.setState.call(this,{...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||sa.prototype.setState.call(this,{...this.state,[e]:t})}notifyAll(){const e={...this.state};sa.prototype.setState.call(this,e)}}class Jd extends sa{constructor(e,t={},i){super(e),this.context=t,this.selectors=i}controlledValues=new Map;useSyncedValue(e,t){S.useDebugValue(e),be(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){be(()=>(this.state[e]!==t&&this.set(e,t),()=>{this.set(e,void 0)}),[e,t])}useSyncedValues(e){const t=Object.values(e);be(()=>{this.update(e)},t)}useControlledProp(e,t,i){S.useDebugValue(e);const r=t!==void 0;this.controlledValues.has(e)||(this.controlledValues.set(e,r),!r&&!Object.is(this.state[e],i)&&super.setState({...this.state,[e]:i})),be(()=>{r&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,i,r])}set(e,t){this.controlledValues.get(e)!==!0&&super.set(e,t)}update(e){const t={...e};for(const i in t)if(Object.hasOwn(t,i)&&this.controlledValues.get(i)===!0){delete t[i];continue}super.update(t)}setState(e){const t={...e};for(const i in t)if(Object.hasOwn(t,i)&&this.controlledValues.get(i)===!0){delete t[i];continue}super.setState({...this.state,...t})}select=(e,t,i,r)=>{const o=this.selectors[e];return o(this.state,t,i,r)};useState=(e,t,i,r)=>{S.useDebugValue(e);const o=this.selectors[e];return We(this,o,t,i,r)};useContextCallback(e,t){S.useDebugValue(e);const i=Se(t??Qn);this.context[e]=i}useStateSetter(e){const t=S.useRef(void 0);return t.current===void 0&&(t.current=i=>{this.set(e,i)}),t.current}observe(e,t){let i;typeof e=="function"?i=e:i=this.selectors[e];let r=i(this.state);return t(r,r,this),this.subscribe(o=>{const a=i(o);if(!Object.is(r,a)){const u=r;r=a,t(a,u,this)}})}}const ML={open:oe(n=>n.open),domReferenceElement:oe(n=>n.domReferenceElement),referenceElement:oe(n=>n.positionReference??n.referenceElement),floatingElement:oe(n=>n.floatingElement),floatingId:oe(n=>n.floatingId)};class bv extends Jd{constructor(e){const{nested:t,noEmit:i,onOpenChange:r,triggerElements:o,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:qR(),nested:t,noEmit:i,triggerElements:o},ML)}setOpen=(e,t)=>{if((!e||!this.state.open||HR(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){const i={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit("openchange",i)}this.context.onOpenChange?.(e,t)}}function nl(n,e=!1,t=!1){const[i,r]=S.useState(n&&e?"idle":void 0),[o,a]=S.useState(n);return n&&!o&&(a(!0),r("starting")),!n&&o&&i!=="ending"&&!t&&r("ending"),!n&&!o&&i==="ending"&&r(void 0),be(()=>{if(!n&&o&&i!=="ending"&&t){const u=qt.request(()=>{r("ending")});return()=>{qt.cancel(u)}}},[n,o,i,t]),be(()=>{if(!n||e)return;const u=qt.request(()=>{r(void 0)});return()=>{qt.cancel(u)}},[e,n]),be(()=>{if(!n||!e)return;n&&o&&i!=="idle"&&r("starting");const u=qt.request(()=>{r("idle")});return()=>{qt.cancel(u)}},[e,n,o,r,i]),S.useMemo(()=>({mounted:o,setMounted:a,transitionStatus:i}),[o,i])}function xv(n,e=!1,t=!0){const i=tl();return Se((r,o=null)=>{i.cancel();const a=Ao(n);a!=null&&(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?r():i.request(()=>{function u(){a&&Promise.all(a.getAnimations().map(f=>f.finished)).then(()=>{o!=null&&o.aborted||ei.flushSync(r)}).catch(()=>{if(t){if(o!=null&&o.aborted)return;ei.flushSync(r)}else a.getAnimations().length>0&&a.getAnimations().some(f=>f.pending||f.playState!=="finished")&&u()})}e?i.request(u):u()}))})}function sr(n){const{enabled:e=!0,open:t,ref:i,onComplete:r}=n,o=ln(t),a=Se(r),u=xv(i,t);S.useEffect(()=>{e&&u(()=>{t===o.current&&a()})},[e,t,a,u,o])}function sk(n,e){const t=S.useRef(null);return S.useCallback(i=>{n!==void 0&&(t.current!==null&&(e.context.triggerElements.delete(t.current),t.current=null),i!==null&&(t.current=n,e.context.triggerElements.add(n,i)))},[e,n])}function Sv(n,e,t,i){const r=t.useState("isMountedByTrigger",n),o=sk(n,t),a=Se(u=>{o(u),u!==null&&t.select("open")&&t.select("activeTriggerId")==null&&t.update({activeTriggerId:n,activeTriggerElement:u,...i})});return be(()=>{r&&t.update({activeTriggerElement:e.current,...i})},[r,t,e,...Object.values(i)]),{registerTrigger:a,isMountedByThisTrigger:r}}function wv(n){const e=n.useState("open");be(()=>{if(e&&!n.select("activeTriggerId")&&n.context.triggerElements.size===1){const t=n.context.triggerElements.entries().next();if(!t.done){const[i,r]=t.value;n.update({activeTriggerId:i,activeTriggerElement:r})}}},[e,n])}function Ev(n,e,t){const{mounted:i,setMounted:r,transitionStatus:o}=nl(n);e.useSyncedValues({mounted:i,transitionStatus:o});const a=Se(()=>{r(!1),e.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),t?.(),e.context.onOpenChangeComplete?.(!1)}),u=e.useState("preventUnmountingOnClose");return sr({enabled:!u,open:n,ref:e.context.popupRef,onComplete(){n||a()}}),{forceUnmount:a,transitionStatus:o}}class Nc{constructor(){this.elements=new Set,this.idMap=new Map}add(e,t){const i=this.idMap.get(e);i!==t&&(i!==void 0&&this.elements.delete(i),this.elements.add(t),this.idMap.set(e,t))}delete(e){const t=this.idMap.get(e);t&&(this.elements.delete(t),this.idMap.delete(e))}hasElement(e){return this.elements.has(e)}hasMatchingElement(e){for(const t of this.elements)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function Cv(){return new bv({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Nc,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Rv(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:Cv(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:Pt,inactiveTriggerProps:Pt,popupProps:Pt}}const kv={open:oe(n=>n.open),mounted:oe(n=>n.mounted),transitionStatus:oe(n=>n.transitionStatus),floatingRootContext:oe(n=>n.floatingRootContext),preventUnmountingOnClose:oe(n=>n.preventUnmountingOnClose),payload:oe(n=>n.payload),activeTriggerId:oe(n=>n.activeTriggerId),activeTriggerElement:oe(n=>n.mounted?n.activeTriggerElement:null),isTriggerActive:oe((n,e)=>e!==void 0&&n.activeTriggerId===e),isOpenedByTrigger:oe((n,e)=>e!==void 0&&n.activeTriggerId===e&&n.open),isMountedByTrigger:oe((n,e)=>e!==void 0&&n.activeTriggerId===e&&n.mounted),triggerProps:oe((n,e)=>e?n.activeTriggerProps:n.inactiveTriggerProps),popupProps:oe(n=>n.popupProps),popupElement:oe(n=>n.popupElement),positionerElement:oe(n=>n.positionerElement)};function ok(n){const{open:e=!1,onOpenChange:t,elements:i={}}=n,r=el(),o=rs()!=null,a=Un(()=>new bv({open:e,onOpenChange:t,referenceElement:i.reference??null,floatingElement:i.floating??null,triggerElements:i.triggers??new Nc,floatingId:r,nested:o,noEmit:n.noEmit||!1})).current;return be(()=>{const u={open:e,floatingId:r};i.reference!==void 0&&(u.referenceElement=i.reference,u.domReferenceElement=yt(i.reference)?i.reference:null),i.floating!==void 0&&(u.floatingElement=i.floating),a.update(u)},[e,r,i.reference,i.floating,a]),a.context.onOpenChange=t,a.context.nested=o,a.context.noEmit=n.noEmit||!1,a}function DL(n={}){const{nodeId:e,externalTree:t}=n,i=ok(n),r=n.rootContext||i,o={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[a,u]=S.useState(null),f=S.useRef(null),d=no(t);be(()=>{o.domReference&&(f.current=o.domReference)},[o.domReference]);const p=MN({...n,elements:{...o,...a&&{reference:a}}}),m=S.useCallback(M=>{const D=yt(M)?{getBoundingClientRect:()=>M.getBoundingClientRect(),getClientRects:()=>M.getClientRects(),contextElement:M}:M;u(D),p.refs.setReference(D)},[p.refs]),[g,v]=S.useState(null),[x,w]=S.useState(null);r.useSyncedValue("referenceElement",g),r.useSyncedValue("domReferenceElement",yt(g)?g:null),r.useSyncedValue("floatingElement",x);const C=S.useCallback(M=>{(yt(M)||M===null)&&(f.current=M,v(M)),(yt(p.refs.reference.current)||p.refs.reference.current===null||M!==null&&!yt(M))&&p.refs.setReference(M)},[p.refs,v]),E=S.useCallback(M=>{w(M),p.refs.setFloating(M)},[p.refs]),k=S.useMemo(()=>({...p.refs,setReference:C,setFloating:E,setPositionReference:m,domReference:f}),[p.refs,C,E,m]),T=S.useMemo(()=>({...p.elements,domReference:o.domReference}),[p.elements,o.domReference]),A=r.useState("open"),O=r.useState("floatingId"),N=S.useMemo(()=>({...p,dataRef:r.context.dataRef,open:A,onOpenChange:r.setOpen,events:r.context.events,floatingId:O,refs:k,elements:T,nodeId:e,rootStore:r}),[p,k,T,e,r,A,O]);return be(()=>{r.context.dataRef.current.floatingContext=N;const M=d?.nodesRef.current.find(D=>D.id===e);M&&(M.context=N)}),S.useMemo(()=>({...p,context:N,refs:k,elements:T,rootStore:r}),[p,k,T,N,r])}function Tv(n){const{popupStore:e,noEmit:t=!1,treatPopupAsFloatingElement:i=!1,onOpenChange:r}=n,o=el(),a=rs()!=null,u=e.useState("open"),f=e.useState("activeTriggerElement"),d=e.useState(i?"popupElement":"positionerElement"),p=e.context.triggerElements,m=Un(()=>new bv({open:u,referenceElement:f,floatingElement:d,triggerElements:p,onOpenChange:r,floatingId:o,nested:a,noEmit:t})).current;return be(()=>{const g={open:u,floatingId:o,referenceElement:f,floatingElement:d};yt(f)&&(g.domReferenceElement=f),m.update(g)},[u,o,f,d,m]),m.context.onOpenChange=r,m.context.nested=a,m.context.noEmit=t,m}const n0=R8&&NR;function lk(n,e={}){const t="rootStore"in n?n.rootStore:n,{events:i,dataRef:r}=t.context,{enabled:o=!0,visibleOnly:a=!0}=e,u=S.useRef(!1),f=en(),d=S.useRef(!0);S.useEffect(()=>{const m=t.select("domReferenceElement");if(!o)return;const g=Yt(m);function v(){!t.select("open")&&_t(m)&&m===yr(Jt(m))&&(u.current=!0)}function x(){d.current=!0}function w(){d.current=!1}return g.addEventListener("blur",v),n0&&(g.addEventListener("keydown",x,!0),g.addEventListener("pointerdown",w,!0)),()=>{g.removeEventListener("blur",v),n0&&(g.removeEventListener("keydown",x,!0),g.removeEventListener("pointerdown",w,!0))}},[t,o]),S.useEffect(()=>{if(!o)return;function m(g){(g.reason===Xr||g.reason===Xd)&&(u.current=!0)}return i.on("openchange",m),()=>{i.off("openchange",m)}},[i,o]);const p=S.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(m){if(u.current)return;const g=Tn(m.nativeEvent);if(a&&yt(g)){if(n0&&!m.relatedTarget){if(!d.current&&!cv(g))return}else if(!M8(g))return}t.setOpen(!0,Ke(fc,m.nativeEvent,m.currentTarget))},onBlur(m){u.current=!1;const g=m.relatedTarget,v=m.nativeEvent,x=yt(g)&&g.hasAttribute(ya("focus-guard"))&&g.getAttribute("data-type")==="outside";f.start(0,()=>{const w=t.select("domReferenceElement"),C=yr(w?w.ownerDocument:document);!g&&C===w||rt(r.current.floatingContext?.refs.floating.current,C)||rt(w,C)||x||t.context.triggerElements.hasElement(m.relatedTarget)||t.setOpen(!1,Ke(fc,v))})}}),[r,t,a,f]);return S.useMemo(()=>o?{reference:p,trigger:p}:{},[o,p])}const J0=ya("safe-polygon"),NL=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${_R}`;function LL(n){return n?!!n.closest(NL):!1}function ak(n){const e=S.useRef(void 0),t=S.useRef(!1),i=S.useRef(void 0),r=S.useRef(!0),o=S.useRef(!1),a=S.useRef(()=>{}),u=S.useRef(!1),f=en(),d=en(),p=S.useRef(void 0);return S.useMemo(()=>{const m=n.context.dataRef.current;return m.hoverInteractionState||(m.hoverInteractionState={pointerTypeRef:e,interactedInsideRef:t,handlerRef:i,blockMouseMoveRef:r,performedPointerEventsMutationRef:o,unbindMouseMoveRef:a,restTimeoutPendingRef:u,openChangeTimeout:f,restTimeout:d,handleCloseOptionsRef:p}),m.hoverInteractionState},[n,e,t,i,r,o,a,u,f,d,p])}const IL=new Set(["click","mousedown"]);function uk(n,e={}){const t="rootStore"in n?n.rootStore:n,i=t.useState("open"),r=t.useState("floatingElement"),o=t.useState("domReferenceElement"),{dataRef:a}=t.context,{enabled:u=!0,closeDelay:f=0,externalTree:d}=e,{pointerTypeRef:p,interactedInsideRef:m,handlerRef:g,performedPointerEventsMutationRef:v,unbindMouseMoveRef:x,restTimeoutPendingRef:w,openChangeTimeout:C,handleCloseOptionsRef:E}=ak(t),k=no(d),T=rs(),A=Se(()=>m.current?!0:a.current.openEvent?IL.has(a.current.openEvent.type):!1),O=Se(()=>{const U=a.current.openEvent?.type;return U?.includes("mouse")&&U!=="mousedown"}),N=S.useCallback((U,j=!0)=>{const I=BL(f,p.current);I&&!g.current?C.start(I,()=>t.setOpen(!1,Ke(Hn,U))):j&&(C.clear(),t.setOpen(!1,Ke(Hn,U)))},[f,g,t,p,C]),M=Se(()=>{x.current(),g.current=void 0}),D=Se(()=>{if(v.current){const U=Jt(r).body;U.style.pointerEvents="",U.removeAttribute(J0),v.current=!1}}),V=Se(U=>{const j=Tn(U);if(!LL(j)){m.current=!1;return}m.current=!0});be(()=>{i||(p.current=void 0,w.current=!1,m.current=!1,M(),D())},[i,p,w,m,M,D]),S.useEffect(()=>()=>{M()},[M]),S.useEffect(()=>D,[D]),be(()=>{if(u&&i&&E.current?.blockPointerEvents&&O()&&yt(o)&&r){v.current=!0;const U=Jt(r).body;U.setAttribute(J0,"");const j=o,I=r,q=k?.nodesRef.current.find(P=>P.id===T)?.context?.elements.floating;return q&&(q.style.pointerEvents=""),U.style.pointerEvents="none",j.style.pointerEvents="auto",I.style.pointerEvents="auto",()=>{U.style.pointerEvents="",j.style.pointerEvents="",I.style.pointerEvents=""}}},[u,i,o,r,E,O,k,T,v]),S.useEffect(()=>{if(!u)return;function U(P){if(A()||!a.current.floatingContext||!t.select("open"))return;const $=t.context.triggerElements;P.relatedTarget&&$.hasElement(P.relatedTarget)||(D(),M(),A()||N(P))}function j(P){C.clear(),D(),g.current?.(P),M()}function I(P){A()||N(P,!1)}const q=r;return q&&(q.addEventListener("mouseleave",U),q.addEventListener("mouseenter",j),q.addEventListener("mouseleave",I),q.addEventListener("pointerdown",V,!0)),()=>{q&&(q.removeEventListener("mouseleave",U),q.removeEventListener("mouseenter",j),q.removeEventListener("mouseleave",I),q.removeEventListener("pointerdown",V,!0))}})}function BL(n,e){return e&&!Yo(e)?0:typeof n=="function"?n():n}function i0(n){return typeof n=="function"?n():n}const _L={current:null};function Av(n,e={}){const t="rootStore"in n?n.rootStore:n,{dataRef:i,events:r}=t.context,{enabled:o=!0,delay:a=0,handleClose:u=null,mouseOnly:f=!1,restMs:d=0,move:p=!0,triggerElementRef:m=_L,externalTree:g,isActiveTrigger:v=!0}=e,x=no(g),{pointerTypeRef:w,interactedInsideRef:C,handlerRef:E,blockMouseMoveRef:k,performedPointerEventsMutationRef:T,unbindMouseMoveRef:A,restTimeoutPendingRef:O,openChangeTimeout:N,restTimeout:M,handleCloseOptionsRef:D}=ak(t),V=ln(u),U=ln(a),j=ln(d);v&&(D.current=V.current?.__options);const I=Se(()=>C.current?!0:i.current.openEvent?["click","mousedown"].includes(i.current.openEvent.type):!1),q=S.useCallback((H,z=!0)=>{const Q=Uh(U.current,"close",w.current);Q&&!E.current?N.start(Q,()=>t.setOpen(!1,Ke(Hn,H))):z&&(N.clear(),t.setOpen(!1,Ke(Hn,H)))},[U,E,t,w,N]),P=Se(()=>{A.current(),E.current=void 0}),$=Se(()=>{if(T.current){const H=Jt(t.select("domReferenceElement")).body;H.style.pointerEvents="",H.removeAttribute(J0),T.current=!1}});S.useEffect(()=>{if(!o)return;function H(z){z.open||(N.clear(),M.clear(),k.current=!0,O.current=!1)}return r.on("openchange",H),()=>{r.off("openchange",H)}},[o,r,N,M,k,O]);const _=Se(H=>{if(I()||!i.current.floatingContext)return;const z=t.context.triggerElements;if(H.relatedTarget&&z.hasElement(H.relatedTarget))return;const Q=m.current;V.current?.({...i.current.floatingContext,tree:x,x:H.clientX,y:H.clientY,onClose(){$(),P(),!I()&&Q===t.select("domReferenceElement")&&q(H)}})(H)});return S.useEffect(()=>{if(!o)return;const H=m.current??(v?t.select("domReferenceElement"):null);if(!yt(H))return;function z(B){if(N.clear(),k.current=!1,f&&!Yo(w.current)||i0(j.current)>0&&!Uh(U.current,"open"))return;const K=Uh(U.current,"open",w.current),X=t.select("domReferenceElement"),J=t.context.triggerElements,W=(J.hasElement(B.target)||J.hasMatchingElement(fe=>rt(fe,B.target)))&&(!X||!rt(X,B.target)),re=B.currentTarget??null,ae=!t.select("open")||W;K?N.start(K,()=>{ae&&t.setOpen(!0,Ke(Hn,B,re))}):ae&&t.setOpen(!0,Ke(Hn,B,re))}function Q(B){if(I()){$();return}A.current();const K=t.select("domReferenceElement"),X=Jt(K);M.clear(),O.current=!1;const J=t.context.triggerElements;if(!(B.relatedTarget&&J.hasElement(B.relatedTarget))){if(V.current&&i.current.floatingContext){t.select("open")||N.clear();const W=m.current;E.current=V.current({...i.current.floatingContext,tree:x,x:B.clientX,y:B.clientY,onClose(){$(),P(),!I()&&W===t.select("domReferenceElement")&&q(B,!0)}});const re=E.current;re(B),X.addEventListener("mousemove",re),A.current=()=>{X.removeEventListener("mousemove",re)};return}(w.current!=="touch"||!rt(t.select("floatingElement"),B.relatedTarget))&&q(B)}}function ee(B){_(B)}return t.select("open")&&H.addEventListener("mouseleave",ee),p&&H.addEventListener("mousemove",z,{once:!0}),H.addEventListener("mouseenter",z),H.addEventListener("mouseleave",Q),()=>{H.removeEventListener("mouseleave",ee),p&&H.removeEventListener("mousemove",z),H.removeEventListener("mouseenter",z),H.removeEventListener("mouseleave",Q)}},[P,$,k,i,U,q,t,o,V,_,v,I,f,p,w,j,M,O,N,m,x,A,E]),S.useMemo(()=>{function H(z){w.current=z.pointerType}return{onPointerDown:H,onPointerEnter:H,onMouseMove(z){const{nativeEvent:Q}=z,ee=z.currentTarget,B=t.select("domReferenceElement"),K=t.context.triggerElements,X=t.select("open"),J=(K.hasElement(z.target)||K.hasMatchingElement(re=>rt(re,z.target)))&&(!B||!rt(B,z.target));if(f&&!Yo(w.current)||X&&!J||i0(j.current)===0||!J&&O.current&&z.movementX**2+z.movementY**2<2)return;M.clear();function W(){!k.current&&(!X||J)&&t.setOpen(!0,Ke(Hn,Q,ee))}w.current==="touch"?ei.flushSync(()=>{W()}):J&&X?W():(O.current=!0,M.start(i0(j.current),W))}}},[k,f,t,w,j,M,O])}function il(n=[]){const e=n.map(d=>d?.reference),t=n.map(d=>d?.floating),i=n.map(d=>d?.item),r=n.map(d=>d?.trigger),o=S.useCallback(d=>hh(d,n,"reference"),e),a=S.useCallback(d=>hh(d,n,"floating"),t),u=S.useCallback(d=>hh(d,n,"item"),i),f=S.useCallback(d=>hh(d,n,"trigger"),r);return S.useMemo(()=>({getReferenceProps:o,getFloatingProps:a,getItemProps:u,getTriggerProps:f}),[o,a,u,f])}function hh(n,e,t){const i=new Map,r=t==="item",o={};t==="floating"&&(o.tabIndex=-1,o[G0]="");for(const a in n)r&&n&&(a===IR||a===BR)||(o[a]=n[a]);for(let a=0;a<e.length;a+=1){let u;const f=e[a]?.[t];typeof f=="function"?u=n?f(n):null:u=f,u&&k2(o,u,r,i)}return k2(o,n,r,i),o}function k2(n,e,t,i){for(const r in e){const o=e[r];t&&(r===IR||r===BR)||(r.startsWith("on")?(i.has(r)||i.set(r,[]),typeof o=="function"&&(i.get(r)?.push(o),n[r]=(...a)=>i.get(r)?.map(u=>u(...a)).find(u=>u!==void 0))):n[r]=o)}}const PL="Escape";function ep(n,e,t){switch(n){case"vertical":return e;case"horizontal":return t;default:return e||t}}function dh(n,e){return ep(e,n===uv||n===Mc,n===qs||n===Fs)}function r0(n,e,t){return ep(e,n===Mc,t?n===qs:n===Fs)||n==="Enter"||n===" "||n===""}function zL(n,e,t){return ep(e,t?n===qs:n===Fs,n===Mc)}function HL(n,e,t,i){const r=t?n===Fs:n===qs,o=n===uv;return e==="both"||e==="horizontal"&&i&&i>1?n===PL:ep(e,r,o)}function ck(n,e){const t="rootStore"in n?n.rootStore:n,i=t.useState("open"),r=t.useState("floatingElement"),o=t.useState("domReferenceElement"),a=t.context.dataRef,{listRef:u,activeIndex:f,onNavigate:d=()=>{},enabled:p=!0,selectedIndex:m=null,allowEscape:g=!1,loopFocus:v=!1,nested:x=!1,rtl:w=!1,virtual:C=!1,focusItemOnOpen:E="auto",focusItemOnHover:k=!0,openOnArrowKeyDown:T=!0,disabledIndices:A=void 0,orientation:O="vertical",parentOrientation:N,cols:M=1,scrollItemIntoView:D=!0,itemSizes:V,dense:U=!1,id:j,resetOnPointerLeave:I=!0,externalTree:q}=e,P=cc(r),$=ln(P),_=rs(),H=no(q);be(()=>{a.current.orientation=O},[a,O]);const z=Q0(o),Q=S.useRef(E),ee=S.useRef(m??-1),B=S.useRef(null),K=S.useRef(!0),X=Se(we=>{d(ee.current===-1?null:ee.current,we)}),J=S.useRef(X),W=S.useRef(!!r),re=S.useRef(i),ae=S.useRef(!1),fe=S.useRef(!1),pe=ln(A),Te=ln(i),le=ln(D),Ee=ln(m),Ce=ln(I),Ue=Se(()=>{function we(Ne){C?H?.events.emit("virtualfocus",Ne):jh(Ne,{sync:ae.current,preventScroll:!0})}const ye=u.current[ee.current],De=fe.current;ye&&we(ye),(ae.current?Ne=>Ne():requestAnimationFrame)(()=>{const Ne=u.current[ee.current]||ye;if(!Ne)return;ye||we(Ne);const Ge=le.current;Ge&&ve&&(De||!K.current)&&Ne.scrollIntoView?.(typeof Ge=="boolean"?{block:"nearest",inline:"nearest"}:Ge)})});be(()=>{p&&(i&&r?(ee.current=m??-1,Q.current&&m!=null&&(fe.current=!0,X())):W.current&&(ee.current=-1,J.current()))},[p,i,r,m,X]),be(()=>{if(p){if(!i){ae.current=!1;return}if(r)if(f==null){if(ae.current=!1,Ee.current!=null)return;if(W.current&&(ee.current=-1,Ue()),(!re.current||!W.current)&&Q.current&&(B.current!=null||Q.current===!0&&B.current==null)){let we=0;const ye=()=>{u.current[0]==null?(we<2&&(we?requestAnimationFrame:queueMicrotask)(ye),we+=1):(ee.current=B.current==null||r0(B.current,O,w)||x?Jg(u):g2(u),B.current=null,X())};ye()}}else Qu(u,f)||(ee.current=f,Ue(),fe.current=!1)}},[p,i,r,f,Ee,x,u,O,w,X,Ue,pe]),be(()=>{if(!p||r||!H||C||!W.current)return;const we=H.nodesRef.current,ye=we.find(Ge=>Ge.id===_)?.context?.elements.floating,De=yr(Jt(r)),Ne=we.some(Ge=>Ge.context&&rt(Ge.context.elements.floating,De));ye&&!Ne&&K.current&&ye.focus({preventScroll:!0})},[p,r,H,_,C]),be(()=>{J.current=X,re.current=i,W.current=!!r}),be(()=>{i||(B.current=null,Q.current=E)},[i,E]);const me=f!=null,ve=S.useMemo(()=>{function we(ye){if(!Te.current)return;const De=u.current.indexOf(ye.currentTarget);De!==-1&&ee.current!==De&&(ee.current=De,X(ye))}return{onFocus(ye){ae.current=!0,we(ye)},onClick:({currentTarget:ye})=>ye.focus({preventScroll:!0}),onMouseMove(ye){ae.current=!0,fe.current=!1,k&&we(ye)},onPointerLeave(ye){if(!Te.current||!K.current||ye.pointerType==="touch")return;ae.current=!0;const De=ye.relatedTarget;!k||u.current.includes(De)||Ce.current&&(ee.current=-1,X(ye),C||$.current?.focus({preventScroll:!0}))}}},[Te,$,k,u,X,Ce,C]),ge=S.useCallback(()=>N??H?.nodesRef.current.find(we=>we.id===_)?.context?.dataRef?.current.orientation,[_,H,N]),Ae=Se(we=>{if(K.current=!1,ae.current=!0,we.which===229||!Te.current&&we.currentTarget===$.current)return;if(x&&HL(we.key,O,w,M)){dh(we.key,ge())||Ln(we),t.setOpen(!1,Ke(Vh,we.nativeEvent)),_t(o)&&(C?H?.events.emit("virtualfocus",o):o.focus());return}const ye=ee.current,De=Jg(u,A),Ne=g2(u,A);if(z||(we.key==="Home"&&(Ln(we),ee.current=De,X(we)),we.key==="End"&&(Ln(we),ee.current=Ne,X(we))),M>1){const Ge=V||Array.from({length:u.current.length},()=>({width:1,height:1})),je=L8(Ge,M,U),mt=je.findIndex(st=>st!=null&&!Xu(u,st,A)),Dt=je.reduce((st,kt,xe)=>kt!=null&&!Xu(u,kt,A)?xe:st,-1),Qt=je[N8({current:je.map(st=>st!=null?u.current[st]:null)},{event:we,orientation:O,loopFocus:v,rtl:w,cols:M,disabledIndices:B8([...(typeof A!="function"?A:null)||u.current.map((st,kt)=>Xu(u,kt,A)?kt:void 0),void 0],je),minIndex:mt,maxIndex:Dt,prevIndex:I8(ee.current>Ne?De:ee.current,Ge,je,M,we.key===Mc?"bl":we.key===(w?qs:Fs)?"tr":"tl"),stopEvent:!0})];if(Qt!=null&&(ee.current=Qt,X(we)),O==="both")return}if(dh(we.key,O)){if(Ln(we),i&&!C&&yr(we.currentTarget.ownerDocument)===we.currentTarget){ee.current=r0(we.key,O,w)?De:Ne,X(we);return}r0(we.key,O,w)?v?ye>=Ne?g&&ye!==u.current.length?ee.current=-1:(ae.current=!1,ee.current=De):ee.current=Nn(u,{startingIndex:ye,disabledIndices:A}):ee.current=Math.min(Ne,Nn(u,{startingIndex:ye,disabledIndices:A})):v?ye<=De?g&&ye!==-1?ee.current=u.current.length:(ae.current=!1,ee.current=Ne):ee.current=Nn(u,{startingIndex:ye,decrement:!0,disabledIndices:A}):ee.current=Math.max(De,Nn(u,{startingIndex:ye,decrement:!0,disabledIndices:A})),Qu(u,ee.current)&&(ee.current=-1),X(we)}}),Oe=S.useMemo(()=>C&&i&&me&&{"aria-activedescendant":`${j}-${f}`},[C,i,me,j,f]),Ye=S.useMemo(()=>({"aria-orientation":O==="both"?void 0:O,...z?{}:Oe,onKeyDown(we){if(we.key==="Tab"&&we.shiftKey&&i&&!C){const ye=Tn(we.nativeEvent);if(ye&&!rt($.current,ye))return;Ln(we),t.setOpen(!1,Ke(Go,we.nativeEvent)),_t(o)&&o.focus();return}Ae(we)},onPointerMove(){K.current=!0}}),[Oe,Ae,$,O,z,t,i,C,o]),de=S.useMemo(()=>{function we(De){E==="auto"&&PR(De.nativeEvent)&&(Q.current=!C)}function ye(De){Q.current=E,E==="auto"&&zR(De.nativeEvent)&&(Q.current=!0)}return{onKeyDown(De){const Ne=t.select("open");K.current=!1;const Ge=De.key.startsWith("Arrow"),je=zL(De.key,ge(),w),mt=dh(De.key,O),Dt=(x?je:mt)||De.key==="Enter"||De.key.trim()==="";if(C&&Ne)return Ae(De);if(!(!Ne&&!T&&Ge)){if(Dt){const Qt=dh(De.key,ge());B.current=x&&Qt?null:De.key}if(x){je&&(Ln(De),Ne?(ee.current=Jg(u,pe.current),X(De)):t.setOpen(!0,Ke(Vh,De.nativeEvent,De.currentTarget)));return}mt&&(Ee.current!=null&&(ee.current=Ee.current),Ln(De),!Ne&&T?t.setOpen(!0,Ke(Vh,De.nativeEvent,De.currentTarget)):Ae(De),Ne&&X(De))}},onFocus(De){t.select("open")&&!C&&(ee.current=-1,X(De))},onPointerDown:ye,onPointerEnter:ye,onMouseDown:we,onClick:we}},[Ae,pe,E,u,x,X,t,T,O,ge,w,Ee,C]),ke=S.useMemo(()=>({...Oe,...de}),[Oe,de]);return S.useMemo(()=>p?{reference:ke,floating:Ye,item:ve,trigger:de}:{},[p,ke,Ye,de,ve])}const VL=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function fk(n,e={}){const t="rootStore"in n?n.rootStore:n,i=t.useState("open"),r=t.useState("floatingId"),o=t.useState("domReferenceElement"),a=t.useState("floatingElement"),{enabled:u=!0,role:f="dialog"}=e,d=el(),p=o?.id||d,m=S.useMemo(()=>cc(a)?.id||r,[a,r]),g=VL.get(f)??f,v=rs()!=null,x=S.useMemo(()=>g==="tooltip"||f==="label"?Pt:{"aria-haspopup":g==="alertdialog"?"dialog":g,"aria-expanded":"false",...g==="listbox"&&{role:"combobox"},...g==="menu"&&v&&{role:"menuitem"},...f==="select"&&{"aria-autocomplete":"none"},...f==="combobox"&&{"aria-autocomplete":"list"}},[g,v,f]),w=S.useMemo(()=>g==="tooltip"||f==="label"?{[`aria-${f==="label"?"labelledby":"describedby"}`]:i?m:void 0}:{...x,"aria-expanded":i?"true":"false","aria-controls":i?m:void 0,...g==="menu"&&{id:p}},[g,m,i,p,f,x]),C=S.useMemo(()=>{const k={id:m,...g&&{role:g}};return g==="tooltip"||f==="label"?k:{...k,...g==="menu"&&{"aria-labelledby":p}}},[g,m,p,f]),E=S.useCallback(({active:k,selected:T})=>{const A={role:"option",...k&&{id:`${m}-fui-option`}};switch(f){case"select":case"combobox":return{...A,"aria-selected":T}}return{}},[m,f]);return S.useMemo(()=>u?{reference:w,floating:C,item:E,trigger:x}:{},[u,w,C,x,E])}function hk(n,e){const t="rootStore"in n?n.rootStore:n,i=t.useState("open"),r=t.context.dataRef,{listRef:o,activeIndex:a,onMatch:u,onTypingChange:f,enabled:d=!0,findMatch:p=null,resetMs:m=750,ignoreKeys:g=Ys,selectedIndex:v=null}=e,x=en(),w=S.useRef(""),C=S.useRef(v??a??-1),E=S.useRef(null);be(()=>{i&&(x.clear(),E.current=null,w.current="")},[i,x]),be(()=>{i&&w.current===""&&(C.current=v??a??-1)},[i,v,a]);const k=Se(N=>{N?r.current.typing||(r.current.typing=N,f?.(N)):r.current.typing&&(r.current.typing=N,f?.(N))}),T=Se(N=>{function M(j,I,q){const P=p?p(I,q):I.find($=>$?.toLocaleLowerCase().indexOf(q.toLocaleLowerCase())===0);return P?j.indexOf(P):-1}const D=o.current;if(w.current.length>0&&w.current[0]!==" "&&(M(D,D,w.current)===-1?k(!1):N.key===" "&&Ln(N)),D==null||g.includes(N.key)||N.key.length!==1||N.ctrlKey||N.metaKey||N.altKey)return;i&&N.key!==" "&&(Ln(N),k(!0)),D.every(j=>j?j[0]?.toLocaleLowerCase()!==j[1]?.toLocaleLowerCase():!0)&&w.current===N.key&&(w.current="",C.current=E.current),w.current+=N.key,x.start(m,()=>{w.current="",C.current=E.current,k(!1)});const V=C.current,U=M(D,[...D.slice((V||0)+1),...D.slice(0,(V||0)+1)],w.current);U!==-1?(u?.(U),E.current=U):N.key!==" "&&(w.current="",k(!1))}),A=S.useMemo(()=>({onKeyDown:T}),[T]),O=S.useMemo(()=>({onKeyDown:T,onKeyUp(N){N.key===" "&&k(!1)}}),[T,k]);return S.useMemo(()=>d?{reference:A,floating:O}:{},[d,A,O])}function T2(n,e){const[t,i]=n;let r=!1;const o=e.length;for(let a=0,u=o-1;a<o;u=a++){const[f,d]=e[a]||[0,0],[p,m]=e[u]||[0,0];d>=i!=m>=i&&t<=(p-f)*(i-d)/(m-d)+f&&(r=!r)}return r}function UL(n,e){return n[0]>=e.x&&n[0]<=e.x+e.width&&n[1]>=e.y&&n[1]<=e.y+e.height}function Ov(n={}){const{buffer:e=.5,blockPointerEvents:t=!1,requireIntent:i=!0}=n,r=new Ks;let o=!1,a=null,u=null,f=typeof performance<"u"?performance.now():0;function d(m,g){const v=performance.now(),x=v-f;if(a===null||u===null||x===0)return a=m,u=g,f=v,null;const w=m-a,C=g-u,E=Math.sqrt(w*w+C*C)/x;return a=m,u=g,f=v,E}const p=({x:m,y:g,placement:v,elements:x,onClose:w,nodeId:C,tree:E})=>function(k){function T(){r.clear(),w()}if(r.clear(),!x.domReference||!x.floating||v==null||m==null||g==null)return;const{clientX:A,clientY:O}=k,N=[A,O],M=Tn(k),D=k.type==="mouseleave",V=rt(x.floating,M),U=rt(x.domReference,M),j=x.domReference.getBoundingClientRect(),I=x.floating.getBoundingClientRect(),q=v.split("-")[0],P=m>I.right-I.width/2,$=g>I.bottom-I.height/2,_=UL(N,j),H=I.width>j.width,z=I.height>j.height,Q=(H?j:I).left,ee=(H?j:I).right,B=(z?j:I).top,K=(z?j:I).bottom;if(V&&(o=!0,!D))return;if(U&&(o=!1),U&&!D){o=!0;return}if(D&&yt(k.relatedTarget)&&rt(x.floating,k.relatedTarget)||E&&Ho(E.nodesRef.current,C).some(({context:W})=>W?.open))return;if(q==="top"&&g>=j.bottom-1||q==="bottom"&&g<=j.top+1||q==="left"&&m>=j.right-1||q==="right"&&m<=j.left+1)return T();let X=[];switch(q){case"top":X=[[Q,j.top+1],[Q,I.bottom-1],[ee,I.bottom-1],[ee,j.top+1]];break;case"bottom":X=[[Q,I.top+1],[Q,j.bottom-1],[ee,j.bottom-1],[ee,I.top+1]];break;case"left":X=[[I.right-1,K],[I.right-1,B],[j.left+1,B],[j.left+1,K]];break;case"right":X=[[j.right-1,K],[j.right-1,B],[I.left+1,B],[I.left+1,K]];break}function J([W,re]){switch(q){case"top":{const ae=[H?W+e/2:P?W+e*4:W-e*4,re+e+1],fe=[H?W-e/2:P?W+e*4:W-e*4,re+e+1],pe=[[I.left,P||H?I.bottom-e:I.top],[I.right,P?H?I.bottom-e:I.top:I.bottom-e]];return[ae,fe,...pe]}case"bottom":{const ae=[H?W+e/2:P?W+e*4:W-e*4,re-e],fe=[H?W-e/2:P?W+e*4:W-e*4,re-e],pe=[[I.left,P||H?I.top+e:I.bottom],[I.right,P?H?I.top+e:I.bottom:I.top+e]];return[ae,fe,...pe]}case"left":{const ae=[W+e+1,z?re+e/2:$?re+e*4:re-e*4],fe=[W+e+1,z?re-e/2:$?re+e*4:re-e*4];return[[$||z?I.right-e:I.left,I.top],[$?z?I.right-e:I.left:I.right-e,I.bottom],ae,fe]}case"right":{const ae=[W-e,z?re+e/2:$?re+e*4:re-e*4],fe=[W-e,z?re-e/2:$?re+e*4:re-e*4],pe=[[$||z?I.left+e:I.right,I.top],[$?z?I.left+e:I.right:I.left+e,I.bottom]];return[ae,fe,...pe]}default:return[]}}if(!T2([A,O],X)){if(o&&!_)return T();if(!D&&i){const W=d(k.clientX,k.clientY);if(W!==null&&W<.1)return T()}T2([A,O],J([m,g]))?!o&&i&&r.start(40,T):T()}};return p.__options={blockPointerEvents:t},p}const jL={...kv,disabled:oe(n=>n.disabled),instantType:oe(n=>n.instantType),isInstantPhase:oe(n=>n.isInstantPhase),trackCursorAxis:oe(n=>n.trackCursorAxis),disableHoverablePopup:oe(n=>n.disableHoverablePopup),lastOpenChangeReason:oe(n=>n.openChangeReason),closeDelay:oe(n=>n.closeDelay)};class Mv extends Jd{constructor(e){super({...qL(),...e},{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Nc},jL)}setOpen=(e,t)=>{const i=t.reason,r=i===Hn,o=e&&i===fc,a=!e&&(i===Xr||i===Xd);if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;const u=()=>{const f={open:e,openChangeReason:i};o?f.instantType="focus":a?f.instantType="dismiss":i===Hn&&(f.instantType=void 0);const d=t.trigger?.id??null;(d||e)&&(f.activeTriggerId=d,f.activeTriggerElement=t.trigger??null),this.update(f)};r?ei.flushSync(u):u()};static useStore(e,t){const i=Un(()=>e??new Mv(t)).current,r=Tv({popupStore:i,onOpenChange:i.setOpen});return i.state.floatingRootContext=r,i}}function qL(){return{...Rv(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0}}function FL(n){const{disabled:e=!1,defaultOpen:t=!1,open:i,disableHoverablePopup:r=!1,trackCursorAxis:o="none",actionsRef:a,onOpenChange:u,onOpenChangeComplete:f,handle:d,triggerId:p,defaultTriggerId:m=null,children:g}=n,v=Mv.useStore(d?.store,{open:i??t,activeTriggerId:p!==void 0?p:m});v.useControlledProp("open",i,t),v.useControlledProp("activeTriggerId",p,m),v.useContextCallback("onOpenChange",u),v.useContextCallback("onOpenChangeComplete",f);const x=v.useState("open"),w=v.useState("activeTriggerId"),C=v.useState("payload");v.useSyncedValues({trackCursorAxis:o,disableHoverablePopup:r});const E=!e&&x;be(()=>{x&&e&&v.setOpen(!1,Ke(G8))},[x,e,v]),v.useSyncedValue("disabled",e),wv(v);const{forceUnmount:k,transitionStatus:T}=Ev(E,v),A=v.useState("isInstantPhase"),O=v.useState("instantType"),N=v.useState("lastOpenChangeReason"),M=S.useRef(null);be(()=>{T==="ending"&&N===ss||T!=="ending"&&A?(O!=="delay"&&(M.current=O),v.set("instantType","delay")):M.current!==null&&(v.set("instantType",M.current),M.current=null)},[T,A,N,O,v]),be(()=>{E&&w==null&&v.set("payload",void 0)},[v,w,E]);const D=S.useCallback(()=>{v.setOpen(!1,$L(v,pv))},[v]);S.useImperativeHandle(a,()=>({unmount:k,close:D}),[k,D]);const V=v.useState("floatingRootContext"),U=lk(V,{enabled:!e}),j=Zd(V,{enabled:!e,referencePress:!0}),I=EL(V,{enabled:!e&&o!=="none",axis:o==="none"?void 0:o}),{getReferenceProps:q,getFloatingProps:P,getTriggerProps:$}=il([U,j,I]),_=S.useMemo(()=>q(),[q]),H=S.useMemo(()=>$(),[$]),z=S.useMemo(()=>P(),[P]);return v.useSyncedValues({floatingRootContext:V,activeTriggerProps:_,inactiveTriggerProps:H,popupProps:z}),Y.jsx(AR.Provider,{value:v,children:typeof g=="function"?g({payload:C}):g})}function $L(n,e){const t=Ke(e);return t.preventUnmountOnClose=()=>{n.set("preventUnmountingOnClose",!0)},t}let ba=(function(n){return n.startingStyle="data-starting-style",n.endingStyle="data-ending-style",n})({});const KL={[ba.startingStyle]:""},YL={[ba.endingStyle]:""},Ot={transitionStatus(n){return n==="starting"?KL:n==="ending"?YL:null}};let Wi=(function(n){return n.open="data-open",n.closed="data-closed",n[n.startingStyle=ba.startingStyle]="startingStyle",n[n.endingStyle=ba.endingStyle]="endingStyle",n.anchorHidden="data-anchor-hidden",n})({}),ey=(function(n){return n.popupOpen="data-popup-open",n.pressed="data-pressed",n})({});const GL={[ey.popupOpen]:""},QL={[ey.popupOpen]:"",[ey.pressed]:""},XL={[Wi.open]:""},WL={[Wi.closed]:""},ZL={[Wi.anchorHidden]:""},Lc={open(n){return n?GL:null}},hc={open(n){return n?QL:null}},Gt={open(n){return n?XL:WL},anchorHidden(n){return n?ZL:null}};function Ht(n){return el(n,"base-ui")}const JL=S.createContext(void 0);function e5(){return S.useContext(JL)}const t5=600,n5=S.forwardRef(function(n,e){const{className:t,render:i,handle:r,payload:o,disabled:a,delay:u,closeDelay:f,id:d,...p}=n,m=Oc(!0),g=r?.store??m;if(!g)throw new Error(bt(82));const v=Ht(d),x=g.useState("isTriggerActive",v),w=g.useState("floatingRootContext"),C=g.useState("isOpenedByTrigger",v),E=S.useRef(null),k=u??t5,T=f??0,{registerTrigger:A,isMountedByThisTrigger:O}=Sv(v,E,g,{payload:o,closeDelay:T}),N=e5(),{delayRef:M,isInstantPhase:D,hasProvider:V}=W8(w,{open:C});g.useSyncedValue("isInstantPhase",D);const U=g.useState("disabled"),j=a??U,I=g.useState("trackCursorAxis"),q=g.useState("disableHoverablePopup"),P=Av(w,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!q&&I!=="both"?Ov():null,restMs(){const H=N?.delay,z=typeof M.current=="object"?M.current.open:void 0;let Q=k;return V&&(z!==0?Q=u??H??k:Q=0),Q},delay(){const H=typeof M.current=="object"?M.current.close:void 0;let z=T;return f==null&&V&&(z=H),{close:z}},triggerElementRef:E,isActiveTrigger:x}),$=S.useMemo(()=>({open:C}),[C]),_=g.useState("triggerProps",O);return Fe("button",n,{state:$,ref:[e,A,E],props:[P,_,{id:v},p],stateAttributesMapping:Lc})}),dk=S.createContext(void 0);function i5(){const n=S.useContext(dk);if(n===void 0)throw new Error(bt(70));return n}const r5=S.forwardRef(function(n,e){const{children:t,container:i,className:r,render:o,...a}=n,{portalNode:u,portalSubtree:f}=rk({container:i,ref:e,componentProps:n,elementProps:a});return!f&&!u?null:Y.jsxs(S.Fragment,{children:[f,u&&ei.createPortal(t,u)]})}),s5=S.forwardRef(function(n,e){const{keepMounted:t=!1,...i}=n;return Oc().useState("mounted")||t?Y.jsx(dk.Provider,{value:t,children:Y.jsx(r5,{ref:e,...i})}):null}),pk=S.createContext(void 0);function mk(){const n=S.useContext(pk);if(n===void 0)throw new Error(bt(71));return n}const o5=S.createContext(void 0);function Dv(){return S.useContext(o5)?.direction??"ltr"}const l5=n=>({name:"arrow",options:n,async fn(e){const{x:t,y:i,placement:r,rects:o,platform:a,elements:u,middlewareData:f}=e,{element:d,padding:p=0,offsetParent:m="real"}=ts(n,e)||{};if(d==null)return{};const g=uR(p),v={x:t,y:i},x=ov(r),w=sv(x),C=await a.getDimensions(d),E=x==="y",k=E?"top":"left",T=E?"bottom":"right",A=E?"clientHeight":"clientWidth",O=o.reference[w]+o.reference[x]-v[x]-o.floating[w],N=v[x]-o.reference[x],M=m==="real"?await a.getOffsetParent?.(d):u.floating;let D=u.floating[A]||o.floating[w];(!D||!await a.isElement?.(M))&&(D=u.floating[A]||o.floating[w]);const V=O/2-N/2,U=D/2-C[w]/2-1,j=Math.min(g[k],U),I=Math.min(g[T],U),q=j,P=D-C[w]-I,$=D/2-C[w]/2+V,_=q0(q,$,P),H=!f.arrow&&to(r)!=null&&$!==_&&o.reference[w]/2-($<q?j:I)-C[w]/2<0,z=H?$<q?$-q:$-P:0;return{[x]:v[x]+z,data:{[x]:_,centerOffset:$-_-z,...H&&{alignmentOffset:z}},reset:H}}}),a5=(n,e)=>({...l5(n),options:[n,e]}),u5={name:"hide",async fn(n){const{width:e,height:t,x:i,y:r}=n.rects.reference,o=e===0&&t===0&&i===0&&r===0;return{data:{referenceHidden:(await _N().fn(n)).data?.referenceHidden||o}}}},qh={sideX:"left",sideY:"top"},c5={name:"adaptiveOrigin",async fn(n){const{x:e,y:t,rects:{floating:i},elements:{floating:r},platform:o,strategy:a,placement:u}=n,f=Yt(r),d=f.getComputedStyle(r);if(!(d.transitionDuration!=="0s"&&d.transitionDuration!==""))return{x:e,y:t,data:qh};const p=await o.getOffsetParent?.(r);let m={width:0,height:0};if(a==="fixed"&&f?.visualViewport)m={width:f.visualViewport.width,height:f.visualViewport.height};else if(p===f){const E=Hi(r);m={width:E.documentElement.clientWidth,height:E.documentElement.clientHeight}}else await o.isElement?.(p)&&(m=await o.getDimensions(p));const g=Wn(u);let v=e,x=t;g==="left"&&(v=m.width-(e+i.width)),g==="top"&&(x=m.height-(t+i.height));const w=g==="left"?"right":qh.sideX,C=g==="top"?"bottom":qh.sideY;return{x:v,y:x,data:{sideX:w,sideY:C}}}};function gk(n,e,t){const i=n==="inline-start"||n==="inline-end";return{top:"top",right:i?t?"inline-start":"inline-end":"right",bottom:"bottom",left:i?t?"inline-end":"inline-start":"left"}[e]}function A2(n,e,t){const{rects:i,placement:r}=n;return{side:gk(e,Wn(r),t),align:to(r)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function Nv(n){const{anchor:e,positionMethod:t="absolute",side:i="bottom",sideOffset:r=0,align:o="center",alignOffset:a=0,collisionBoundary:u,collisionPadding:f=5,sticky:d=!1,arrowPadding:p=5,disableAnchorTracking:m=!1,keepMounted:g=!1,floatingRootContext:v,mounted:x,collisionAvoidance:w,shiftCrossAxis:C=!1,nodeId:E,adaptiveOrigin:k,lazyFlip:T=!1,externalTree:A}=n,[O,N]=S.useState(null);!x&&O!==null&&N(null);const M=w.side||"flip",D=w.align||"flip",V=w.fallbackAxisSide||"end",U=typeof e=="function"?e:void 0,j=Se(U),I=U?j:e,q=ln(e),P=Dv()==="rtl",$=O||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":P?"left":"right","inline-start":P?"right":"left"}[i],_=o==="center"?$:`${$}-${o}`;let H=f;const z=1,Q=i==="bottom"?z:0,ee=i==="top"?z:0,B=i==="right"?z:0,K=i==="left"?z:0;typeof H=="number"?H={top:H+Q,right:H+K,bottom:H+ee,left:H+B}:H&&(H={top:(H.top||0)+Q,right:(H.right||0)+K,bottom:(H.bottom||0)+ee,left:(H.left||0)+B});const X={boundary:u==="clipping-ancestors"?"clippingAncestors":u,padding:H},J=S.useRef(null),W=ln(r),re=ln(a),ae=[DN(xe=>{const He=A2(xe,i,P),Xe=typeof W.current=="function"?W.current(He):W.current,On=typeof re.current=="function"?re.current(He):re.current;return{mainAxis:Xe,crossAxis:On,alignmentAxis:On}},[typeof r!="function"?r:0,typeof a!="function"?a:0,P,i])],fe=D==="none"&&M!=="shift",pe=!fe&&(d||C||M==="shift"),Te=M==="none"?null:IN({...X,padding:{top:H.top+z,right:H.right+z,bottom:H.bottom+z,left:H.left+z},mainAxis:!C&&M==="flip",crossAxis:D==="flip"?"alignment":!1,fallbackAxisSideDirection:V}),le=fe?null:NN(xe=>{const He=Hi(xe.elements.floating).documentElement;return{...X,rootBoundary:C?{x:0,y:0,width:He.clientWidth,height:He.clientHeight}:void 0,mainAxis:D!=="none",crossAxis:pe,limiter:d||C?void 0:LN(Xe=>{if(!J.current)return{};const{width:On,height:hn}=J.current.getBoundingClientRect(),vn=Ii(Wn(Xe.placement)),bn=vn==="y"?On:hn,Mn=vn==="y"?H.left+H.right:H.top+H.bottom;return{offset:bn/2+Mn/2}})}},[X,d,C,H,D]);M==="shift"||D==="shift"||o==="center"?ae.push(le,Te):ae.push(Te,le),ae.push(BN({...X,apply({elements:{floating:xe},rects:{reference:He},availableWidth:Xe,availableHeight:On}){Object.entries({"--available-width":`${Xe}px`,"--available-height":`${On}px`,"--anchor-width":`${He.width}px`,"--anchor-height":`${He.height}px`}).forEach(([hn,vn])=>{xe.style.setProperty(hn,vn)})}}),a5(()=>({element:J.current||document.createElement("div"),padding:p,offsetParent:"floating"}),[p]),{name:"transformOrigin",fn(xe){const{elements:He,middlewareData:Xe,placement:On,rects:hn,y:vn}=xe,bn=Wn(On),Mn=Ii(bn),Bt=J.current,dn=Xe.arrow?.x||0,lr=Xe.arrow?.y||0,$i=Bt?.clientWidth||0,oo=Bt?.clientHeight||0,tt=dn+$i/2,Vt=lr+oo/2,xn=Math.abs(Xe.shift?.y||0),ar=hn.reference.height/2,un=typeof r=="function"?r(A2(xe,i,P)):r,sl=xn>un,Uc={top:`${tt}px calc(100% + ${un}px)`,bottom:`${tt}px ${-un}px`,left:`calc(100% + ${un}px) ${Vt}px`,right:`${-un}px ${Vt}px`}[bn],Ba=`${tt}px ${hn.reference.y+ar-vn}px`;return He.floating.style.setProperty("--transform-origin",pe&&Mn==="y"&&sl?Ba:Uc),{}}},u5,k),be(()=>{!x&&v&&v.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[x,v]);const Ee=S.useMemo(()=>({elementResize:!m&&typeof ResizeObserver<"u",layoutShift:!m&&typeof IntersectionObserver<"u"}),[m]),{refs:Ce,elements:Ue,x:me,y:ve,middlewareData:ge,update:Ae,placement:Oe,context:Ye,isPositioned:de,floatingStyles:ke}=DL({rootContext:v,placement:_,middleware:ae,strategy:t,whileElementsMounted:g?void 0:(...xe)=>i2(...xe,Ee),nodeId:E,externalTree:A}),{sideX:we,sideY:ye}=ge.adaptiveOrigin||qh,De=de?t:"fixed",Ne=S.useMemo(()=>k?{position:De,[we]:me,[ye]:ve}:{position:De,...ke},[k,De,we,me,ye,ve,ke]),Ge=S.useRef(null);be(()=>{if(!x)return;const xe=q.current,He=typeof xe=="function"?xe():xe,Xe=(O2(He)?He.current:He)||null||null;Xe!==Ge.current&&(Ce.setPositionReference(Xe),Ge.current=Xe)},[x,Ce,I,q]),S.useEffect(()=>{if(!x)return;const xe=q.current;typeof xe!="function"&&O2(xe)&&xe.current!==Ge.current&&(Ce.setPositionReference(xe.current),Ge.current=xe.current)},[x,Ce,I,q]),S.useEffect(()=>{if(g&&x&&Ue.domReference&&Ue.floating)return i2(Ue.domReference,Ue.floating,Ae,Ee)},[g,x,Ue,Ae,Ee]);const je=Wn(Oe),mt=gk(i,je,P),Dt=to(Oe)||"center",Qt=!!ge.hide?.referenceHidden;be(()=>{T&&x&&de&&N(je)},[T,x,de,je]);const st=S.useMemo(()=>({position:"absolute",top:ge.arrow?.y,left:ge.arrow?.x}),[ge.arrow]),kt=ge.arrow?.centerOffset!==0;return S.useMemo(()=>({positionerStyles:Ne,arrowStyles:st,arrowRef:J,arrowUncentered:kt,side:mt,align:Dt,physicalSide:je,anchorHidden:Qt,refs:Ce,context:Ye,isPositioned:de,update:Ae}),[Ne,st,J,kt,mt,Dt,je,Qt,Ce,Ye,de,Ae])}function O2(n){return n!=null&&"current"in n}function tp(n){return n==="starting"?$8:Pt}const f5=S.forwardRef(function(n,e){const{render:t,className:i,anchor:r,positionMethod:o="absolute",side:a="top",align:u="center",sideOffset:f=0,alignOffset:d=0,collisionBoundary:p="clipping-ancestors",collisionPadding:m=5,arrowPadding:g=5,sticky:v=!1,disableAnchorTracking:x=!1,collisionAvoidance:w=QR,...C}=n,E=Oc(),k=i5(),T=E.useState("open"),A=E.useState("mounted"),O=E.useState("trackCursorAxis"),N=E.useState("disableHoverablePopup"),M=E.useState("floatingRootContext"),D=E.useState("instantType"),V=E.useState("transitionStatus"),U=Nv({anchor:r,positionMethod:o,floatingRootContext:M,mounted:A,side:a,sideOffset:f,align:u,alignOffset:d,collisionBoundary:p,collisionPadding:m,sticky:v,arrowPadding:g,disableAnchorTracking:x,keepMounted:k,collisionAvoidance:w,adaptiveOrigin:c5}),j=S.useMemo(()=>{const $={};return(!T||O==="both"||N)&&($.pointerEvents="none"),{role:"presentation",hidden:!A,style:{...U.positionerStyles,...$}}},[T,O,N,A,U.positionerStyles]),I=S.useMemo(()=>({open:T,side:U.side,align:U.align,anchorHidden:U.anchorHidden,instant:O!=="none"?"tracking-cursor":D}),[T,U.side,U.align,U.anchorHidden,O,D]),q=S.useMemo(()=>({...I,arrowRef:U.arrowRef,arrowStyles:U.arrowStyles,arrowUncentered:U.arrowUncentered}),[I,U.arrowRef,U.arrowStyles,U.arrowUncentered]),P=Fe("div",n,{state:I,props:[j,tp(V),C],ref:[e,E.useStateSetter("positionerElement")],stateAttributesMapping:Gt});return Y.jsx(pk.Provider,{value:q,children:P})});function M2(n){const e=ti(n);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=_t(n),o=r?n.offsetWidth:t,a=r?n.offsetHeight:i;return(ma(t)!==o||ma(i)!==a)&&(t=o,i=a),{width:t,height:i}}const h5=typeof ResizeObserver<"u",d5=()=>!0;function p5(n){const{popupElement:e,positionerElement:t,content:i,mounted:r,enabled:o=d5,onMeasureLayout:a,onMeasureLayoutComplete:u,side:f,direction:d}=n,p=S.useRef(!0),m=xv(e,!0,!1),g=tl(),v=S.useRef(null),x=Se(a),w=Se(u),C=S.useMemo(()=>{let E=f==="top",k=f==="left";return d==="rtl"?(E=E||f==="inline-end",k=k||f==="inline-end"):(E=E||f==="inline-start",k=k||f==="inline-start"),E?{position:"absolute",[f==="top"?"bottom":"top"]:"0",[k?"right":"left"]:"0"}:Pt},[f,d]);be(()=>{if(!r||!o()||!h5){p.current=!0,v.current=null;return}if(!e||!t)return;Object.entries(C).forEach(([V,U])=>{e.style.setProperty(V,U)});const E=new ResizeObserver(V=>{const U=V[0];U&&(v.current===null?v.current={width:Math.ceil(U.borderBoxSize[0].inlineSize),height:Math.ceil(U.borderBoxSize[0].blockSize)}:(v.current.width=Math.ceil(U.borderBoxSize[0].inlineSize),v.current.height=Math.ceil(U.borderBoxSize[0].blockSize)))});E.observe(e),e.style.setProperty("--popup-width","auto"),e.style.setProperty("--popup-height","auto");const k=Iu(e,"position","static"),T=Iu(e,"transform","none"),A=Iu(e,"scale","1"),O=Iu(t,"--available-width","max-content"),N=Iu(t,"--available-height","max-content");if(x?.(),p.current||v.current===null){t.style.setProperty("--positioner-width","max-content"),t.style.setProperty("--positioner-height","max-content");const V=M2(e);return t.style.setProperty("--positioner-width",`${V.width}px`),t.style.setProperty("--positioner-height",`${V.height}px`),k(),T(),A(),O(),N(),w?.(null,V),p.current=!1,()=>{E.disconnect()}}e.style.setProperty("--popup-width","auto"),e.style.setProperty("--popup-height","auto"),t.style.setProperty("--positioner-width","max-content"),t.style.setProperty("--positioner-height","max-content");const M=M2(e);e.style.setProperty("--popup-width",`${v.current.width}px`),e.style.setProperty("--popup-height",`${v.current.height}px`),k(),T(),O(),N(),w?.(v.current,M),t.style.setProperty("--positioner-width",`${M.width}px`),t.style.setProperty("--positioner-height",`${M.height}px`);const D=new AbortController;return g.request(()=>{e.style.setProperty("--popup-width",`${M.width}px`),e.style.setProperty("--popup-height",`${M.height}px`),m(()=>{e.style.setProperty("--popup-width","auto"),e.style.setProperty("--popup-height","auto")},D.signal)}),()=>{E.disconnect(),D.abort(),g.cancel()}},[i,e,t,m,g,o,r,x,w,C])}function Iu(n,e,t){const i=n.style.getPropertyValue(e);return n.style.setProperty(e,t),()=>{n.style.setProperty(e,i)}}const m5={...Gt,...Ot},g5=S.forwardRef(function(n,e){const{className:t,render:i,...r}=n,o=Oc(),{side:a,align:u}=mk(),f=o.useState("open"),d=o.useState("mounted"),p=o.useState("instantType"),m=o.useState("transitionStatus"),g=o.useState("popupProps"),v=o.useState("payload"),x=o.useState("popupElement"),w=o.useState("positionerElement"),C=o.useState("floatingRootContext"),E=Dv();sr({open:f,ref:o.context.popupRef,onComplete(){f&&o.context.onOpenChangeComplete?.(!0)}});function k(){C.context.events.emit("measure-layout")}function T(D,V){C.context.events.emit("measure-layout-complete",{previousDimensions:D,nextDimensions:V})}const A=S.useCallback(()=>o.context.triggerElements.size>1,[o]);p5({popupElement:x,positionerElement:w,mounted:d,content:v,enabled:A,onMeasureLayout:k,onMeasureLayoutComplete:T,side:a,direction:E});const O=o.useState("disabled"),N=o.useState("closeDelay");uk(C,{enabled:!O,closeDelay:N});const M=S.useMemo(()=>({open:f,side:a,align:u,instant:p,transitionStatus:m}),[f,a,u,p,m]);return Fe("div",n,{state:M,ref:[e,o.context.popupRef,o.useStateSetter("popupElement")],props:[g,tp(m),r],stateAttributesMapping:m5})}),y5=S.forwardRef(function(n,e){const{className:t,render:i,...r}=n,o=Oc().useState("instantType"),{open:a,arrowRef:u,side:f,align:d,arrowUncentered:p,arrowStyles:m}=mk(),g=S.useMemo(()=>({open:a,side:f,align:d,uncentered:p,instant:o}),[a,f,d,p,o]);return Fe("div",n,{state:g,ref:[e,u],props:[{style:m,"aria-hidden":!0},r],stateAttributesMapping:Gt})});function Lv(n){return mv(19)?n:n?"true":void 0}const yk=S.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function vk(n=!1){const e=S.useContext(yk);if(!e&&!n)throw new Error(bt(86));return e}const RH=S.forwardRef(function(n,e){const{render:t,className:i,disabled:r=!1,...o}=n,[a,u]=S.useState(void 0),f=S.useMemo(()=>({disabled:r}),[r]),d=Fe("fieldset",n,{ref:e,state:f,props:[{"aria-labelledby":a},o]}),p=S.useMemo(()=>({legendId:a,setLegendId:u,disabled:r}),[a,u,r]);return Y.jsx(yk.Provider,{value:p,children:d})}),kH=S.forwardRef(function(n,e){const{render:t,className:i,id:r,...o}=n,{disabled:a,setLegendId:u}=vk(),f=Ht(r);be(()=>(u(f),()=>{u(void 0)}),[u,f]);const d=S.useMemo(()=>({disabled:a??!1}),[a]);return Fe("div",n,{state:d,ref:e,props:[{id:f},o]})});let D2=(function(n){return n.disabled="data-disabled",n.valid="data-valid",n.invalid="data-invalid",n.touched="data-touched",n.dirty="data-dirty",n.filled="data-filled",n.focused="data-focused",n})({});const np={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},ii={valid(n){return n===null?null:n?{[D2.valid]:""}:{[D2.invalid]:""}}},bk=S.createContext({invalid:void 0,name:void 0,validityData:{state:np,errors:[],error:"",value:"",initialValue:null},setValidityData:Qn,disabled:void 0,touched:!1,setTouched:Qn,dirty:!1,setDirty:Qn,filled:!1,setFilled:Qn,focused:!1,setFocused:Qn,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(n=Pt)=>n,getInputValidationProps:(n=Pt)=>n,inputRef:{current:null},commit:async()=>{}}});function Ui(n=!0){const e=S.useContext(bk);if(e.setValidityData===Qn&&!n)throw new Error(bt(28));return e}const v5=S.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Qn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function io(){return S.useContext(v5)}const xk=S.createContext({controlId:void 0,setControlId:Qn,labelId:void 0,setLabelId:Qn,messageIds:[],setMessageIds:Qn,getDescriptionProps:n=>n});function qi(){return S.useContext(xk)}const b5=function(n){const e=Ht(),[t,i]=S.useState(n.initialControlId===void 0?e:n.initialControlId),[r,o]=S.useState(void 0),[a,u]=S.useState([]),{messageIds:f}=qi(),d=S.useCallback(m=>Vi({"aria-describedby":f.concat(a).join(" ")||void 0},m),[f,a]),p=S.useMemo(()=>({controlId:t,setControlId:i,labelId:r,setLabelId:o,messageIds:a,setMessageIds:u,getDescriptionProps:d}),[t,i,r,o,a,u,d]);return Y.jsx(xk.Provider,{value:p,children:n.children})};function ty(n,e){return{...n,state:{...n.state,valid:!e&&n.state.valid}}}const Fh=Object.keys(np);function x5(n){if(!n||n.valid||!n.valueMissing)return!1;let e=!1;for(const t of Fh)t!=="valid"&&(t==="valueMissing"&&(e=n[t]),n[t]&&(e=!1));return e}function S5(n){const{formRef:e,clearErrors:t}=io(),{setValidityData:i,validate:r,validityData:o,validationDebounceTime:a,invalid:u,markedDirtyRef:f,state:d,name:p,shouldValidateOnChange:m}=n,{controlId:g,getDescriptionProps:v}=qi(),x=en(),w=S.useRef(null),C=Se(async(T,A=!1)=>{const O=w.current;if(!O)return;if(A){if(d.valid!==!1)return;const q=O.validity;if(!q.valueMissing){const $={value:T,state:{...np,valid:!0},error:"",errors:[],initialValue:o.initialValue};if(O.setCustomValidity(""),g){const _=e.current.fields.get(g);_&&e.current.fields.set(g,{..._,...ty($,!1)})}i($);return}const P=Fh.reduce(($,_)=>($[_]=q[_],$),{});if(!P.valid&&!x5(P))return}function N(q){const P=Fh.reduce((_,H)=>(_[H]=q.validity[H],_),{});let $=!1;for(const _ of Fh)if(_!=="valid"){if(_==="valueMissing"&&P[_])$=!0;else if(P[_])return P}return $&&!f.current&&(P.valid=!0,P.valueMissing=!1),P}x.clear();let M=null,D=[];const V=N(O);let U;const j=m();if(O.validationMessage&&!j)U=O.validationMessage,D=[O.validationMessage];else{const q=Array.from(e.current.fields.values()).reduce(($,_)=>(_.name&&($[_.name]=_.getValue()),$),{}),P=r(T,q);typeof P=="object"&&P!==null&&"then"in P?M=await P:M=P,M!==null?(V.valid=!1,V.customError=!0,Array.isArray(M)?(D=M,O.setCustomValidity(M.join(`
|
|
17
|
+
`))):M&&(D=[M],O.setCustomValidity(M))):j&&(O.setCustomValidity(""),V.customError=!1,O.validationMessage?(U=O.validationMessage,D=[O.validationMessage]):O.validity.valid&&!V.valid&&(V.valid=!0))}const I={value:T,state:V,error:U??(Array.isArray(M)?M[0]:M??""),errors:D,initialValue:o.initialValue};if(g){const q=e.current.fields.get(g);q&&e.current.fields.set(g,{...q,...ty(I,u)})}i(I)}),E=S.useCallback((T={})=>Vi(v,d.valid===!1?{"aria-invalid":!0}:Pt,T),[v,d.valid]),k=S.useCallback((T={})=>Vi({onChange(A){if(A.nativeEvent.defaultPrevented)return;if(t(p),!m()){C(A.currentTarget.value,!0);return}if(u)return;const O=A.currentTarget;if(O.value===""){C(O.value);return}x.clear(),a?x.start(a,()=>{C(O.value)}):C(O.value)}},E(T)),[E,t,p,x,C,u,a,m]);return S.useMemo(()=>({getValidationProps:E,getInputValidationProps:k,inputRef:w,commit:C}),[E,k,C])}const w5=S.forwardRef(function(n,e){const{errors:t,validationMode:i,submitAttemptedRef:r}=io(),{render:o,className:a,validate:u,validationDebounceTime:f=0,validationMode:d=i,name:p,disabled:m=!1,invalid:g,dirty:v,touched:x,...w}=n,{disabled:C}=vk(),E=Se(u||(()=>null)),k=C||m,[T,A]=S.useState(!1),[O,N]=S.useState(!1),[M,D]=S.useState(!1),[V,U]=S.useState(!1),j=v??O,I=x??T,q=S.useRef(!1),P=Se(W=>{v===void 0&&(W&&(q.current=!0),N(W))}),$=Se(W=>{x===void 0&&A(W)}),_=Se(()=>d==="onChange"||d==="onSubmit"&&r.current),H=!!(g||p&&{}.hasOwnProperty.call(t,p)&&t[p]!==void 0),[z,Q]=S.useState({state:np,error:"",errors:[],value:null,initialValue:null}),ee=!H&&z.state.valid,B=S.useMemo(()=>({disabled:k,touched:I,dirty:j,valid:ee,filled:M,focused:V}),[k,I,j,ee,M,V]),K=S5({setValidityData:Q,validate:E,validityData:z,validationDebounceTime:f,invalid:H,markedDirtyRef:q,state:B,name:p,shouldValidateOnChange:_}),X=S.useMemo(()=>({invalid:H,name:p,validityData:z,setValidityData:Q,disabled:k,touched:I,setTouched:$,dirty:j,setDirty:P,filled:M,setFilled:D,focused:V,setFocused:U,validate:E,validationMode:d,validationDebounceTime:f,shouldValidateOnChange:_,state:B,markedDirtyRef:q,validation:K}),[H,p,z,k,I,$,j,P,M,D,V,U,E,d,f,_,B,K]),J=Fe("div",n,{ref:e,state:B,props:w,stateAttributesMapping:ii});return Y.jsx(bk.Provider,{value:X,children:J})}),TH=S.forwardRef(function(n,e){return Y.jsx(b5,{children:Y.jsx(w5,{...n,ref:e})})}),AH=S.forwardRef(function(n,e){const{render:t,className:i,id:r,...o}=n,a=Ui(!1),{controlId:u,setLabelId:f,labelId:d}=qi(),p=Ht(r),m=S.useRef(null);return be(()=>(p&&f(p),()=>{f(void 0)}),[p,f]),Fe("label",n,{ref:[e,m],state:a.state,props:[{id:d,htmlFor:u??void 0,onMouseDown(g){Tn(g.nativeEvent)?.closest("button,input,select,textarea")||!g.defaultPrevented&&g.detail>1&&g.preventDefault()}},o],stateAttributesMapping:ii})}),OH=S.forwardRef(function(n,e){const{render:t,id:i,className:r,match:o,...a}=n,u=Ht(i),{validityData:f,state:d,name:p}=Ui(!1),{setMessageIds:m}=qi(),{errors:g}=io(),v=p?g[p]:null;let x=!1;v||o===!0?x=!0:o?x=!!f.state[o]:x=f.state.valid===!1,be(()=>{if(!(!x||!u))return m(C=>C.concat(u)),()=>{m(C=>C.filter(E=>E!==u))}},[x,u,m]);const w=Fe("div",n,{ref:e,state:d,props:[{id:u,children:v||(f.errors.length>1?S.createElement("ul",{},f.errors.map(C=>S.createElement("li",{key:C},C))):f.error)},a],stateAttributesMapping:ii});return x?w:null}),MH=S.forwardRef(function(n,e){const{render:t,id:i,className:r,...o}=n,a=Ht(i),u=Ui(!1),{setMessageIds:f}=qi();return be(()=>{if(a)return f(d=>d.concat(a)),()=>{f(d=>d.filter(p=>p!==a))}},[a,f]),Fe("p",n,{ref:e,state:u.state,props:[{id:a},o],stateAttributesMapping:ii})});function ns({controlled:n,default:e,name:t,state:i="value"}){const{current:r}=S.useRef(n!==void 0),[o,a]=S.useState(e),u=r?n:o,f=S.useCallback(d=>{r||a(d)},[]);return[u,f]}function Iv(n={}){const{id:e,implicit:t=!1,controlRef:i}=n,{controlId:r,setControlId:o}=qi(),a=Ht(e);return be(()=>{if(!(!t&&!e||o===Qn)){if(t){const u=i?.current;yt(u)&&u.closest("label")!=null?o(e??null):o(r??a)}else e&&o(e);return()=>{e&&o(void 0)}}},[e,i,r,o,t,a]),r??a}function Ic(n){const{enabled:e=!0,value:t,id:i,name:r,controlRef:o,commit:a}=n,{formRef:u}=io(),{invalid:f,markedDirtyRef:d,validityData:p,setValidityData:m}=Ui(),g=Se(n.getValue);be(()=>{if(!e)return;let v=t;v===void 0&&(v=g()),p.initialValue===null&&v!==null&&m(x=>({...x,initialValue:v}))},[e,m,t,p.initialValue,g]),be(()=>{!e||!i||u.current.fields.set(i,{getValue:g,name:r,controlRef:o,validityData:ty(p,f),validate(){let v=t;v===void 0&&(v=g()),d.current=!0,ei.flushSync(()=>a(v))}})},[a,o,e,u,g,i,f,d,r,p,t]),be(()=>{const v=u.current.fields;return()=>{i&&v.delete(i)}},[u,i])}const E5=S.forwardRef(function(n,e){const{render:t,className:i,id:r,name:o,value:a,disabled:u=!1,onValueChange:f,defaultValue:d,...p}=n,{state:m,name:g,disabled:v}=Ui(),x=v||u,w=g??o,C=S.useMemo(()=>({...m,disabled:x}),[m,x]),{setTouched:E,setDirty:k,validityData:T,setFocused:A,setFilled:O,validationMode:N,validation:M}=Ui(),{labelId:D}=qi(),V=Iv({id:r});be(()=>{const P=a!=null;M.inputRef.current?.value||P&&a!==""?O(!0):P&&a===""&&O(!1)},[M.inputRef,O,a]);const[U,j]=ns({controlled:a,default:d,name:"FieldControl",state:"value"}),I=a!==void 0,q=Se((P,$)=>{f?.(P,$),!$.isCanceled&&j(P)});return Ic({id:V,name:w,commit:M.commit,value:U,getValue:()=>M.inputRef.current?.value,controlRef:M.inputRef}),Fe("input",n,{ref:e,state:C,props:[{id:V,disabled:x,name:w,ref:M.inputRef,"aria-labelledby":D,...I?{value:U}:{defaultValue:d},onChange(P){const $=P.currentTarget.value;q($,Ke(ss,P.nativeEvent)),k($!==T.initialValue),O($!=="")},onFocus(){A(!0)},onBlur(P){E(!0),A(!1),N==="onBlur"&&M.commit(P.currentTarget.value)},onKeyDown(P){P.currentTarget.tagName==="INPUT"&&P.key==="Enter"&&(E(!0),M.commit(P.currentTarget.value))}},M.getInputValidationProps(),p],stateAttributesMapping:ii})}),C5=S.createContext({disabled:!1});function R5(){return S.useContext(C5)}const Sk=S.createContext(void 0);function k5(n=!0){const e=S.useContext(Sk);if(e===void 0&&!n)throw new Error(bt(3));return e}let N2=(function(n){return n.checked="data-checked",n.unchecked="data-unchecked",n.disabled="data-disabled",n.readonly="data-readonly",n.required="data-required",n.valid="data-valid",n.invalid="data-invalid",n.touched="data-touched",n.dirty="data-dirty",n.filled="data-filled",n.focused="data-focused",n})({});function wk(n){return S.useMemo(()=>({checked(e){return n.indeterminate?{}:e?{[N2.checked]:""}:{[N2.unchecked]:""}},...ii}),[n.indeterminate])}const T5=S.createContext(void 0);function Bv(n=!1){const e=S.useContext(T5);if(e===void 0&&!n)throw new Error(bt(16));return e}function A5(n){const{focusableWhenDisabled:e,disabled:t,composite:i=!1,tabIndex:r=0,isNativeButton:o}=n,a=i&&e!==!1,u=i&&e===!1;return{props:S.useMemo(()=>{const f={onKeyDown(d){t&&e&&d.key!=="Tab"&&d.preventDefault()}};return i||(f.tabIndex=r,!o&&t&&(f.tabIndex=e?r:-1)),(o&&(e||a)||!o&&t)&&(f["aria-disabled"]=t),o&&(!e||u)&&(f.disabled=t),f},[i,t,e,a,u,o,r])}}function os(n={}){const{disabled:e=!1,focusableWhenDisabled:t,tabIndex:i=0,native:r=!0}=n,o=S.useRef(null),a=Bv(!0)!==void 0,u=Se(()=>{const g=o.current;return!!(g?.tagName==="A"&&g?.href)}),{props:f}=A5({focusableWhenDisabled:t,disabled:e,composite:a,tabIndex:i,isNativeButton:r}),d=S.useCallback(()=>{const g=o.current;O5(g)&&a&&e&&f.disabled===void 0&&g.disabled&&(g.disabled=!1)},[e,f.disabled,a]);be(d,[d]);const p=S.useCallback((g={})=>{const{onClick:v,onMouseDown:x,onKeyUp:w,onKeyDown:C,onPointerDown:E,...k}=g;return Vi({type:r?"button":void 0,onClick(T){if(e){T.preventDefault();return}v?.(T)},onMouseDown(T){e||x?.(T)},onKeyDown(T){if(e||(Z0(T),C?.(T)),T.baseUIHandlerPrevented)return;const A=T.target===T.currentTarget&&!r&&!u()&&!e,O=T.key==="Enter",N=T.key===" ";A&&((N||O)&&T.preventDefault(),O&&v?.(T))},onKeyUp(T){e||(Z0(T),w?.(T)),!T.baseUIHandlerPrevented&&T.target===T.currentTarget&&!r&&!e&&T.key===" "&&v?.(T)},onPointerDown(T){if(e){T.preventDefault();return}E?.(T)}},r?void 0:{role:"button"},f,k)},[e,f,r,u]),m=Se(g=>{o.current=g,d()});return{getButtonProps:p,buttonRef:m}}function O5(n){return _t(n)&&n.tagName==="BUTTON"}const Ek=S.createContext(void 0);function M5(){const n=S.useContext(Ek);if(n===void 0)throw new Error(bt(14));return n}function ip(n,e){const t=S.useRef(n),i=Se(e);be(()=>{t.current!==n&&i(t.current)},[n,i]),be(()=>{t.current=n},[n])}const Ck="data-parent",DH=S.forwardRef(function(n,e){const{checked:t,className:i,defaultChecked:r=!1,disabled:o=!1,id:a,indeterminate:u=!1,inputRef:f,name:d,onCheckedChange:p,parent:m=!1,readOnly:g=!1,render:v,required:x=!1,uncheckedValue:w,value:C,nativeButton:E=!1,...k}=n,{clearErrors:T}=io(),{disabled:A,name:O,setDirty:N,setFilled:M,setFocused:D,setTouched:V,state:U,validationMode:j,validityData:I,shouldValidateOnChange:q,validation:P}=Ui(),$=R5(),{labelId:_,controlId:H,setControlId:z,getDescriptionProps:Q}=qi(),ee=k5(),B=ee?.parent,K=B&&ee.allValues,X=A||$.disabled||ee?.disabled||o,J=O??d,W=C??J,re=Ht(),ae=Ht();let fe=H;K?fe=m?ae:`${B.id}-${W}`:a&&(fe=a);let pe={};K&&(m?pe=ee.parent.getParentProps():W&&(pe=ee.parent.getChildProps(W)));const Te=Se(p),{checked:le=t,indeterminate:Ee=u,onCheckedChange:Ce,...Ue}=pe,me=ee?.value,ve=ee?.setValue,ge=ee?.defaultValue,Ae=S.useRef(null),{getButtonProps:Oe,buttonRef:Ye}=os({disabled:X,native:E}),de=ee?.validation??P,[ke,we]=ns({controlled:W&&me&&!m?me.includes(W):le,default:W&&ge&&!m?ge.includes(W):r,name:"Checkbox",state:"checked"});be(()=>{if(z!==Qn)return z(fe),()=>{z(void 0)}},[fe,ee,z,m]),Ic({enabled:!ee,id:re,commit:de.commit,value:ke,controlRef:Ae,name:J,getValue:()=>ke});const ye=S.useRef(null),De=tr(f,ye,de.inputRef);be(()=>{ye.current&&(ye.current.indeterminate=Ee,ke&&M(!0))},[ke,Ee,M]),ip(ke,()=>{ee&&!m||(T(J),M(ke),N(ke!==I.initialValue),q()?de.commit(ke):de.commit(ke,!0))});const Ne=Vi({checked:ke,disabled:X,name:m?void 0:J,id:fe??void 0,required:x,ref:De,style:Dc,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(st){if(st.nativeEvent.defaultPrevented)return;const kt=st.target.checked,xe=Ke(ss,st.nativeEvent);if(Ce?.(kt,xe),Te(kt,xe),!xe.isCanceled&&(we(kt),W&&me&&ve&&!m)){const He=kt?[...me,W]:me.filter(Xe=>Xe!==W);ve(He,xe)}},onFocus(){Ae.current?.focus()}},C!==void 0?{value:(ee?ke&&C:C)||""}:Pt,Q,ee?de.getValidationProps:de.getInputValidationProps),Ge=K?!!le:ke,je=K&&Ee||u;S.useEffect(()=>{B&&W&&B.disabledStatesRef.current.set(W,X)},[B,X,W]);const mt=S.useMemo(()=>({...U,checked:Ge,disabled:X,readOnly:g,required:x,indeterminate:je}),[U,Ge,X,g,x,je]),Dt=wk(mt),Qt=Fe("span",n,{state:mt,ref:[Ye,Ae,e,ee?.registerControlRef],props:[{id:re,role:"checkbox","aria-checked":Ee?"mixed":ke,"aria-readonly":g||void 0,"aria-required":x||void 0,"aria-labelledby":_,[Ck]:m?"":void 0,onFocus(){D(!0)},onBlur(){const st=ye.current;st&&(V(!0),D(!1),j==="onBlur"&&de.commit(ee?me:st.checked))},onClick(st){g||X||(st.preventDefault(),ye.current?.click())}},Q,de.getValidationProps,k,Ue,Oe],stateAttributesMapping:Dt});return Y.jsxs(Ek.Provider,{value:mt,children:[Qt,!ke&&!ee&&J&&!m&&w!==void 0&&Y.jsx("input",{type:"hidden",name:J,value:w}),Y.jsx("input",{...Ne})]})}),L2=[];function D5(n){const{allValues:e=L2,value:t=L2,onValueChange:i}=n,r=S.useRef(t),o=S.useRef(new Map),[a,u]=S.useState("mixed"),f=Ht(),d=t.length===e.length,p=t.length!==e.length&&t.length>0,m=Se(i),g=S.useCallback(()=>({id:f,indeterminate:p,checked:d,"aria-controls":e.map(x=>`${f}-${x}`).join(" "),onCheckedChange(x,w){const C=r.current,E=e.filter(T=>o.current.get(T)&&C.includes(T)),k=e.filter(T=>!o.current.get(T)||o.current.get(T)&&C.includes(T));if(C.length===k.length||C.length===0){t.length===k.length?m(E,w):m(k,w);return}a==="mixed"?(m(k,w),u("on")):a==="on"?(m(E,w),u("off")):a==="off"&&(m(C,w),u("mixed"))}}),[e,d,f,p,m,a,t.length]),v=S.useCallback(x=>({checked:t.includes(x),onCheckedChange(w,C){const E=t.slice();w?E.push(x):E.splice(E.indexOf(x),1),r.current=E,m(E,C),u("mixed")}}),[m,t]);return S.useMemo(()=>({id:f,indeterminate:p,getParentProps:g,getChildProps:v,disabledStatesRef:o}),[f,p,g,v])}function N5(n,e,t=(i,r)=>i===r){return n.length===e.length&&n.every((i,r)=>t(i,e[r]))}const NH=S.forwardRef(function(n,e){const{allValues:t,className:i,defaultValue:r,disabled:o=!1,id:a,onValueChange:u,render:f,value:d,...p}=n,{disabled:m,name:g,state:v,validation:x,setFilled:w,setDirty:C,shouldValidateOnChange:E,validityData:k}=Ui(),{labelId:T,getDescriptionProps:A}=qi(),{clearErrors:O}=io(),N=m||o,[M,D]=ns({controlled:d,default:r,name:"CheckboxGroup",state:"value"}),V=Se((z,Q)=>{u?.(z,Q),!Q.isCanceled&&D(z)}),U=D5({allValues:t,value:d,onValueChange:u}),j=Ht(a),I=S.useRef(null),q=S.useCallback(z=>{I.current==null&&z!=null&&!z.hasAttribute(Ck)&&(I.current=z)},[]);Ic({enabled:!!g,id:j,commit:x.commit,value:M,controlRef:I,name:g,getValue:()=>M});const P=M??Ys;ip(P,()=>{g&&O(g);const z=Array.isArray(k.initialValue)?k.initialValue:Ys;w(P.length>0),C(!N5(P,z)),E()?x.commit(P):x.commit(P,!0)});const $=S.useMemo(()=>({...v,disabled:N}),[v,N]),_=S.useMemo(()=>({allValues:t,value:M,defaultValue:r,setValue:V,parent:U,disabled:N,validation:x,registerControlRef:q}),[t,M,r,V,U,N,x,q]),H=Fe("div",n,{state:$,ref:e,props:[{role:"group","aria-labelledby":T},A,p],stateAttributesMapping:ii});return Y.jsx(Sk.Provider,{value:_,children:H})}),LH=S.forwardRef(function(n,e){const{render:t,className:i,keepMounted:r=!1,...o}=n,a=M5(),u=a.checked||a.indeterminate,{transitionStatus:f,setMounted:d}=nl(u),p=S.useRef(null),m=S.useMemo(()=>({...a,transitionStatus:f}),[a,f]);sr({open:u,ref:p,onComplete(){u||d(!1)}});const g=wk(a),v=S.useMemo(()=>({...g,...Ot,...ii}),[g]),x=r||u,w=Fe("span",n,{enabled:x,ref:[e,p],state:m,stateAttributesMapping:v,props:o});return x?w:null}),IH=S.forwardRef(function(n,e){return Y.jsx(E5,{ref:e,...n})});function L5(n){const e=S.useRef(!0);e.current&&(e.current=!1,n())}const I5=(n,e)=>Object.is(n,e);function Gs(n,e,t){return n==null||e==null?Object.is(n,e):t(n,e)}function s0(n,e,t){return!n||n.length===0?!1:n.some(i=>i===void 0?!1:Gs(i,e,t))}function ny(n,e,t){return!n||n.length===0?-1:n.findIndex(i=>i===void 0?!1:Gs(i,e,t))}function B5(n,e,t){return n.filter(i=>!Gs(i,e,t))}oe(n=>n.id),oe(n=>n.query),oe(n=>n.items),oe(n=>n.selectedValue),oe(n=>n.open),oe(n=>n.mounted),oe(n=>n.forceMounted),oe(n=>n.inline),oe(n=>n.activeIndex),oe(n=>n.selectedIndex),oe((n,e)=>n.activeIndex===e),oe((n,e)=>{const t=n.isItemEqualToValue,i=n.selectedValue;return Array.isArray(i)?i.some(r=>Gs(r,e,t)):Gs(i,e,t)}),oe(n=>n.transitionStatus),oe(n=>n.popupProps),oe(n=>n.inputProps),oe(n=>n.triggerProps),oe(n=>n.getItemProps),oe(n=>n.positionerElement),oe(n=>n.listElement),oe(n=>n.triggerElement),oe(n=>n.inputElement),oe(n=>n.popupSide),oe(n=>n.openMethod),oe(n=>n.inputInsidePopup),oe(n=>n.selectionMode),oe(n=>n.listRef),oe(n=>n.labelsRef),oe(n=>n.popupRef),oe(n=>n.emptyRef),oe(n=>n.inputRef),oe(n=>n.keyboardActiveRef),oe(n=>n.chipsContainerRef),oe(n=>n.clearRef),oe(n=>n.valuesRef),oe(n=>n.allValuesRef),oe(n=>n.name),oe(n=>n.disabled),oe(n=>n.readOnly),oe(n=>n.required),oe(n=>n.grid),oe(n=>n.isGrouped),oe(n=>n.virtualized),oe(n=>n.onOpenChangeComplete),oe(n=>n.openOnInputClick),oe(n=>n.itemToStringLabel),oe(n=>n.isItemEqualToValue),oe(n=>n.modal),oe(n=>n.autoHighlight),oe(n=>n.submitOnItemClick);function iy(n){if(n==null)return"";if(typeof n=="string")return n;try{return JSON.stringify(n)}catch{return String(n)}}function _5(n){return n!=null&&n.length>0&&typeof n[0]=="object"&&n[0]!=null&&"items"in n[0]}function ju(n,e){if(e&&n!=null)return e(n)??"";if(n&&typeof n=="object"){if("label"in n&&n.label!=null)return String(n.label);if("value"in n)return String(n.value)}return iy(n)}function Yl(n,e){return e&&n!=null?e(n)??"":n&&typeof n=="object"&&"value"in n&&"label"in n?iy(n.value):iy(n)}function P5(n,e,t){if(t&&n!=null)return t(n);if(n&&typeof n=="object"&&"label"in n&&n.label!=null)return n.label;if(e&&!Array.isArray(e))return e[n]??ju(n,t);if(Array.isArray(e)){const i=_5(e)?e.flatMap(r=>r.items):e;if(n==null){const r=i.find(o=>o.value==null);return r&&r.label!=null?r.label:ju(n,t)}if(typeof n!="object"){const r=i.find(o=>o&&o.value===n);return r&&r.label!=null?r.label:ju(n,t)}if("value"in n){const r=i.find(o=>o&&o.value===n.value);if(r&&r.label!=null)return r.label}}return ju(n,t)}function z5(n,e){return!Array.isArray(n)||n.length===0?"":n.map(t=>ju(t,e)).join(", ")}function H5(n){const e=S.useRef(""),t=S.useCallback(i=>{i.defaultPrevented||(e.current=i.pointerType,n(i,i.pointerType))},[n]);return{onClick:S.useCallback(i=>{if(i.detail===0){n(i,"keyboard");return}"pointerType"in i&&n(i,i.pointerType),n(i,e.current),e.current=""},[n]),onPointerDown:t}}function _v(n){const[e,t]=S.useState(null),i=Se((u,f)=>{n||t(f)}),r=S.useCallback(()=>{t(null)},[]),{onClick:o,onPointerDown:a}=H5(i);return S.useMemo(()=>({openMethod:e,reset:r,triggerProps:{onClick:o,onPointerDown:a}}),[e,r,o,a])}({...hc,...ii});function Rk(n){const e=n.getBoundingClientRect(),t=window.getComputedStyle(n,"::before"),i=window.getComputedStyle(n,"::after");if(!(t.content!=="none"||i.content!=="none"))return e;const r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,a=parseFloat(i.width)||0,u=parseFloat(i.height)||0,f=Math.max(e.width,r,a),d=Math.max(e.height,o,u),p=f-e.width,m=d-e.height;return{left:e.left-p/2,right:e.right+p/2,top:e.top-m/2,bottom:e.bottom+m/2}}({...hc,...ii});const kk=S.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function V5(){return S.useContext(kk)}function Tk(n){const{children:e,elementsRef:t,labelsRef:i,onMapChange:r}=n,o=Se(r),a=S.useRef(0),u=Un(j5).current,f=Un(U5).current,[d,p]=S.useState(0),m=S.useRef(d),g=Se((E,k)=>{f.set(E,k??null),m.current+=1,p(m.current)}),v=Se(E=>{f.delete(E),m.current+=1,p(m.current)}),x=S.useMemo(()=>{const E=new Map;return Array.from(f.keys()).filter(k=>k.isConnected).sort(q5).forEach((k,T)=>{const A=f.get(k)??{};E.set(k,{...A,index:T})}),E},[f,d]);be(()=>{if(typeof MutationObserver!="function"||x.size===0)return;const E=new MutationObserver(k=>{const T=new Set,A=O=>T.has(O)?T.delete(O):T.add(O);k.forEach(O=>{O.removedNodes.forEach(A),O.addedNodes.forEach(A)}),T.size===0&&(m.current+=1,p(m.current))});return x.forEach((k,T)=>{T.parentElement&&E.observe(T.parentElement,{childList:!0})}),()=>{E.disconnect()}},[x]),be(()=>{m.current===d&&(t.current.length!==x.size&&(t.current.length=x.size),i&&i.current.length!==x.size&&(i.current.length=x.size),a.current=x.size),o(x)},[o,x,t,i,d]),be(()=>()=>{t.current=[]},[t]),be(()=>()=>{i&&(i.current=[])},[i]);const w=Se(E=>(u.add(E),()=>{u.delete(E)}));be(()=>{u.forEach(E=>E(x))},[u,x]);const C=S.useMemo(()=>({register:g,unregister:v,subscribeMapChange:w,elementsRef:t,labelsRef:i,nextIndexRef:a}),[g,v,w,t,i,a]);return Y.jsx(kk.Provider,{value:C,children:e})}function U5(){return new Map}function j5(){return new Set}function q5(n,e){const t=n.compareDocumentPosition(e);return t&Node.DOCUMENT_POSITION_FOLLOWING||t&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:t&Node.DOCUMENT_POSITION_PRECEDING||t&Node.DOCUMENT_POSITION_CONTAINS?1:0}({...Gt,...Ot});let I2={},B2={},_2="";function F5(n){if(typeof document>"u")return!1;const e=Hi(n);return Yt(e).innerWidth-e.documentElement.clientWidth>0}function $5(n){const e=Hi(n),t=e.documentElement,i=e.body,r=Jo(t)?t:i,o=r.style.overflow;return r.style.overflow="hidden",()=>{r.style.overflow=o}}function K5(n){const e=Hi(n),t=e.documentElement,i=e.body,r=Yt(t);let o=0,a=0;const u=qt.create(),f=typeof CSS<"u"&&CSS.supports?.("scrollbar-gutter","stable");if(DR&&(r.visualViewport?.scale??1)!==1)return()=>{};function d(){const g=r.getComputedStyle(t),v=r.getComputedStyle(i),x=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=t.scrollTop,a=t.scrollLeft,I2={scrollbarGutter:t.style.scrollbarGutter,overflowY:t.style.overflowY,overflowX:t.style.overflowX},_2=t.style.scrollBehavior,B2={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const w=t.scrollHeight>t.clientHeight,C=t.scrollWidth>t.clientWidth,E=g.overflowY==="scroll"||v.overflowY==="scroll",k=g.overflowX==="scroll"||v.overflowX==="scroll",T=Math.max(0,r.innerWidth-t.clientWidth),A=Math.max(0,r.innerHeight-t.clientHeight),O=parseFloat(v.marginTop)+parseFloat(v.marginBottom),N=parseFloat(v.marginLeft)+parseFloat(v.marginRight),M=Jo(t)?t:i;if(f){t.style.scrollbarGutter=x,M.style.overflowY="hidden",M.style.overflowX="hidden";return}Object.assign(t.style,{scrollbarGutter:x,overflowY:"hidden",overflowX:"hidden"}),(w||E)&&(t.style.overflowY="scroll"),(C||k)&&(t.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:O||A?`calc(100dvh - ${O+A}px)`:"100dvh",width:N||T?`calc(100vw - ${N+T}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),i.scrollTop=o,i.scrollLeft=a,t.setAttribute("data-base-ui-scroll-locked",""),t.style.scrollBehavior="unset"}function p(){Object.assign(t.style,I2),Object.assign(i.style,B2),f||(t.scrollTop=o,t.scrollLeft=a,t.removeAttribute("data-base-ui-scroll-locked"),t.style.scrollBehavior=_2)}function m(){p(),u.request(d)}return d(),r.addEventListener("resize",m),()=>{u.cancel(),p(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",m)}}class Y5{lockCount=0;restore=null;timeoutLock=Ks.create();timeoutUnlock=Ks.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;const t=Hi(e).documentElement,i=Yt(t).getComputedStyle(t).overflowY;if(i==="hidden"||i==="clip"){this.restore=Qn;return}const r=C8||!F5(e);this.restore=r?$5(e):K5(e)}}const G5=new Y5;function Pv(n=!0,e=null){be(()=>{if(n)return G5.acquire(e)},[n,e])}const zv=S.forwardRef(function(n,e){const{cutout:t,...i}=n;let r;if(t){const o=t?.getBoundingClientRect();r=`polygon(
|
|
18
|
+
0% 0%,
|
|
19
|
+
100% 0%,
|
|
20
|
+
100% 100%,
|
|
21
|
+
0% 100%,
|
|
22
|
+
0% 0%,
|
|
23
|
+
${o.left}px ${o.top}px,
|
|
24
|
+
${o.left}px ${o.bottom}px,
|
|
25
|
+
${o.right}px ${o.bottom}px,
|
|
26
|
+
${o.right}px ${o.top}px,
|
|
27
|
+
${o.left}px ${o.top}px
|
|
28
|
+
)`}return Y.jsx("div",{ref:e,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:r}})});({...Gt,...Ot});let Ak=(function(n){return n[n.None=0]="None",n[n.GuessFromOrder=1]="GuessFromOrder",n})({});function Na(n={}){const{label:e,metadata:t,textRef:i,indexGuessBehavior:r,index:o}=n,{register:a,unregister:u,subscribeMapChange:f,elementsRef:d,labelsRef:p,nextIndexRef:m}=V5(),g=S.useRef(-1),[v,x]=S.useState(o??(r===Ak.GuessFromOrder?()=>{if(g.current===-1){const E=m.current;m.current+=1,g.current=E}return g.current}:-1)),w=S.useRef(null),C=S.useCallback(E=>{if(w.current=E,v!==-1&&E!==null&&(d.current[v]=E,p)){const k=e!==void 0;p.current[v]=k?e:i?.current?.textContent??E.textContent}},[v,d,p,e,i]);return be(()=>{if(o!=null)return;const E=w.current;if(E)return a(E,t),()=>{u(E)}},[o,a,u,t]),be(()=>{if(o==null)return f(E=>{const k=w.current?E.get(w.current)?.index:null;k!=null&&x(k)})},[o,f,x]),S.useMemo(()=>({ref:C,index:v}),[v,C])}({...Ot,...Lc});const Q5=S.forwardRef(function(n,e){const{className:t,render:i,orientation:r="horizontal",...o}=n,a=S.useMemo(()=>({orientation:r}),[r]);return Fe("div",n,{state:a,ref:e,props:[{role:"separator","aria-orientation":r},o]})}),Ok=S.createContext(void 0);function ro(n){const e=S.useContext(Ok);if(n===!1&&e===void 0)throw new Error(bt(27));return e}const X5={...Gt,...Ot},BH=S.forwardRef(function(n,e){const{render:t,className:i,forceRender:r=!1,...o}=n,{store:a}=ro(),u=a.useState("open"),f=a.useState("nested"),d=a.useState("mounted"),p=a.useState("transitionStatus"),m=S.useMemo(()=>({open:u,transitionStatus:p}),[u,p]);return Fe("div",n,{state:m,ref:[a.context.backdropRef,e],stateAttributesMapping:X5,props:[{role:"presentation",hidden:!d,style:{userSelect:"none",WebkitUserSelect:"none"}},o],enabled:r||!f})}),_H=S.forwardRef(function(n,e){const{render:t,className:i,disabled:r=!1,nativeButton:o=!0,...a}=n,{store:u}=ro(),f=u.useState("open");function d(v){f&&u.setOpen(!1,Ke(Y8,v.nativeEvent))}const{getButtonProps:p,buttonRef:m}=os({disabled:r,native:o}),g=S.useMemo(()=>({disabled:r}),[r]);return Fe("button",n,{state:g,ref:[e,m],props:[{onClick:d},a,p]})}),PH=S.forwardRef(function(n,e){const{render:t,className:i,id:r,...o}=n,{store:a}=ro(),u=Ht(r);return a.useSyncedValueWithCleanup("descriptionElementId",u),Fe("p",n,{ref:e,props:[{id:u},o]})});let W5=(function(n){return n.nestedDialogs="--nested-dialogs",n})({}),Z5=(function(n){return n[n.open=Wi.open]="open",n[n.closed=Wi.closed]="closed",n[n.startingStyle=Wi.startingStyle]="startingStyle",n[n.endingStyle=Wi.endingStyle]="endingStyle",n.nested="data-nested",n.nestedDialogOpen="data-nested-dialog-open",n})({});const Mk=S.createContext(void 0);function J5(){const n=S.useContext(Mk);if(n===void 0)throw new Error(bt(26));return n}const Dk="ArrowUp",Nk="ArrowDown",Lk="ArrowLeft",Ik="ArrowRight",Bk="Home",_k="End",eI=new Set([Lk,Ik]),tI=new Set([Dk,Nk]),nI=new Set([...eI,...tI]);[...nI];const Hv=new Set([Dk,Nk,Lk,Ik,Bk,_k]),iI={...Gt,...Ot,nestedDialogOpen(n){return n?{[Z5.nestedDialogOpen]:""}:null}},zH=S.forwardRef(function(n,e){const{className:t,finalFocus:i,initialFocus:r,render:o,...a}=n,{store:u}=ro(),f=u.useState("descriptionElementId"),d=u.useState("disablePointerDismissal"),p=u.useState("floatingRootContext"),m=u.useState("popupProps"),g=u.useState("modal"),v=u.useState("mounted"),x=u.useState("nested"),w=u.useState("nestedOpenDialogCount"),C=u.useState("open"),E=u.useState("openMethod"),k=u.useState("titleElementId"),T=u.useState("transitionStatus"),A=u.useState("role");J5(),sr({open:C,ref:u.context.popupRef,onComplete(){C&&u.context.onOpenChangeComplete?.(!0)}});function O(U){return U==="touch"?u.context.popupRef.current:!0}const N=r===void 0?O:r,M=w>0,D=S.useMemo(()=>({open:C,nested:x,transitionStatus:T,nestedDialogOpen:M}),[C,x,T,M]),V=Fe("div",n,{state:D,props:[m,{"aria-labelledby":k??void 0,"aria-describedby":f??void 0,role:A,tabIndex:-1,hidden:!v,onKeyDown(U){Hv.has(U.key)&&U.stopPropagation()},style:{[W5.nestedDialogs]:w}},a],ref:[e,u.context.popupRef,u.useStateSetter("popupElement")],stateAttributesMapping:iI});return Y.jsx(vv,{context:p,openInteractionType:E,disabled:!v,closeOnFocusOut:!d,initialFocus:N,returnFocus:i,modal:g!==!1,restoreFocus:"popup",children:V})}),HH=S.forwardRef(function(n,e){const{keepMounted:t=!1,...i}=n,{store:r}=ro(),o=r.useState("mounted"),a=r.useState("modal");return o||t?Y.jsx(Mk.Provider,{value:t,children:Y.jsxs(gv,{ref:e,...i,children:[o&&a===!0&&Y.jsx(zv,{ref:r.context.internalBackdropRef,inert:Lv(!open)}),n.children]})}):null});function rI(n){const{store:e,parentContext:t,actionsRef:i}=n,r=e.useState("open"),o=e.useState("disablePointerDismissal"),a=e.useState("modal"),u=e.useState("popupElement"),{openMethod:f,triggerProps:d,reset:p}=_v(r);wv(e);const{forceUnmount:m}=Ev(r,e,()=>{p()}),g=Se(U=>{const j=Ke(U);return j.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},j}),v=S.useCallback(()=>{e.setOpen(!1,g(pv))},[e,g]);S.useImperativeHandle(i,()=>({unmount:m,close:v}),[m,v]);const x=Tv({popupStore:e,onOpenChange:e.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[w,C]=S.useState(0),E=w===0,k=fk(x),T=Zd(x,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:a==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(U){if("button"in U&&U.button!==0||"touches"in U&&U.touches.length!==1)return!1;const j=Tn(U);if(E&&!o){const I=j;return a&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===I||e.context.backdropRef.current===I||rt(I,u)&&!I?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:E});Pv(r&&a===!0,u);const{getReferenceProps:A,getFloatingProps:O,getTriggerProps:N}=il([k,T]);e.useContextCallback("onNestedDialogOpen",U=>{C(U+1)}),e.useContextCallback("onNestedDialogClose",()=>{C(0)}),S.useEffect(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(w),t?.onNestedDialogClose&&!r&&t.onNestedDialogClose(),()=>{t?.onNestedDialogClose&&r&&t.onNestedDialogClose()}),[r,t,w]);const M=S.useMemo(()=>A(d),[A,d]),D=S.useMemo(()=>N(d),[N,d]),V=S.useMemo(()=>O(),[O]);e.useSyncedValues({openMethod:f,activeTriggerProps:M,inactiveTriggerProps:D,popupProps:V,floatingRootContext:x,nestedOpenDialogCount:w})}const sI={...kv,modal:oe(n=>n.modal),nested:oe(n=>n.nested),nestedOpenDialogCount:oe(n=>n.nestedOpenDialogCount),disablePointerDismissal:oe(n=>n.disablePointerDismissal),openMethod:oe(n=>n.openMethod),descriptionElementId:oe(n=>n.descriptionElementId),titleElementId:oe(n=>n.titleElementId),viewportElement:oe(n=>n.viewportElement),role:oe(n=>n.role)};class oI extends Jd{constructor(e){super(lI(e),{popupRef:S.createRef(),backdropRef:S.createRef(),internalBackdropRef:S.createRef(),triggerElements:new Nc,onOpenChange:void 0,onOpenChangeComplete:void 0},sI)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;const i={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",i);const r={open:e},o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),this.update(r)}}function lI(n={}){return{...Rv(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...n}}function VH(n){const{children:e,open:t,defaultOpen:i=!1,onOpenChange:r,onOpenChangeComplete:o,disablePointerDismissal:a=!1,modal:u=!0,actionsRef:f,handle:d,triggerId:p,defaultTriggerId:m=null}=n,g=ro(!0),v=!!g,x=Un(()=>d?.store??new oI({open:t??i,activeTriggerId:p!==void 0?p:m,modal:u,disablePointerDismissal:a,nested:v})).current;x.useControlledProp("open",t,i),x.useControlledProp("activeTriggerId",p,m),x.useSyncedValues({disablePointerDismissal:a,nested:v,modal:u}),x.useContextCallback("onOpenChange",r),x.useContextCallback("onOpenChangeComplete",o);const w=x.useState("payload");rI({store:x,actionsRef:f,parentContext:g?.store.context});const C=S.useMemo(()=>({store:x}),[x]);return Y.jsx(Ok.Provider,{value:C,children:typeof e=="function"?e({payload:w}):e})}(function(n){return n[n.open=Wi.open]="open",n[n.closed=Wi.closed]="closed",n[n.startingStyle=Wi.startingStyle]="startingStyle",n[n.endingStyle=Wi.endingStyle]="endingStyle",n.nested="data-nested",n.nestedDialogOpen="data-nested-dialog-open",n})({});({...Gt,...Ot});const UH=S.forwardRef(function(n,e){const{render:t,className:i,id:r,...o}=n,{store:a}=ro(),u=Ht(r);return a.useSyncedValueWithCleanup("titleElementId",u),Fe("h2",n,{ref:e,props:[{id:u},o]})}),jH=S.forwardRef(function(n,e){const{render:t,className:i,disabled:r=!1,nativeButton:o=!0,id:a,payload:u,handle:f,...d}=n,p=ro(!0),m=f?.store??p?.store;if(!m)throw new Error(bt(79));const g=Ht(a),v=m.useState("floatingRootContext"),x=m.useState("isOpenedByTrigger",g),w=S.useRef(null),{registerTrigger:C,isMountedByThisTrigger:E}=Sv(g,w,m,{payload:u}),{getButtonProps:k,buttonRef:T}=os({disabled:r,native:o}),A=Wd(v,{enabled:v!=null}),O=il([A]),N=S.useMemo(()=>({disabled:r,open:x}),[r,x]),M=m.useState("triggerProps",E);return Fe("button",n,{state:N,ref:[T,e,C,w],props:[O.getReferenceProps(),M,{[YR]:"",id:g},d,k],stateAttributesMapping:Lc})}),Pk=S.createContext(void 0);function Bc(n){const e=S.useContext(Pk);if(e===void 0&&!n)throw new Error(bt(33));return e}const zk=S.createContext(void 0);function or(n){const e=S.useContext(zk);if(e===void 0&&!n)throw new Error(bt(36));return e}const aI=S.createContext(void 0);function rp(n=!0){const e=S.useContext(aI);if(e===void 0&&!n)throw new Error(bt(25));return e}({...Gt,...Ot});const uI=S.createContext(void 0),Vv={type:"regular-item"};function sp(n){const{closeOnClick:e,disabled:t=!1,highlighted:i,id:r,store:o,nativeButton:a,itemMetadata:u,nodeId:f}=n,d=S.useRef(null),p=rp(!0),m=p!==void 0,{events:g}=o.useState("floatingTreeRoot"),{getButtonProps:v,buttonRef:x}=os({disabled:t,focusableWhenDisabled:!0,native:a}),w=S.useCallback(E=>Vi({id:r,role:"menuitem",tabIndex:i?0:-1,onMouseMove(k){f&&g.emit("itemhover",{nodeId:f,target:k.currentTarget})},onMouseEnter(){u.type==="submenu-trigger"&&u.setActive()},onKeyUp(k){k.key===" "&&o.context.typingRef.current&&k.preventBaseUIHandler()},onClick(k){e&&g.emit("close",{domEvent:k,reason:Vo})},onMouseUp(k){if(p){const T=p.initialCursorPointRef.current;if(p.initialCursorPointRef.current=null,m&&T&&Math.abs(k.clientX-T.x)<=1&&Math.abs(k.clientY-T.y)<=1)return}d.current&&o.context.allowMouseUpTriggerRef.current&&(!m||k.button===2)&&u.type==="regular-item"&&d.current.click()}},E,v),[r,i,v,e,g,o,m,p,u,f]),C=tr(d,x);return S.useMemo(()=>({getItemProps:w,itemRef:C}),[w,C])}let P2=(function(n){return n.checked="data-checked",n.unchecked="data-unchecked",n.disabled="data-disabled",n.highlighted="data-highlighted",n})({});const Uv={checked(n){return n?{[P2.checked]:""}:{[P2.unchecked]:""}},...Ot},qH=S.forwardRef(function(n,e){const{render:t,className:i,id:r,label:o,nativeButton:a=!1,disabled:u=!1,closeOnClick:f=!1,checked:d,defaultChecked:p,onCheckedChange:m,...g}=n,v=Na({label:o}),x=Bc(!0),w=Ht(r),{store:C}=or(),E=C.useState("isActive",v.index),k=C.useState("itemProps"),[T,A]=ns({controlled:d,default:p??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:O,itemRef:N}=sp({closeOnClick:f,disabled:u,highlighted:E,id:w,store:C,nativeButton:a,nodeId:x?.nodeId,itemMetadata:Vv}),M=S.useMemo(()=>({disabled:u,highlighted:E,checked:T}),[u,E,T]),D=Se(U=>{const j={...Ke(Vo,U.nativeEvent),preventUnmountOnClose:()=>{}};m?.(!T,j),!j.isCanceled&&A(I=>!I)}),V=Fe("div",n,{state:M,stateAttributesMapping:Uv,props:[k,{role:"menuitemcheckbox","aria-checked":T,onClick:D},g,O],ref:[N,e,v.ref]});return Y.jsx(uI.Provider,{value:M,children:V})}),Hk=S.createContext(void 0);function cI(){const n=S.useContext(Hk);if(n===void 0)throw new Error(bt(31));return n}const FH=S.forwardRef(function(n,e){const{render:t,className:i,...r}=n,[o,a]=S.useState(void 0),u=S.useMemo(()=>({setLabelId:a}),[a]),f=Fe("div",n,{ref:e,props:{role:"group","aria-labelledby":o,...r}});return Y.jsx(Hk.Provider,{value:u,children:f})}),$H=S.forwardRef(function(n,e){const{className:t,render:i,id:r,...o}=n,a=Ht(r),{setLabelId:u}=cI();return be(()=>(u(a),()=>{u(void 0)}),[u,a]),Fe("div",n,{ref:e,props:{id:a,role:"presentation",...o}})}),KH=S.forwardRef(function(n,e){const{render:t,className:i,id:r,label:o,nativeButton:a=!1,disabled:u=!1,closeOnClick:f=!0,...d}=n,p=Na({label:o}),m=Bc(!0),g=Ht(r),{store:v}=or(),x=v.useState("isActive",p.index),w=v.useState("itemProps"),{getItemProps:C,itemRef:E}=sp({closeOnClick:f,disabled:u,highlighted:x,id:g,store:v,nativeButton:a,nodeId:m?.nodeId,itemMetadata:Vv}),k=S.useMemo(()=>({disabled:u,highlighted:x}),[u,x]);return Fe("div",n,{state:k,props:[w,d,C],ref:[E,e,p.ref]})}),fI=S.createContext(void 0);function Vk(n){return S.useContext(fI)}const hI={...Gt,...Ot},YH=S.forwardRef(function(n,e){const{render:t,className:i,finalFocus:r,...o}=n,{store:a}=or(),{side:u,align:f}=Bc(),d=Vk()!=null,p=a.useState("open"),m=a.useState("transitionStatus"),g=a.useState("popupProps"),v=a.useState("mounted"),x=a.useState("instantType"),w=a.useState("activeTriggerElement"),C=a.useState("parent"),E=a.useState("lastOpenChangeReason"),k=a.useState("rootId"),T=a.useState("floatingRootContext"),A=a.useState("floatingTreeRoot"),O=a.useState("closeDelay"),N=a.useState("activeTriggerElement");sr({open:p,ref:a.context.popupRef,onComplete(){p&&a.context.onOpenChangeComplete?.(!0)}}),S.useEffect(()=>{function I(q){a.setOpen(!1,Ke(q.reason,q.domEvent))}return A.events.on("close",I),()=>{A.events.off("close",I)}},[A.events,a]);const M=a.useState("hoverEnabled"),D=a.useState("disabled");uk(T,{enabled:M&&!D&&C.type!=="context-menu"&&C.type!=="menubar",closeDelay:O});const V=S.useMemo(()=>({transitionStatus:m,side:u,align:f,open:p,nested:C.type==="menu",instant:x}),[m,u,f,p,C.type,x]),U=Fe("div",n,{state:V,ref:[e,a.context.popupRef],stateAttributesMapping:hI,props:[g,{onKeyDown(I){d&&Hv.has(I.key)&&I.stopPropagation()}},tp(m),o,{"data-rootownerid":k}]});let j=C.type===void 0||C.type==="context-menu";return(w||C.type==="menubar"&&E!==dv)&&(j=!0),Y.jsx(vv,{context:T,modal:!1,disabled:!v,returnFocus:r===void 0?j:r,initialFocus:C.type!=="menu",restoreFocus:!0,externalTree:C.type!=="menubar"?A:void 0,previousFocusableElement:N,nextFocusableElement:C.type===void 0?a.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:C.type===void 0?a.context.beforeContentFocusGuardRef:void 0,children:U})}),Uk=S.createContext(void 0);function dI(){const n=S.useContext(Uk);if(n===void 0)throw new Error(bt(32));return n}const GH=S.forwardRef(function(n,e){const{keepMounted:t=!1,...i}=n,{store:r}=or();return r.useState("mounted")||t?Y.jsx(Uk.Provider,{value:t,children:Y.jsx(gv,{ref:e,...i})}):null}),QH=S.forwardRef(function(n,e){const{anchor:t,positionMethod:i="absolute",className:r,render:o,side:a,align:u,sideOffset:f=0,alignOffset:d=0,collisionBoundary:p="clipping-ancestors",collisionPadding:m=5,arrowPadding:g=5,sticky:v=!1,disableAnchorTracking:x=!1,collisionAvoidance:w=GR,...C}=n,{store:E}=or(),k=dI(),T=rp(!0),A=E.useState("parent"),O=E.useState("floatingRootContext"),N=E.useState("floatingTreeRoot"),M=E.useState("mounted"),D=E.useState("open"),V=E.useState("modal"),U=E.useState("activeTriggerElement"),j=E.useState("lastOpenChangeReason"),I=E.useState("floatingNodeId"),q=E.useState("floatingParentNodeId");let P=t,$=f,_=d,H=u,z=w;A.type==="context-menu"&&(P=t??A.context?.anchor,H=H??"start",!a&&H!=="center"&&(_=n.alignOffset??2,$=n.sideOffset??-5));let Q=a,ee=H;A.type==="menu"?(Q=Q??"inline-end",ee=ee??"start",z=n.collisionAvoidance??QR):A.type==="menubar"&&(Q=Q??"bottom",ee=ee??"start");const B=A.type==="context-menu",K=Nv({anchor:P,floatingRootContext:O,positionMethod:T?"fixed":i,mounted:M,side:Q,sideOffset:$,align:ee,alignOffset:_,arrowPadding:B?0:g,collisionBoundary:p,collisionPadding:m,sticky:v,nodeId:I,keepMounted:k,disableAnchorTracking:x,collisionAvoidance:z,shiftCrossAxis:B,externalTree:N}),X=S.useMemo(()=>{const pe={};return D||(pe.pointerEvents="none"),{role:"presentation",hidden:!M,style:{...K.positionerStyles,...pe}}},[D,M,K.positionerStyles]);S.useEffect(()=>{function pe(Te){Te.open?(Te.parentNodeId===I&&E.set("hoverEnabled",!1),Te.nodeId!==I&&Te.parentNodeId===E.select("floatingParentNodeId")&&E.setOpen(!1,Ke(Vu))):Te.parentNodeId===I&&Te.reason!==Vu&&E.set("hoverEnabled",!0)}return N.events.on("menuopenchange",pe),()=>{N.events.off("menuopenchange",pe)}},[E,N.events,I]),S.useEffect(()=>{if(E.select("floatingParentNodeId")==null)return;function pe(Te){if(Te.open||Te.nodeId!==E.select("floatingParentNodeId"))return;const le=Te.reason??Vu;E.setOpen(!1,Ke(le))}return N.events.on("menuopenchange",pe),()=>{N.events.off("menuopenchange",pe)}},[N.events,E]),S.useEffect(()=>{function pe(Te){!D||Te.nodeId!==E.select("floatingParentNodeId")||Te.target&&U&&U!==Te.target&&E.setOpen(!1,Ke(Vu))}return N.events.on("itemhover",pe),()=>{N.events.off("itemhover",pe)}},[N.events,D,U,E]),S.useEffect(()=>{const pe={open:D,nodeId:I,parentNodeId:q,reason:E.select("lastOpenChangeReason")};N.events.emit("menuopenchange",pe)},[N.events,D,E,I,q]);const J=S.useMemo(()=>({open:D,side:K.side,align:K.align,anchorHidden:K.anchorHidden,nested:A.type==="menu"}),[D,K.side,K.align,K.anchorHidden,A.type]),W=S.useMemo(()=>({side:K.side,align:K.align,arrowRef:K.arrowRef,arrowUncentered:K.arrowUncentered,arrowStyles:K.arrowStyles,nodeId:K.context.nodeId}),[K.side,K.align,K.arrowRef,K.arrowUncentered,K.arrowStyles,K.context.nodeId]),re=Fe("div",n,{state:J,stateAttributesMapping:Gt,ref:[e,E.useStateSetter("positionerElement")],props:[X,C]}),ae=M&&A.type!=="menu"&&(A.type!=="menubar"&&V&&j!==Hn||A.type==="menubar"&&A.context.modal);let fe=null;return A.type==="menubar"?fe=A.context.contentElement:A.type===void 0&&(fe=U),Y.jsxs(Pk.Provider,{value:W,children:[ae&&Y.jsx(zv,{ref:A.type==="context-menu"||A.type==="nested-context-menu"?A.context.internalBackdropRef:null,inert:Lv(!D),cutout:fe}),Y.jsx(U8,{id:I,children:Y.jsx(Tk,{elementsRef:E.context.itemDomElements,labelsRef:E.context.itemLabels,children:re})})]})}),jk=S.createContext(void 0);function pI(){const n=S.useContext(jk);if(n===void 0)throw new Error(bt(34));return n}const XH=S.memo(S.forwardRef(function(n,e){const{render:t,className:i,value:r,defaultValue:o,onValueChange:a,disabled:u=!1,...f}=n,[d,p]=ns({controlled:r,default:o,name:"MenuRadioGroup"}),m=Se(a),g=Se((C,E)=>{m?.(C,E),!E.isCanceled&&p(C)}),v=S.useMemo(()=>({disabled:u}),[u]),x=Fe("div",n,{state:v,ref:e,props:{role:"group","aria-disabled":u||void 0,...f}}),w=S.useMemo(()=>({value:d,setValue:g,disabled:u}),[d,g,u]);return Y.jsx(jk.Provider,{value:w,children:x})})),qk=S.createContext(void 0);function mI(){const n=S.useContext(qk);if(n===void 0)throw new Error(bt(35));return n}const WH=S.forwardRef(function(n,e){const{render:t,className:i,id:r,label:o,nativeButton:a=!1,disabled:u=!1,closeOnClick:f=!1,value:d,...p}=n,m=Na({label:o}),g=Bc(!0),v=Ht(r),{store:x}=or(),w=x.useState("isActive",m.index),C=x.useState("itemProps"),{value:E,setValue:k,disabled:T}=pI(),A=T||u,O=E===d,{getItemProps:N,itemRef:M}=sp({closeOnClick:f,disabled:A,highlighted:w,id:v,store:x,nativeButton:a,nodeId:g?.nodeId,itemMetadata:Vv}),D=S.useMemo(()=>({disabled:A,highlighted:w,checked:O}),[A,w,O]),V=Se(j=>{const I={...Ke(Vo,j.nativeEvent),preventUnmountOnClose:()=>{}};k(d,I)}),U=Fe("div",n,{state:D,stateAttributesMapping:Uv,props:[C,{role:"menuitemradio","aria-checked":O,onClick:V},p,N],ref:[M,e,m.ref]});return Y.jsx(qk.Provider,{value:D,children:U})}),ZH=S.forwardRef(function(n,e){const{render:t,className:i,keepMounted:r=!1,...o}=n,a=mI(),u=S.useRef(null),{transitionStatus:f,setMounted:d}=nl(a.checked);sr({open:a.checked,ref:u,onComplete(){a.checked||d(!1)}});const p=S.useMemo(()=>({checked:a.checked,disabled:a.disabled,highlighted:a.highlighted,transitionStatus:f}),[a.checked,a.disabled,a.highlighted,f]);return Fe("span",n,{state:p,stateAttributesMapping:Uv,ref:[e,u],props:{"aria-hidden":!0,...o},enabled:r||a.checked})}),gI=S.createContext(null);function Fk(n){return S.useContext(gI)}const yI={...kv,disabled:oe(n=>n.parent.type==="menubar"&&n.parent.context.disabled||n.disabled),modal:oe(n=>(n.parent.type===void 0||n.parent.type==="context-menu")&&(n.modal??!0)),allowMouseEnter:oe(n=>n.parent.type==="menu"?n.parent.store.select("allowMouseEnter"):n.allowMouseEnter),stickIfOpen:oe(n=>n.stickIfOpen),parent:oe(n=>n.parent),rootId:oe(n=>n.parent.type==="menu"?n.parent.store.select("rootId"):n.parent.type!==void 0?n.parent.context.rootId:n.rootId),activeIndex:oe(n=>n.activeIndex),isActive:oe((n,e)=>n.activeIndex===e),hoverEnabled:oe(n=>n.hoverEnabled),instantType:oe(n=>n.instantType),lastOpenChangeReason:oe(n=>n.openChangeReason),floatingTreeRoot:oe(n=>n.parent.type==="menu"?n.parent.store.select("floatingTreeRoot"):n.floatingTreeRoot),floatingNodeId:oe(n=>n.floatingNodeId),floatingParentNodeId:oe(n=>n.floatingParentNodeId),itemProps:oe(n=>n.itemProps),closeDelay:oe(n=>n.closeDelay),keyboardEventRelay:oe(n=>{if(n.keyboardEventRelay)return n.keyboardEventRelay;if(n.parent.type==="menu")return n.parent.store.select("keyboardEventRelay")})};class jv extends Jd{constructor(e){super({...vI(),...e},{positionerRef:S.createRef(),popupRef:S.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:S.createRef(),beforeContentFocusGuardRef:S.createRef(),onOpenChangeComplete:void 0,triggerElements:new Nc},yI),this.observe(oe(t=>t.allowMouseEnter),(t,i)=>{this.state.parent.type==="menu"&&t!==i&&this.state.parent.store.set("allowMouseEnter",t)}),this.unsubscribeParentListener=this.observe("parent",t=>{if(this.unsubscribeParentListener?.(),t.type==="menu"){this.unsubscribeParentListener=t.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=t.store.context.allowMouseUpTriggerRef;return}t.type!==void 0&&(this.context.allowMouseUpTriggerRef=t.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:t})}static useStore(e,t){return Un(()=>e??new jv(t)).current}unsubscribeParentListener=null}function vI(){return{...Rv(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new hv,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Pt,keyboardEventRelay:void 0,closeDelay:0}}const $k=S.createContext(void 0);function Kk(){return S.useContext($k)}function bI(n){const{children:e,open:t,onOpenChange:i,onOpenChangeComplete:r,defaultOpen:o=!1,disabled:a=!1,modal:u,loopFocus:f=!0,orientation:d="vertical",actionsRef:p,closeParentOnEsc:m=!1,handle:g,triggerId:v,defaultTriggerId:x=null,highlightItemOnHover:w=!0}=n,C=rp(!0),E=or(!0),k=Fk(),T=Kk(),A=S.useMemo(()=>T&&E?{type:"menu",store:E.store}:k?{type:"menubar",context:k}:C&&!E?{type:"context-menu",context:C}:{type:void 0},[C,E,k,T]),O=jv.useStore(g?.store,{parent:A}),N=O.useState("floatingTreeRoot"),M=KR(N),D=rs();be(()=>{C&&!E?O.update({parent:{type:"context-menu",context:C},floatingNodeId:M,floatingParentNodeId:D}):E&&O.update({floatingNodeId:M,floatingParentNodeId:D})},[C,E,M,D,O]),O.useControlledProp("open",t,o),O.useControlledProp("activeTriggerId",v,x),O.useContextCallback("onOpenChangeComplete",r);const V=O.useState("open"),U=O.useState("activeTriggerElement"),j=O.useState("positionerElement"),I=O.useState("hoverEnabled"),q=O.useState("modal"),P=O.useState("disabled"),$=O.useState("lastOpenChangeReason"),_=O.useState("parent"),H=O.useState("activeIndex"),z=O.useState("payload"),Q=O.useState("floatingParentNodeId"),ee=S.useRef(null),B=Q!=null;let K;O.useSyncedValues({disabled:a,modal:_.type===void 0?u:void 0,rootId:el()});const{openMethod:X,triggerProps:J,reset:W}=_v(V);wv(O);const{forceUnmount:re}=Ev(V,O,()=>{O.update({allowMouseEnter:!1,stickIfOpen:!0}),W()}),ae=S.useRef(_.type!=="context-menu"),fe=en();S.useEffect(()=>{if(V||(ee.current=null),_.type==="context-menu"){if(!V){fe.clear(),ae.current=!1;return}fe.start(500,()=>{ae.current=!0})}},[fe,V,_.type]),Pv(V&&q&&$!==Hn&&X!=="touch",j),be(()=>{!V&&!I&&O.set("hoverEnabled",!0)},[V,I,O]);const pe=S.useRef(!0),Te=en(),le=Se((xe,He)=>{const Xe=He.reason;if(V===xe&&He.trigger===U||(He.preventUnmountOnClose=()=>{O.set("preventUnmountingOnClose",!0)},!xe&&He.trigger==null&&(He.trigger=U??void 0),i?.(xe,He),He.isCanceled))return;const On={open:xe,nativeEvent:He.event,reason:He.reason,nested:B};K?.emit("openchange",On);const hn=He.event;if(xe===!1&&hn?.type==="click"&&hn.pointerType==="touch"&&!pe.current)return;if(!xe&&H!==null){const Bt=O.context.itemDomElements.current[H];queueMicrotask(()=>{Bt?.setAttribute("tabindex","-1")})}xe&&Xe===fc?(pe.current=!1,Te.start(300,()=>{pe.current=!0})):(pe.current=!0,Te.clear());const vn=(Xe===Xr||Xe===Vo)&&hn.detail===0&&hn?.isTrusted,bn=!xe&&(Xe===Xd||Xe==null);function Mn(){const Bt={open:xe,openChangeReason:Xe};ee.current=He.event??null;const dn=He.trigger?.id??null;(dn||xe)&&(Bt.activeTriggerId=dn,Bt.activeTriggerElement=He.trigger??null),O.update(Bt)}Xe===Hn?ei.flushSync(Mn):Mn(),_.type==="menubar"&&(Xe===fc||Xe===Go||Xe===Hn||Xe===Vh||Xe===Vu)?O.set("instantType","group"):vn||bn?O.set("instantType",vn?"click":"dismiss"):O.set("instantType",void 0)}),Ee=S.useCallback(xe=>{const He=Ke(xe);return He.preventUnmountOnClose=()=>{O.set("preventUnmountingOnClose",!0)},He},[O]),Ce=S.useCallback(()=>{O.setOpen(!1,Ee(pv))},[O,Ee]);S.useImperativeHandle(p,()=>({unmount:re,close:Ce}),[re,Ce]);let Ue;_.type==="context-menu"&&(Ue=_.context),S.useImperativeHandle(Ue?.positionerRef,()=>j,[j]),S.useImperativeHandle(Ue?.actionsRef,()=>({setOpen:le}),[le]);const me=Tv({popupStore:O,onOpenChange:le});K=me.context.events,S.useEffect(()=>{const xe=({open:He,eventDetails:Xe})=>le(He,Xe);return K.on("setOpen",xe),()=>{K?.off("setOpen",xe)}},[K,le]);const ve=Zd(me,{enabled:!P,bubbles:m&&_.type==="menu",outsidePress(){return _.type!=="context-menu"||ee.current?.type==="contextmenu"?!0:ae.current},externalTree:B?N:void 0}),ge=fk(me,{role:"menu"}),Ae=Dv(),Oe=S.useCallback(xe=>{O.select("activeIndex")!==xe&&O.set("activeIndex",xe)},[O]),Ye=ck(me,{enabled:!P,listRef:O.context.itemDomElements,activeIndex:H,nested:_.type!==void 0,loopFocus:f,orientation:d,parentOrientation:_.type==="menubar"?_.context.orientation:void 0,rtl:Ae==="rtl",disabledIndices:Ys,onNavigate:Oe,openOnArrowKeyDown:_.type!=="context-menu",externalTree:B?N:void 0,focusItemOnHover:w}),de=S.useCallback(xe=>{O.context.typingRef.current=xe},[O]),ke=hk(me,{listRef:O.context.itemLabels,activeIndex:H,resetMs:q8,onMatch:xe=>{V&&xe!==H&&O.set("activeIndex",xe)},onTypingChange:de}),{getReferenceProps:we,getFloatingProps:ye,getItemProps:De,getTriggerProps:Ne}=il([ve,ge,Ye,ke]),Ge=S.useMemo(()=>{const xe=Vi(we(),{onMouseEnter(){O.set("hoverEnabled",!0)},onMouseMove(){O.set("allowMouseEnter",!0)}},J);return delete xe.role,xe},[we,O,J]),je=S.useMemo(()=>{const xe=Ne();if(!xe)return xe;const He=Vi(xe,J);return delete He.role,delete He["aria-controls"],He},[Ne,J]),mt=tl(),Dt=S.useMemo(()=>ye({onMouseEnter(){_.type==="menu"&&mt.request(()=>O.set("hoverEnabled",!1))},onMouseMove(){O.set("allowMouseEnter",!0)},onClick(){O.select("hoverEnabled")&&O.set("hoverEnabled",!1)},onKeyDown(xe){const He=O.select("keyboardEventRelay");He&&!xe.isPropagationStopped()&&He(xe)}}),[ye,_.type,mt,O]),Qt=S.useMemo(()=>De(),[De]);O.useSyncedValues({floatingRootContext:me,activeTriggerProps:Ge,inactiveTriggerProps:je,popupProps:Dt,itemProps:Qt});const st=S.useMemo(()=>({store:O,parent:A}),[O,A]),kt=Y.jsx(zk.Provider,{value:st,children:typeof e=="function"?e({payload:z}):e});return _.type===void 0||_.type==="context-menu"?Y.jsx(j8,{externalTree:N,children:kt}):kt}function JH(n){const e=or().store,t=S.useMemo(()=>({parentMenu:e}),[e]);return Y.jsx($k.Provider,{value:t,children:Y.jsx(bI,{...n})})}function xI(n={}){const{highlightItemOnHover:e,highlightedIndex:t,onHighlightedIndexChange:i}=Bv(),{ref:r,index:o}=Na(n),a=t===o,u=S.useRef(null),f=tr(r,u);return{compositeProps:S.useMemo(()=>({tabIndex:a?0:-1,onFocus(){i(o)},onMouseMove(){const d=u.current;if(!e||!d)return;const p=d.hasAttribute("disabled")||d.ariaDisabled==="true";!a&&!p&&d.focus()}}),[a,i,o,e]),compositeRef:f,index:o}}function SI(n){const{render:e,className:t,state:i=Pt,props:r=Ys,refs:o=Ys,metadata:a,stateAttributesMapping:u,tag:f="div",...d}=n,{compositeProps:p,compositeRef:m}=xI({metadata:a});return Fe(f,n,{state:i,ref:[...o,m],props:[p,...r,d],stateAttributesMapping:u})}function Yk(n){if(_t(n)&&n.hasAttribute("data-rootownerid"))return n.getAttribute("data-rootownerid")??void 0;if(!Sr(n))return Yk(Er(n))}function wI(n){const{enabled:e=!0,mouseDownAction:t,open:i}=n,r=S.useRef(!1);return S.useMemo(()=>e?{onMouseDown:o=>{(t==="open"&&!i||t==="close"&&i)&&(r.current=!0,Hi(o.currentTarget).addEventListener("click",()=>{r.current=!1},{once:!0}))},onClick:o=>{r.current&&(r.current=!1,o.preventBaseUIHandler())}}:Pt,[e,t,i])}const ph=2,eV=S.forwardRef(function(n,e){const{render:t,className:i,disabled:r=!1,nativeButton:o=!0,id:a,openOnHover:u,delay:f=100,closeDelay:d=0,handle:p,payload:m,...g}=n,v=or(!0),x=p?.store??v?.store;if(!x)throw new Error(bt(85));const w=Ht(a),C=x.useState("isTriggerActive",w),E=x.useState("floatingRootContext"),k=x.useState("isOpenedByTrigger",w),T=S.useRef(null),A=CI(),O=Bv(!0),N=no(),M=S.useMemo(()=>N??new hv,[N]),D=KR(M),V=rs(),{registerTrigger:U,isMountedByThisTrigger:j}=Sv(w,T,x,{payload:m,closeDelay:d,parent:A,floatingTreeRoot:M,floatingNodeId:D,floatingParentNodeId:V,keyboardEventRelay:O?.relayKeyboardEvent}),I=x.useState("disabled"),q=r||I||A.type==="menubar"&&A.context.disabled,{getButtonProps:P,buttonRef:$}=os({disabled:q,native:o});S.useEffect(()=>{!k&&A.type===void 0&&(x.context.allowMouseUpTriggerRef.current=!1)},[x,k,A.type]);const _=S.useRef(null),H=en(),z=Se(me=>{if(!_.current)return;H.clear(),x.context.allowMouseUpTriggerRef.current=!1;const ve=me.target;if(rt(_.current,ve)||rt(x.select("positionerElement"),ve)||ve===_.current||ve!=null&&Yk(ve)===x.select("rootId"))return;const ge=Rk(_.current);me.clientX>=ge.left-ph&&me.clientX<=ge.right+ph&&me.clientY>=ge.top-ph&&me.clientY<=ge.bottom+ph||M.events.emit("close",{domEvent:me,reason:XR})});S.useEffect(()=>{k&&x.select("lastOpenChangeReason")===Hn&&Hi(_.current).addEventListener("mouseup",z,{once:!0})},[k,z,x]);const Q=A.type==="menubar"&&A.context.hasSubmenuOpen,ee=Av(E,{enabled:(u??Q??!1)&&!q&&A.type!=="context-menu"&&(A.type!=="menubar"||Q&&!j),handleClose:Ov({blockPointerEvents:A.type!=="menubar"}),mouseOnly:!0,move:!1,restMs:A.type===void 0?f:void 0,delay:{close:d},triggerElementRef:T,externalTree:M,isActiveTrigger:C}),B=EI(k,x.select("lastOpenChangeReason")),K=Wd(E,{enabled:!q&&A.type!=="context-menu",event:k&&A.type==="menubar"?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:A.type===void 0?B:!1}),X=lk(E,{enabled:!q&&(A.type!=="menubar"&&k||Q)}),J=wI({open:k,enabled:A.type==="menubar",mouseDownAction:"open"}),W=il([K,X]),re=A.type==="menubar",ae=S.useMemo(()=>({disabled:q,open:k}),[q,k]),fe=x.useState("triggerProps",j),pe=[_,e,$,U,T],Te=[W.getReferenceProps(),ee??Pt,fe,{"aria-haspopup":"menu",id:w,onMouseDown:me=>{x.select("open")||(H.start(200,()=>{x.context.allowMouseUpTriggerRef.current=!0}),Hi(me.currentTarget).addEventListener("mouseup",z,{once:!0}))}},re?{role:"menuitem"}:{},J,g,P],le=S.useRef(null),Ee=Se(me=>{ei.flushSync(()=>{x.setOpen(!1,Ke(Go,me.nativeEvent,me.currentTarget))}),P8(le.current)?.focus()}),Ce=Se(me=>{const ve=x.select("positionerElement");if(ve&&ia(me,ve))x.context.beforeContentFocusGuardRef.current?.focus();else{ei.flushSync(()=>{x.setOpen(!1,Ke(Go,me.nativeEvent,me.currentTarget))});let ge=_8(T.current);for(;ge!==null&&rt(ve,ge)||ge?.hasAttribute("aria-hidden");){const Ae=ge;if(ge=fv(ge),ge===Ae)break}ge?.focus()}}),Ue=Fe("button",n,{enabled:!re,stateAttributesMapping:hc,state:ae,ref:pe,props:Te});return re?Y.jsx(SI,{tag:"button",render:t,className:i,state:ae,refs:pe,props:Te,stateAttributesMapping:hc}):k?Y.jsxs(S.Fragment,{children:[Y.jsx(va,{ref:le,onFocus:Ee},`${w}-pre-focus-guard`),Y.jsx(S.Fragment,{children:Ue},w),Y.jsx(va,{ref:x.context.triggerFocusTargetRef,onFocus:Ce},`${w}-post-focus-guard`)]}):Y.jsx(S.Fragment,{children:Ue},w)});function EI(n,e){const t=en(),[i,r]=S.useState(!1);return be(()=>{n&&e==="trigger-hover"?(r(!0),t.start(F8,()=>{r(!1)})):n||(t.clear(),r(!1))},[n,e,t]),i}function CI(){const n=rp(!0),e=or(!0),t=Fk();return S.useMemo(()=>t?{type:"menubar",context:t}:n&&!e?{type:"context-menu",context:n}:{type:void 0},[n,e,t])}const tV=S.forwardRef(function(n,e){const{render:t,className:i,label:r,id:o,nativeButton:a=!1,openOnHover:u=!0,delay:f=100,closeDelay:d=0,disabled:p=!1,...m}=n,g=Na(),v=Bc(),{store:x}=or(),w=Ht(o),C=x.useState("open"),E=x.useState("floatingRootContext"),k=x.useState("floatingTreeRoot"),T=sk(w,x),A=S.useCallback(X=>{const J=T(X);return X!==null&&x.select("open")&&x.select("activeTriggerId")==null&&x.update({activeTriggerId:w,activeTriggerElement:X,closeDelay:d}),J},[T,d,x,w]),O=S.useRef(null),N=S.useCallback(X=>{O.current=X,x.set("activeTriggerElement",X)},[x]),M=Kk();if(!M?.parentMenu)throw new Error(bt(37));x.useSyncedValue("closeDelay",d);const D=M.parentMenu,V=D.useState("itemProps"),U=D.useState("isActive",g.index),j=S.useMemo(()=>({type:"submenu-trigger",setActive:()=>D.set("activeIndex",g.index)}),[D,g.index]),I=x.useState("disabled"),q=p||I,{getItemProps:P,itemRef:$}=sp({closeOnClick:!1,disabled:q,highlighted:U,id:w,store:x,nativeButton:a,itemMetadata:j,nodeId:v?.nodeId}),_=x.useState("hoverEnabled"),H=x.useState("allowMouseEnter"),z=Av(E,{enabled:_&&u&&!q&&H,handleClose:Ov({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:f,delay:{open:f,close:d},triggerElementRef:O,externalTree:k}),Q=Wd(E,{enabled:!q,event:"mousedown",toggle:!u,ignoreMouse:u,stickIfOpen:!1}),ee=il([Q]),B=x.useState("triggerProps",!0);delete B.id;const K=S.useMemo(()=>({disabled:q,highlighted:U,open:C}),[q,U,C]);return Fe("div",n,{state:K,stateAttributesMapping:Lc,props:[ee.getReferenceProps(),z,B,V,{tabIndex:C||U?0:-1,onBlur(){U&&D.set("activeIndex",null)}},m,P],ref:[e,g.ref,$,A,N]})}),Gk=S.createContext(null),Qk=S.createContext(null);function Fi(){const n=S.useContext(Gk);if(n===null)throw new Error(bt(60));return n}function Xk(){const n=S.useContext(Qk);if(n===null)throw new Error(bt(61));return n}const Qe={id:oe(n=>n.id),modal:oe(n=>n.modal),multiple:oe(n=>n.multiple),items:oe(n=>n.items),itemToStringLabel:oe(n=>n.itemToStringLabel),itemToStringValue:oe(n=>n.itemToStringValue),isItemEqualToValue:oe(n=>n.isItemEqualToValue),value:oe(n=>n.value),open:oe(n=>n.open),mounted:oe(n=>n.mounted),forceMount:oe(n=>n.forceMount),transitionStatus:oe(n=>n.transitionStatus),openMethod:oe(n=>n.openMethod),activeIndex:oe(n=>n.activeIndex),selectedIndex:oe(n=>n.selectedIndex),isActive:oe((n,e)=>n.activeIndex===e),isSelected:oe((n,e,t)=>{const i=n.isItemEqualToValue,r=n.value;return n.multiple?Array.isArray(r)&&r.some(o=>Gs(o,t,i)):n.selectedIndex===e&&n.selectedIndex!==null?!0:Gs(r,t,i)}),isSelectedByFocus:oe((n,e)=>n.selectedIndex===e),popupProps:oe(n=>n.popupProps),triggerProps:oe(n=>n.triggerProps),triggerElement:oe(n=>n.triggerElement),positionerElement:oe(n=>n.positionerElement),listElement:oe(n=>n.listElement),scrollUpArrowVisible:oe(n=>n.scrollUpArrowVisible),scrollDownArrowVisible:oe(n=>n.scrollDownArrowVisible),hasScrollArrows:oe(n=>n.hasScrollArrows),serializedValue:oe(n=>{const{multiple:e,value:t,itemToStringValue:i}=n;return e&&Array.isArray(t)&&t.length===0?"":Yl(t,i)})};function RI(n){const{id:e,value:t,defaultValue:i=null,onValueChange:r,open:o,defaultOpen:a=!1,onOpenChange:u,name:f,disabled:d=!1,readOnly:p=!1,required:m=!1,modal:g=!0,actionsRef:v,inputRef:x,onOpenChangeComplete:w,items:C,multiple:E=!1,itemToStringLabel:k,itemToStringValue:T,isItemEqualToValue:A=I5,highlightItemOnHover:O=!0,children:N}=n,{clearErrors:M}=io(),{setDirty:D,shouldValidateOnChange:V,validityData:U,setFilled:j,name:I,disabled:q,validation:P}=Ui(),{controlId:$}=qi(),_=Iv({id:e}),H=q||d,z=I??f,[Q,ee]=ns({controlled:t,default:E?i??Ys:i,name:"Select",state:"value"}),[B,K]=ns({controlled:o,default:a,name:"Select",state:"open"}),X=S.useRef([]),J=S.useRef([]),W=S.useRef(null),re=S.useRef(null),ae=S.useRef(0),fe=S.useRef(null),pe=S.useRef([]),Te=S.useRef(!1),le=S.useRef(!1),Ee=S.useRef(null),Ce=S.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),Ue=S.useRef(!1),{mounted:me,setMounted:ve,transitionStatus:ge}=nl(B),{openMethod:Ae,triggerProps:Oe,reset:Ye}=_v(B),de=Un(()=>new sa({id:_,modal:g,multiple:E,itemToStringLabel:k,itemToStringValue:T,isItemEqualToValue:A,value:Q,open:B,mounted:me,transitionStatus:ge,items:C,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ke=We(de,Qe.activeIndex),we=We(de,Qe.selectedIndex),ye=We(de,Qe.triggerElement),De=We(de,Qe.positionerElement),Ne=S.useMemo(()=>E&&Array.isArray(Q)&&Q.length===0?"":Yl(Q,T),[E,Q,T]),Ge=S.useMemo(()=>E&&Array.isArray(Q)?Q.map(tt=>Yl(tt,T)):Yl(Q,T),[E,Q,T]),je=ln(de.state.triggerElement);Ic({id:_,commit:P.commit,value:Q,controlRef:je,name:z,getValue:()=>Ge});const mt=S.useRef(Q);be(()=>{Q!==mt.current&&de.set("forceMount",!0)},[de,Q]),be(()=>{j(Q!==null)},[Q,j]),be(function(){if(B)return;const tt=pe.current;if(E){const xn=Array.isArray(Q)?Q:[];if(xn.length===0){de.set("selectedIndex",null);return}const ar=xn[xn.length-1],un=ny(tt,ar,A);de.set("selectedIndex",un===-1?null:un);return}const Vt=ny(tt,Q,A);de.set("selectedIndex",Vt===-1?null:Vt)},[E,B,Q,pe,A,de]),ip(Q,()=>{M(z),D(Q!==U.initialValue),V()?P.commit(Q):P.commit(Q,!0)});const Dt=Se((tt,Vt)=>{if(u?.(tt,Vt),!Vt.isCanceled&&(K(tt),!tt&&de.state.activeIndex!==null)){const xn=X.current[de.state.activeIndex];queueMicrotask(()=>{xn?.setAttribute("tabindex","-1")})}}),Qt=Se(()=>{ve(!1),de.set("activeIndex",null),Ye(),w?.(!1)});sr({enabled:!v,open:B,ref:W,onComplete(){B||Qt()}}),S.useImperativeHandle(v,()=>({unmount:Qt}),[Qt]);const st=Se((tt,Vt)=>{r?.(tt,Vt),!Vt.isCanceled&&ee(tt)}),kt=Se(()=>{const tt=de.state.listElement||W.current;if(!tt)return;const Vt=tt.scrollTop,xn=tt.scrollTop+tt.clientHeight,ar=Vt>1,un=xn<tt.scrollHeight-1;de.state.scrollUpArrowVisible!==ar&&de.set("scrollUpArrowVisible",ar),de.state.scrollDownArrowVisible!==un&&de.set("scrollDownArrowVisible",un)}),xe=ok({open:B,onOpenChange:Dt,elements:{reference:ye,floating:De}}),He=Wd(xe,{enabled:!p&&!H,event:"mousedown"}),Xe=Zd(xe,{bubbles:!1}),On=ck(xe,{enabled:!p&&!H,listRef:X,activeIndex:ke,selectedIndex:we,disabledIndices:Ys,onNavigate(tt){tt===null&&!B||de.set("activeIndex",tt)},focusItemOnHover:!1}),hn=hk(xe,{enabled:!p&&!H&&(B||!E),listRef:J,activeIndex:ke,selectedIndex:we,onMatch(tt){B?de.set("activeIndex",tt):st(pe.current[tt],Ke("none"))},onTypingChange(tt){Te.current=tt}}),{getReferenceProps:vn,getFloatingProps:bn,getItemProps:Mn}=il([He,Xe,On,hn]),Bt=S.useMemo(()=>Vi(vn(),Oe),[vn,Oe]);L5(()=>{de.update({popupProps:bn(),triggerProps:Bt})}),be(()=>{de.update({id:_,modal:g,multiple:E,value:Q,open:B,mounted:me,transitionStatus:ge,popupProps:bn(),triggerProps:Bt,items:C,itemToStringLabel:k,itemToStringValue:T,isItemEqualToValue:A,openMethod:Ae})},[de,_,g,E,Q,B,me,ge,bn,Bt,C,k,T,A,Ae]);const dn=S.useMemo(()=>({store:de,name:z,required:m,disabled:H,readOnly:p,multiple:E,itemToStringLabel:k,itemToStringValue:T,highlightItemOnHover:O,setValue:st,setOpen:Dt,listRef:X,popupRef:W,scrollHandlerRef:re,handleScrollArrowVisibility:kt,scrollArrowsMountedCountRef:ae,getItemProps:Mn,events:xe.context.events,valueRef:fe,valuesRef:pe,labelsRef:J,typingRef:Te,selectionRef:Ce,selectedItemTextRef:Ee,validation:P,onOpenChangeComplete:w,keyboardActiveRef:le,alignItemWithTriggerActiveRef:Ue,initialValueRef:mt}),[de,z,m,H,p,E,k,T,O,st,Dt,Mn,xe.context.events,P,w,kt]),lr=tr(x,P.inputRef),$i=E&&Array.isArray(Q)&&Q.length>0,oo=S.useMemo(()=>!E||!Array.isArray(Q)||!z?null:Q.map(tt=>{const Vt=Yl(tt,T);return Y.jsx("input",{type:"hidden",name:z,value:Vt},Vt)}),[E,Q,z,T]);return Y.jsx(Gk.Provider,{value:dn,children:Y.jsxs(Qk.Provider,{value:xe,children:[N,Y.jsx("input",{...P.getInputValidationProps({onFocus(){de.state.triggerElement?.focus()},onChange(tt){if(tt.nativeEvent.defaultPrevented)return;const Vt=tt.target.value,xn=Ke(ss,tt.nativeEvent);function ar(){if(E)return;const un=pe.current.find(sl=>Yl(sl,T).toLowerCase()===Vt.toLowerCase());un!=null&&(D(un!==U.initialValue),st(un,xn),V()&&P.commit(un))}de.set("forceMount",!0),queueMicrotask(ar)}}),id:e||$||void 0,name:E?void 0:z,value:Ne,disabled:H,required:m&&!$i,readOnly:p,ref:lr,style:Dc,tabIndex:-1,"aria-hidden":!0}),oo]})})}const mh=2,kI={...hc,...ii,value:()=>null},TI=S.forwardRef(function(n,e){const{render:t,className:i,disabled:r=!1,nativeButton:o=!0,...a}=n,{setTouched:u,setFocused:f,validationMode:d,state:p,disabled:m}=Ui(),{labelId:g}=qi(),{store:v,setOpen:x,selectionRef:w,validation:C,readOnly:E,alignItemWithTriggerActiveRef:k,disabled:T,keyboardActiveRef:A}=Fi(),O=m||T||r,N=We(v,Qe.open),M=We(v,Qe.value),D=We(v,Qe.triggerProps),V=We(v,Qe.positionerElement),U=We(v,Qe.listElement),j=We(v,Qe.serializedValue),I=ln(V),q=S.useRef(null),P=en(),$=en(),{getButtonProps:_,buttonRef:H}=os({disabled:O,native:o}),z=Se(W=>{v.set("triggerElement",W)}),Q=tr(e,q,H,z),ee=en(),B=en();S.useEffect(()=>{if(N)return B.start(200,()=>{w.current.allowUnselectedMouseUp=!0,ee.start(200,()=>{w.current.allowSelectedMouseUp=!0})}),()=>{ee.clear(),B.clear()};w.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},$.clear()},[N,w,$,ee,B]);const K=S.useMemo(()=>U?.id??cc(V)?.id,[U,V]),X=Vi(D,{role:"combobox","aria-expanded":N?"true":"false","aria-haspopup":"listbox","aria-controls":N?K:void 0,"aria-labelledby":g,"aria-readonly":E||void 0,tabIndex:O?-1:0,ref:Q,onFocus(W){f(!0),N&&k.current&&x(!1,Ke(Go,W.nativeEvent)),P.start(0,()=>{v.set("forceMount",!0)})},onBlur(){u(!0),f(!1),d==="onBlur"&&C.commit(M)},onPointerMove(){A.current=!1},onKeyDown(){A.current=!0},onMouseDown(W){if(N)return;const re=Hi(W.currentTarget);function ae(fe){if(!q.current)return;const pe=fe.target;if(rt(q.current,pe)||rt(I.current,pe)||pe===q.current)return;const Te=Rk(q.current);fe.clientX>=Te.left-mh&&fe.clientX<=Te.right+mh&&fe.clientY>=Te.top-mh&&fe.clientY<=Te.bottom+mh||x(!1,Ke(XR,fe))}$.start(0,()=>{re.addEventListener("mouseup",ae,{once:!0})})}},C.getValidationProps,a,_);X.role="combobox";const J=S.useMemo(()=>({...p,open:N,disabled:O,value:M,readOnly:E,placeholder:!j}),[p,N,O,M,E,j]);return Fe("button",n,{ref:[e,q],state:J,stateAttributesMapping:kI,props:X})}),AI={value:()=>null},OI=S.forwardRef(function(n,e){const{className:t,render:i,children:r,...o}=n,{store:a,valueRef:u}=Fi(),f=We(a,Qe.value),d=We(a,Qe.items),p=We(a,Qe.itemToStringLabel),m=We(a,Qe.serializedValue),g=S.useMemo(()=>({value:f,placeholder:!m}),[f,m]),v=typeof r=="function"?r(f):r??(Array.isArray(f)?z5(f,p):P5(f,d,p));return Fe("span",n,{state:g,ref:[e,u],props:[{children:v},o],stateAttributesMapping:AI})}),MI=S.forwardRef(function(n,e){const{className:t,render:i,...r}=n,{store:o}=Fi(),a=We(o,Qe.open),u=S.useMemo(()=>({open:a}),[a]);return Fe("span",n,{state:u,ref:e,props:[{"aria-hidden":!0,children:"▼"},r],stateAttributesMapping:Lc})}),DI=S.createContext(void 0),NI=S.forwardRef(function(n,e){const{store:t}=Fi(),i=We(t,Qe.mounted),r=We(t,Qe.forceMount);return i||r?Y.jsx(DI.Provider,{value:!0,children:Y.jsx(gv,{ref:e,...n})}):null}),LI={...Gt,...Ot},II=S.forwardRef(function(n,e){const{className:t,render:i,...r}=n,{store:o}=Fi(),a=We(o,Qe.open),u=We(o,Qe.mounted),f=We(o,Qe.transitionStatus),d=S.useMemo(()=>({open:a,transitionStatus:f}),[a,f]);return Fe("div",n,{state:d,ref:e,props:[{role:"presentation",hidden:!u,style:{userSelect:"none",WebkitUserSelect:"none"}},r],stateAttributesMapping:LI})}),Wk=S.createContext(void 0);function op(){const n=S.useContext(Wk);if(!n)throw new Error(bt(59));return n}function dd(n,e){n&&Object.assign(n.style,e)}const Zk={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},BI={position:"fixed"},_I=S.forwardRef(function(n,e){const{anchor:t,positionMethod:i="absolute",className:r,render:o,side:a="bottom",align:u="center",sideOffset:f=0,alignOffset:d=0,collisionBoundary:p="clipping-ancestors",collisionPadding:m,arrowPadding:g=5,sticky:v=!1,disableAnchorTracking:x,alignItemWithTrigger:w=!0,collisionAvoidance:C=GR,...E}=n,{store:k,listRef:T,labelsRef:A,alignItemWithTriggerActiveRef:O,selectedItemTextRef:N,valuesRef:M,initialValueRef:D,popupRef:V,setValue:U}=Fi(),j=Xk(),I=We(k,Qe.open),q=We(k,Qe.mounted),P=We(k,Qe.modal),$=We(k,Qe.value),_=We(k,Qe.openMethod),H=We(k,Qe.positionerElement),z=We(k,Qe.triggerElement),Q=We(k,Qe.isItemEqualToValue),ee=S.useRef(null),B=S.useRef(null),[K,X]=S.useState(w),J=q&&K&&_!=="touch";!q&&K!==w&&X(w),be(()=>{q||(Qe.scrollUpArrowVisible(k.state)&&k.set("scrollUpArrowVisible",!1),Qe.scrollDownArrowVisible(k.state)&&k.set("scrollDownArrowVisible",!1))},[k,q]),S.useImperativeHandle(O,()=>J),Pv((J||P)&&I&&_!=="touch",z);const W=Nv({anchor:t,floatingRootContext:j,positionMethod:i,mounted:q,side:a,sideOffset:f,align:u,alignOffset:d,arrowPadding:g,collisionBoundary:p,collisionPadding:m,sticky:v,disableAnchorTracking:x??J,collisionAvoidance:C,keepMounted:!0}),re=J?"none":W.side,ae=J?BI:W.positionerStyles,fe=S.useMemo(()=>{const me={};return I||(me.pointerEvents="none"),{role:"presentation",hidden:!q,style:{...ae,...me}}},[I,q,ae]),pe=S.useMemo(()=>({open:I,side:re,align:W.align,anchorHidden:W.anchorHidden}),[I,re,W.align,W.anchorHidden]),Te=Se(me=>{k.set("positionerElement",me)}),le=Fe("div",n,{ref:[e,Te],state:pe,stateAttributesMapping:Gt,props:[fe,E]}),Ee=S.useRef(0),Ce=Se(me=>{if(me.size===0&&Ee.current===0||M.current.length===0)return;const ve=Ee.current;if(Ee.current=me.size,me.size===ve)return;const ge=Ke(ss);if(ve!==0&&!k.state.multiple&&$!==null&&ny(M.current,$,Q)===-1){const Ae=D.current,Oe=Ae!=null&&s0(M.current,Ae,Q)?Ae:null;U(Oe,ge),Oe===null&&(k.set("selectedIndex",null),N.current=null)}if(ve!==0&&k.state.multiple&&Array.isArray($)){const Ae=$.filter(Oe=>s0(M.current,Oe,Q));(Ae.length!==$.length||Ae.some(Oe=>!s0($,Oe,Q)))&&(U(Ae,ge),Ae.length===0&&(k.set("selectedIndex",null),N.current=null))}if(I&&J){k.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ae={height:""};dd(H,Ae),dd(V.current,Ae)}}),Ue=S.useMemo(()=>({...W,side:re,alignItemWithTriggerActive:J,setControlledAlignItemWithTrigger:X,scrollUpArrowRef:ee,scrollDownArrowRef:B}),[W,re,J,X]);return Y.jsx(Tk,{elementsRef:T,labelsRef:A,onMapChange:Ce,children:Y.jsxs(Wk.Provider,{value:Ue,children:[q&&P&&Y.jsx(zv,{inert:Lv(!I),cutout:z}),le]})})});function Jk(n){const e=n.currentTarget.getBoundingClientRect();return e.top+1<=n.clientY&&n.clientY<=e.bottom-1&&e.left+1<=n.clientX&&n.clientX<=e.right-1}const gh="base-ui-disable-scrollbar",ry={className:gh,element:Y.jsx("style",{href:gh,precedence:"base-ui:low",children:`.${gh}{scrollbar-width:none}.${gh}::-webkit-scrollbar{display:none}`})},PI={...Gt,...Ot},zI=S.forwardRef(function(n,e){const{render:t,className:i,...r}=n,{store:o,popupRef:a,onOpenChangeComplete:u,setOpen:f,valueRef:d,selectedItemTextRef:p,keyboardActiveRef:m,multiple:g,handleScrollArrowVisibility:v,scrollHandlerRef:x}=Fi(),{side:w,align:C,alignItemWithTriggerActive:E,setControlledAlignItemWithTrigger:k,scrollDownArrowRef:T,scrollUpArrowRef:A}=op(),O=Vk()!=null,N=Xk(),M=en(),D=We(o,Qe.id),V=We(o,Qe.open),U=We(o,Qe.mounted),j=We(o,Qe.popupProps),I=We(o,Qe.transitionStatus),q=We(o,Qe.triggerElement),P=We(o,Qe.positionerElement),$=We(o,Qe.listElement),_=S.useRef(0),H=S.useRef(!1),z=S.useRef(0),Q=S.useRef(!1),ee=S.useRef({}),B=tl(),K=Se(re=>{if(!P||!a.current||!Q.current)return;if(H.current||!E){v();return}const ae=P.style.top==="0px",fe=P.style.bottom==="0px",pe=P.getBoundingClientRect().height,Te=Hi(P),le=getComputedStyle(P),Ee=parseFloat(le.marginTop),Ce=parseFloat(le.marginBottom),Ue=Te.documentElement.clientHeight-Ee-Ce,me=re.scrollTop,ve=re.scrollHeight,ge=re.clientHeight,Ae=ve-ge;let Oe=null,Ye=null,de=!1;if(ae){const ke=Ae-me,we=pe+ke,ye=Math.min(we,Ue);Oe=ye,ye!==Ue?Ye=Ae:de=!0}else if(fe){const ke=me-0,we=pe+ke,ye=Math.min(we,Ue),De=we-Ue;Oe=ye,ye!==Ue?Ye=0:(de=!0,me<Ae&&(Ye=me-(ke-De)))}Oe!=null&&(P.style.height=`${Oe}px`),Ye!=null&&(re.scrollTop=Ye),de&&(H.current=!0),v()});S.useImperativeHandle(x,()=>K,[K]),sr({open:V,ref:a,onComplete(){V&&u?.(!0)}});const X=S.useMemo(()=>({open:V,transitionStatus:I,side:w,align:C}),[V,I,w,C]);be(()=>{!P||!a.current||Object.keys(ee.current).length||(ee.current={top:P.style.top||"0",left:P.style.left||"0",right:P.style.right,height:P.style.height,bottom:P.style.bottom,minHeight:P.style.minHeight,maxHeight:P.style.maxHeight,marginTop:P.style.marginTop,marginBottom:P.style.marginBottom})},[a,P]),be(()=>{U||E||(Q.current=!1,H.current=!1,_.current=0,z.current=0,dd(P,ee.current))},[U,E,P,a]),be(()=>{const re=a.current;if(!(!U||!q||!P||!re)){if(!E){Q.current=!0,B.request(v);return}queueMicrotask(()=>{const ae=getComputedStyle(P),fe=getComputedStyle(re),pe=Hi(q),Te=Yt(P),le=q.getBoundingClientRect(),Ee=P.getBoundingClientRect(),Ce=le.left,Ue=le.height,me=$||re,ve=me.scrollHeight,ge=parseFloat(fe.borderBottomWidth),Ae=parseFloat(ae.marginTop)||10,Oe=parseFloat(ae.marginBottom)||10,Ye=parseFloat(ae.minHeight)||100,de=5,ke=5,we=20,ye=pe.documentElement.clientHeight-Ae-Oe,De=pe.documentElement.clientWidth,Ne=ye-le.bottom+Ue,Ge=p.current,je=d.current;let mt=0,Dt=0;if(Ge&&je){const Bt=je.getBoundingClientRect(),dn=Ge.getBoundingClientRect(),lr=Bt.left-Ce,$i=dn.left-Ee.left,oo=Bt.top-le.top+Bt.height/2,tt=dn.top-Ee.top+dn.height/2;mt=lr-$i,Dt=tt-oo}const Qt=Ne+Dt+Oe+ge;let st=Math.min(ye,Qt);const kt=ye-Ae-Oe,xe=Qt-st,He=Math.max(de,Ce+mt),Xe=De-ke,On=Math.max(0,He+Ee.width-Xe);P.style.left=`${He-On}px`,P.style.height=`${st}px`,P.style.maxHeight="auto",P.style.marginTop=`${Ae}px`,P.style.marginBottom=`${Oe}px`,re.style.height="100%";const hn=me.scrollHeight-me.clientHeight,vn=xe>=hn;vn&&(st=Math.min(ye,Ee.height)-(xe-hn));const bn=le.top<we||le.bottom>ye-we||st<Math.min(ve,Ye),Mn=(Te.visualViewport?.scale??1)!==1&&DR;if(bn||Mn){Q.current=!0,dd(P,ee.current),ei.flushSync(()=>k(!1));return}if(vn){const Bt=Math.max(0,ye-Qt);P.style.top=Ee.height>=kt?"0":`${Bt}px`,P.style.height=`${st}px`,me.scrollTop=me.scrollHeight-me.clientHeight,_.current=Math.max(Ye,st)}else P.style.bottom="0",_.current=Math.max(Ye,st),me.scrollTop=xe;_.current===ye&&(H.current=!0),v(),setTimeout(()=>{Q.current=!0})})}},[o,U,P,q,d,p,a,v,E,k,B,T,A,$]),S.useEffect(()=>{if(!E||!P||!U)return;const re=Yt(P);function ae(fe){f(!1,Ke(Q8,fe))}return re.addEventListener("resize",ae),()=>{re.removeEventListener("resize",ae)}},[f,E,P,U]);const J={...$?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":g||void 0,id:`${D}-list`},onKeyDown(re){m.current=!0,O&&Hv.has(re.key)&&re.stopPropagation()},onMouseMove(){m.current=!1},onPointerLeave(re){if(Jk(re)||re.pointerType==="touch")return;const ae=re.currentTarget;M.start(0,()=>{o.set("activeIndex",null),ae.focus({preventScroll:!0})})},onScroll(re){$||x.current?.(re.currentTarget)},...E&&{style:$?{height:"100%"}:Zk}},W=Fe("div",n,{ref:[e,a],state:X,stateAttributesMapping:PI,props:[j,J,tp(I),{className:!$&&E?ry.className:void 0},r]});return Y.jsxs(S.Fragment,{children:[ry.element,Y.jsx(vv,{context:N,modal:!1,disabled:!U,restoreFocus:!0,children:W})]})}),HI=S.forwardRef(function(n,e){const{className:t,render:i,...r}=n,{store:o,scrollHandlerRef:a}=Fi(),{alignItemWithTriggerActive:u}=op(),f=We(o,Qe.hasScrollArrows),d=We(o,Qe.openMethod),p=We(o,Qe.multiple),m={id:`${We(o,Qe.id)}-list`,role:"listbox","aria-multiselectable":p||void 0,onScroll(v){a.current?.(v.currentTarget)},...u&&{style:Zk},className:f&&d!=="touch"?ry.className:void 0},g=Se(v=>{o.set("listElement",v)});return Fe("div",n,{ref:[e,g],props:[m,r]})}),eT=S.createContext(void 0);function qv(){const n=S.useContext(eT);if(!n)throw new Error(bt(57));return n}const VI=S.memo(S.forwardRef(function(n,e){const{render:t,className:i,value:r=null,label:o,disabled:a=!1,nativeButton:u=!1,...f}=n,d=S.useRef(null),p=Na({label:o,textRef:d,indexGuessBehavior:Ak.GuessFromOrder}),{store:m,getItemProps:g,setOpen:v,setValue:x,selectionRef:w,typingRef:C,valuesRef:E,keyboardActiveRef:k,multiple:T,highlightItemOnHover:A}=Fi(),O=en(),N=We(m,Qe.isActive,p.index),M=We(m,Qe.isSelected,p.index,r),D=We(m,Qe.isSelectedByFocus,p.index),V=We(m,Qe.isItemEqualToValue),U=p.index,j=U!==-1,I=S.useRef(null),q=ln(U);be(()=>{if(!j)return;const W=E.current;return W[U]=r,()=>{delete W[U]}},[j,U,r,E]),be(()=>{if(!j)return;const W=m.state.value;let re=W;T&&Array.isArray(W)&&W.length>0&&(re=W[W.length-1]),re!==void 0&&Gs(re,r,V)&&m.set("selectedIndex",U)},[j,U,T,V,m,r]);const P=S.useMemo(()=>({disabled:a,selected:M,highlighted:N}),[a,M,N]),$=g({active:N,selected:M});$.onFocus=void 0,$.id=void 0;const _=S.useRef(null),H=S.useRef("mouse"),z=S.useRef(!1),{getButtonProps:Q,buttonRef:ee}=os({disabled:a,focusableWhenDisabled:!0,native:u});function B(W){const re=m.state.value;if(T){const ae=Array.isArray(re)?re:[],fe=M?B5(ae,r,V):[...ae,r];x(fe,Ke(Vo,W))}else x(r,Ke(Vo,W)),v(!1,Ke(Vo,W))}const K={role:"option","aria-selected":M,"aria-disabled":a||void 0,tabIndex:N?0:-1,onFocus(){m.set("activeIndex",U)},onMouseEnter(){!k.current&&m.state.selectedIndex===null&&m.set("activeIndex",U)},onMouseMove(){A&&m.set("activeIndex",U)},onMouseLeave(W){!A||k.current||Jk(W)||O.start(0,()=>{m.state.activeIndex===U&&m.set("activeIndex",null)})},onTouchStart(){w.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(W){_.current=W.key,m.set("activeIndex",U)},onClick(W){z.current=!1,!(W.type==="keydown"&&_.current===null)&&(a||_.current===" "&&C.current||H.current!=="touch"&&!N||(_.current=null,B(W.nativeEvent)))},onPointerEnter(W){H.current=W.pointerType},onPointerDown(W){H.current=W.pointerType,z.current=!0},onMouseUp(W){if(a)return;if(z.current){z.current=!1;return}const re=!w.current.allowSelectedMouseUp&&M,ae=!w.current.allowUnselectedMouseUp&&!M;re||ae||H.current!=="touch"&&!N||B(W.nativeEvent)}},X=Fe("div",n,{ref:[ee,e,p.ref,I],state:P,props:[$,K,f,Q]}),J=S.useMemo(()=>({selected:M,indexRef:q,textRef:d,selectedByFocus:D,hasRegistered:j}),[M,q,d,D,j]);return Y.jsx(eT.Provider,{value:J,children:X})})),UI=S.forwardRef(function(n,e){const t=n.keepMounted??!1,{selected:i}=qv();return t||i?Y.jsx(jI,{...n,ref:e}):null}),jI=S.memo(S.forwardRef((n,e)=>{const{render:t,className:i,keepMounted:r,...o}=n,{selected:a}=qv(),u=S.useRef(null),{transitionStatus:f,setMounted:d}=nl(a),p=S.useMemo(()=>({selected:a,transitionStatus:f}),[a,f]),m=Fe("span",n,{ref:[e,u],state:p,props:[{"aria-hidden":!0,children:"✔️"},o],stateAttributesMapping:Ot});return sr({open:a,ref:u,onComplete(){a||d(!1)}}),m})),qI=S.memo(S.forwardRef(function(n,e){const{indexRef:t,textRef:i,selectedByFocus:r,hasRegistered:o}=qv(),{selectedItemTextRef:a}=Fi(),{className:u,render:f,...d}=n,p=S.useCallback(m=>{if(!m||!o)return;const g=a.current===null||!a.current.isConnected;(r||g&&t.current===0)&&(a.current=m)},[a,t,r,o]);return Fe("div",n,{ref:[p,e,i],props:d})})),FI={...Gt,...Ot},$I=S.forwardRef(function(n,e){const{className:t,render:i,...r}=n,{store:o}=Fi(),{side:a,align:u,arrowRef:f,arrowStyles:d,arrowUncentered:p,alignItemWithTriggerActive:m}=op(),g=We(o,Qe.open,!0),v=S.useMemo(()=>({open:g,side:a,align:u,uncentered:p}),[g,a,u,p]),x=Fe("div",n,{state:v,ref:[f,e],props:[{style:d,"aria-hidden":!0},r],stateAttributesMapping:FI});return m?null:x}),tT=S.forwardRef(function(n,e){const{render:t,className:i,direction:r,keepMounted:o=!1,...a}=n,{store:u,popupRef:f,listRef:d,handleScrollArrowVisibility:p,scrollArrowsMountedCountRef:m}=Fi(),{side:g,scrollDownArrowRef:v,scrollUpArrowRef:x}=op(),w=r==="up"?Qe.scrollUpArrowVisible:Qe.scrollDownArrowVisible,C=We(u,w),E=We(u,Qe.openMethod),k=C&&E!=="touch",T=en(),A=r==="up"?x:v,{transitionStatus:O,setMounted:N}=nl(k);be(()=>(m.current+=1,u.state.hasScrollArrows||u.set("hasScrollArrows",!0),()=>{m.current=Math.max(0,m.current-1),m.current===0&&u.state.hasScrollArrows&&u.set("hasScrollArrows",!1)}),[u,m]),sr({open:k,ref:A,onComplete(){k||N(!1)}});const M=S.useMemo(()=>({direction:r,visible:k,side:g,transitionStatus:O}),[r,k,g,O]),D=Fe("div",n,{ref:[e,A],state:M,props:[{"aria-hidden":!0,children:r==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(V){if(V.movementX===0&&V.movementY===0||T.isStarted())return;u.set("activeIndex",null);function U(){const j=u.state.listElement??f.current;if(!j)return;u.set("activeIndex",null),p();const I=j.scrollTop===0,q=Math.round(j.scrollTop+j.clientHeight)>=j.scrollHeight;if(d.current.length===0&&(r==="up"?u.set("scrollUpArrowVisible",!I):u.set("scrollDownArrowVisible",!q)),r==="up"&&I||r==="down"&&q){T.clear();return}if((u.state.listElement||f.current)&&d.current&&d.current.length>0){const P=d.current,$=A.current?.offsetHeight||0;if(r==="up"){let _=0;const H=j.scrollTop+$;for(let Q=0;Q<P.length;Q+=1){const ee=P[Q];if(ee&&ee.offsetTop>=H){_=Q;break}}const z=Math.max(0,_-1);if(z<_){const Q=P[z];Q&&(j.scrollTop=Math.max(0,Q.offsetTop-$))}else j.scrollTop=0}else{let _=P.length-1;const H=j.scrollTop+j.clientHeight-$;for(let Q=0;Q<P.length;Q+=1){const ee=P[Q];if(ee&&ee.offsetTop+ee.offsetHeight>H){_=Math.max(0,Q-1);break}}const z=Math.min(P.length-1,_+1);if(z>_){const Q=P[z];Q&&(j.scrollTop=Q.offsetTop+Q.offsetHeight-j.clientHeight+$)}else j.scrollTop=j.scrollHeight-j.clientHeight}}T.start(40,U)}T.start(40,U)},onMouseLeave(){T.clear()}},a]});return k||o?D:null}),KI=S.forwardRef(function(n,e){return Y.jsx(tT,{...n,ref:e,direction:"down"})}),YI=S.forwardRef(function(n,e){return Y.jsx(tT,{...n,ref:e,direction:"up"})}),nT=S.createContext(void 0);function GI(){const n=S.useContext(nT);if(n===void 0)throw new Error(bt(56));return n}const QI=S.forwardRef(function(n,e){const{className:t,render:i,...r}=n,[o,a]=S.useState(),u=S.useMemo(()=>({labelId:o,setLabelId:a}),[o,a]),f=Fe("div",n,{ref:e,props:[{role:"group","aria-labelledby":o},r]});return Y.jsx(nT.Provider,{value:u,children:f})}),XI=S.forwardRef(function(n,e){const{className:t,render:i,id:r,...o}=n,{setLabelId:a}=GI(),u=Ht(r);return be(()=>{a(u)},[u,a]),Fe("div",n,{ref:e,props:[{id:u},o]})}),nV=Object.freeze(Object.defineProperty({__proto__:null,Arrow:$I,Backdrop:II,Group:QI,GroupLabel:XI,Icon:MI,Item:VI,ItemIndicator:UI,ItemText:qI,List:HI,Popup:zI,Portal:NI,Positioner:_I,Root:RI,ScrollDownArrow:KI,ScrollUpArrow:YI,Separator:Q5,Trigger:TI,Value:OI},Symbol.toStringTag,{value:"Module"})),iT=S.createContext(void 0);function WI(){const n=S.useContext(iT);if(n===void 0)throw new Error(bt(63));return n}let z2=(function(n){return n.checked="data-checked",n.unchecked="data-unchecked",n.disabled="data-disabled",n.readonly="data-readonly",n.required="data-required",n.valid="data-valid",n.invalid="data-invalid",n.touched="data-touched",n.dirty="data-dirty",n.filled="data-filled",n.focused="data-focused",n})({});const rT={...ii,checked(n){return n?{[z2.checked]:""}:{[z2.unchecked]:""}}},iV=S.forwardRef(function(n,e){const{checked:t,className:i,defaultChecked:r,id:o,inputRef:a,name:u,nativeButton:f=!1,onCheckedChange:d,readOnly:p=!1,required:m=!1,disabled:g=!1,render:v,uncheckedValue:x,...w}=n,{clearErrors:C}=io(),{state:E,setTouched:k,setDirty:T,validityData:A,setFilled:O,setFocused:N,shouldValidateOnChange:M,validationMode:D,disabled:V,name:U,validation:j}=Ui(),{labelId:I}=qi(),q=V||g,P=U??u,$=Se(d),_=S.useRef(null),H=tr(_,a,j.inputRef),z=S.useRef(null),Q=Ht(),ee=Iv({id:o,implicit:!1,controlRef:z}),[B,K]=ns({controlled:t,default:!!r,name:"Switch",state:"checked"});Ic({id:Q,commit:j.commit,value:B,controlRef:z,name:P,getValue:()=>B}),be(()=>{_.current&&O(_.current.checked)},[_,O]),ip(B,()=>{C(P),T(B!==A.initialValue),O(B),M()?j.commit(B):j.commit(B,!0)});const{getButtonProps:X,buttonRef:J}=os({disabled:q,native:f}),W={id:Q,role:"switch","aria-checked":B,"aria-readonly":p||void 0,"aria-labelledby":I,onFocus(){q||N(!0)},onBlur(){const pe=_.current;!pe||q||(k(!0),N(!1),D==="onBlur"&&j.commit(pe.checked))},onClick(pe){p||q||(pe.preventDefault(),_?.current?.click())}},re=S.useMemo(()=>Vi({checked:B,disabled:q,id:ee,name:P,required:m,style:Dc,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:H,onChange(pe){if(pe.nativeEvent.defaultPrevented)return;const Te=pe.target.checked,le=Ke(ss,pe.nativeEvent);$?.(Te,le),!le.isCanceled&&K(Te)},onFocus(){z.current?.focus()}},j.getInputValidationProps),[B,q,H,ee,P,$,m,K,j]),ae=S.useMemo(()=>({...E,checked:B,disabled:q,readOnly:p,required:m}),[E,B,q,p,m]),fe=Fe("span",n,{state:ae,ref:[e,z,J],props:[W,j.getValidationProps,w,X],stateAttributesMapping:rT});return Y.jsxs(iT.Provider,{value:ae,children:[fe,!B&&P&&x!==void 0&&Y.jsx("input",{type:"hidden",name:P,value:x}),Y.jsx("input",{...re})]})}),rV=S.forwardRef(function(n,e){const{render:t,className:i,...r}=n,{state:o}=Ui(),a=WI(),u={...o,...a};return Fe("span",n,{state:u,ref:e,stateAttributesMapping:rT,props:r})});({...Ot});oe(n=>n.disabled),oe(n=>n.instantType),oe(n=>n.openMethod),oe(n=>n.openChangeReason),oe(n=>n.modal),oe(n=>n.stickIfOpen),oe(n=>n.titleElementId),oe(n=>n.descriptionElementId),oe(n=>n.openOnHover),oe(n=>n.closeDelay);({...Gt,...Ot});({...Gt,...Ot});({...Ot,...ii});function sV(n){return Fe(n.defaultTagName??"div",n,n)}function ZI(n){const{open:e,defaultOpen:t,onOpenChange:i,disabled:r}=n,o=e!==void 0,[a,u]=ns({controlled:e,default:t,name:"Collapsible",state:"open"}),{mounted:f,setMounted:d,transitionStatus:p}=nl(a,!0,!0),[m,g]=S.useState(a),[{height:v,width:x},w]=S.useState({height:void 0,width:void 0}),C=Ht(),[E,k]=S.useState(),T=E??C,[A,O]=S.useState(!1),[N,M]=S.useState(!1),D=S.useRef(null),V=S.useRef(null),U=S.useRef(null),j=S.useRef(null),I=xv(j,!1),q=Se(P=>{const $=!a,_=Ke(Xr,P.nativeEvent);if(i($,_),_.isCanceled)return;const H=j.current;V.current==="css-animation"&&H!=null&&H.style.removeProperty("animation-name"),!A&&!N&&(V.current!=null&&V.current!=="css-animation"&&!f&&$&&d(!0),V.current==="css-animation"&&(!m&&$&&g(!0),!f&&$&&d(!0))),u($),V.current==="none"&&f&&!$&&d(!1)});return be(()=>{o&&V.current==="none"&&!N&&!a&&d(!1)},[o,N,a,e,d]),S.useMemo(()=>({abortControllerRef:D,animationTypeRef:V,disabled:r,handleTrigger:q,height:v,mounted:f,open:a,panelId:T,panelRef:j,runOnceAnimationsFinish:I,setDimensions:w,setHiddenUntilFound:O,setKeepMounted:M,setMounted:d,setOpen:u,setPanelIdState:k,setVisible:g,transitionDimensionRef:U,transitionStatus:p,visible:m,width:x}),[D,V,r,q,v,f,a,T,j,I,w,O,M,d,u,g,U,p,m,x])}const sT=S.createContext(void 0);function oT(){const n=S.useContext(sT);if(n===void 0)throw new Error(bt(15));return n}let Zu=(function(n){return n.open="data-open",n.closed="data-closed",n[n.startingStyle=ba.startingStyle]="startingStyle",n[n.endingStyle=ba.endingStyle]="endingStyle",n})({}),JI=(function(n){return n.panelOpen="data-panel-open",n})({});const eB={[Zu.open]:""},tB={[Zu.closed]:""},nB={open(n){return n?{[JI.panelOpen]:""}:null}},iB={open(n){return n?eB:tB}};({...Ot});let rB=(function(n){return n.disabled="data-disabled",n.orientation="data-orientation",n})({});function sB(n){const{abortControllerRef:e,animationTypeRef:t,externalRef:i,height:r,hiddenUntilFound:o,keepMounted:a,id:u,mounted:f,onOpenChange:d,open:p,panelRef:m,runOnceAnimationsFinish:g,setDimensions:v,setMounted:x,setOpen:w,setVisible:C,transitionDimensionRef:E,visible:k,width:T}=n,A=S.useRef(!1),O=S.useRef(null),N=S.useRef(p),M=S.useRef(p),D=tl(),V=S.useMemo(()=>t.current==="css-animation"?!k:!p&&!f,[p,f,k,t]),U=Se(I=>{if(!I)return;if(t.current==null||E.current==null){const $=getComputedStyle(I),_=$.animationName!=="none"&&$.animationName!=="",H=$.transitionDuration!=="0s"&&$.transitionDuration!=="";_&&H||($.animationName==="none"&&$.transitionDuration!=="0s"?t.current="css-transition":$.animationName!=="none"&&$.transitionDuration==="0s"?t.current="css-animation":t.current="none"),I.getAttribute(rB.orientation)==="horizontal"||$.transitionProperty.indexOf("width")>-1?E.current="width":E.current="height"}if(t.current!=="css-transition")return;(r===void 0||T===void 0)&&(v({height:I.scrollHeight,width:I.scrollWidth}),M.current&&I.style.setProperty("transition-duration","0s"));let q=-1,P=-1;return q=qt.request(()=>{M.current=!1,P=qt.request(()=>{setTimeout(()=>{I.style.removeProperty("transition-duration")})})}),()=>{qt.cancel(q),qt.cancel(P)}}),j=tr(i,m,U);return be(()=>{if(t.current!=="css-transition")return;const I=m.current;if(!I)return;let q=-1;if(e.current!=null&&(e.current.abort(),e.current=null),p){const P={"justify-content":I.style.justifyContent,"align-items":I.style.alignItems,"align-content":I.style.alignContent,"justify-items":I.style.justifyItems};Object.keys(P).forEach($=>{I.style.setProperty($,"initial","important")}),!M.current&&!a&&I.setAttribute(Zu.startingStyle,""),v({height:I.scrollHeight,width:I.scrollWidth}),q=qt.request(()=>{Object.entries(P).forEach(([$,_])=>{_===""?I.style.removeProperty($):I.style.setProperty($,_)})})}else{if(I.scrollHeight===0&&I.scrollWidth===0)return;v({height:I.scrollHeight,width:I.scrollWidth});const P=new AbortController;e.current=P;const $=P.signal;let _=null;const H=Zu.endingStyle;return _=new MutationObserver(z=>{z.some(Q=>Q.type==="attributes"&&Q.attributeName===H)&&(_?.disconnect(),_=null,g(()=>{v({height:0,width:0}),I.style.removeProperty("content-visibility"),x(!1),e.current===P&&(e.current=null)},$))}),_.observe(I,{attributes:!0,attributeFilter:[H]}),()=>{_?.disconnect(),D.cancel(),e.current===P&&(P.abort(),e.current=null)}}return()=>{qt.cancel(q)}},[e,t,D,o,a,f,p,m,g,v,x]),be(()=>{if(t.current!=="css-animation")return;const I=m.current;I&&(O.current=I.style.animationName||O.current,I.style.setProperty("animation-name","none"),v({height:I.scrollHeight,width:I.scrollWidth}),!N.current&&!A.current&&I.style.removeProperty("animation-name"),p?(e.current!=null&&(e.current.abort(),e.current=null),x(!0),C(!0)):(e.current=new AbortController,g(()=>{x(!1),C(!1),e.current=null},e.current.signal)))},[e,t,p,m,g,v,x,C,k]),av(()=>{const I=qt.request(()=>{N.current=!1});return()=>qt.cancel(I)}),be(()=>{if(!o)return;const I=m.current;if(!I)return;let q=-1,P=-1;return p&&A.current&&(I.style.transitionDuration="0s",v({height:I.scrollHeight,width:I.scrollWidth}),q=qt.request(()=>{A.current=!1,P=qt.request(()=>{setTimeout(()=>{I.style.removeProperty("transition-duration")})})})),()=>{qt.cancel(q),qt.cancel(P)}},[o,p,m,v]),be(()=>{const I=m.current;I&&o&&V&&(I.setAttribute("hidden","until-found"),t.current==="css-transition"&&I.setAttribute(Zu.startingStyle,""))},[o,V,t,m]),S.useEffect(function(){const I=m.current;if(!I)return;function q(P){A.current=!0,w(!0),d(!0,Ke(ss,P))}return I.addEventListener("beforematch",q),()=>{I.removeEventListener("beforematch",q)}},[d,m,w]),S.useMemo(()=>({props:{hidden:V,id:u,ref:j}}),[V,u,j])}const lT={...iB,...Ot},oB=S.forwardRef(function(n,e){const{render:t,className:i,defaultOpen:r=!1,disabled:o=!1,onOpenChange:a,open:u,...f}=n,d=Se(a),p=ZI({open:u,defaultOpen:r,onOpenChange:d,disabled:o}),m=S.useMemo(()=>({open:p.open,disabled:p.disabled,transitionStatus:p.transitionStatus}),[p.open,p.disabled,p.transitionStatus]),g=S.useMemo(()=>({...p,onOpenChange:d,state:m}),[p,d,m]),v=Fe("div",n,{state:m,ref:e,props:f,stateAttributesMapping:lT});return Y.jsx(sT.Provider,{value:g,children:v})}),lB={...nB,...Ot},aB=S.forwardRef(function(n,e){const{panelId:t,open:i,handleTrigger:r,state:o,disabled:a}=oT(),{className:u,disabled:f=a,id:d,render:p,nativeButton:m=!0,...g}=n,{getButtonProps:v,buttonRef:x}=os({disabled:f,focusableWhenDisabled:!0,native:m}),w=S.useMemo(()=>({"aria-controls":i?t:void 0,"aria-expanded":i,disabled:f,onClick:r}),[t,f,i,r]);return Fe("button",n,{state:o,ref:[e,x],props:[w,g,v],stateAttributesMapping:lB})});let H2=(function(n){return n.collapsiblePanelHeight="--collapsible-panel-height",n.collapsiblePanelWidth="--collapsible-panel-width",n})({});const uB=S.forwardRef(function(n,e){const{className:t,hiddenUntilFound:i,keepMounted:r,render:o,id:a,...u}=n,{abortControllerRef:f,animationTypeRef:d,height:p,mounted:m,onOpenChange:g,open:v,panelId:x,panelRef:w,runOnceAnimationsFinish:C,setDimensions:E,setHiddenUntilFound:k,setKeepMounted:T,setMounted:A,setPanelIdState:O,setOpen:N,setVisible:M,state:D,transitionDimensionRef:V,visible:U,width:j,transitionStatus:I}=oT(),q=i??!1,P=r??!1;be(()=>{if(a)return O(a),()=>{O(void 0)}},[a,O]),be(()=>{k(q)},[k,q]),be(()=>{T(P)},[T,P]);const{props:$}=sB({abortControllerRef:f,animationTypeRef:d,externalRef:e,height:p,hiddenUntilFound:q,id:x,keepMounted:P,mounted:m,onOpenChange:g,open:v,panelRef:w,runOnceAnimationsFinish:C,setDimensions:E,setMounted:A,setOpen:N,setVisible:M,transitionDimensionRef:V,visible:U,width:j});sr({open:v&&I==="idle",ref:w,onComplete(){v&&E({height:void 0,width:void 0})}});const _=S.useMemo(()=>({...D,transitionStatus:I}),[D,I]),H=Fe("div",n,{state:_,ref:[e,w],props:[$,{style:{[H2.collapsiblePanelHeight]:p===void 0?"auto":`${p}px`,[H2.collapsiblePanelWidth]:j===void 0?"auto":`${j}px`}},u],stateAttributesMapping:lT});return P||q||!P&&m?H:null}),o0=Object.freeze(Object.defineProperty({__proto__:null,Panel:uB,Root:oB,Trigger:aB},Symbol.toStringTag,{value:"Module"}));({...Gt,...Ot});Cv();Cv();({...Gt,...Ot});({...Gt,...Ot});const cB=["−","-","‒","–","—","﹣"],fB=["+","﹢"],hB=n=>n.replace(/[-\\\]^]/g,e=>`\\${e}`),aT=n=>`[${n.map(hB).join("")}]`;aT(["-"].concat(cB));aT(["+"].concat(fB));({...ii});({...Gt,...Ot});({...Gt,...Ot});function V2({content:n,children:e,align:t,asChild:i,side:r,className:o,...a}){return Y.jsxs(FL,{...a,children:[Y.jsx(n5,{className:o,render:i?e:void 0,children:i?void 0:e}),Y.jsx(s5,{children:Y.jsx(f5,{align:t,side:r,sideOffset:10,children:Y.jsxs(g5,{className:$o("flex origin-[var(--transform-origin)] flex-col rounded-md bg-kumo-base px-2.5 py-1.5 text-sm text-kumo-default","shadow-lg shadow-kumo-tip-shadow outline outline-kumo-fill","transition-[transform,opacity] duration-150","data-[starting-style]:scale-90 data-[starting-style]:opacity-0","data-[ending-style]:scale-90 data-[ending-style]:opacity-0","data-[instant]:duration-0","kumo-tooltip-popup"),children:[Y.jsx(y5,{className:$o("flex","data-[side=bottom]:top-[-8px]","data-[side=left]:right-[-13px] data-[side=left]:rotate-90","data-[side=right]:left-[-13px] data-[side=right]:-rotate-90","data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180"),children:Y.jsx(dB,{})}),n]})})})]})}function dB(n){return Y.jsxs("svg",{width:"20",height:"10",viewBox:"0 0 20 10",fill:"none",...n,children:[Y.jsx("path",{d:"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z",className:"fill-kumo-base"}),Y.jsx("path",{d:"M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z",className:"fill-kumo-tip-shadow"}),Y.jsx("path",{d:"M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z",className:"fill-kumo-tip-stroke"})]})}const pB="#F48120",mB="#FAAD3F",gB="0 0 49 22",yB="0 0 101.4 33.5",U2={variant:"full",color:"color"},Fv=S.forwardRef(({variant:n=U2.variant,color:e=U2.color,className:t,...i},r)=>{const o=n==="glyph",a=e==="color"?pB:"currentColor",u=e==="color"?mB:"currentColor";return o?Y.jsxs("svg",{ref:r,viewBox:gB,fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Cloudflare logo",className:$o(e==="white"&&"text-white",e==="black"&&"text-black",t),...i,children:[Y.jsx("path",{d:"M33.204 20.4C33.3649 19.9741 33.4217 19.5159 33.3695 19.0636C33.3173 18.6113 33.1577 18.1781 32.904 17.8C32.6435 17.4876 32.3239 17.2297 31.9636 17.0409C31.6032 16.8522 31.2092 16.7363 30.804 16.7L13.404 16.5C13.304 16.5 13.204 16.4 13.104 16.4C13.0808 16.3825 13.0618 16.3599 13.0488 16.3339C13.0358 16.3078 13.029 16.2791 13.029 16.25C13.029 16.2209 13.0358 16.1922 13.0488 16.1662C13.0618 16.1401 13.0808 16.1175 13.104 16.1C13.204 15.9 13.304 15.8 13.504 15.8L31.004 15.6C32.115 15.4767 33.1731 15.0597 34.0695 14.3918C34.9659 13.7239 35.6681 12.8293 36.104 11.8L37.104 9.20002C37.104 9.10002 37.204 9.00001 37.104 8.90001C36.5604 6.47843 35.2411 4.30052 33.3466 2.69721C31.4521 1.09391 29.086 0.152865 26.6079 0.0170769C24.1298 -0.118712 21.675 0.558179 19.6167 1.94489C17.5584 3.33161 16.009 5.35233 15.204 7.70002C14.159 6.95365 12.8843 6.59957 11.604 6.70002C10.4291 6.83102 9.33369 7.35777 8.49774 8.19372C7.66179 9.02966 7.13505 10.1251 7.00404 11.3C6.93745 11.9014 6.97125 12.5097 7.10404 13.1C5.20298 13.1526 3.39743 13.9448 2.07147 15.3081C0.745511 16.6714 0.00377461 18.4982 0.00403983 20.4C-0.0123708 20.7695 0.0212659 21.1395 0.104038 21.5C0.10863 21.5781 0.141713 21.6517 0.19701 21.707C0.252307 21.7623 0.325975 21.7954 0.404041 21.8H32.504C32.704 21.8 32.904 21.7 32.904 21.5L33.204 20.4Z",fill:a}),Y.jsx("path",{d:"M38.704 9.20002H38.204C38.104 9.20002 38.004 9.30001 37.904 9.40001L37.204 11.8C37.0431 12.2259 36.9864 12.6841 37.0386 13.1364C37.0908 13.5887 37.2504 14.0219 37.504 14.4C37.7646 14.7124 38.0842 14.9704 38.4445 15.1591C38.8049 15.3479 39.1989 15.4637 39.604 15.5L43.304 15.7C43.404 15.7 43.504 15.8 43.604 15.8C43.6273 15.8175 43.6462 15.8401 43.6592 15.8662C43.6723 15.8922 43.679 15.9209 43.679 15.95C43.679 15.9791 43.6723 16.0078 43.6592 16.0339C43.6462 16.0599 43.6273 16.0826 43.604 16.1C43.504 16.3 43.404 16.4 43.204 16.4L39.404 16.6C38.293 16.7233 37.2349 17.1403 36.3386 17.8082C35.4422 18.4761 34.74 19.3707 34.304 20.4L34.104 21.3C34.004 21.4 34.104 21.6 34.304 21.6H47.504C47.5448 21.6058 47.5863 21.6021 47.6254 21.5891C47.6644 21.5761 47.6999 21.5541 47.729 21.525C47.7581 21.4959 47.7801 21.4604 47.7931 21.4214C47.8061 21.3823 47.8099 21.3408 47.804 21.3C48.0421 20.4527 48.1764 19.5797 48.204 18.7C48.1882 16.1854 47.1822 13.7782 45.404 12C43.6259 10.2218 41.2187 9.21587 38.704 9.20002Z",fill:u})]}):Y.jsxs("svg",{ref:r,viewBox:yB,fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Cloudflare logo",className:$o(e==="color"&&"text-kumo-default",e==="white"&&"text-white",e==="black"&&"text-black",t),...i,children:[Y.jsx("path",{d:"M84.2,20.4a2.85546,2.85546,0,0,0-.3-2.6,3.09428,3.09428,0,0,0-2.1-1.1l-17.4-.2c-.1,0-.2-.1-.3-.1a.1875.1875,0,0,1,0-.3c.1-.2.2-.3.4-.3L82,15.6a6.29223,6.29223,0,0,0,5.1-3.8l1-2.6c0-.1.1-.2,0-.3A11.39646,11.39646,0,0,0,66.2,7.7a5.45941,5.45941,0,0,0-3.6-1A5.20936,5.20936,0,0,0,58,11.3a5.46262,5.46262,0,0,0,.1,1.8A7.30177,7.30177,0,0,0,51,20.4a4.102,4.102,0,0,0,.1,1.1.3193.3193,0,0,0,.3.3H83.5c.2,0,.4-.1.4-.3Z",fill:a}),Y.jsx("path",{d:"M89.7,9.2h-.5c-.1,0-.2.1-.3.2l-.7,2.4a2.85546,2.85546,0,0,0,.3,2.6,3.09428,3.09428,0,0,0,2.1,1.1l3.7.2c.1,0,.2.1.3.1a.1875.1875,0,0,1,0,.3c-.1.2-.2.3-.4.3l-3.8.2a6.29223,6.29223,0,0,0-5.1,3.8l-.2.9c-.1.1,0,.3.2.3H98.5a.26517.26517,0,0,0,.3-.3,10.87184,10.87184,0,0,0,.4-2.6,9.56045,9.56045,0,0,0-9.5-9.5",fill:u}),Y.jsx("path",{d:"M100.5,27.2a.9.9,0,1,1,.9-.9.89626.89626,0,0,1-.9.9m0-1.6a.7.7,0,1,0,.7.7.68354.68354,0,0,0-.7-.7m.4,1.2h-.2l-.2-.3h-.2v.3h-.2v-.9h.5a.26517.26517,0,0,1,.3.3c0,.1-.1.2-.2.3l.2.3Zm-.3-.5c.1,0,.1,0,.1-.1a.09794.09794,0,0,0-.1-.1h-.3v.3h.3Zm-89.7-.9h2.2v6h3.8v1.9h-6Zm8.3,3.9a4.10491,4.10491,0,0,1,4.3-4.1,4.02,4.02,0,0,1,4.2,4.1,4.10491,4.10491,0,0,1-4.3,4.1,4.07888,4.07888,0,0,1-4.2-4.1m6.3,0a2.05565,2.05565,0,0,0-2-2.2,2.1025,2.1025,0,0,0,0,4.2c1.2.2,2-.8,2-2m4.9.5V25.4h2.2v4.4c0,1.1.6,1.7,1.5,1.7a1.39926,1.39926,0,0,0,1.5-1.6V25.4h2.2v4.4c0,2.6-1.5,3.7-3.7,3.7-2.3-.1-3.7-1.2-3.7-3.7m10.7-4.4h3.1c2.8,0,4.5,1.6,4.5,3.9s-1.7,4-4.5,4h-3V25.4Zm3.1,5.9a2.00909,2.00909,0,1,0,0-4h-.9v4Zm7.6-5.9h6.3v1.9H54v1.3h3.7v1.8H54v2.9H51.8Zm9.4,0h2.2v6h3.8v1.9h-6Zm11.7-.1h2.2l3.4,8H76.1l-.6-1.4H72.4l-.6,1.4H69.5Zm2,4.9L74,28l-.9,2.2Zm6.4-4.8H85a3.41818,3.41818,0,0,1,2.6.9,2.62373,2.62373,0,0,1-.9,4.2l1.9,2.8H86.1l-1.6-2.4h-1v2.4H81.3Zm3.6,3.8c.7,0,1.2-.4,1.2-.9,0-.6-.5-.9-1.2-.9H83.5v1.9h1.4Zm6.5-3.8h6.4v1.8H93.6v1.2h3.8v1.8H93.6v1.2h4.3v1.9H91.4ZM6.1,30.3a1.97548,1.97548,0,0,1-1.8,1.2,2.1025,2.1025,0,0,1,0-4.2,2.0977,2.0977,0,0,1,1.9,1.3H8.5a4.13459,4.13459,0,0,0-4.2-3.3A4.1651,4.1651,0,0,0,0,29.4a4.07888,4.07888,0,0,0,4.2,4.1,4.31812,4.31812,0,0,0,4.2-3.2Z",fill:"currentColor"})]})});Fv.displayName="CloudflareLogo";const vB=S.forwardRef(({color:n="color",href:e="https://www.cloudflare.com",className:t,...i},r)=>Y.jsxs("a",{ref:r,href:e,target:"_blank",rel:"noopener noreferrer",className:$o("inline-flex items-center gap-2 rounded-lg py-2 pl-2.5 pr-3 text-sm font-medium","ring-1 ring-inset transition-all hover:shadow-sm",n==="color"&&"bg-kumo-base text-kumo-default ring-kumo-line",n==="black"&&"bg-white text-black ring-black/20",n==="white"&&"bg-black text-white ring-white/20",t),...i,children:[Y.jsx(Fv,{variant:"glyph",color:n,className:"h-4 w-auto"}),Y.jsxs("span",{children:["Powered by ",Y.jsx("span",{className:"font-semibold",children:"Cloudflare"})]})]}));vB.displayName="PoweredByCloudflare";const bB=n=>S.createElement("svg",{width:16,height:16,viewBox:"-4 -2 73 68",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},S.createElement("path",{fill:"currentColor",d:"m23.6 22.2 3.03 1.75v3.5L23.6 29.2l-3.03-1.75v-3.5zM20.06 49l3.54-3.54L27.14 49l-3.54 3.54zm3.54-14.7c.593 0 1.17.176 1.67.506.493.33.878.798 1.1 1.35a3 3 0 0 1-.65 3.27c-.42.42-.954.705-1.54.821a3 3 0 0 1-1.73-.171 3.04 3.04 0 0 1-1.35-1.1 3 3 0 0 1-.506-1.67c0-.796.316-1.56.879-2.12a3 3 0 0 1 2.12-.879zM10.3 11.2l6.42-4.89 1.21-.37h29l1.19.39 6.61 4.89.82 1.61v38L55 52.21l-4.83 5.11-1.46.63h-31.7l-1.37-.54-5.48-5.11-.64-1.47v-38zm3.21 25.4 4.47 4.94h.056v4h-1.83l-2.7-3v7.39l4.26 4h30l3.7-3.91V42.3l-3.67 3.24h-18.6v-4h17.2l5.19-4.61v-7.44l-3.67 3.25h-18.7v-4h17.2l5.19-4.6v-6.92l-3.67 3.26h-31.6l-2.74-2.8v6.12l4.47 4.94h.056v4h-1.83l-2.7-3zm32.7-26.7h-27.6l-4.07 3.11 3.4 3.48h28.4l4-3.56z"})),xB=n=>S.createElement("svg",{width:16,height:16,viewBox:"-4 -2 72 68",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},S.createElement("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M32.214 6h-.202a26 26 0 1 0 .327 52q.266 0 .527-.014A26 26 0 0 0 58.012 32 26 26 0 0 0 32.865 6.014a10 10 0 0 0-.65-.013m-9.503 6.063A22 22 0 0 0 10.104 30h7.804q.068-1.79.252-3.51l3.998.24A46 46 0 0 0 21.91 30H30V10.519c-1.784.81-3.475 2.582-4.9 5.41q-.139.278-.274.567l-3.873-1.145q.276-.627.575-1.221c.363-.72.757-1.412 1.182-2.067M30 34h-8.09c.226 5.584 1.392 10.5 3.19 14.071 1.425 2.829 3.116 4.6 4.9 5.41zm-7.29 17.937a22 22 0 0 1-1.182-2.067c-2.131-4.233-3.393-9.795-3.62-15.87h-7.806A22 22 0 0 0 22.71 51.937m19.554-.472A22 22 0 0 0 53.921 34h-7.15a51 51 0 0 1-.26 3.589l-3.998-.24q.185-1.627.255-3.349H34v19.742c2.032-.641 3.973-2.486 5.577-5.671q.129-.255.252-.517l3.874 1.145q-.267.6-.553 1.171a23 23 0 0 1-.885 1.595M42.768 30H34V10.258c2.032.641 3.973 2.486 5.577 5.671 1.799 3.572 2.965 8.487 3.191 14.071m4.003 0c-.227-6.075-1.49-11.637-3.621-15.87a22 22 0 0 0-.885-1.595A22 22 0 0 1 53.921 30z"})),SB=n=>S.createElement("svg",{width:16,height:16,viewBox:"-4 -2 72 68",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},S.createElement("path",{fill:"currentColor",d:"M22 44.95h-7v-4h7zm-7-8h7v-4h-7zm7-8h-7v-4h7zm4 16h23v-4H26zm23-8H26v-4h23zm-23-8h23v-4H26z"}),S.createElement("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"m6 12 2-2h19l1.675.907 3.408 5.225H56l2 2V52l-2 2H8l-2-2zm4 2v36h44V20.132H31l-1.675-.908L25.917 14z"}));function l0({emptyLabel:n,error:e,icon:t,items:i,title:r}){return Y.jsxs(o0.Root,{defaultOpen:!0,className:"py-0.5",children:[Y.jsxs(o0.Trigger,{className:"group ml-1 flex w-[calc(100%-0.25rem)] cursor-pointer items-center gap-2 rounded-l-md bg-transparent p-3 text-xs font-semibold text-text transition-colors hover:bg-surface-tertiary",children:[Y.jsx(sR,{className:"h-3.5 w-3.5 text-muted transition-transform duration-200 group-data-panel-open:rotate-90",weight:"bold"}),Y.jsx(t,{className:"h-4 w-4 text-muted"}),r]}),Y.jsx(o0.Panel,{className:"overflow-hidden transition-[height,opacity] duration-200 ease-out data-ending-style:h-0 data-ending-style:opacity-0 data-starting-style:h-0 data-starting-style:opacity-0",children:Y.jsxs("ul",{className:"ml-3 list-none space-y-0.5 border-l border-border pl-3",children:[e?Y.jsx("li",{className:"px-2 py-1.5 text-sm text-danger",children:e}):null,e?null:i.map(o=>Y.jsx("li",{children:Y.jsx(Ud,{className:$o("block cursor-pointer rounded-l-md px-2 py-2.5 text-sm text-text no-underline transition-colors hover:bg-surface-tertiary",{"bg-primary/10 font-medium text-primary":o.isActive}),params:o.link.params,search:o.link.search,to:o.link.to,children:o.label})},o.id)),!e&&i.length===0&&Y.jsx("li",{className:"px-2 py-1.5 text-sm text-text-secondary italic",children:n})]})})]})}function wB({currentPath:n,d1Error:e,databases:t,doError:i,doNamespaces:r,kvError:o,kvNamespaces:a}){return Y.jsxs("aside",{className:"flex w-sidebar flex-col border-r border-border bg-bg-secondary",children:[Y.jsxs("a",{className:"box-border flex min-h-16.75 items-center gap-2.5 p-4",href:"/cdn-cgi/explorer/",children:[Y.jsx(Fv,{variant:"glyph",className:"h-8 w-8 shrink-0"}),Y.jsxs("div",{className:"flex flex-col gap-px",children:[Y.jsx("span",{className:"text-sm leading-tight font-semibold text-text",children:"Local Explorer"}),Y.jsx("span",{className:"text-[10px] font-medium tracking-wide text-text-secondary uppercase",children:"Cloudflare DevTools"})]})]}),Y.jsx(l0,{emptyLabel:"No namespaces",error:o,icon:SB,items:a.map(u=>({id:u.id,isActive:n===`/kv/${u.id}`,label:u.title,link:{params:{namespaceId:u.id},to:"/kv/$namespaceId"}})),title:"KV Namespaces"}),Y.jsx(l0,{emptyLabel:"No databases",error:e,icon:bB,items:t.map(u=>({id:u.uuid,isActive:n===`/d1/${u.uuid}`,label:u.name,link:{params:{databaseId:u.uuid},search:{table:void 0},to:"/d1/$databaseId"}})),title:"D1 Databases"}),Y.jsx(l0,{emptyLabel:"No SQLite namespaces",error:i,icon:xB,items:r.map(u=>{const f=u.class??u.name??u.id??"Unknown";return{id:u.id,isActive:n===`/do/${f}`||n.startsWith(`/do/${f}/`),label:f,link:{params:{className:f},to:"/do/$className"}}}),title:"Durable Objects"})]})}const La=X4({component:EB,loader:async()=>{const[n,e,t]=await Promise.allSettled([D6(),I6(),qd()]);let i=new Array,r=null;n.status==="fulfilled"?i=n.value.data?.result??[]:r=`KV Error: ${n.reason instanceof Error?n.reason.message:JSON.stringify(n.reason)}`;let o=new Array,a=null;e.status==="fulfilled"?o=e.value.data?.result??[]:a=`D1 Error: ${e.reason instanceof Error?e.reason.message:JSON.stringify(e.reason)}`;let u=new Array,f=null;return t.status==="fulfilled"?u=(t.value.data?.result??[]).filter(p=>p.use_sqlite===!0):f=`DO Error: ${t.reason instanceof Error?t.reason.message:JSON.stringify(t.reason)}`,{d1Error:a,databases:o,doError:f,doNamespaces:u,kvError:r,kvNamespaces:i}}});function EB(){const n=La.useLoaderData(),t=xi().location.pathname;return Y.jsxs("div",{className:"flex min-h-screen",children:[Y.jsx(wB,{currentPath:t,d1Error:n.d1Error,databases:n.databases,doError:n.doError,doNamespaces:n.doNamespaces,kvError:n.kvError,kvNamespaces:n.kvNamespaces}),Y.jsx("main",{className:"flex flex-1 flex-col overflow-y-auto",children:Y.jsx(VC,{})})]})}const CB="modulepreload",RB=function(n){return"/cdn-cgi/explorer/"+n},j2={},Ia=function(e,t,i){let r=Promise.resolve();if(t&&t.length>0){let f=function(d){return Promise.all(d.map(p=>Promise.resolve(p).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),u=a?.nonce||a?.getAttribute("nonce");r=f(t.map(d=>{if(d=RB(d),d in j2)return;j2[d]=!0;const p=d.endsWith(".css"),m=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${m}`))return;const g=document.createElement("link");if(g.rel=p?"stylesheet":CB,p||(g.as="script"),g.crossOrigin="",g.href=d,u&&g.setAttribute("nonce",u),document.head.appendChild(g),p)return new Promise((v,x)=>{g.addEventListener("load",v),g.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${d}`)))})}))}function o(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return r.then(a=>{for(const u of a||[])u.status==="rejected"&&o(u.reason);return e().catch(o)})},kB=()=>Ia(()=>import("./index-CLSFsgi0.js"),[]),TB=$s("/")({component:Ta(kB,"component")}),AB=()=>Ia(()=>import("./_namespaceId-8ViM8VDL.js"),__vite__mapDeps([0,1,2,3])),OB=$s("/kv/$namespaceId")({component:Ta(AB,"component"),loader:async({params:n})=>{const e=await N6({path:{namespace_id:n.namespaceId},query:{limit:50}}),t=e.data?.result??[];let i={};t.length>0&&(i=(await L6({path:{namespace_id:n.namespaceId},body:{keys:t.map(u=>u.name)}})).data?.result?.values??{});const r=e.data?.result_info?.cursor??null,o=t.map(a=>({key:a,value:i[a.name]??null}));return{cursor:r,entries:o,hasMore:!!r}}}),MB=()=>Ia(()=>import("./_className-gSkjniQn.js"),[]),DB=$s("/do/$className")({component:Ta(MB,"component"),loader:async({params:n})=>{const i=((await qd()).data?.result??[]).find(r=>r.class===n.className||r.name===n.className||r.id===n.className);if(!i?.id)throw new Error(`Durable Object class "${n.className}" not found`);return{className:n.className,namespaceId:i.id}}}),uT=1024;let NB=0,a0=class{constructor(e,t){this.from=e,this.to=t}};class ft{constructor(e={}){this.id=NB++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ni.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}ft.closedBy=new ft({deserialize:n=>n.split(" ")});ft.openedBy=new ft({deserialize:n=>n.split(" ")});ft.group=new ft({deserialize:n=>n.split(" ")});ft.isolate=new ft({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});ft.contextHash=new ft({perNode:!0});ft.lookAhead=new ft({perNode:!0});ft.mounted=new ft({perNode:!0});class Ju{constructor(e,t,i,r=!1){this.tree=e,this.overlay=t,this.parser=i,this.bracketed=r}static get(e){return e&&e.props&&e.props[ft.mounted.id]}}const LB=Object.create(null);class ni{constructor(e,t,i,r=0){this.name=e,this.props=t,this.id=i,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):LB,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new ni(e.name||"",t,e.id,i);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(r)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[o[0].id]=o[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(ft.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let r of i.split(" "))t[r]=e[i];return i=>{for(let r=i.prop(ft.group),o=-1;o<(r?r.length:0);o++){let a=t[o<0?i.name:r[o]];if(a)return a}}}}ni.none=new ni("",Object.create(null),0,8);class $v{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let i of this.types){let r=null;for(let o of e){let a=o(i);if(a){r||(r=Object.assign({},i.props));let u=a[1],f=a[0];f.combine&&f.id in r&&(u=f.combine(r[f.id],u)),r[f.id]=u}}t.push(r?new ni(i.name,r,i.id,i.flags):i)}return new $v(t)}}const yh=new WeakMap,q2=new WeakMap;var Ft;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(Ft||(Ft={}));class tn{constructor(e,t,i,r,o){if(this.type=e,this.children=t,this.positions=i,this.length=r,this.props=null,o&&o.length){this.props=Object.create(null);for(let[a,u]of o)this.props[typeof a=="number"?a:a.id]=u}}toString(){let e=Ju.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let i of this.children){let r=i.toString();r&&(t&&(t+=","),t+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new oy(this.topNode,e)}cursorAt(e,t=0,i=0){let r=yh.get(this)||this.topNode,o=new oy(r);return o.moveTo(e,t),yh.set(this,o._tree),o}get topNode(){return new Pi(this,0,0,null)}resolve(e,t=0){let i=dc(yh.get(this)||this.topNode,e,t,!1);return yh.set(this,i),i}resolveInner(e,t=0){let i=dc(q2.get(this)||this.topNode,e,t,!0);return q2.set(this,i),i}resolveStack(e,t=0){return _B(this,e,t)}iterate(e){let{enter:t,leave:i,from:r=0,to:o=this.length}=e,a=e.mode||0,u=(a&Ft.IncludeAnonymous)>0;for(let f=this.cursor(a|Ft.IncludeAnonymous);;){let d=!1;if(f.from<=o&&f.to>=r&&(!u&&f.type.isAnonymous||t(f)!==!1)){if(f.firstChild())continue;d=!0}for(;d&&i&&(u||!f.type.isAnonymous)&&i(f),!f.nextSibling();){if(!f.parent())return;d=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Gv(ni.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,r)=>new tn(this.type,t,i,r,this.propValues),e.makeTree||((t,i,r)=>new tn(ni.none,t,i,r)))}static build(e){return PB(e)}}tn.empty=new tn(ni.none,[],[],0);class Kv{constructor(e,t){this.buffer=e,this.index=t}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 Kv(this.buffer,this.index)}}class Qs{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return ni.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],i=this.buffer[e+3],r=this.set.types[t],o=r.name;if(/\W/.test(o)&&!r.isError&&(o=JSON.stringify(o)),e+=4,i==e)return o;let a=[];for(;e<i;)a.push(this.childString(e)),e=this.buffer[e+3];return o+"("+a.join(",")+")"}findChild(e,t,i,r,o){let{buffer:a}=this,u=-1;for(let f=e;f!=t&&!(cT(o,r,a[f+1],a[f+2])&&(u=f,i>0));f=a[f+3]);return u}slice(e,t,i){let r=this.buffer,o=new Uint16Array(t-e),a=0;for(let u=e,f=0;u<t;){o[f++]=r[u++],o[f++]=r[u++]-i;let d=o[f++]=r[u++]-i;o[f++]=r[u++]-e,a=Math.max(a,d)}return new Qs(o,a,this.set)}}function cT(n,e,t,i){switch(n){case-2:return t<e;case-1:return i>=e&&t<e;case 0:return t<e&&i>e;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function dc(n,e,t,i){for(var r;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let a=!i&&n instanceof Pi&&n.index<0?null:n.parent;if(!a)return n;n=a}let o=i?0:Ft.IgnoreOverlays;if(i)for(let a=n,u=a.parent;u;a=u,u=a.parent)a instanceof Pi&&a.index<0&&((r=u.enter(e,t,o))===null||r===void 0?void 0:r.from)!=a.from&&(n=u);for(;;){let a=n.enter(e,t,o);if(!a)return n;n=a}}class fT{cursor(e=0){return new oy(this,e)}getChild(e,t=null,i=null){let r=F2(this,e,t,i);return r.length?r[0]:null}getChildren(e,t=null,i=null){return F2(this,e,t,i)}resolve(e,t=0){return dc(this,e,t,!1)}resolveInner(e,t=0){return dc(this,e,t,!0)}matchContext(e){return sy(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),i=this;for(;t;){let r=t.lastChild;if(!r||r.to!=t.to)break;r.type.isError&&r.from==r.to?(i=t,t=r.prevSibling):t=r}return i}get node(){return this}get next(){return this.parent}}class Pi extends fT{constructor(e,t,i,r){super(),this._tree=e,this.from=t,this.index=i,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,i,r,o=0){for(let a=this;;){for(let{children:u,positions:f}=a._tree,d=t>0?u.length:-1;e!=d;e+=t){let p=u[e],m=f[e]+a.from,g;if(!(!(o&Ft.EnterBracketed&&p instanceof tn&&(g=Ju.get(p))&&!g.overlay&&g.bracketed&&i>=m&&i<=m+p.length)&&!cT(r,i,m,m+p.length))){if(p instanceof Qs){if(o&Ft.ExcludeBuffers)continue;let v=p.findChild(0,p.buffer.length,t,i-m,r);if(v>-1)return new Hs(new IB(a,p,e,m),null,v)}else if(o&Ft.IncludeAnonymous||!p.type.isAnonymous||Yv(p)){let v;if(!(o&Ft.IgnoreMounts)&&(v=Ju.get(p))&&!v.overlay)return new Pi(v.tree,m,e,a);let x=new Pi(p,m,e,a);return o&Ft.IncludeAnonymous||!x.type.isAnonymous?x:x.nextChild(t<0?p.children.length-1:0,t,i,r,o)}}}if(o&Ft.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+t:e=t<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,i=0){let r;if(!(i&Ft.IgnoreOverlays)&&(r=Ju.get(this._tree))&&r.overlay){let o=e-this.from,a=i&Ft.EnterBracketed&&r.bracketed;for(let{from:u,to:f}of r.overlay)if((t>0||a?u<=o:u<o)&&(t<0||a?f>=o:f>o))return new Pi(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function F2(n,e,t,i){let r=n.cursor(),o=[];if(!r.firstChild())return o;if(t!=null){for(let a=!1;!a;)if(a=r.type.is(t),!r.nextSibling())return o}for(;;){if(i!=null&&r.type.is(i))return o;if(r.type.is(e)&&o.push(r.node),!r.nextSibling())return i==null?o:[]}}function sy(n,e,t=e.length-1){for(let i=n;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class IB{constructor(e,t,i,r){this.parent=e,this.buffer=t,this.index=i,this.start=r}}class Hs extends fT{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:r}=this.context,o=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,i);return o<0?null:new Hs(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,i=0){if(i&Ft.ExcludeBuffers)return null;let{buffer:r}=this.context,o=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return o<0?null:new Hs(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Hs(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Hs(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,r=this.index+4,o=i.buffer[this.index+3];if(o>r){let a=i.buffer[this.index+1];e.push(i.slice(r,o,a)),t.push(0)}return new tn(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function hT(n){if(!n.length)return null;let e=0,t=n[0];for(let o=1;o<n.length;o++){let a=n[o];(a.from>t.from||a.to<t.to)&&(t=a,e=o)}let i=t instanceof Pi&&t.index<0?null:t.parent,r=n.slice();return i?r[e]=i:r.splice(e,1),new BB(r,t)}class BB{constructor(e,t){this.heads=e,this.node=t}get next(){return hT(this.heads)}}function _B(n,e,t){let i=n.resolveInner(e,t),r=null;for(let o=i instanceof Pi?i:i.context.parent;o;o=o.parent)if(o.index<0){let a=o.parent;(r||(r=[i])).push(a.resolve(e,t)),o=a}else{let a=Ju.get(o.tree);if(a&&a.overlay&&a.overlay[0].from<=e&&a.overlay[a.overlay.length-1].to>=e){let u=new Pi(a.tree,a.overlay[0].from+o.from,-1,o);(r||(r=[i])).push(dc(u,e,t,!1))}}return r?hT(r):i}class oy{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~Ft.EnterBracketed,e instanceof Pi)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof Pi?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:r}=this.buffer,o=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,i);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&Ft.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ft.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ft.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(r.buffer.buffer[o+3]<this.index)return!1;({index:t,parent:i}=r)}else({index:t,_parent:i}=this._tree);for(;i;{index:t,_parent:i}=i)if(t>-1)for(let o=t+e,a=e<0?-1:i._tree.children.length;o!=a;o+=e){let u=i._tree.children[o];if(this.mode&Ft.IncludeAnonymous||u instanceof Qs||!u.type.isAnonymous||Yv(u))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,i=0;if(e&&e.context==this.buffer)e:for(let r=this.index,o=this.stack.length;o>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,i=o+1;break e}r=this.stack[--o]}for(let r=i;r<this.stack.length;r++)t=new Hs(this.buffer,t,this.stack[r]);return this.bufferNode=new Hs(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let i=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,r=!0}}}matchContext(e){if(!this.buffer)return sy(this.node.parent,e);let{buffer:t}=this.buffer,{types:i}=t.set;for(let r=e.length-1,o=this.stack.length-1;r>=0;o--){if(o<0)return sy(this._tree,e,r);let a=i[t.buffer[this.stack[o]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}}function Yv(n){return n.children.some(e=>e instanceof Qs||!e.type.isAnonymous||Yv(e))}function PB(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:r=uT,reused:o=[],minRepeatType:a=i.types.length}=n,u=Array.isArray(t)?new Kv(t,t.length):t,f=i.types,d=0,p=0;function m(O,N,M,D,V,U){let{id:j,start:I,end:q,size:P}=u,$=p,_=d;if(P<0)if(u.next(),P==-1){let B=o[j];M.push(B),D.push(I-O);return}else if(P==-3){d=j;return}else if(P==-4){p=j;return}else throw new RangeError(`Unrecognized record size: ${P}`);let H=f[j],z,Q,ee=I-O;if(q-I<=r&&(Q=C(u.pos-N,V))){let B=new Uint16Array(Q.size-Q.skip),K=u.pos-Q.size,X=B.length;for(;u.pos>K;)X=E(Q.start,B,X);z=new Qs(B,q-Q.start,i),ee=Q.start-O}else{let B=u.pos-P;u.next();let K=[],X=[],J=j>=a?j:-1,W=0,re=q;for(;u.pos>B;)J>=0&&u.id==J&&u.size>=0?(u.end<=re-r&&(x(K,X,I,W,u.end,re,J,$,_),W=K.length,re=u.end),u.next()):U>2500?g(I,B,K,X):m(I,B,K,X,J,U+1);if(J>=0&&W>0&&W<K.length&&x(K,X,I,W,I,re,J,$,_),K.reverse(),X.reverse(),J>-1&&W>0){let ae=v(H,_);z=Gv(H,K,X,0,K.length,0,q-I,ae,ae)}else z=w(H,K,X,q-I,$-q,_)}M.push(z),D.push(ee)}function g(O,N,M,D){let V=[],U=0,j=-1;for(;u.pos>N;){let{id:I,start:q,end:P,size:$}=u;if($>4)u.next();else{if(j>-1&&q<j)break;j<0&&(j=P-r),V.push(I,q,P),U++,u.next()}}if(U){let I=new Uint16Array(U*4),q=V[V.length-2];for(let P=V.length-3,$=0;P>=0;P-=3)I[$++]=V[P],I[$++]=V[P+1]-q,I[$++]=V[P+2]-q,I[$++]=$;M.push(new Qs(I,V[2]-q,i)),D.push(q-O)}}function v(O,N){return(M,D,V)=>{let U=0,j=M.length-1,I,q;if(j>=0&&(I=M[j])instanceof tn){if(!j&&I.type==O&&I.length==V)return I;(q=I.prop(ft.lookAhead))&&(U=D[j]+I.length+q)}return w(O,M,D,V,U,N)}}function x(O,N,M,D,V,U,j,I,q){let P=[],$=[];for(;O.length>D;)P.push(O.pop()),$.push(N.pop()+M-V);O.push(w(i.types[j],P,$,U-V,I-U,q)),N.push(V-M)}function w(O,N,M,D,V,U,j){if(U){let I=[ft.contextHash,U];j=j?[I].concat(j):[I]}if(V>25){let I=[ft.lookAhead,V];j=j?[I].concat(j):[I]}return new tn(O,N,M,D,j)}function C(O,N){let M=u.fork(),D=0,V=0,U=0,j=M.end-r,I={size:0,start:0,skip:0};e:for(let q=M.pos-O;M.pos>q;){let P=M.size;if(M.id==N&&P>=0){I.size=D,I.start=V,I.skip=U,U+=4,D+=4,M.next();continue}let $=M.pos-P;if(P<0||$<q||M.start<j)break;let _=M.id>=a?4:0,H=M.start;for(M.next();M.pos>$;){if(M.size<0)if(M.size==-3||M.size==-4)_+=4;else break e;else M.id>=a&&(_+=4);M.next()}V=H,D+=P,U+=_}return(N<0||D==O)&&(I.size=D,I.start=V,I.skip=U),I.size>4?I:void 0}function E(O,N,M){let{id:D,start:V,end:U,size:j}=u;if(u.next(),j>=0&&D<a){let I=M;if(j>4){let q=u.pos-(j-4);for(;u.pos>q;)M=E(O,N,M)}N[--M]=I,N[--M]=U-O,N[--M]=V-O,N[--M]=D}else j==-3?d=D:j==-4&&(p=D);return M}let k=[],T=[];for(;u.pos>0;)m(n.start||0,n.bufferStart||0,k,T,-1,0);let A=(e=n.length)!==null&&e!==void 0?e:k.length?T[0]+k[0].length:0;return new tn(f[n.topID],k.reverse(),T.reverse(),A)}const $2=new WeakMap;function $h(n,e){if(!n.isAnonymous||e instanceof Qs||e.type!=n)return 1;let t=$2.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof tn)){t=1;break}t+=$h(n,i)}$2.set(e,t)}return t}function Gv(n,e,t,i,r,o,a,u,f){let d=0;for(let x=i;x<r;x++)d+=$h(n,e[x]);let p=Math.ceil(d*1.5/8),m=[],g=[];function v(x,w,C,E,k){for(let T=C;T<E;){let A=T,O=w[T],N=$h(n,x[T]);for(T++;T<E;T++){let M=$h(n,x[T]);if(N+M>=p)break;N+=M}if(T==A+1){if(N>p){let M=x[A];v(M.children,M.positions,0,M.children.length,w[A]+k);continue}m.push(x[A])}else{let M=w[T-1]+x[T-1].length-O;m.push(Gv(n,x,w,A,T,O,M,null,f))}g.push(O+k-o)}}return v(e,t,i,r,0),(u||f)(m,g,a)}class Uo{constructor(e,t,i,r,o=!1,a=!1){this.from=e,this.to=t,this.tree=i,this.offset=r,this.open=(o?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let r=[new Uo(0,e.length,e,0,!1,i)];for(let o of t)o.to>e.length&&r.push(o);return r}static applyChanges(e,t,i=128){if(!t.length)return e;let r=[],o=1,a=e.length?e[0]:null;for(let u=0,f=0,d=0;;u++){let p=u<t.length?t[u]:null,m=p?p.fromA:1e9;if(m-f>=i)for(;a&&a.from<m;){let g=a;if(f>=g.from||m<=g.to||d){let v=Math.max(g.from,f)-d,x=Math.min(g.to,m)-d;g=v>=x?null:new Uo(v,x,g.tree,g.offset+d,u>0,!!p)}if(g&&r.push(g),a.to>m)break;a=o<e.length?e[o++]:null}if(!p)break;f=p.toA,d=p.toA-p.toB}return r}}class dT{startParse(e,t,i){return typeof e=="string"&&(e=new zB(e)),i=i?i.length?i.map(r=>new a0(r.from,r.to)):[new a0(0,0)]:[new a0(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let r=this.startParse(e,t,i);for(;;){let o=r.advance();if(o)return o}}}class zB{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new ft({perNode:!0});let ly=[],pT=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?pT:ly).push(t=t+n[e])})();function HB(n){if(n<768)return!1;for(let e=0,t=ly.length;;){let i=e+t>>1;if(n<ly[i])t=i;else if(n>=pT[i])e=i+1;else return!0;if(e==t)return!1}}function K2(n){return n>=127462&&n<=127487}const Y2=8205;function VB(n,e,t=!0,i=!0){return(t?mT:UB)(n,e,i)}function mT(n,e,t){if(e==n.length)return e;e&&gT(n.charCodeAt(e))&&yT(n.charCodeAt(e-1))&&e--;let i=u0(n,e);for(e+=G2(i);e<n.length;){let r=u0(n,e);if(i==Y2||r==Y2||t&&HB(r))e+=G2(r),i=r;else if(K2(r)){let o=0,a=e-2;for(;a>=0&&K2(u0(n,a));)o++,a-=2;if(o%2==0)break;e+=2}else break}return e}function UB(n,e,t){for(;e>0;){let i=mT(n,e-2,t);if(i<e)return i;e--}return 0}function u0(n,e){let t=n.charCodeAt(e);if(!yT(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return gT(i)?(t-55296<<10)+(i-56320)+65536:t}function gT(n){return n>=56320&&n<57344}function yT(n){return n>=55296&&n<56320}function G2(n){return n<65536?1:2}class vt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=xa(this,e,t);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(t,this.length,r,1),vr.from(r,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=xa(this,e,t);let i=[];return this.decompose(e,t,i,0),vr.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new ec(this),o=new ec(e);for(let a=t,u=t;;){if(r.next(a),o.next(a),a=0,r.lineBreak!=o.lineBreak||r.done!=o.done||r.value!=o.value)return!1;if(u+=r.value.length,r.done||u>=i)return!0}}iter(e=1){return new ec(this,e)}iterRange(e,t=this.length){return new vT(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new bT(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?vt.empty:e.length<=32?new Zt(e):vr.from(Zt.split(e,[]))}}class Zt extends vt{constructor(e,t=jB(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,r){for(let o=0;;o++){let a=this.text[o],u=r+a.length;if((t?i:u)>=e)return new qB(r,u,i,a);r=u+1,i++}}decompose(e,t,i,r){let o=e<=0&&t>=this.length?this:new Zt(Q2(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let a=i.pop(),u=Kh(o.text,a.text.slice(),0,o.length);if(u.length<=32)i.push(new Zt(u,a.length+o.length));else{let f=u.length>>1;i.push(new Zt(u.slice(0,f)),new Zt(u.slice(f)))}}else i.push(o)}replace(e,t,i){if(!(i instanceof Zt))return super.replace(e,t,i);[e,t]=xa(this,e,t);let r=Kh(this.text,Kh(i.text,Q2(this.text,0,e)),t),o=this.length+i.length-(t-e);return r.length<=32?new Zt(r,o):vr.from(Zt.split(r,[]),o)}sliceString(e,t=this.length,i=`
|
|
29
|
+
`){[e,t]=xa(this,e,t);let r="";for(let o=0,a=0;o<=t&&a<this.text.length;a++){let u=this.text[a],f=o+u.length;o>e&&a&&(r+=i),e<f&&t>o&&(r+=u.slice(Math.max(0,e-o),t-o)),o=f+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],r=-1;for(let o of e)i.push(o),r+=o.length+1,i.length==32&&(t.push(new Zt(i,r)),i=[],r=-1);return r>-1&&t.push(new Zt(i,r)),t}}class vr extends vt{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,r){for(let o=0;;o++){let a=this.children[o],u=r+a.length,f=i+a.lines-1;if((t?f:u)>=e)return a.lineInner(e,t,i,r);r=u+1,i=f+1}}decompose(e,t,i,r){for(let o=0,a=0;a<=t&&o<this.children.length;o++){let u=this.children[o],f=a+u.length;if(e<=f&&t>=a){let d=r&((a<=e?1:0)|(f>=t?2:0));a>=e&&f<=t&&!d?i.push(u):u.decompose(e-a,t-a,i,d)}a=f+1}}replace(e,t,i){if([e,t]=xa(this,e,t),i.lines<this.lines)for(let r=0,o=0;r<this.children.length;r++){let a=this.children[r],u=o+a.length;if(e>=o&&t<=u){let f=a.replace(e-o,t-o,i),d=this.lines-a.lines+f.lines;if(f.lines<d>>4&&f.lines>d>>6){let p=this.children.slice();return p[r]=f,new vr(p,this.length-(t-e)+i.length)}return super.replace(o,u,f)}o=u+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
|
|
30
|
+
`){[e,t]=xa(this,e,t);let r="";for(let o=0,a=0;o<this.children.length&&a<=t;o++){let u=this.children[o],f=a+u.length;a>e&&o&&(r+=i),e<f&&t>a&&(r+=u.sliceString(e-a,t-a,i)),a=f+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof vr))return 0;let i=0,[r,o,a,u]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,o+=t){if(r==a||o==u)return i;let f=this.children[r],d=e.children[o];if(f!=d)return i+f.scanIdentical(d,t);i+=f.length+1}}static from(e,t=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let v of e)i+=v.lines;if(i<32){let v=[];for(let x of e)x.flatten(v);return new Zt(v,t)}let r=Math.max(32,i>>5),o=r<<1,a=r>>1,u=[],f=0,d=-1,p=[];function m(v){let x;if(v.lines>o&&v instanceof vr)for(let w of v.children)m(w);else v.lines>a&&(f>a||!f)?(g(),u.push(v)):v instanceof Zt&&f&&(x=p[p.length-1])instanceof Zt&&v.lines+x.lines<=32?(f+=v.lines,d+=v.length+1,p[p.length-1]=new Zt(x.text.concat(v.text),x.length+1+v.length)):(f+v.lines>r&&g(),f+=v.lines,d+=v.length+1,p.push(v))}function g(){f!=0&&(u.push(p.length==1?p[0]:vr.from(p,d)),d=-1,f=p.length=0)}for(let v of e)m(v);return g(),u.length==1?u[0]:new vr(u,t)}}vt.empty=new Zt([""],0);function jB(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Kh(n,e,t=0,i=1e9){for(let r=0,o=0,a=!0;o<n.length&&r<=i;o++){let u=n[o],f=r+u.length;f>=t&&(f>i&&(u=u.slice(0,i-r)),r<t&&(u=u.slice(t-r)),a?(e[e.length-1]+=u,a=!1):e.push(u)),r=f+1}return e}function Q2(n,e,t){return Kh(n,[""],e,t)}class ec{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Zt?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],o=this.offsets[i],a=o>>1,u=r instanceof Zt?r.text.length:r.children.length;if(a==(t>0?u:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
31
|
+
`,this;e--}else if(r instanceof Zt){let f=r.text[a+(t<0?-1:0)];if(this.offsets[i]+=t,f.length>Math.max(0,e))return this.value=e==0?f:t>0?f.slice(e):f.slice(0,f.length-e),this;e-=f.length}else{let f=r.children[a+(t<0?-1:0)];e>f.length?(e-=f.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(f),this.offsets.push(t>0?1:(f instanceof Zt?f.text.length:f.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class vT{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new ec(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=i?r:t<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class bT{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(vt.prototype[Symbol.iterator]=function(){return this.iter()},ec.prototype[Symbol.iterator]=vT.prototype[Symbol.iterator]=bT.prototype[Symbol.iterator]=function(){return this});class qB{constructor(e,t,i,r){this.from=e,this.to=t,this.number=i,this.text=r}get length(){return this.to-this.from}}function xa(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function Zi(n,e,t=!0,i=!0){return VB(n,e,t,i)}function FB(n){return n>=56320&&n<57344}function $B(n){return n>=55296&&n<56320}function Oo(n,e){let t=n.charCodeAt(e);if(!$B(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return FB(i)?(t-55296<<10)+(i-56320)+65536:t}function KB(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Gl(n){return n<65536?1:2}const ay=/\r\n?|\n/;var yi=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(yi||(yi={}));class Wr{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,r=0;t<this.sections.length;){let o=this.sections[t++],a=this.sections[t++];a<0?(e(i,r,o),r+=o):r+=a,i+=o}}iterChangedRanges(e,t=!1){uy(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],r=this.sections[t++];r<0?e.push(i,r):e.push(r,i)}return new Wr(e)}composeDesc(e){return this.empty?e:e.empty?this:xT(this,e)}mapDesc(e,t=!1){return e.empty?this:cy(this,e,t)}mapPos(e,t=-1,i=yi.Simple){let r=0,o=0;for(let a=0;a<this.sections.length;){let u=this.sections[a++],f=this.sections[a++],d=r+u;if(f<0){if(d>e)return o+(e-r);o+=u}else{if(i!=yi.Simple&&d>=e&&(i==yi.TrackDel&&r<e&&d>e||i==yi.TrackBefore&&r<e||i==yi.TrackAfter&&d>e))return null;if(d>e||d==e&&t<0&&!u)return e==r||t<0?o:o+f;o+=f}r=d}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return o}touchesRange(e,t=e){for(let i=0,r=0;i<this.sections.length&&r<=t;){let o=this.sections[i++],a=this.sections[i++],u=r+o;if(a>=0&&r<=t&&u>=e)return r<e&&u>t?"cover":!0;r=u}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+i+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Wr(e)}static create(e){return new Wr(e)}}class gn extends Wr{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return uy(this,(t,i,r,o,a)=>e=e.replace(r,r+(i-t),a),!1),e}mapDesc(e,t=!1){return cy(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let r=0,o=0;r<t.length;r+=2){let a=t[r],u=t[r+1];if(u>=0){t[r]=u,t[r+1]=a;let f=r>>1;for(;i.length<f;)i.push(vt.empty);i.push(a?e.slice(o,o+a):vt.empty)}o+=a}return new gn(t,i)}compose(e){return this.empty?e:e.empty?this:xT(this,e,!0)}map(e,t=!1){return e.empty?this:cy(this,e,t,!0)}iterChanges(e,t=!1){uy(this,e,t)}get desc(){return Wr.create(this.sections)}filter(e){let t=[],i=[],r=[],o=new pc(this);e:for(let a=0,u=0;;){let f=a==e.length?1e9:e[a++];for(;u<f||u==f&&o.len==0;){if(o.done)break e;let p=Math.min(o.len,f-u);In(r,p,-1);let m=o.ins==-1?-1:o.off==0?o.ins:0;In(t,p,m),m>0&&Vs(i,t,o.text),o.forward(p),u+=p}let d=e[a++];for(;u<d;){if(o.done)break e;let p=Math.min(o.len,d-u);In(t,p,-1),In(r,p,o.ins==-1?-1:o.off==0?o.ins:0),o.forward(p),u+=p}}return{changes:new gn(t,i),filtered:Wr.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],r=this.sections[t+1];r<0?e.push(i):r==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let r=[],o=[],a=0,u=null;function f(p=!1){if(!p&&!r.length)return;a<t&&In(r,t-a,-1);let m=new gn(r,o);u=u?u.compose(m.map(u)):m,r=[],o=[],a=0}function d(p){if(Array.isArray(p))for(let m of p)d(m);else if(p instanceof gn){if(p.length!=t)throw new RangeError(`Mismatched change set length (got ${p.length}, expected ${t})`);f(),u=u?u.compose(p.map(u)):p}else{let{from:m,to:g=m,insert:v}=p;if(m>g||m<0||g>t)throw new RangeError(`Invalid change range ${m} to ${g} (in doc of length ${t})`);let x=v?typeof v=="string"?vt.of(v.split(i||ay)):v:vt.empty,w=x.length;if(m==g&&w==0)return;m<a&&f(),m>a&&In(r,m-a,-1),In(r,g-m,w),Vs(o,r,x),a=g}}return d(e),f(!u),u}static empty(e){return new gn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let r=0;r<e.length;r++){let o=e[r];if(typeof o=="number")t.push(o,-1);else{if(!Array.isArray(o)||typeof o[0]!="number"||o.some((a,u)=>u&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)t.push(o[0],0);else{for(;i.length<r;)i.push(vt.empty);i[r]=vt.of(o.slice(1)),t.push(o[0],i[r].length)}}}return new gn(t,i)}static createSet(e,t){return new gn(e,t)}}function In(n,e,t,i=!1){if(e==0&&t<=0)return;let r=n.length-2;r>=0&&t<=0&&t==n[r+1]?n[r]+=e:r>=0&&e==0&&n[r]==0?n[r+1]+=t:i?(n[r]+=e,n[r+1]+=t):n.push(e,t)}function Vs(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<i;)n.push(vt.empty);n.push(t)}}function uy(n,e,t){let i=n.inserted;for(let r=0,o=0,a=0;a<n.sections.length;){let u=n.sections[a++],f=n.sections[a++];if(f<0)r+=u,o+=u;else{let d=r,p=o,m=vt.empty;for(;d+=u,p+=f,f&&i&&(m=m.append(i[a-2>>1])),!(t||a==n.sections.length||n.sections[a+1]<0);)u=n.sections[a++],f=n.sections[a++];e(r,d,o,p,m),r=d,o=p}}}function cy(n,e,t,i=!1){let r=[],o=i?[]:null,a=new pc(n),u=new pc(e);for(let f=-1;;){if(a.done&&u.len||u.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&u.ins==-1){let d=Math.min(a.len,u.len);In(r,d,-1),a.forward(d),u.forward(d)}else if(u.ins>=0&&(a.ins<0||f==a.i||a.off==0&&(u.len<a.len||u.len==a.len&&!t))){let d=u.len;for(In(r,u.ins,-1);d;){let p=Math.min(a.len,d);a.ins>=0&&f<a.i&&a.len<=p&&(In(r,0,a.ins),o&&Vs(o,r,a.text),f=a.i),a.forward(p),d-=p}u.next()}else if(a.ins>=0){let d=0,p=a.len;for(;p;)if(u.ins==-1){let m=Math.min(p,u.len);d+=m,p-=m,u.forward(m)}else if(u.ins==0&&u.len<p)p-=u.len,u.next();else break;In(r,d,f<a.i?a.ins:0),o&&f<a.i&&Vs(o,r,a.text),f=a.i,a.forward(a.len-p)}else{if(a.done&&u.done)return o?gn.createSet(r,o):Wr.create(r);throw new Error("Mismatched change set lengths")}}}function xT(n,e,t=!1){let i=[],r=t?[]:null,o=new pc(n),a=new pc(e);for(let u=!1;;){if(o.done&&a.done)return r?gn.createSet(i,r):Wr.create(i);if(o.ins==0)In(i,o.len,0,u),o.next();else if(a.len==0&&!a.done)In(i,0,a.ins,u),r&&Vs(r,i,a.text),a.next();else{if(o.done||a.done)throw new Error("Mismatched change set lengths");{let f=Math.min(o.len2,a.len),d=i.length;if(o.ins==-1){let p=a.ins==-1?-1:a.off?0:a.ins;In(i,f,p,u),r&&p&&Vs(r,i,a.text)}else a.ins==-1?(In(i,o.off?0:o.len,f,u),r&&Vs(r,i,o.textBit(f))):(In(i,o.off?0:o.len,a.off?0:a.ins,u),r&&!a.off&&Vs(r,i,a.text));u=(o.ins>f||a.ins>=0&&a.len>f)&&(u||i.length>d),o.forward2(f),a.forward(f)}}}}class pc{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[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:e}=this.set,t=this.i-2>>1;return t>=e.length?vt.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?vt.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Bo{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new Bo(i,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return Pe.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Pe.range(this.anchor,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Pe.range(e.anchor,e.head)}static create(e,t,i){return new Bo(e,t,i)}}class Pe{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:Pe.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Pe([this.main],0)}addRange(e,t=!0){return Pe.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,Pe.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Pe(e.ranges.map(t=>Bo.fromJSON(t)),e.main)}static single(e,t=e){return new Pe([Pe.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;r<e.length;r++){let o=e[r];if(o.empty?o.from<=i:o.from<i)return Pe.normalized(e.slice(),t);i=o.to}return new Pe(e,t)}static cursor(e,t=0,i,r){return Bo.create(e,e,(t==0?0:t<0?8:16)|(i==null?7:Math.min(6,i))|(r??16777215)<<6)}static range(e,t,i,r){let o=(i??16777215)<<6|(r==null?7:Math.min(6,r));return t<e?Bo.create(t,e,48|o):Bo.create(e,t,(t>e?8:0)|o)}static normalized(e,t=0){let i=e[t];e.sort((r,o)=>r.from-o.from),t=e.indexOf(i);for(let r=1;r<e.length;r++){let o=e[r],a=e[r-1];if(o.empty?o.from<=a.to:o.from<a.to){let u=a.from,f=Math.max(o.to,a.to);r<=t&&t--,e.splice(--r,2,o.anchor>o.head?Pe.range(f,u):Pe.range(u,f))}}return new Pe(e,t)}}function ST(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Qv=0;class Ve{constructor(e,t,i,r,o){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=r,this.id=Qv++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new Ve(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Xv),!!e.static,e.enables)}of(e){return new Yh([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Yh(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Yh(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Xv(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class Yh{constructor(e,t,i,r){this.dependencies=e,this.facet=t,this.type=i,this.value=r,this.id=Qv++}dynamicSlot(e){var t;let i=this.value,r=this.facet.compareInput,o=this.id,a=e[o]>>1,u=this.type==2,f=!1,d=!1,p=[];for(let m of this.dependencies)m=="doc"?f=!0:m=="selection"?d=!0:(((t=e[m.id])!==null&&t!==void 0?t:1)&1)==0&&p.push(e[m.id]);return{create(m){return m.values[a]=i(m),1},update(m,g){if(f&&g.docChanged||d&&(g.docChanged||g.selection)||fy(m,p)){let v=i(m);if(u?!X2(v,m.values[a],r):!r(v,m.values[a]))return m.values[a]=v,1}return 0},reconfigure:(m,g)=>{let v,x=g.config.address[o];if(x!=null){let w=md(g,x);if(this.dependencies.every(C=>C instanceof Ve?g.facet(C)===m.facet(C):C instanceof so?g.field(C,!1)==m.field(C,!1):!0)||(u?X2(v=i(m),w,r):r(v=i(m),w)))return m.values[a]=w,0}else v=i(m);return m.values[a]=v,1}}}}function X2(n,e,t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!t(n[i],e[i]))return!1;return!0}function fy(n,e){let t=!1;for(let i of e)tc(n,i)&1&&(t=!0);return t}function YB(n,e,t){let i=t.map(f=>n[f.id]),r=t.map(f=>f.type),o=i.filter(f=>!(f&1)),a=n[e.id]>>1;function u(f){let d=[];for(let p=0;p<i.length;p++){let m=md(f,i[p]);if(r[p]==2)for(let g of m)d.push(g);else d.push(m)}return e.combine(d)}return{create(f){for(let d of i)tc(f,d);return f.values[a]=u(f),1},update(f,d){if(!fy(f,o))return 0;let p=u(f);return e.compare(p,f.values[a])?0:(f.values[a]=p,1)},reconfigure(f,d){let p=fy(f,i),m=d.config.facets[e.id],g=d.facet(e);if(m&&!p&&Xv(t,m))return f.values[a]=g,0;let v=u(f);return e.compare(v,g)?(f.values[a]=g,0):(f.values[a]=v,1)}}}const vh=Ve.define({static:!0});class so{constructor(e,t,i,r,o){this.id=e,this.createF=t,this.updateF=i,this.compareF=r,this.spec=o,this.provides=void 0}static define(e){let t=new so(Qv++,e.create,e.update,e.compare||((i,r)=>i===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(vh).find(i=>i.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,r)=>{let o=i.values[t],a=this.updateF(o,r);return this.compareF(o,a)?0:(i.values[t]=a,1)},reconfigure:(i,r)=>{let o=i.facet(vh),a=r.facet(vh),u;return(u=o.find(f=>f.field==this))&&u!=a.find(f=>f.field==this)?(i.values[t]=u.create(i),1):r.config.address[this.id]!=null?(i.values[t]=r.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,vh.of({field:this,create:e})]}get extension(){return this}}const No={lowest:4,low:3,default:2,high:1,highest:0};function Bu(n){return e=>new wT(e,n)}const _c={highest:Bu(No.highest),high:Bu(No.high),default:Bu(No.default),low:Bu(No.low),lowest:Bu(No.lowest)};class wT{constructor(e,t){this.inner=e,this.prec=t}}class lp{of(e){return new hy(this,e)}reconfigure(e){return lp.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class hy{constructor(e,t){this.compartment=e,this.inner=t}}class pd{constructor(e,t,i,r,o,a){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=r,this.staticValues=o,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let r=[],o=Object.create(null),a=new Map;for(let g of GB(e,t,a))g instanceof so?r.push(g):(o[g.facet.id]||(o[g.facet.id]=[])).push(g);let u=Object.create(null),f=[],d=[];for(let g of r)u[g.id]=d.length<<1,d.push(v=>g.slot(v));let p=i?.config.facets;for(let g in o){let v=o[g],x=v[0].facet,w=p&&p[g]||[];if(v.every(C=>C.type==0))if(u[x.id]=f.length<<1|1,Xv(w,v))f.push(i.facet(x));else{let C=x.combine(v.map(E=>E.value));f.push(i&&x.compare(C,i.facet(x))?i.facet(x):C)}else{for(let C of v)C.type==0?(u[C.id]=f.length<<1|1,f.push(C.value)):(u[C.id]=d.length<<1,d.push(E=>C.dynamicSlot(E)));u[x.id]=d.length<<1,d.push(C=>YB(C,x,v))}}let m=d.map(g=>g(u));return new pd(e,a,m,u,f,o)}}function GB(n,e,t){let i=[[],[],[],[],[]],r=new Map;function o(a,u){let f=r.get(a);if(f!=null){if(f<=u)return;let d=i[f].indexOf(a);d>-1&&i[f].splice(d,1),a instanceof hy&&t.delete(a.compartment)}if(r.set(a,u),Array.isArray(a))for(let d of a)o(d,u);else if(a instanceof hy){if(t.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let d=e.get(a.compartment)||a.inner;t.set(a.compartment,d),o(d,u)}else if(a instanceof wT)o(a.inner,a.prec);else if(a instanceof so)i[u].push(a),a.provides&&o(a.provides,u);else if(a instanceof Yh)i[u].push(a),a.facet.extensions&&o(a.facet.extensions,No.default);else{let d=a.extension;if(!d)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(d,u)}}return o(n,No.default),i.reduce((a,u)=>a.concat(u))}function tc(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let r=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|r}function md(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const ET=Ve.define(),dy=Ve.define({combine:n=>n.some(e=>e),static:!0}),CT=Ve.define({combine:n=>n.length?n[0]:void 0,static:!0}),RT=Ve.define(),kT=Ve.define(),TT=Ve.define(),AT=Ve.define({combine:n=>n.length?n[0]:!1});class rl{constructor(e,t){this.type=e,this.value=t}static define(){return new QB}}class QB{of(e){return new rl(this,e)}}class XB{constructor(e){this.map=e}of(e){return new zt(this,e)}}class zt{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new zt(this.type,t)}is(e){return this.type==e}static define(e={}){return new XB(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let r of e){let o=r.map(t);o&&i.push(o)}return i}}zt.reconfigure=zt.define();zt.appendConfig=zt.define();class Bn{constructor(e,t,i,r,o,a){this.startState=e,this.changes=t,this.selection=i,this.effects=r,this.annotations=o,this.scrollIntoView=a,this._doc=null,this._state=null,i&&ST(i,t.newLength),o.some(u=>u.type==Bn.time)||(this.annotations=o.concat(Bn.time.of(Date.now())))}static create(e,t,i,r,o,a){return new Bn(e,t,i,r,o,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Bn.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Bn.time=rl.define();Bn.userEvent=rl.define();Bn.addToHistory=rl.define();Bn.remote=rl.define();function WB(n,e){let t=[];for(let i=0,r=0;;){let o,a;if(i<n.length&&(r==e.length||e[r]>=n[i]))o=n[i++],a=n[i++];else if(r<e.length)o=e[r++],a=e[r++];else return t;!t.length||t[t.length-1]<o?t.push(o,a):t[t.length-1]<a&&(t[t.length-1]=a)}}function OT(n,e,t){var i;let r,o,a;return t?(r=e.changes,o=gn.empty(e.changes.length),a=n.changes.compose(e.changes)):(r=e.changes.map(n.changes),o=n.changes.mapDesc(e.changes,!0),a=n.changes.compose(r)),{changes:a,selection:e.selection?e.selection.map(o):(i=n.selection)===null||i===void 0?void 0:i.map(r),effects:zt.mapEffects(n.effects,r).concat(zt.mapEffects(e.effects,o)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function py(n,e,t){let i=e.selection,r=oa(e.annotations);return e.userEvent&&(r=r.concat(Bn.userEvent.of(e.userEvent))),{changes:e.changes instanceof gn?e.changes:gn.of(e.changes||[],t,n.facet(CT)),selection:i&&(i instanceof Pe?i:Pe.single(i.anchor,i.head)),effects:oa(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function MT(n,e,t){let i=py(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let o=1;o<e.length;o++){e[o].filter===!1&&(t=!1);let a=!!e[o].sequential;i=OT(i,py(n,e[o],a?i.changes.newLength:n.doc.length),a)}let r=Bn.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return JB(t?ZB(r):r)}function ZB(n){let e=n.startState,t=!0;for(let r of e.facet(RT)){let o=r(n);if(o===!1){t=!1;break}Array.isArray(o)&&(t=t===!0?o:WB(t,o))}if(t!==!0){let r,o;if(t===!1)o=n.changes.invertedDesc,r=gn.empty(e.doc.length);else{let a=n.changes.filter(t);r=a.changes,o=a.filtered.mapDesc(a.changes).invertedDesc}n=Bn.create(e,r,n.selection&&n.selection.map(o),zt.mapEffects(n.effects,o),n.annotations,n.scrollIntoView)}let i=e.facet(kT);for(let r=i.length-1;r>=0;r--){let o=i[r](n);o instanceof Bn?n=o:Array.isArray(o)&&o.length==1&&o[0]instanceof Bn?n=o[0]:n=MT(e,oa(o),!1)}return n}function JB(n){let e=n.startState,t=e.facet(TT),i=n;for(let r=t.length-1;r>=0;r--){let o=t[r](n);o&&Object.keys(o).length&&(i=OT(i,py(e,o,n.changes.newLength),!0))}return i==n?n:Bn.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const e_=[];function oa(n){return n==null?e_:Array.isArray(n)?n:[n]}var Qr=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(Qr||(Qr={}));const t_=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let my;try{my=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function n_(n){if(my)return my.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||t_.test(t)))return!0}return!1}function i_(n){return e=>{if(!/\S/.test(e))return Qr.Space;if(n_(e))return Qr.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return Qr.Word;return Qr.Other}}class wt{constructor(e,t,i,r,o,a){this.config=e,this.doc=t,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=o,a&&(a._state=this);for(let u=0;u<this.config.dynamicSlots.length;u++)tc(this,u<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return tc(this,i),md(this,i)}update(...e){return MT(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:r}=t;for(let u of e.effects)u.is(lp.reconfigure)?(t&&(r=new Map,t.compartments.forEach((f,d)=>r.set(d,f)),t=null),r.set(u.value.compartment,u.value.extension)):u.is(zt.reconfigure)?(t=null,i=u.value):u.is(zt.appendConfig)&&(t=null,i=oa(i).concat(u.value));let o;t?o=e.startState.values.slice():(t=pd.resolve(i,r,this),o=new wt(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(f,d)=>d.reconfigure(f,this),null).values);let a=e.startState.facet(dy)?e.newSelection:e.newSelection.asSingle();new wt(t,e.newDoc,a,o,(u,f)=>f.update(u,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:Pe.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),r=this.changes(i.changes),o=[i.range],a=oa(i.effects);for(let u=1;u<t.ranges.length;u++){let f=e(t.ranges[u]),d=this.changes(f.changes),p=d.map(r);for(let g=0;g<u;g++)o[g]=o[g].map(p);let m=r.mapDesc(d,!0);o.push(f.range.map(m)),r=r.compose(p),a=zt.mapEffects(a,p).concat(zt.mapEffects(oa(f.effects),m))}return{changes:r,selection:Pe.create(o,t.mainIndex),effects:a}}changes(e=[]){return e instanceof gn?e:gn.of(e,this.doc.length,this.facet(wt.lineSeparator))}toText(e){return vt.of(e.split(this.facet(wt.lineSeparator)||ay))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(tc(this,t),md(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let r=e[i];r instanceof so&&this.config.address[r.id]!=null&&(t[i]=r.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let o in i)if(Object.prototype.hasOwnProperty.call(e,o)){let a=i[o],u=e[o];r.push(a.init(f=>a.spec.fromJSON(u,f)))}}return wt.create({doc:e.doc,selection:Pe.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=pd.resolve(e.extensions||[],new Map),i=e.doc instanceof vt?e.doc:vt.of((e.doc||"").split(t.staticFacet(wt.lineSeparator)||ay)),r=e.selection?e.selection instanceof Pe?e.selection:Pe.single(e.selection.anchor,e.selection.head):Pe.single(0);return ST(r,i.length),t.staticFacet(dy)||(r=r.asSingle()),new wt(t,i,r,t.dynamicSlots.map(()=>null),(o,a)=>a.create(o),null)}get tabSize(){return this.facet(wt.tabSize)}get lineBreak(){return this.facet(wt.lineSeparator)||`
|
|
32
|
+
`}get readOnly(){return this.facet(AT)}phrase(e,...t){for(let i of this.facet(wt.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let o=+(r||1);return!o||o>t.length?i:t[o-1]})),e}languageDataAt(e,t,i=-1){let r=[];for(let o of this.facet(ET))for(let a of o(this,t,i))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return i_(t.length?t[0]:"")}wordAt(e){let{text:t,from:i,length:r}=this.doc.lineAt(e),o=this.charCategorizer(e),a=e-i,u=e-i;for(;a>0;){let f=Zi(t,a,!1);if(o(t.slice(f,a))!=Qr.Word)break;a=f}for(;u<r;){let f=Zi(t,u);if(o(t.slice(u,f))!=Qr.Word)break;u=f}return a==u?null:Pe.range(a+i,u+i)}}wt.allowMultipleSelections=dy;wt.tabSize=Ve.define({combine:n=>n.length?n[0]:4});wt.lineSeparator=CT;wt.readOnly=AT;wt.phrases=Ve.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(r=>n[r]==e[r])}});wt.languageData=ET;wt.changeFilter=RT;wt.transactionFilter=kT;wt.transactionExtender=TT;lp.reconfigure=zt.define();function DT(n,e,t={}){let i={};for(let r of n)for(let o of Object.keys(r)){let a=r[o],u=i[o];if(u===void 0)i[o]=a;else if(!(u===a||a===void 0))if(Object.hasOwnProperty.call(t,o))i[o]=t[o](u,a);else throw new Error("Config merge conflict for field "+o)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}class Xs{eq(e){return this==e}range(e,t=e){return mc.create(e,t,this)}}Xs.prototype.startSide=Xs.prototype.endSide=0;Xs.prototype.point=!1;Xs.prototype.mapMode=yi.TrackDel;function Wv(n,e){return n==e||n.constructor==e.constructor&&n.eq(e)}class mc{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new mc(e,t,i)}}function gy(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Zv{constructor(e,t,i,r){this.from=e,this.to=t,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,r=0){let o=i?this.to:this.from;for(let a=r,u=o.length;;){if(a==u)return a;let f=a+u>>1,d=o[f]-e||(i?this.value[f].endSide:this.value[f].startSide)-t;if(f==a)return d>=0?a:u;d>=0?u=f:a=f+1}}between(e,t,i,r){for(let o=this.findIndex(t,-1e9,!0),a=this.findIndex(i,1e9,!1,o);o<a;o++)if(r(this.from[o]+e,this.to[o]+e,this.value[o])===!1)return!1}map(e,t){let i=[],r=[],o=[],a=-1,u=-1;for(let f=0;f<this.value.length;f++){let d=this.value[f],p=this.from[f]+e,m=this.to[f]+e,g,v;if(p==m){let x=t.mapPos(p,d.startSide,d.mapMode);if(x==null||(g=v=x,d.startSide!=d.endSide&&(v=t.mapPos(p,d.endSide),v<g)))continue}else if(g=t.mapPos(p,d.startSide),v=t.mapPos(m,d.endSide),g>v||g==v&&d.startSide>0&&d.endSide<=0)continue;(v-g||d.endSide-d.startSide)<0||(a<0&&(a=g),d.point&&(u=Math.max(u,v-g)),i.push(d),r.push(g-a),o.push(v-a))}return{mapped:i.length?new Zv(r,o,i,u):null,pos:a}}}class ht{constructor(e,t,i,r){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=r}static create(e,t,i,r){return new ht(e,t,i,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:r=0,filterTo:o=this.length}=e,a=e.filter;if(t.length==0&&!a)return this;if(i&&(t=t.slice().sort(gy)),this.isEmpty)return t.length?ht.of(t):this;let u=new NT(this,null,-1).goto(0),f=0,d=[],p=new gc;for(;u.value||f<t.length;)if(f<t.length&&(u.from-t[f].from||u.startSide-t[f].value.startSide)>=0){let m=t[f++];p.addInner(m.from,m.to,m.value)||d.push(m)}else u.rangeIndex==1&&u.chunkIndex<this.chunk.length&&(f==t.length||this.chunkEnd(u.chunkIndex)<t[f].from)&&(!a||r>this.chunkEnd(u.chunkIndex)||o<this.chunkPos[u.chunkIndex])&&p.addChunk(this.chunkPos[u.chunkIndex],this.chunk[u.chunkIndex])?u.nextChunk():((!a||r>u.to||o<u.from||a(u.from,u.to,u.value))&&(p.addInner(u.from,u.to,u.value)||d.push(mc.create(u.from,u.to,u.value))),u.next());return p.finishInner(this.nextLayer.isEmpty&&!d.length?ht.empty:this.nextLayer.update({add:d,filter:a,filterFrom:r,filterTo:o}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],r=-1;for(let a=0;a<this.chunk.length;a++){let u=this.chunkPos[a],f=this.chunk[a],d=e.touchesRange(u,u+f.length);if(d===!1)r=Math.max(r,f.maxPoint),t.push(f),i.push(e.mapPos(u));else if(d===!0){let{mapped:p,pos:m}=f.map(u,e);p&&(r=Math.max(r,p.maxPoint),t.push(p),i.push(m))}}let o=this.nextLayer.map(e);return t.length==0?o:new ht(i,t,o||ht.empty,r)}between(e,t,i){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let o=this.chunkPos[r],a=this.chunk[r];if(t>=o&&e<=o+a.length&&a.between(o,e-o,t-o,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return yc.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return yc.from(e).goto(t)}static compare(e,t,i,r,o=-1){let a=e.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=o),u=t.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=o),f=W2(a,u,i),d=new _u(a,f,o),p=new _u(u,f,o);i.iterGaps((m,g,v)=>Z2(d,m,p,g,v,r)),i.empty&&i.length==0&&Z2(d,0,p,0,0,r)}static eq(e,t,i=0,r){r==null&&(r=999999999);let o=e.filter(p=>!p.isEmpty&&t.indexOf(p)<0),a=t.filter(p=>!p.isEmpty&&e.indexOf(p)<0);if(o.length!=a.length)return!1;if(!o.length)return!0;let u=W2(o,a),f=new _u(o,u,0).goto(i),d=new _u(a,u,0).goto(i);for(;;){if(f.to!=d.to||!yy(f.active,d.active)||f.point&&(!d.point||!Wv(f.point,d.point)))return!1;if(f.to>r)return!0;f.next(),d.next()}}static spans(e,t,i,r,o=-1){let a=new _u(e,null,o).goto(t),u=t,f=a.openStart;for(;;){let d=Math.min(a.to,i);if(a.point){let p=a.activeForPoint(a.to),m=a.pointFrom<t?p.length+1:a.point.startSide<0?p.length:Math.min(p.length,f);r.point(u,d,a.point,p,m,a.pointRank),f=Math.min(a.openEnd(d),p.length)}else d>u&&(r.span(u,d,a.active,f),f=a.openEnd(d));if(a.to>i)return f+(a.point&&a.to>i?1:0);u=a.to,a.next()}}static of(e,t=!1){let i=new gc;for(let r of e instanceof mc?[e]:t?r_(e):e)i.add(r.from,r.to,r.value);return i.finish()}static join(e){if(!e.length)return ht.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let r=e[i];r!=ht.empty;r=r.nextLayer)t=new ht(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}ht.empty=new ht([],[],null,-1);function r_(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let i=n[t];if(gy(e,i)>0)return n.slice().sort(gy);e=i}return n}ht.empty.nextLayer=ht.empty;class gc{finishChunk(e){this.chunks.push(new Zv(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new gc)).add(e,t,i)}addInner(e,t,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(ht.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=ht.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function W2(n,e,t){let i=new Map;for(let o of n)for(let a=0;a<o.chunk.length;a++)o.chunk[a].maxPoint<=0&&i.set(o.chunk[a],o.chunkPos[a]);let r=new Set;for(let o of e)for(let a=0;a<o.chunk.length;a++){let u=i.get(o.chunk[a]);u!=null&&(t?t.mapPos(u):u)==o.chunkPos[a]&&!t?.touchesRange(u,u+o.chunk[a].length)&&r.add(o.chunk[a])}return r}class NT{constructor(e,t,i,r=0){this.layer=e,this.skip=t,this.minPoint=i,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,i){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!i||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],i=e+t.from[this.rangeIndex];if(this.from=i,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==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=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class yc{constructor(e){this.heap=e}static from(e,t=null,i=-1){let r=[];for(let o=0;o<e.length;o++)for(let a=e[o];!a.isEmpty;a=a.nextLayer)a.maxPoint>=i&&r.push(new NT(a,t,i,o));return r.length==1?r[0]:new yc(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)c0(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)c0(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),c0(this.heap,0)}}}function c0(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let r=n[i];if(i+1<n.length&&r.compare(n[i+1])>=0&&(r=n[i+1],i++),t.compare(r)<0)break;n[i]=t,n[e]=r,e=i}}class _u{constructor(e,t,i){this.minPoint=i,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=yc.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){bh(this.active,e),bh(this.activeTo,e),bh(this.activeRank,e),this.minActive=J2(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:r,rank:o}=this.cursor;for(;t<this.activeRank.length&&(o-this.activeRank[t]||r-this.activeTo[t])>0;)t++;xh(this.active,t,i),xh(this.activeTo,t,r),xh(this.activeRank,t,o),e&&xh(e,t,this.cursor.from),this.minActive=J2(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&bh(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=o,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=o.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let r=i.length-1;r>=0&&i[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function Z2(n,e,t,i,r,o){n.goto(e),t.goto(i);let a=i+r,u=i,f=i-e,d=!!o.boundChange;for(let p=!1;;){let m=n.to+f-t.to,g=m||n.endSide-t.endSide,v=g<0?n.to+f:t.to,x=Math.min(v,a);if(n.point||t.point?(n.point&&t.point&&Wv(n.point,t.point)&&yy(n.activeForPoint(n.to),t.activeForPoint(t.to))||o.comparePoint(u,x,n.point,t.point),p=!1):(p&&o.boundChange(u),x>u&&!yy(n.active,t.active)&&o.compareRange(u,x,n.active,t.active),d&&x<a&&(m||n.openEnd(v)!=t.openEnd(v))&&(p=!0)),v>a)break;u=v,g<=0&&n.next(),g>=0&&t.next()}}function yy(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!Wv(n[t],e[t]))return!1;return!0}function bh(n,e){for(let t=e,i=n.length-1;t<i;t++)n[t]=n[t+1];n.pop()}function xh(n,e,t){for(let i=n.length-1;i>=e;i--)n[i+1]=n[i];n[e]=t}function J2(n,e){let t=-1,i=1e9;for(let r=0;r<e.length;r++)(e[r]-i||n[r].endSide-n[t].endSide)<0&&(t=r,i=e[r]);return t}function s_(n,e,t=n.length){let i=0;for(let r=0;r<t&&r<n.length;)n.charCodeAt(r)==9?(i+=e-i%e,r++):(i++,r=Zi(n,r));return i}function o_(n,e,t,i){for(let r=0,o=0;;){if(o>=e)return r;if(r==n.length)break;o+=n.charCodeAt(r)==9?t-o%t:1,r=Zi(n,r)}return n.length}const vy="ͼ",eE=typeof Symbol>"u"?"__"+vy:Symbol.for(vy),by=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),tE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Ws{constructor(e,t){this.rules=[];let{finish:i}=t||{};function r(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function o(a,u,f,d){let p=[],m=/^@(\w+)\b/.exec(a[0]),g=m&&m[1]=="keyframes";if(m&&u==null)return f.push(a[0]+";");for(let v in u){let x=u[v];if(/&/.test(v))o(v.split(/,\s*/).map(w=>a.map(C=>w.replace(/&/,C))).reduce((w,C)=>w.concat(C)),x,f);else if(x&&typeof x=="object"){if(!m)throw new RangeError("The value of a property ("+v+") should be a primitive value.");o(r(v),x,p,g)}else x!=null&&p.push(v.replace(/_.*/,"").replace(/[A-Z]/g,w=>"-"+w.toLowerCase())+": "+x+";")}(p.length||g)&&f.push((i&&!m&&!d?a.map(i):a).join(", ")+" {"+p.join(" ")+"}")}for(let a in e)o(r(a),e[a],this.rules)}getRules(){return this.rules.join(`
|
|
33
|
+
`)}static newName(){let e=tE[eE]||1;return tE[eE]=e+1,vy+e.toString(36)}static mount(e,t,i){let r=e[by],o=i&&i.nonce;r?o&&r.setNonce(o):r=new l_(e,o),r.mount(Array.isArray(t)?t:[t],e)}}let nE=new Map;class l_{constructor(e,t){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let o=nE.get(i);if(o)return e[by]=o;this.sheet=new r.CSSStyleSheet,nE.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[by]=this}mount(e,t){let i=this.sheet,r=0,o=0;for(let a=0;a<e.length;a++){let u=e[a],f=this.modules.indexOf(u);if(f<o&&f>-1&&(this.modules.splice(f,1),o--,f=-1),f==-1){if(this.modules.splice(o++,0,u),i)for(let d=0;d<u.rules.length;d++)i.insertRule(u.rules[d],r++)}else{for(;o<f;)r+=this.modules[o++].rules.length;r+=u.rules.length,o++}}if(i)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let a="";for(let f=0;f<this.modules.length;f++)a+=this.modules[f].getRules()+`
|
|
34
|
+
`;this.styleTag.textContent=a;let u=t.head||t;this.styleTag.parentNode!=u&&u.insertBefore(this.styleTag,u.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Zs={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:"'"},vc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},a_=typeof navigator<"u"&&/Mac/.test(navigator.platform),u_=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var An=0;An<10;An++)Zs[48+An]=Zs[96+An]=String(An);for(var An=1;An<=24;An++)Zs[An+111]="F"+An;for(var An=65;An<=90;An++)Zs[An]=String.fromCharCode(An+32),vc[An]=String.fromCharCode(An);for(var f0 in Zs)vc.hasOwnProperty(f0)||(vc[f0]=Zs[f0]);function c_(n){var e=a_&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||u_&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?vc:Zs)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}let Pn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},xy=typeof document<"u"?document:{documentElement:{style:{}}};const Sy=/Edge\/(\d+)/.exec(Pn.userAgent),LT=/MSIE \d/.test(Pn.userAgent),wy=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Pn.userAgent),ap=!!(LT||wy||Sy),iE=!ap&&/gecko\/(\d+)/i.test(Pn.userAgent),h0=!ap&&/Chrome\/(\d+)/.exec(Pn.userAgent),f_="webkitFontSmoothing"in xy.documentElement.style,Ey=!ap&&/Apple Computer/.test(Pn.vendor),rE=Ey&&(/Mobile\/\w+/.test(Pn.userAgent)||Pn.maxTouchPoints>2);var Me={mac:rE||/Mac/.test(Pn.platform),windows:/Win/.test(Pn.platform),linux:/Linux|X11/.test(Pn.platform),ie:ap,ie_version:LT?xy.documentMode||6:wy?+wy[1]:Sy?+Sy[1]:0,gecko:iE,gecko_version:iE?+(/Firefox\/(\d+)/.exec(Pn.userAgent)||[0,0])[1]:0,chrome:!!h0,chrome_version:h0?+h0[1]:0,ios:rE,android:/Android\b/.test(Pn.userAgent),webkit_version:f_?+(/\bAppleWebKit\/(\d+)/.exec(Pn.userAgent)||[0,0])[1]:0,safari:Ey,safari_version:Ey?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Pn.userAgent)||[0,0])[1]:0,tabSize:xy.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Jv(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const gd=Object.create(null);function eb(n,e,t){if(n==e)return!0;n||(n=gd),e||(e=gd);let i=Object.keys(n),r=Object.keys(e);if(i.length-0!=r.length-0)return!1;for(let o of i)if(o!=t&&(r.indexOf(o)==-1||n[o]!==e[o]))return!1;return!0}function h_(n,e){for(let t=n.attributes.length-1;t>=0;t--){let i=n.attributes[t].name;e[i]==null&&n.removeAttribute(i)}for(let t in e){let i=e[t];t=="style"?n.style.cssText=i:n.getAttribute(t)!=i&&n.setAttribute(t,i)}}function sE(n,e,t){let i=!1;if(e)for(let r in e)t&&r in t||(i=!0,r=="style"?n.style.cssText="":n.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(i=!0,r=="style"?n.style.cssText=t[r]:n.setAttribute(r,t[r]));return i}function d_(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let i=n.attributes[t];e[i.name]=i.value}return e}class Pc{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Zn=(function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n})(Zn||(Zn={}));class $t extends Xs{constructor(e,t,i,r){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=r}get heightRelevant(){return!1}static mark(e){return new zc(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Qo(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:o,end:a}=IT(e,t);i=(o?t?-3e8:-1:5e8)-1,r=(a?t?2e8:1:-6e8)+1}return new Qo(e,i,r,t,e.widget||null,!0)}static line(e){return new Hc(e)}static set(e,t=!1){return ht.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}$t.none=ht.empty;class zc extends $t{constructor(e){let{start:t,end:i}=IT(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?Jv(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||gd}eq(e){return this==e||e instanceof zc&&this.tagName==e.tagName&&eb(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}zc.prototype.point=!1;class Hc extends $t{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Hc&&this.spec.class==e.spec.class&&eb(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Hc.prototype.mapMode=yi.TrackBefore;Hc.prototype.point=!0;class Qo extends $t{constructor(e,t,i,r,o,a){super(t,i,o,e),this.block=r,this.isReplace=a,this.mapMode=r?t<=0?yi.TrackBefore:yi.TrackAfter:yi.TrackDel}get type(){return this.startSide!=this.endSide?Zn.WidgetRange:this.startSide<=0?Zn.WidgetBefore:Zn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Qo&&p_(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}Qo.prototype.point=!0;function IT(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function p_(n,e){return n==e||!!(n&&e&&n.compare(e))}function la(n,e,t,i=0){let r=t.length-1;r>=0&&t[r]+i>=n?t[r]=Math.max(t[r],e):t.push(n,e)}class bc extends Xs{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(e){return e==this||e instanceof bc&&this.tagName==e.tagName&&eb(this.attributes,e.attributes)}static create(e){return new bc(e.tagName,e.attributes||gd)}static set(e,t=!1){return ht.of(e,t)}}bc.prototype.startSide=bc.prototype.endSide=-1;function xc(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Cy(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function nc(n,e){if(!e.anchorNode)return!1;try{return Cy(n,e.anchorNode)}catch{return!1}}function ic(n){return n.nodeType==3?wc(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function rc(n,e,t,i){return t?oE(n,e,t,i,-1)||oE(n,e,t,i,1):!1}function Js(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function yd(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function oE(n,e,t,i,r){for(;;){if(n==t&&e==i)return!0;if(e==(r<0?0:is(n))){if(n.nodeName=="DIV")return!1;let o=n.parentNode;if(!o||o.nodeType!=1)return!1;e=Js(n)+(r<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(r<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=r<0?is(n):0}else return!1}}function is(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Sc(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function m_(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function BT(n,e){let t=e.width/n.offsetWidth,i=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-n.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function g_(n,e,t,i,r,o,a,u){let f=n.ownerDocument,d=f.defaultView||window;for(let p=n,m=!1;p&&!m;)if(p.nodeType==1){let g,v=p==f.body,x=1,w=1;if(v)g=m_(d);else{if(/^(fixed|sticky)$/.test(getComputedStyle(p).position)&&(m=!0),p.scrollHeight<=p.clientHeight&&p.scrollWidth<=p.clientWidth){p=p.assignedSlot||p.parentNode;continue}let k=p.getBoundingClientRect();({scaleX:x,scaleY:w}=BT(p,k)),g={left:k.left,right:k.left+p.clientWidth*x,top:k.top,bottom:k.top+p.clientHeight*w}}let C=0,E=0;if(r=="nearest")e.top<g.top?(E=e.top-(g.top+a),t>0&&e.bottom>g.bottom+E&&(E=e.bottom-g.bottom+a)):e.bottom>g.bottom&&(E=e.bottom-g.bottom+a,t<0&&e.top-E<g.top&&(E=e.top-(g.top+a)));else{let k=e.bottom-e.top,T=g.bottom-g.top;E=(r=="center"&&k<=T?e.top+k/2-T/2:r=="start"||r=="center"&&t<0?e.top-a:e.bottom-T+a)-g.top}if(i=="nearest"?e.left<g.left?(C=e.left-(g.left+o),t>0&&e.right>g.right+C&&(C=e.right-g.right+o)):e.right>g.right&&(C=e.right-g.right+o,t<0&&e.left<g.left+C&&(C=e.left-(g.left+o))):C=(i=="center"?e.left+(e.right-e.left)/2-(g.right-g.left)/2:i=="start"==u?e.left-o:e.right-(g.right-g.left)+o)-g.left,C||E)if(v)d.scrollBy(C,E);else{let k=0,T=0;if(E){let A=p.scrollTop;p.scrollTop+=E/w,T=(p.scrollTop-A)*w}if(C){let A=p.scrollLeft;p.scrollLeft+=C/x,k=(p.scrollLeft-A)*x}e={left:e.left-k,top:e.top-T,right:e.right-k,bottom:e.bottom-T},k&&Math.abs(k-C)<1&&(i="nearest"),T&&Math.abs(T-E)<1&&(r="nearest")}if(v)break;(e.top<g.top||e.bottom>g.bottom||e.left<g.left||e.right>g.right)&&(e={left:Math.max(e.left,g.left),right:Math.min(e.right,g.right),top:Math.max(e.top,g.top),bottom:Math.min(e.bottom,g.bottom)}),p=p.assignedSlot||p.parentNode}else if(p.nodeType==11)p=p.host;else break}function y_(n){let e=n.ownerDocument,t,i;for(let r=n.parentNode;r&&!(r==e.body||t&&i);)if(r.nodeType==1)!i&&r.scrollHeight>r.clientHeight&&(i=r),!t&&r.scrollWidth>r.clientWidth&&(t=r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;return{x:t,y:i}}class v_{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?is(t):0),i,Math.min(e.focusOffset,i?is(i):0))}set(e,t,i,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=r}}let Mo=null;Me.safari&&Me.safari_version>=26&&(Mo=!1);function _T(n){if(n.setActive)return n.setActive();if(Mo)return n.focus(Mo);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Mo==null?{get preventScroll(){return Mo={preventScroll:!0},!0}}:void 0),!Mo){Mo=!1;for(let t=0;t<e.length;){let i=e[t++],r=e[t++],o=e[t++];i.scrollTop!=r&&(i.scrollTop=r),i.scrollLeft!=o&&(i.scrollLeft=o)}}}let lE;function wc(n,e,t=e){let i=lE||(lE=document.createRange());return i.setEnd(n,t),i.setStart(n,e),i}function aa(n,e,t,i){let r={key:e,code:e,keyCode:t,which:t,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let o=new KeyboardEvent("keydown",r);o.synthetic=!0,n.dispatchEvent(o);let a=new KeyboardEvent("keyup",r);return a.synthetic=!0,n.dispatchEvent(a),o.defaultPrevented||a.defaultPrevented}function b_(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function x_(n,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,is(t));;)if(i){if(t.nodeType!=1)return!1;let r=t.childNodes[i-1];r.contentEditable=="false"?i--:(t=r,i=is(t))}else{if(t==n)return!0;i=Js(t),t=t.parentNode}}function PT(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function zT(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i>0)return{node:t,offset:i};if(t.nodeType==1&&i>0){if(t.contentEditable=="false")return null;t=t.childNodes[i-1],i=is(t)}else if(t.parentNode&&!yd(t))i=Js(t),t=t.parentNode;else return null}}function HT(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i<t.nodeValue.length)return{node:t,offset:i};if(t.nodeType==1&&i<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[i],i=0}else if(t.parentNode&&!yd(t))i=Js(t)+1,t=t.parentNode;else return null}}class Ji{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new Ji(e.parentNode,Js(e),t)}static after(e,t){return new Ji(e.parentNode,Js(e)+1,t)}}var Kt=(function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n})(Kt||(Kt={}));const Xo=Kt.LTR,tb=Kt.RTL;function VT(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const S_=VT("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),w_=VT("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Ry=Object.create(null),dr=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);Ry[e]=t,Ry[t]=-e}function UT(n){return n<=247?S_[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?w_[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const E_=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class xr{get dir(){return this.level%2?tb:Xo}constructor(e,t,i){this.from=e,this.to=t,this.level=i}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,i,r){let o=-1;for(let a=0;a<e.length;a++){let u=e[a];if(u.from<=t&&u.to>=t){if(u.level==i)return a;(o<0||(r!=0?r<0?u.from<t:u.to>t:e[o].level>u.level))&&(o=a)}}if(o<0)throw new RangeError("Index out of range");return o}}function jT(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++){let i=n[t],r=e[t];if(i.from!=r.from||i.to!=r.to||i.direction!=r.direction||!jT(i.inner,r.inner))return!1}return!0}const At=[];function C_(n,e,t,i,r){for(let o=0;o<=i.length;o++){let a=o?i[o-1].to:e,u=o<i.length?i[o].from:t,f=o?256:r;for(let d=a,p=f,m=f;d<u;d++){let g=UT(n.charCodeAt(d));g==512?g=p:g==8&&m==4&&(g=16),At[d]=g==4?2:g,g&7&&(m=g),p=g}for(let d=a,p=f,m=f;d<u;d++){let g=At[d];if(g==128)d<u-1&&p==At[d+1]&&p&24?g=At[d]=p:At[d]=256;else if(g==64){let v=d+1;for(;v<u&&At[v]==64;)v++;let x=d&&p==8||v<t&&At[v]==8?m==1?1:8:256;for(let w=d;w<v;w++)At[w]=x;d=v-1}else g==8&&m==1&&(At[d]=1);p=g,g&7&&(m=g)}}}function R_(n,e,t,i,r){let o=r==1?2:1;for(let a=0,u=0,f=0;a<=i.length;a++){let d=a?i[a-1].to:e,p=a<i.length?i[a].from:t;for(let m=d,g,v,x;m<p;m++)if(v=Ry[g=n.charCodeAt(m)])if(v<0){for(let w=u-3;w>=0;w-=3)if(dr[w+1]==-v){let C=dr[w+2],E=C&2?r:C&4?C&1?o:r:0;E&&(At[m]=At[dr[w]]=E),u=w;break}}else{if(dr.length==189)break;dr[u++]=m,dr[u++]=g,dr[u++]=f}else if((x=At[m])==2||x==1){let w=x==r;f=w?0:1;for(let C=u-3;C>=0;C-=3){let E=dr[C+2];if(E&2)break;if(w)dr[C+2]|=2;else{if(E&4)break;dr[C+2]|=4}}}}}function k_(n,e,t,i){for(let r=0,o=i;r<=t.length;r++){let a=r?t[r-1].to:n,u=r<t.length?t[r].from:e;for(let f=a;f<u;){let d=At[f];if(d==256){let p=f+1;for(;;)if(p==u){if(r==t.length)break;p=t[r++].to,u=r<t.length?t[r].from:e}else if(At[p]==256)p++;else break;let m=o==1,g=(p<e?At[p]:i)==1,v=m==g?m?1:2:i;for(let x=p,w=r,C=w?t[w-1].to:n;x>f;)x==C&&(x=t[--w].from,C=w?t[w-1].to:n),At[--x]=v;f=p}else o=d,f++}}}function ky(n,e,t,i,r,o,a){let u=i%2?2:1;if(i%2==r%2)for(let f=e,d=0;f<t;){let p=!0,m=!1;if(d==o.length||f<o[d].from){let w=At[f];w!=u&&(p=!1,m=w==16)}let g=!p&&u==1?[]:null,v=p?i:i+1,x=f;e:for(;;)if(d<o.length&&x==o[d].from){if(m)break e;let w=o[d];if(!p)for(let C=w.to,E=d+1;;){if(C==t)break e;if(E<o.length&&o[E].from==C)C=o[E++].to;else{if(At[C]==u)break e;break}}if(d++,g)g.push(w);else{w.from>f&&a.push(new xr(f,w.from,v));let C=w.direction==Xo!=!(v%2);Ty(n,C?i+1:i,r,w.inner,w.from,w.to,a),f=w.to}x=w.to}else{if(x==t||(p?At[x]!=u:At[x]==u))break;x++}g?ky(n,f,x,i+1,r,g,a):f<x&&a.push(new xr(f,x,v)),f=x}else for(let f=t,d=o.length;f>e;){let p=!0,m=!1;if(!d||f>o[d-1].to){let w=At[f-1];w!=u&&(p=!1,m=w==16)}let g=!p&&u==1?[]:null,v=p?i:i+1,x=f;e:for(;;)if(d&&x==o[d-1].to){if(m)break e;let w=o[--d];if(!p)for(let C=w.from,E=d;;){if(C==e)break e;if(E&&o[E-1].to==C)C=o[--E].from;else{if(At[C-1]==u)break e;break}}if(g)g.push(w);else{w.to<f&&a.push(new xr(w.to,f,v));let C=w.direction==Xo!=!(v%2);Ty(n,C?i+1:i,r,w.inner,w.from,w.to,a),f=w.from}x=w.from}else{if(x==e||(p?At[x-1]!=u:At[x-1]==u))break;x--}g?ky(n,x,f,i+1,r,g,a):x<f&&a.push(new xr(x,f,v)),f=x}}function Ty(n,e,t,i,r,o,a){let u=e%2?2:1;C_(n,r,o,i,u),R_(n,r,o,i,u),k_(r,o,i,u),ky(n,r,o,e,t,i,a)}function T_(n,e,t){if(!n)return[new xr(0,0,e==tb?1:0)];if(e==Xo&&!t.length&&!E_.test(n))return qT(n.length);if(t.length)for(;n.length>At.length;)At[At.length]=256;let i=[],r=e==Xo?0:1;return Ty(n,r,r,t,0,n.length,i),i}function qT(n){return[new xr(0,n,0)]}let FT="";function A_(n,e,t,i,r){var o;let a=i.head-n.from,u=xr.find(e,a,(o=i.bidiLevel)!==null&&o!==void 0?o:-1,i.assoc),f=e[u],d=f.side(r,t);if(a==d){let g=u+=r?1:-1;if(g<0||g>=e.length)return null;f=e[u=g],a=f.side(!r,t),d=f.side(r,t)}let p=Zi(n.text,a,f.forward(r,t));(p<f.from||p>f.to)&&(p=d),FT=n.text.slice(Math.min(a,p),Math.max(a,p));let m=u==(r?e.length-1:0)?null:e[u+(r?1:-1)];return m&&p==d&&m.level+(r?0:1)<f.level?Pe.cursor(m.side(!r,t)+n.from,m.forward(r,t)?1:-1,m.level):Pe.cursor(p+n.from,f.forward(r,t)?-1:1,f.level)}function O_(n,e,t){for(let i=e;i<t;i++){let r=UT(n.charCodeAt(i));if(r==1)return Xo;if(r==2||r==4)return tb}return Xo}const $T=Ve.define(),KT=Ve.define(),YT=Ve.define(),GT=Ve.define(),Ay=Ve.define(),QT=Ve.define(),XT=Ve.define(),nb=Ve.define(),ib=Ve.define(),WT=Ve.define({combine:n=>n.some(e=>e)}),M_=Ve.define({combine:n=>n.some(e=>e)}),ZT=Ve.define();class ua{constructor(e,t="nearest",i="nearest",r=5,o=5,a=!1){this.range=e,this.y=t,this.x=i,this.yMargin=r,this.xMargin=o,this.isSnapshot=a}map(e){return e.empty?this:new ua(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new ua(Pe.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Sh=zt.define({map:(n,e)=>n.map(e)}),JT=zt.define();function vi(n,e,t){let i=n.facet(GT);i.length?i[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const Yr=Ve.define({combine:n=>n.length?n[0]:!0});let D_=0;const Xl=Ve.define({combine(n){return n.filter((e,t)=>{for(let i=0;i<t;i++)if(n[i].plugin==e.plugin)return!1;return!0})}});class nr{constructor(e,t,i,r,o){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=r,this.baseExtensions=o(this),this.extension=this.baseExtensions.concat(Xl.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Xl.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:i,eventObservers:r,provide:o,decorations:a}=t||{};return new nr(D_++,e,i,r,u=>{let f=[];return a&&f.push(up.of(d=>{let p=d.plugin(u);return p?a(p):$t.none})),o&&f.push(o(u)),f})}static fromClass(e,t){return nr.define((i,r)=>new e(i,r),t)}}class d0{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(vi(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){vi(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){vi(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const eA=Ve.define(),rb=Ve.define(),up=Ve.define(),tA=Ve.define(),sb=Ve.define(),Vc=Ve.define(),nA=Ve.define();function aE(n,e){let t=n.state.facet(nA);if(!t.length)return t;let i=t.map(o=>o instanceof Function?o(n):o),r=[];return ht.spans(i,e.from,e.to,{point(){},span(o,a,u,f){let d=o-e.from,p=a-e.from,m=r;for(let g=u.length-1;g>=0;g--,f--){let v=u[g].spec.bidiIsolate,x;if(v==null&&(v=O_(e.text,d,p)),f>0&&m.length&&(x=m[m.length-1]).to==d&&x.direction==v)x.to=p,m=x.inner;else{let w={from:d,to:p,direction:v,inner:[]};m.push(w),m=w.inner}}}}),r}const iA=Ve.define();function ob(n){let e=0,t=0,i=0,r=0;for(let o of n.state.facet(iA)){let a=o(n);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(t=Math.max(t,a.right)),a.top!=null&&(i=Math.max(i,a.top)),a.bottom!=null&&(r=Math.max(r,a.bottom)))}return{left:e,right:t,top:i,bottom:r}}const qu=Ve.define();class Bi{constructor(e,t,i,r){this.fromA=e,this.toA=t,this.fromB=i,this.toB=r}join(e){return new Bi(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>i.toA)){if(r.toA<i.fromA)break;i=i.join(r),e.splice(t-1,1)}}return e.splice(t,0,i),e}static extendWithRanges(e,t){if(t.length==0)return e;let i=[];for(let r=0,o=0,a=0;;){let u=r<e.length?e[r].fromB:1e9,f=o<t.length?t[o]:1e9,d=Math.min(u,f);if(d==1e9)break;let p=d+a,m=d,g=p;for(;;)if(o<t.length&&t[o]<=m){let v=t[o+1];o+=2,m=Math.max(m,v);for(let x=r;x<e.length&&e[x].fromB<=m;x++)a=e[x].toA-e[x].toB;g=Math.max(g,v+a)}else if(r<e.length&&e[r].fromB<=m){let v=e[r++];m=Math.max(m,v.toB),g=Math.max(g,v.toA),a=v.toA-v.toB}else break;i.push(new Bi(p,g,d,m))}return i}}class vd{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=gn.empty(this.startState.doc.length);for(let o of i)this.changes=this.changes.compose(o.changes);let r=[];this.changes.iterChangedRanges((o,a,u,f)=>r.push(new Bi(o,a,u,f))),this.changedRanges=r}static create(e,t,i){return new vd(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const N_=[];class an{constructor(e,t,i=0){this.dom=e,this.length=t,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return N_}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let t=this.domAttrs;t&&h_(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let i=t;for(let r of this.children){if(r==e)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let i=Js(this.dom),r=this.length?e>0:t>0;return new Ji(this.parent.dom,i+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof fp)return e;return null}static get(e){return e.cmTile}}class cp extends an{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,i=null,r,o=e?.node==t?e:null,a=0;for(let u of this.children){if(u.sync(e),a+=u.length+u.breakAfter,r=i?i.nextSibling:t.firstChild,o&&r!=u.dom&&(o.written=!0),u.dom.parentNode==t)for(;r&&r!=u.dom;)r=uE(r);else t.insertBefore(u.dom,r);i=u.dom}for(r=i?i.nextSibling:t.firstChild,o&&r&&(o.written=!0);r;)r=uE(r);this.length=a}}function uE(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class fp extends cp{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=an.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],i=this,r=0,o=0;;)if(r==i.children.length){if(!t.length)return;i=i.parent,i.breakAfter&&o++,r=t.pop()}else{let a=i.children[r++];if(a instanceof Zr)t.push(r),i=a,r=0;else{let u=o+a.length,f=e(a,o);if(f!==void 0)return f;o=u+a.breakAfter}}}resolveBlock(e,t){let i,r=-1,o,a=-1;if(this.blockTiles((u,f)=>{let d=f+u.length;if(e>=f&&e<=d){if(u.isWidget()&&t>=-1&&t<=1){if(u.flags&32)return!0;u.flags&16&&(i=void 0)}(f<e||e==d&&(t<-1?u.length:u.covers(1)))&&(!i||!u.isWidget()&&i.isWidget())&&(i=u,r=e-f),(d>e||e==f&&(t>1?u.length:u.covers(-1)))&&(!o||!u.isWidget()&&o.isWidget())&&(o=u,a=e-f)}}),!i&&!o)throw new Error("No tile at position "+e);return i&&t<0||!o?{tile:i,offset:r}:{tile:o,offset:a}}}class Zr extends cp{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,t){let i=new Zr(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}}class Sa extends cp{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,i){let r=new Sa(t||document.createElement("div"),e);return(!t||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,t,i){let r=null,o=-1,a=null,u=-1;function f(p,m){for(let g=0,v=0;g<p.children.length&&v<=m;g++){let x=p.children[g],w=v+x.length;w>=m&&(x.isComposite()?f(x,m-v):(!a||a.isHidden&&(t>0||i&&I_(a,x)))&&(w>m||x.flags&32)?(a=x,u=m-v):(v<m||x.flags&16&&!x.isHidden)&&(r=x,o=m-v)),v=w}}f(this,e);let d=(t<0?r:a)||r||a;return d?{tile:d,offset:d==r?o:u}:null}coordsIn(e,t){let i=this.resolveInline(e,t,!0);return i?i.tile.coordsIn(Math.max(0,i.offset),t):L_(this)}domIn(e,t){let i=this.resolveInline(e,t);if(i){let{tile:r,offset:o}=i;if(this.dom.contains(r.dom))return r.isText()?new Ji(r.dom,Math.min(r.dom.nodeValue.length,o)):r.domPosFor(o,r.flags&16?1:r.flags&32?-1:t);let a=i.tile.parent,u=!1;for(let f of a.children){if(u)return new Ji(f.dom,0);f==i.tile&&(u=!0)}}return new Ji(this.dom,0)}}function L_(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=ic(e);return t[t.length-1]||null}function I_(n,e){let t=n.coordsIn(0,1),i=e.coordsIn(0,1);return t&&i&&i.top<t.bottom}class Xn extends cp{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let i=new Xn(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}}class _o extends an{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let i=this.dom.nodeValue.length;e>i&&(e=i);let r=e,o=e,a=0;e==0&&t<0||e==i&&t>=0?Me.chrome||Me.gecko||(e?(r--,a=1):o<i&&(o++,a=-1)):t<0?r--:o<i&&o++;let u=wc(this.dom,r,o).getClientRects();if(!u.length)return null;let f=u[(a?a<0:t>=0)?0:u.length-1];return Me.safari&&!a&&f.width==0&&(f=Array.prototype.find.call(u,d=>d.width)||f),a?Sc(f,a<0):f||null}static of(e,t){let i=new _o(t||document.createTextNode(e),e);return t||(i.flags|=2),i}}class Wo extends an{constructor(e,t,i,r){super(e,t,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,i){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(i)return Sc(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let o=this.dom.getClientRects(),a=null;if(!o.length)return null;let u=this.flags&16?!0:this.flags&32?!1:e>0;for(let f=u?o.length-1:0;a=o[f],!(e>0?f==0:f==o.length-1||a.top<a.bottom);f+=u?-1:1);return Sc(a,!u)}}get overrideDOMText(){if(!this.length)return vt.empty;let{root:e}=this;if(!e)return vt.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,i,r,o){return o||(o=e.toDOM(t),e.editable||(o.contentEditable="false")),new Wo(o,i,e,r)}}class bd extends an{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return vt.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class B_{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,i){let{tile:r,index:o,beforeBreak:a,parents:u}=this;for(;e||t>0;)if(r.isComposite())if(a){if(!e)break;i&&i.break(),e--,a=!1}else if(o==r.children.length){if(!e&&!u.length)break;i&&i.leave(r),a=!!r.breakAfter,{tile:r,index:o}=u.pop(),o++}else{let f=r.children[o],d=f.breakAfter;(t>0?f.length<=e:f.length<e)&&(!i||i.skip(f,0,f.length)!==!1||!f.isComposite)?(a=!!d,o++,e-=f.length):(u.push({tile:r,index:o}),r=f,o=0,i&&f.isComposite()&&i.enter(f))}else if(o==r.length)a=!!r.breakAfter,{tile:r,index:o}=u.pop(),o++;else if(e){let f=Math.min(e,r.length-o);i&&i.skip(r,o,o+f),e-=f,o+=f}else break;return this.tile=r,this.index=o,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class __{constructor(e,t,i,r){this.from=e,this.to=t,this.wrapper=i,this.rank=r}}class P_{constructor(e,t,i){this.cache=e,this.root=t,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,i,r){var o;this.flushBuffer();let a=this.ensureMarks(t,i),u=a.lastChild;if(u&&u.isText()&&!(u.flags&8)&&u.length+e.length<512){this.cache.reused.set(u,2);let f=a.children[a.children.length-1]=new _o(u.dom,u.text+e);f.parent=a}else a.append(r||_o.of(e,(o=this.cache.find(_o))===null||o===void 0?void 0:o.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let i=this.curLine;i.dom!=t.line.dom&&(i.setDOM(this.cache.reused.has(t.line)?p0(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=i;for(let u=t.marks.length-1;u>=0;u--){let f=t.marks[u],d=r.lastChild;if(d instanceof Xn&&d.mark.eq(f.mark))d.dom!=f.dom&&d.setDOM(p0(f.dom)),r=d;else{if(this.cache.reused.get(f)){let m=an.get(f.dom);m&&m.setDOM(p0(f.dom))}let p=Xn.of(f.mark,f.dom);r.append(p),r=p}this.cache.reused.set(f,2)}let o=an.get(e.text);o&&this.cache.reused.set(o,2);let a=new _o(e.text,e.text.nodeValue);a.flags|=8,r.append(a)}addInlineWidget(e,t,i){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let o=this.ensureMarks(t,i);!r&&!(e.flags&16)&&o.append(this.getBuffer(1)),o.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,i){this.flushBuffer(),this.ensureMarks(t,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var i;e||(e=rA);let r=Sa.start(e,t||((i=this.cache.find(Sa))===null||i===void 0?void 0:i.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var i;let r=this.curLine;for(let o=e.length-1;o>=0;o--){let a=e[o],u;if(t>0&&(u=r.lastChild)&&u instanceof Xn&&u.mark.eq(a))r=u,t--;else{let f=Xn.of(a,(i=this.cache.find(Xn,d=>d.mark.eq(a)))===null||i===void 0?void 0:i.dom);r.append(f),r=f,t=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!cE(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Me.ios&&cE(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(m0,0,32)||new Wo(m0.toDOM(),0,m0,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=new __(e.from,e.to,e.value,e.rank),i=this.wrappers.length;for(;i>0&&(this.wrappers[i-1].rank-t.rank||this.wrappers[i-1].to-t.to)<0;)i--;this.wrappers.splice(i,0,t)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let i of this.wrappers){let r=t.lastChild;if(i.from<this.pos&&r instanceof Zr&&r.wrapper.eq(i.wrapper))t=r;else{let o=Zr.of(i.wrapper,(e=this.cache.find(Zr,a=>a.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);t.append(o),t=o}}return t}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),i=this.cache.find(bd,void 0,1);return i&&(i.flags=t),i||new bd(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class z_{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:a}=this.cursor.next(this.skipCount);if(this.skipCount=0,a)throw new Error("Ran out of text content when drawing inline views");this.text=r;let u=this.textOff=Math.min(e,r.length);return o?null:r.slice(0,u)}let t=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,t);return this.textOff=t,i}}const xd=[Wo,Sa,_o,Xn,bd,Zr,fp];for(let n=0;n<xd.length;n++)xd[n].bucket=n;class H_{constructor(e){this.view=e,this.buckets=xd.map(()=>[]),this.index=xd.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,i=this.buckets[t];i.length<6?i.push(e):i[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,i=2){let r=e.bucket,o=this.buckets[r],a=this.index[r];for(let u=o.length-1;u>=0;u--){let f=(u+a)%o.length,d=o[f];if((!t||t(d))&&!this.reused.has(d))return o.splice(f,1),f<a&&this.index[r]--,this.reused.set(d,i),d}return null}findWidget(e,t,i){let r=this.buckets[0];if(r.length)for(let o=0,a=0;;o++){if(o==r.length){if(a)return null;a=1,o=0}let u=r[o];if(!this.reused.has(u)&&(a==0?u.widget.compare(e):u.widget.constructor==e.constructor&&e.updateDOM(u.dom,this.view)))return r.splice(o,1),o<this.index[0]&&this.index[0]--,u.widget==e&&u.length==t&&(u.flags&497)==i?(this.reused.set(u,1),u):(this.reused.set(u,2),new Wo(u.dom,t,e,u.flags&-498|i))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class V_{constructor(e,t,i,r,o){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=o,this.openWidget=!1,this.openMarks=0,this.cache=new H_(e),this.text=new z_(e.state.doc),this.builder=new P_(this.cache,new fp(e,e.contentDOM),ht.iter(i)),this.cache.reused.set(t,2),this.old=new B_(t),this.reuseWalker={skip:(a,u,f)=>{if(this.cache.add(a),a.isComposite())return!1},enter:a=>this.cache.add(a),leave:()=>{},break:()=>{}}}run(e,t){let i=t&&this.getCompositionContext(t.text);for(let r=0,o=0,a=0;;){let u=a<e.length?e[a++]:null,f=u?u.fromA:this.old.root.length;if(f>r){let d=f-r;this.preserve(d,!a,!u),r=f,o+=d}if(!u)break;t&&u.fromA<=t.range.fromA&&u.toA>=t.range.toA?(this.forward(u.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(o,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,i),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,u.toA),this.emit(t.range.toB,u.toB)):(this.forward(u.fromA,u.toA),this.emit(o,u.toB)),o=u.toB,r=u.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,i){let r=q_(this.old),o=this.openMarks;this.old.advance(e,i?1:-1,{skip:(a,u,f)=>{if(a.isWidget())if(this.openWidget)this.builder.continueWidget(f-u);else{let d=f>0||u<a.length?Wo.of(a.widget,this.view,f-u,a.flags&496,this.cache.maybeReuse(a)):this.cache.reuse(a);d.flags&256?(d.flags&=-2,this.builder.addBlockWidget(d)):(this.builder.ensureLine(null),this.builder.addInlineWidget(d,r,o),o=r.length)}else if(a.isText())this.builder.ensureLine(null),!u&&f==a.length?this.builder.addText(a.text,r,o,this.cache.reuse(a)):(this.cache.add(a),this.builder.addText(a.text.slice(u,f),r,o)),o=r.length;else if(a.isLine())a.flags&=-2,this.cache.reused.set(a,1),this.builder.addLine(a);else if(a instanceof bd)this.cache.add(a);else if(a instanceof Xn)this.builder.ensureLine(null),this.builder.addMark(a,r,o),this.cache.reused.set(a,1),o=r.length;else return!1;this.openWidget=!1},enter:a=>{a.isLine()?this.builder.addLineStart(a.attrs,this.cache.maybeReuse(a)):(this.cache.add(a),a instanceof Xn&&r.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?r.length&&(r.length=o=0):a instanceof Xn&&(r.shift(),o=Math.min(o,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let i=null,r=this.builder,o=0,a=ht.spans(this.decorations,e,t,{point:(u,f,d,p,m,g)=>{if(d instanceof Qo){if(this.disallowBlockEffectsFor[g]){if(d.block)throw new RangeError("Block decorations may not be specified via plugins");if(f>this.view.state.doc.lineAt(u).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(o=p.length,m>p.length)r.continueWidget(f-u);else{let v=d.widget||(d.block?wa.block:wa.inline),x=U_(d),w=this.cache.findWidget(v,f-u,x)||Wo.of(v,this.view,f-u,x);d.block?(d.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(w)):(r.ensureLine(i),r.addInlineWidget(w,p,m))}i=null}else i=j_(i,d);f>u&&this.text.skip(f-u)},span:(u,f,d,p)=>{for(let m=u;m<f;){let g=this.text.next(Math.min(512,f-m));g==null?(r.addLineStartIfNotCovered(i),r.addBreak(),m++):(r.ensureLine(i),r.addText(g,d,m==u?p:d.length),m+=g.length),i=null}}});r.addLineStartIfNotCovered(i),this.openWidget=a>o,this.openMarks=a}forward(e,t,i=1){t-e<=10?this.old.advance(t-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let t=[],i=null;for(let r=e.parentNode;;r=r.parentNode){let o=an.get(r);if(r==this.view.contentDOM)break;o instanceof Xn?t.push(o):o?.isLine()?i=o:o instanceof Zr||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new Sa(r,rA):i||t.push(Xn.of(new zc({tagName:r.nodeName.toLowerCase(),attributes:d_(r)}),r)))}return{line:i,marks:t}}}function cE(n,e){let t=i=>{for(let r of i.children)if((e?r.isText():r.length)||t(r))return!0;return!1};return t(n)}function U_(n){let e=n.isReplace?(n.startSide<0?64:0)|(n.endSide>0?128:0):n.startSide>0?32:16;return n.block&&(e|=256),e}const rA={class:"cm-line"};function j_(n,e){let t=e.spec.attributes,i=e.spec.class;return!t&&!i||(n||(n={class:"cm-line"}),t&&Jv(t,n),i&&(n.class+=" "+i)),n}function q_(n){let e=[];for(let t=n.parents.length;t>1;t--){let i=t==n.parents.length?n.tile:n.parents[t].tile;i instanceof Xn&&e.push(i.mark)}return e}function p0(n){let e=an.get(n);return e&&e.setDOM(n.cloneNode()),n}class wa extends Pc{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}wa.inline=new wa("span");wa.block=new wa("div");const m0=new class extends Pc{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class fE{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=$t.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.updateDeco(),this.tile=new fp(e,e.contentDOM),this.updateInner([new Bi(0,0,0,e.state.doc.length)],null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:p,toA:m})=>m<this.minWidthFrom||p>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!Z_(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let o=r>-1?$_(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:p,to:m}=this.hasComposition;i=new Bi(p,m,e.changes.mapPos(p,-1),e.changes.mapPos(m,1)).addToSet(i.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(Me.ie||Me.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,u=this.blockWrappers;this.updateDeco();let f=G_(a,this.decorations,e.changes);f.length&&(i=Bi.extendWithRanges(i,f));let d=X_(u,this.blockWrappers,e.changes);return d.length&&(i=Bi.extendWithRanges(i,d)),o&&!i.some(p=>p.fromA<=o.range.fromA&&p.toA>=o.range.toA)&&(i=o.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(t||e.length){let a=this.tile,u=new V_(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=u.run(e,t),Oy(a,u.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=Me.chrome||Me.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(o),o&&(o.written||i.selectionRange.focusNode!=o.node||!this.tile.dom.contains(o.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.tile.children)o.isWidget()&&o.widget instanceof g0&&r.push(o.dom);i.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let i of t.effects)i.is(JT)&&(this.editContextFormatting=i.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,r=this.view.root.activeElement,o=r==i,a=!o&&!(this.view.state.facet(Yr)||i.tabIndex>-1)&&nc(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(o||t||a))return;let u=this.forceSelection;this.forceSelection=!1;let f=this.view.state.selection.main,d,p;if(f.empty?p=d=this.inlineDOMNearPos(f.anchor,f.assoc||1):(p=this.inlineDOMNearPos(f.head,f.head==f.from?1:-1),d=this.inlineDOMNearPos(f.anchor,f.anchor==f.from?1:-1)),Me.gecko&&f.empty&&!this.hasComposition&&F_(d)){let g=document.createTextNode("");this.view.observer.ignore(()=>d.node.insertBefore(g,d.node.childNodes[d.offset]||null)),d=p=new Ji(g,0),u=!0}let m=this.view.observer.selectionRange;(u||!m.focusNode||(!rc(d.node,d.offset,m.anchorNode,m.anchorOffset)||!rc(p.node,p.offset,m.focusNode,m.focusOffset))&&!this.suppressWidgetCursorChange(m,f))&&(this.view.observer.ignore(()=>{Me.android&&Me.chrome&&i.contains(m.focusNode)&&W_(m.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let g=xc(this.view.root);if(g)if(f.empty){if(Me.gecko){let v=K_(d.node,d.offset);if(v&&v!=3){let x=(v==1?zT:HT)(d.node,d.offset);x&&(d=new Ji(x.node,x.offset))}}g.collapse(d.node,d.offset),f.bidiLevel!=null&&g.caretBidiLevel!==void 0&&(g.caretBidiLevel=f.bidiLevel)}else if(g.extend){g.collapse(d.node,d.offset);try{g.extend(p.node,p.offset)}catch{}}else{let v=document.createRange();f.anchor>f.head&&([d,p]=[p,d]),v.setEnd(p.node,p.offset),v.setStart(d.node,d.offset),g.removeAllRanges(),g.addRange(v)}a&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(d,p)),this.impreciseAnchor=d.precise?null:new Ji(m.anchorNode,m.anchorOffset),this.impreciseHead=p.precise?null:new Ji(m.focusNode,m.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&rc(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=xc(e.root),{anchorNode:r,anchorOffset:o}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let a=this.lineAt(t.head,t.assoc);if(!a)return;let u=a.posAtStart;if(t.head==u||t.head==u+a.length)return;let f=this.coordsAt(t.head,-1),d=this.coordsAt(t.head,1);if(!f||!d||f.bottom>d.top)return;let p=this.domAtPos(t.head+t.assoc,t.assoc);i.collapse(p.node,p.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let m=e.observer.selectionRange;e.docView.posFromDOM(m.anchorNode,m.anchorOffset)!=t.from&&i.collapse(r,o)}posFromDOM(e,t){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let o;if(e==i.dom)o=i.dom.childNodes[t];else{let a=is(e)==0?0:t==0?-1:1;for(;;){let u=e.parentNode;if(u==i.dom)break;a==0&&u.firstChild!=u.lastChild&&(e==u.firstChild?a=-1:a=1),e=u}a<0?o=e:o=e.nextSibling}if(o==i.dom.firstChild)return r;for(;o&&!an.get(o);)o=o.nextSibling;if(!o)return r+i.length;for(let a=0,u=r;;a++){let f=i.children[a];if(f.dom==o)return u;u+=f.length+f.breakAfter}}else return i.isText()?e==i.dom?r+t:r+(t?i.length:0):r}domAtPos(e,t){let{tile:i,offset:r}=this.tile.resolveBlock(e,t);return i.isWidget()?i.domPosFor(e,t):i.domIn(r,t)}inlineDOMNearPos(e,t){let i,r=-1,o=!1,a,u=-1,f=!1;return this.tile.blockTiles((d,p)=>{if(d.isWidget()){if(d.flags&32&&p>=e)return!0;d.flags&16&&(o=!0)}else{let m=p+d.length;if(p<=e&&(i=d,r=e-p,o=m<e),m>=e&&!a&&(a=d,u=e-p,f=p>e),p>e&&a)return!0}}),!i&&!a?this.domAtPos(e,t):(o&&a?i=null:f&&i&&(a=null),i&&t<0||!a?i.domIn(r,t):a.domIn(u,t))}coordsAt(e,t){let{tile:i,offset:r}=this.tile.resolveBlock(e,t);return i.isWidget()?i.widget instanceof g0?null:i.coordsInWidget(r,t,!0):i.coordsIn(r,t)}lineAt(e,t){let{tile:i}=this.tile.resolveBlock(e,t);return i.isLine()?i:null}coordsForChar(e){let{tile:t,offset:i}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(o,a){if(o.isComposite())for(let u of o.children){if(u.length>=a){let f=r(u,a);if(f)return f}if(a-=u.length,a<0)break}else if(o.isText()&&a<o.length){let u=Zi(o.text,a);if(u==a)return null;let f=wc(o.dom,a,u).getClientRects();for(let d=0;d<f.length;d++){let p=f[d];if(d==f.length-1||p.top<p.bottom&&p.left<p.right)return p}}return null}return r(t,i)}measureVisibleLineHeights(e){let t=[],{from:i,to:r}=e,o=this.view.contentDOM.clientWidth,a=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,u=-1,f=this.view.textDirection==Kt.LTR,d=0,p=(m,g,v)=>{for(let x=0;x<m.children.length&&!(g>r);x++){let w=m.children[x],C=g+w.length,E=w.dom.getBoundingClientRect(),{height:k}=E;if(v&&!x&&(d+=E.top-v.top),w instanceof Zr)C>i&&p(w,g,E);else if(g>=i&&(d>0&&t.push(-d),t.push(k+d),d=0,a)){let T=w.dom.lastChild,A=T?ic(T):[];if(A.length){let O=A[A.length-1],N=f?O.right-E.left:E.right-O.left;N>u&&(u=N,this.minWidth=o,this.minWidthFrom=g,this.minWidthTo=C)}}v&&x==m.children.length-1&&(d+=v.bottom-E.bottom),g=C+w.breakAfter}};return p(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?Kt.RTL:Kt.LTR}measureTextSize(){let e=this.tile.blockTiles(a=>{if(a.isLine()&&a.children.length&&a.length<=20){let u=0,f;for(let d of a.children){if(!d.isText()||/[^ -~]/.test(d.text))return;let p=ic(d.dom);if(p.length!=1)return;u+=p[0].width,f=p[0].height}if(u)return{lineHeight:a.dom.getBoundingClientRect().height,charWidth:u/a.length,textHeight:f}}});if(e)return e;let t=document.createElement("div"),i,r,o;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let a=ic(t.firstChild)[0];i=t.getBoundingClientRect().height,r=a&&a.width?a.width/27:7,o=a&&a.height?a.height:i,t.remove()}),{lineHeight:i,charWidth:r,textHeight:o}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,r=0;;r++){let o=r==t.viewports.length?null:t.viewports[r],a=o?o.from-1:this.view.state.doc.length;if(a>i){let u=(t.lineBlockAt(a).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push($t.replace({widget:new g0(u),block:!0,inclusive:!0,isBlockGap:!0}).range(i,a))}if(!o)break;i=o.to+1}return $t.set(e)}updateDeco(){let e=1,t=this.view.state.facet(up).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),i=!1,r=this.view.state.facet(sb).map((o,a)=>{let u=typeof o=="function";return u&&(i=!0),u?o(this.view):o});for(r.length&&(this.dynamicDecorationMap[e++]=i,t.push(ht.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(tA).map(o=>typeof o=="function"?o(this.view):o)}scrollIntoView(e){if(e.isSnapshot){let d=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=d.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let d of this.view.state.facet(ZT))try{if(d(this.view,e.range,e))return!0}catch(p){vi(this.view.state,p,"scroll handler")}let{range:t}=e,i=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),r;if(!i)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let o=ob(this.view),a={left:i.left-o.left,top:i.top-o.top,right:i.right+o.right,bottom:i.bottom+o.bottom},{offsetWidth:u,offsetHeight:f}=this.view.scrollDOM;if(g_(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,u),-u),Math.max(Math.min(e.yMargin,f),-f),this.view.textDirection==Kt.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let d=this.view.docView.lineAt(t.head,1);d&&d.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let t=i=>i.isWidget()||i.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Oy(this.tile)}}function Oy(n,e){let t=e?.get(n);if(t!=1){t==null&&n.destroy();for(let i of n.children)Oy(i,e)}}function F_(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function sA(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let i=zT(t.focusNode,t.focusOffset),r=HT(t.focusNode,t.focusOffset),o=i||r;if(r&&i&&r.node!=i.node){let u=an.get(r.node);if(!u||u.isText()&&u.text!=r.node.nodeValue)o=r;else if(n.docView.lastCompositionAfterCursor){let f=an.get(i.node);!f||f.isText()&&f.text!=i.node.nodeValue||(o=r)}}if(n.docView.lastCompositionAfterCursor=o!=i,!o)return null;let a=e-o.offset;return{from:a,to:a+o.node.nodeValue.length,node:o.node}}function $_(n,e,t){let i=sA(n,t);if(!i)return null;let{node:r,from:o,to:a}=i,u=r.nodeValue;if(/[\n\r]/.test(u)||n.state.doc.sliceString(i.from,i.to)!=u)return null;let f=e.invertedDesc;return{range:new Bi(f.mapPos(o),f.mapPos(a),o,a),text:r}}function K_(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable=="false"?2:0)}let Y_=class{constructor(){this.changes=[]}compareRange(e,t){la(e,t,this.changes)}comparePoint(e,t){la(e,t,this.changes)}boundChange(e){la(e,e,this.changes)}};function G_(n,e,t){let i=new Y_;return ht.compare(n,e,t,i),i.changes}class Q_{constructor(){this.changes=[]}compareRange(e,t){la(e,t,this.changes)}comparePoint(){}boundChange(e){la(e,e,this.changes)}}function X_(n,e,t){let i=new Q_;return ht.compare(n,e,t,i),i.changes}function W_(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function Z_(n,e){let t=!1;return e&&n.iterChangedRanges((i,r)=>{i<e.to&&r>e.from&&(t=!0)}),t}class g0 extends Pc{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function J_(n,e,t=1){let i=n.charCategorizer(e),r=n.doc.lineAt(e),o=e-r.from;if(r.length==0)return Pe.cursor(e);o==0?t=1:o==r.length&&(t=-1);let a=o,u=o;t<0?a=Zi(r.text,o,!1):u=Zi(r.text,o);let f=i(r.text.slice(a,u));for(;a>0;){let d=Zi(r.text,a,!1);if(i(r.text.slice(d,a))!=f)break;a=d}for(;u<r.length;){let d=Zi(r.text,u);if(i(r.text.slice(u,d))!=f)break;u=d}return Pe.range(a+r.from,u+r.from)}function eP(n,e,t,i,r){let o=Math.round((i-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let u=n.viewState.heightOracle.textHeight,f=Math.floor((r-t.top-(n.defaultLineHeight-u)*.5)/u);o+=f*n.viewState.heightOracle.lineLength}let a=n.state.sliceDoc(t.from,t.to);return t.from+o_(a,o,n.state.tabSize)}function tP(n,e,t){let i=n.lineBlockAt(e);if(Array.isArray(i.type)){let r;for(let o of i.type){if(o.from>e)break;if(!(o.to<e)){if(o.from<e&&o.to>e)return o;(!r||o.type==Zn.Text&&(r.type!=o.type||(t<0?o.from<e:o.to>e)))&&(r=o)}}return r||i}return i}function nP(n,e,t,i){let r=tP(n,e.head,e.assoc||-1),o=!i||r.type!=Zn.Text||!(n.lineWrapping||r.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(o){let a=n.dom.getBoundingClientRect(),u=n.textDirectionAt(r.from),f=n.posAtCoords({x:t==(u==Kt.LTR)?a.right-1:a.left+1,y:(o.top+o.bottom)/2});if(f!=null)return Pe.cursor(f,t?-1:1)}return Pe.cursor(t?r.to:r.from,t?-1:1)}function hE(n,e,t,i){let r=n.state.doc.lineAt(e.head),o=n.bidiSpans(r),a=n.textDirectionAt(r.from);for(let u=e,f=null;;){let d=A_(r,o,a,u,t),p=FT;if(!d){if(r.number==(t?n.state.doc.lines:1))return u;p=`
|
|
35
|
+
`,r=n.state.doc.line(r.number+(t?1:-1)),o=n.bidiSpans(r),d=n.visualLineSide(r,!t)}if(f){if(!f(p))return u}else{if(!i)return d;f=i(p)}u=d}}function iP(n,e,t){let i=n.state.charCategorizer(e),r=i(t);return o=>{let a=i(o);return r==Qr.Space&&(r=a),r==a}}function rP(n,e,t,i){let r=e.head,o=t?1:-1;if(r==(t?n.state.doc.length:0))return Pe.cursor(r,e.assoc);let a=e.goalColumn,u,f=n.contentDOM.getBoundingClientRect(),d=n.coordsAtPos(r,(e.empty?e.assoc:0)||(t?1:-1)),p=n.documentTop;if(d)a==null&&(a=d.left-f.left),u=o<0?d.top:d.bottom;else{let x=n.viewState.lineBlockAt(r);a==null&&(a=Math.min(f.right-f.left,n.defaultCharacterWidth*(r-x.from))),u=(o<0?x.top:x.bottom)+p}let m=f.left+a,g=i??n.viewState.heightOracle.textHeight>>1,v=My(n,{x:m,y:u+g*o},!1,o);return Pe.cursor(v.pos,v.assoc,void 0,a)}function sc(n,e,t){for(;;){let i=0;for(let r of n)r.between(e-1,e+1,(o,a,u)=>{if(e>o&&e<a){let f=i||t||(e-o<a-e?-1:1);e=f<0?o:a,i=f}});if(!i)return e}}function oA(n,e){let t=null;for(let i=0;i<e.ranges.length;i++){let r=e.ranges[i],o=null;if(r.empty){let a=sc(n,r.from,0);a!=r.from&&(o=Pe.cursor(a,-1))}else{let a=sc(n,r.from,-1),u=sc(n,r.to,1);(a!=r.from||u!=r.to)&&(o=Pe.range(r.from==r.anchor?a:u,r.from==r.head?a:u))}o&&(t||(t=e.ranges.slice()),t[i]=o)}return t?Pe.create(t,e.mainIndex):e}function y0(n,e,t){let i=sc(n.state.facet(Vc).map(r=>r(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:Pe.cursor(i,i<t.from?1:-1)}class br{constructor(e,t){this.pos=e,this.assoc=t}}function My(n,e,t,i){let r=n.contentDOM.getBoundingClientRect(),o=r.top+n.viewState.paddingTop,{x:a,y:u}=e,f=u-o,d;for(;;){if(f<0)return new br(0,1);if(f>n.viewState.docHeight)return new br(n.state.doc.length,-1);if(d=n.elementAtHeight(f),i==null)break;if(d.type==Zn.Text){if(i<0?d.to<n.viewport.from:d.from>n.viewport.to)break;let g=n.docView.coordsAt(i<0?d.from:d.to,i>0?-1:1);if(g&&(i<0?g.top<=f+o:g.bottom>=f+o))break}let m=n.viewState.heightOracle.textHeight/2;f=i>0?d.bottom+m:d.top-m}if(n.viewport.from>=d.to||n.viewport.to<=d.from){if(t)return null;if(d.type==Zn.Text){let m=eP(n,r,d,a,u);return new br(m,m==d.from?1:-1)}}if(d.type!=Zn.Text)return f<(d.top+d.bottom)/2?new br(d.from,1):new br(d.to,-1);let p=n.docView.lineAt(d.from,2);return(!p||p.length!=d.length)&&(p=n.docView.lineAt(d.from,-2)),new sP(n,a,u,n.textDirectionAt(d.from)).scanTile(p,d.from)}class sP{constructor(e,t,i,r){this.view=e,this.x=t,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:i,spans:r}=this.bidiSpansAt(e);return r[xr.find(r,e-i.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:i,spans:r}=this.bidiSpansAt(e);return r[xr.find(r,e-i.from,-1,t)].dir}bidiIn(e,t){let{spans:i,line:r}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from<t)}scan(e,t){let i=0,r=e.length-1,o=new Set,a=this.bidiIn(e[0],e[r]),u,f,d=-1,p=1e9,m;e:for(;i<r;){let v=r-i,x=i+r>>1;t:if(o.has(x)){let C=i+Math.floor(Math.random()*v);for(let E=0;E<v;E++){if(!o.has(C)){x=C;break t}C++,C==r&&(C=i)}break e}o.add(x);let w=t(x);if(w)for(let C=0;C<w.length;C++){let E=w[C],k=0;if(E.bottom<this.y)(!u||u.bottom<E.bottom)&&(u=E),k=1;else if(E.top>this.y)(!f||f.top>E.top)&&(f=E),k=-1;else{let T=E.left>this.x?this.x-E.left:E.right<this.x?this.x-E.right:0,A=Math.abs(T);A<p&&(d=x,p=A,m=E),T&&(k=T<0==(this.baseDir==Kt.LTR)?-1:1)}k==-1&&(!a||this.baseDirAt(e[x],1))?r=x:k==1&&(!a||this.baseDirAt(e[x+1],-1))&&(i=x+1)}}if(!m){let v=u&&(!f||this.y-u.bottom<f.top-this.y)?u:f;return this.y=(v.top+v.bottom)/2,this.scan(e,t)}let g=(a?this.dirAt(e[d],1):this.baseDir)==Kt.LTR;return{i:d,after:this.x>(m.left+m.right)/2==g}}scanText(e,t){let i=[];for(let o=0;o<e.length;o=Zi(e.text,o))i.push(t+o);i.push(t+e.length);let r=this.scan(i,o=>{let a=i[o]-t,u=i[o+1]-t;return wc(e.dom,a,u).getClientRects()});return r.after?new br(i[r.i+1],-1):new br(i[r.i],1)}scanTile(e,t){if(!e.length)return new br(t,1);if(e.children.length==1){let u=e.children[0];if(u.isText())return this.scanText(u,t);if(u.isComposite())return this.scanTile(u,t)}let i=[t];for(let u=0,f=t;u<e.children.length;u++)i.push(f+=e.children[u].length);let r=this.scan(i,u=>{let f=e.children[u];return f.flags&48?null:(f.dom.nodeType==1?f.dom:wc(f.dom,0,f.length)).getClientRects()}),o=e.children[r.i],a=i[r.i];return o.isText()?this.scanText(o,a):o.isComposite()?this.scanTile(o,a):r.after?new br(i[r.i+1],-1):new br(a,1)}}const Fu="";class oP{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(wt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Fu}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let o=this.text.length;this.readNode(r);let a=an.get(r),u=r.nextSibling;if(u==t){a?.breakAfter&&!u&&i!=this.view.contentDOM&&this.lineBreak();break}let f=an.get(u);(a&&f?a.breakAfter:(a?a.breakAfter:yd(r))||yd(u)&&(r.nodeName!="BR"||a?.isWidget())&&this.text.length>o)&&!aP(u,t)&&this.lineBreak(),r=u}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,a=1,u;if(this.lineSeparator?(o=t.indexOf(this.lineSeparator,i),a=this.lineSeparator.length):(u=r.exec(t))&&(o=u.index,a=u[0].length),this.append(t.slice(i,o<0?t.length:o)),o<0)break;if(this.lineBreak(),a>1)for(let f of this.points)f.node==e&&f.pos>this.text.length&&(f.pos-=a-1);i=o+a}}readNode(e){let t=an.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(lP(e,i.node,i.offset)?t:0))}}function lP(n,e,t){for(;;){if(!e||t<is(e))return!1;if(e==n)return!0;t=Js(e)+1,e=e.parentNode}}function aP(n,e){let t;for(;!(n==e||!n);n=n.nextSibling){let i=an.get(n);if(!i?.isWidget())return!1;i&&(t||(t=[])).push(i)}if(t)for(let i of t){let r=i.overrideDOMText;if(r?.length)return!1}return!0}class dE{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class uP{constructor(e,t,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:o,impreciseAnchor:a}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=lA(e.docView.tile,t,i,0))){let u=o||a?[]:fP(e),f=new oP(u,e);f.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=f.text,this.newSel=hP(u,this.bounds.from)}else{let u=e.observer.selectionRange,f=o&&o.node==u.focusNode&&o.offset==u.focusOffset||!Cy(e.contentDOM,u.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(u.focusNode,u.focusOffset),d=a&&a.node==u.anchorNode&&a.offset==u.anchorOffset||!Cy(e.contentDOM,u.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(u.anchorNode,u.anchorOffset),p=e.viewport;if((Me.ios||Me.chrome)&&e.state.selection.main.empty&&f!=d&&(p.from>0||p.to<e.state.doc.length)){let m=Math.min(f,d),g=Math.max(f,d),v=p.from-m,x=p.to-g;(v==0||v==1||m==0)&&(x==0||x==-1||g==e.state.doc.length)&&(f=0,d=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(Pe.range(d,f)):this.newSel=Pe.single(d,f)}}}function lA(n,e,t,i){if(n.isComposite()){let r=-1,o=-1,a=-1,u=-1;for(let f=0,d=i,p=i;f<n.children.length;f++){let m=n.children[f],g=d+m.length;if(d<e&&g>t)return lA(m,e,t,d);if(g>=e&&r==-1&&(r=f,o=d),d>t&&m.dom.parentNode==n.dom){a=f,u=p;break}p=g,d=g+m.breakAfter}return{from:o,to:u<0?i+n.length:u,startDOM:(r?n.children[r-1].dom.nextSibling:null)||n.dom.firstChild,endDOM:a<n.children.length&&a>=0?n.children[a].dom:null}}else return n.isText()?{from:i,to:i+n.length,startDOM:n.dom,endDOM:n.dom.nextSibling}:null}function aA(n,e){let t,{newSel:i}=e,r=n.state.selection.main,o=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:u}=e.bounds,f=r.from,d=null;(o===8||Me.android&&e.text.length<u-a)&&(f=r.to,d="end");let p=uA(n.state.doc.sliceString(a,u,Fu),e.text,f-a,d);p&&(Me.chrome&&o==13&&p.toB==p.from+2&&e.text.slice(p.from,p.toB)==Fu+Fu&&p.toB--,t={from:a+p.from,to:a+p.toA,insert:vt.of(e.text.slice(p.from,p.toB).split(Fu))})}else i&&(!n.hasFocus&&n.state.facet(Yr)||Sd(i,r))&&(i=null);if(!t&&!i)return!1;if(!t&&e.typeOver&&!r.empty&&i&&i.main.empty?t={from:r.from,to:r.to,insert:n.state.doc.slice(r.from,r.to)}:(Me.mac||Me.android)&&t&&t.from==t.to&&t.from==r.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=Pe.single(i.main.anchor-1,i.main.head-1)),t={from:t.from,to:t.to,insert:vt.of([t.insert.toString().replace("."," ")])}):t&&t.from>=r.from&&t.to<=r.to&&(t.from!=r.from||t.to!=r.to)&&r.to-r.from-(t.to-t.from)<=4?t={from:r.from,to:r.to,insert:n.state.doc.slice(r.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,r.to))}:n.state.doc.lineAt(r.from).to<r.to&&n.docView.lineHasWidget(r.to)&&n.inputState.insertingTextAt>Date.now()-50?t={from:r.from,to:r.to,insert:n.state.toText(n.inputState.insertingText)}:Me.chrome&&t&&t.from==t.to&&t.from==r.head&&t.insert.toString()==`
|
|
36
|
+
`&&n.lineWrapping&&(i&&(i=Pe.single(i.main.anchor-1,i.main.head-1)),t={from:r.from,to:r.to,insert:vt.of([" "])}),t)return lb(n,t,i,o);if(i&&!Sd(i,r)){let a=!1,u="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(a=!0),u=n.inputState.lastSelectionOrigin,u=="select.pointer"&&(i=oA(n.state.facet(Vc).map(f=>f(n)),i))),n.dispatch({selection:i,scrollIntoView:a,userEvent:u}),!0}else return!1}function lb(n,e,t,i=-1){if(Me.ios&&n.inputState.flushIOSKey(e))return!0;let r=n.state.selection.main;if(Me.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&n.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&aa(n.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&aa(n.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&aa(n.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let a,u=()=>a||(a=cP(n,e,t));return n.state.facet(QT).some(f=>f(n,e.from,e.to,o,u))||n.dispatch(u()),!0}function cP(n,e,t){let i,r=n.state,o=r.selection.main,a=-1;if(e.from==e.to&&e.from<o.from||e.from>o.to){let f=e.from<o.from?-1:1,d=f<0?o.from:o.to,p=sc(r.facet(Vc).map(m=>m(n)),d,f);e.from==p&&(a=p)}if(a>-1)i={changes:e,selection:Pe.cursor(e.from+e.insert.length,-1)};else if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let f=o.from<e.from?r.sliceDoc(o.from,e.from):"",d=o.to>e.to?r.sliceDoc(e.to,o.to):"";i=r.replaceSelection(n.state.toText(f+e.insert.sliceString(0,void 0,n.state.lineBreak)+d))}else{let f=r.changes(e),d=t&&t.main.to<=f.newLength?t.main:void 0;if(r.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=o.to+10&&e.to>=o.to-10){let p=n.state.sliceDoc(e.from,e.to),m,g=t&&sA(n,t.main.head);if(g){let x=e.insert.length-(e.to-e.from);m={from:g.from,to:g.to-x}}else m=n.state.doc.lineAt(o.head);let v=o.to-e.to;i=r.changeByRange(x=>{if(x.from==o.from&&x.to==o.to)return{changes:f,range:d||x.map(f)};let w=x.to-v,C=w-p.length;if(n.state.sliceDoc(C,w)!=p||w>=m.from&&C<=m.to)return{range:x};let E=r.changes({from:C,to:w,insert:e.insert}),k=x.to-o.to;return{changes:E,range:d?Pe.range(Math.max(0,d.anchor+k),Math.max(0,d.head+k)):x.map(E)}})}else i={changes:f,selection:d&&r.selection.replaceRange(d)}}let u="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,u+=".compose",n.inputState.compositionFirstChange&&(u+=".start",n.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:u,scrollIntoView:!0})}function uA(n,e,t,i){let r=Math.min(n.length,e.length),o=0;for(;o<r&&n.charCodeAt(o)==e.charCodeAt(o);)o++;if(o==r&&n.length==e.length)return null;let a=n.length,u=e.length;for(;a>0&&u>0&&n.charCodeAt(a-1)==e.charCodeAt(u-1);)a--,u--;if(i=="end"){let f=Math.max(0,o-Math.min(a,u));t-=a+f-o}if(a<o&&n.length<e.length){let f=t<=o&&t>=a?o-t:0;o-=f,u=o+(u-a),a=o}else if(u<o){let f=t<=o&&t>=u?o-t:0;o-=f,a=o+(a-u),u=o}return{from:o,toA:a,toB:u}}function fP(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:o}=n.observer.selectionRange;return t&&(e.push(new dE(t,i)),(r!=t||o!=i)&&e.push(new dE(r,o))),e}function hP(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?Pe.single(t+e,i+e):null}function Sd(n,e){return e.head==n.main.head&&e.anchor==n.main.anchor}class dP{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Me.safari&&e.contentDOM.addEventListener("input",()=>null),Me.gecko&&AP(e.contentDOM.ownerDocument)}handleEvent(e){!SP(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,t);for(let r of i.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=pP(e),i=this.handlers,r=this.view.contentDOM;for(let o in t)if(o!="scroll"){let a=!t[o].handlers.length,u=i[o];u&&a!=!u.handlers.length&&(r.removeEventListener(o,this.handleEvent),u=null),u||r.addEventListener(o,this.handleEvent,{passive:a})}for(let o in i)o!="scroll"&&!t[o]&&r.removeEventListener(o,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&fA.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Me.android&&Me.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return Me.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=cA.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||mP.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,aa(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Me.safari&&!Me.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function pE(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(r){vi(t.state,r)}}}function pP(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let r=i.spec,o=r&&r.plugin.domEventHandlers,a=r&&r.plugin.domEventObservers;if(o)for(let u in o){let f=o[u];f&&t(u).handlers.push(pE(i.value,f))}if(a)for(let u in a){let f=a[u];f&&t(u).observers.push(pE(i.value,f))}}for(let i in ir)t(i).handlers.push(ir[i]);for(let i in ji)t(i).observers.push(ji[i]);return e}const cA=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],mP="dthko",fA=[16,17,18,20,91,92,224,225],wh=6;function Eh(n){return Math.max(0,n)*.7+8}function gP(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class yP{constructor(e,t,i,r){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=y_(e.contentDOM),this.atoms=e.state.facet(Vc).map(a=>a(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(wt.allowMultipleSelections)&&vP(e,t),this.dragging=xP(e,t)&&pA(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&gP(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,r=0,o=0,a=this.view.win.innerWidth,u=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:u}=this.scrollParents.y.getBoundingClientRect());let f=ob(this.view);e.clientX-f.left<=r+wh?t=-Eh(r-e.clientX):e.clientX+f.right>=a-wh&&(t=Eh(e.clientX-a)),e.clientY-f.top<=o+wh?i=-Eh(o-e.clientY):e.clientY+f.bottom>=u-wh&&(i=Eh(e.clientY-u)),this.setScrollSpeed(t,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,i=oA(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function vP(n,e){let t=n.state.facet($T);return t.length?t[0](e):Me.mac?e.metaKey:e.ctrlKey}function bP(n,e){let t=n.state.facet(KT);return t.length?t[0](e):Me.mac?!e.altKey:!e.ctrlKey}function xP(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=xc(n.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let o=0;o<r.length;o++){let a=r[o];if(a.left<=e.clientX&&a.right>=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function SP(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=an.get(t))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}const ir=Object.create(null),ji=Object.create(null),hA=Me.ie&&Me.ie_version<15||Me.ios&&Me.webkit_version<604;function wP(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),dA(n,t.value)},50)}function hp(n,e,t){for(let i of n.facet(e))t=i(t,n);return t}function dA(n,e){e=hp(n.state,nb,e);let{state:t}=n,i,r=1,o=t.toText(e),a=o.lines==t.selection.ranges.length;if(Dy!=null&&t.selection.ranges.every(f=>f.empty)&&Dy==o.toString()){let f=-1;i=t.changeByRange(d=>{let p=t.doc.lineAt(d.from);if(p.from==f)return{range:d};f=p.from;let m=t.toText((a?o.line(r++).text:e)+t.lineBreak);return{changes:{from:p.from,insert:m},range:Pe.cursor(d.from+m.length)}})}else a?i=t.changeByRange(f=>{let d=o.line(r++);return{changes:{from:f.from,to:f.to,insert:d.text},range:Pe.cursor(f.from+d.length)}}):i=t.replaceSelection(o);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}ji.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};ir.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);ji.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};ji.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};ir.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(YT))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=CP(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new yP(n,e,t,i)),i&&n.observer.ignore(()=>{_T(n.contentDOM);let o=n.root.activeElement;o&&!o.contains(n.contentDOM)&&o.blur()});let r=n.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else n.inputState.setSelectionOrigin("select.pointer");return!1};function mE(n,e,t,i){if(i==1)return Pe.cursor(e,t);if(i==2)return J_(n.state,e,t);{let r=n.docView.lineAt(e,t),o=n.state.doc.lineAt(r?r.posAtEnd:e),a=r?r.posAtStart:o.from,u=r?r.posAtEnd:o.to;return u<n.state.doc.length&&u==o.to&&u++,Pe.range(a,u)}}const EP=Me.ie&&Me.ie_version<=11;let gE=null,yE=0,vE=0;function pA(n){if(!EP)return n.detail;let e=gE,t=vE;return gE=n,vE=Date.now(),yE=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(yE+1)%3:1}function CP(n,e){let t=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=pA(e),r=n.state.selection;return{update(o){o.docChanged&&(t.pos=o.changes.mapPos(t.pos),r=r.map(o.changes))},get(o,a,u){let f=n.posAndSideAtCoords({x:o.clientX,y:o.clientY},!1),d,p=mE(n,f.pos,f.assoc,i);if(t.pos!=f.pos&&!a){let m=mE(n,t.pos,t.assoc,i),g=Math.min(m.from,p.from),v=Math.max(m.to,p.to);p=g<p.from?Pe.range(g,v):Pe.range(v,g)}return a?r.replaceRange(r.main.extend(p.from,p.to)):u&&i==1&&r.ranges.length>1&&(d=RP(r,f.pos))?d:u?r.addRange(p):Pe.create([p])}}}function RP(n,e){for(let t=0;t<n.ranges.length;t++){let{from:i,to:r}=n.ranges[t];if(i<=e&&r>=e)return Pe.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}ir.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let r=n.docView.tile.nearest(e.target);if(r&&r.isWidget()){let o=r.posAtStart,a=o+r.length;(o>=t.to||a<=t.from)&&(t=Pe.range(o,a))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",hp(n.state,ib,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};ir.dragend=n=>(n.inputState.draggedContent=null,!1);function bE(n,e,t,i){if(t=hp(n.state,nb,t),!t)return;let r=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=n.inputState,a=i&&o&&bP(n,e)?{from:o.from,to:o.to}:null,u={from:r,insert:t},f=n.state.changes(a?[a,u]:u);n.focus(),n.dispatch({changes:f,selection:{anchor:f.mapPos(r,-1),head:f.mapPos(r,1)},userEvent:a?"move.drop":"input.drop"}),n.inputState.draggedContent=null}ir.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),r=0,o=()=>{++r==t.length&&bE(n,e,i.filter(a=>a!=null).join(n.state.lineBreak),!1)};for(let a=0;a<t.length;a++){let u=new FileReader;u.onerror=o,u.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(u.result)||(i[a]=u.result),o()},u.readAsText(t[a])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return bE(n,e,i,!0),!0}return!1};ir.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=hA?null:e.clipboardData;return t?(dA(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(wP(n),!1)};function kP(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function TP(n){let e=[],t=[],i=!1;for(let r of n.selection.ranges)r.empty||(e.push(n.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:o}of n.selection.ranges){let a=n.doc.lineAt(o);a.number>r&&(e.push(a.text),t.push({from:a.from,to:Math.min(n.doc.length,a.to+1)})),r=a.number}i=!0}return{text:hp(n,ib,e.join(n.lineBreak)),ranges:t,linewise:i}}let Dy=null;ir.copy=ir.cut=(n,e)=>{if(!nc(n.contentDOM,n.observer.selectionRange))return!1;let{text:t,ranges:i,linewise:r}=TP(n.state);if(!t&&!r)return!1;Dy=r?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let o=hA?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",t),!0):(kP(n,t),!1)};const mA=rl.define();function gA(n,e){let t=[];for(let i of n.facet(XT)){let r=i(n,e);r&&t.push(r)}return t.length?n.update({effects:t,annotations:mA.of(!0)}):null}function yA(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=gA(n.state,e);t?n.dispatch(t):n.update([])}},10)}ji.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),yA(n)};ji.blur=n=>{n.observer.clearSelectionRange(),yA(n)};ji.compositionstart=ji.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};ji.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,Me.chrome&&Me.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};ji.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};ir.beforeinput=(n,e)=>{var t,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(n.inputState.insertingText=e.data,n.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&n.observer.editContext){let o=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),a=e.getTargetRanges();if(o&&a.length){let u=a[0],f=n.posAtDOM(u.startContainer,u.startOffset),d=n.posAtDOM(u.endContainer,u.endOffset);return lb(n,{from:f,to:d,insert:n.state.toText(o)},null),!0}}let r;if(Me.chrome&&Me.android&&(r=cA.find(o=>o.inputType==e.inputType))&&(n.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let o=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>o+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return Me.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),Me.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>ji.compositionend(n,e),20),!1};const xE=new Set;function AP(n){xE.has(n)||(xE.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const SE=["pre-wrap","normal","pre-line","break-spaces"];let Ea=!1;function wE(){Ea=!1}class OP{constructor(e){this.lineWrapping=e,this.doc=vt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return SE.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i<e.length;i++){let r=e[i];r<0?i++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,i,r,o,a){let u=SE.indexOf(e)>-1,f=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=u||Math.abs(i-this.charWidth)>.1;if(this.lineWrapping=u,this.lineHeight=t,this.charWidth=i,this.textHeight=r,this.lineLength=o,f){this.heightSamples={};for(let d=0;d<a.length;d++){let p=a[d];p<0?d++:this.heightSamples[Math.floor(p*10)]=!0}}return f}}class MP{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class Xi{constructor(e,t,i,r,o){this.from=e,this.length=t,this.top=i,this.height=r,this._content=o}get type(){return typeof this._content=="number"?Zn.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 Qo?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Xi(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var Mt=(function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n})(Mt||(Mt={}));const Gh=.001;class Vn{constructor(e,t,i=2){this.length=e,this.height=t,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Gh&&(Ea=!0),this.height=e)}replace(e,t,i){return Vn.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,r){let o=this,a=i.doc;for(let u=r.length-1;u>=0;u--){let{fromA:f,toA:d,fromB:p,toB:m}=r[u],g=o.lineAt(f,Mt.ByPosNoHeight,i.setDoc(t),0,0),v=g.to>=d?g:o.lineAt(d,Mt.ByPosNoHeight,i,0,0);for(m+=v.to-d,d=v.to;u>0&&g.from<=r[u-1].toA;)f=r[u-1].fromA,p=r[u-1].fromB,u--,f<g.from&&(g=o.lineAt(f,Mt.ByPosNoHeight,i,0,0));p+=g.from-f,f=g.from;let x=ab.build(i.setDoc(a),e,p,m);o=wd(o,o.replace(f,d,x))}return o.updateHeight(i,0)}static empty(){return new mi(0,0,0)}static of(e){if(e.length==1)return e[0];let t=0,i=e.length,r=0,o=0;for(;;)if(t==i)if(r>o*2){let u=e[t-1];u.break?e.splice(--t,1,u.left,null,u.right):e.splice(--t,1,u.left,u.right),i+=1+u.break,r-=u.size}else if(o>r*2){let u=e[i];u.break?e.splice(i,1,u.left,null,u.right):e.splice(i,1,u.left,u.right),i+=2+u.break,o-=u.size}else break;else if(r<o){let u=e[t++];u&&(r+=u.size)}else{let u=e[--i];u&&(o+=u.size)}let a=0;return e[t-1]==null?(a=1,t--):e[t]==null&&(a=1,i++),new NP(Vn.of(e.slice(0,t)),a,Vn.of(e.slice(i)))}}function wd(n,e){return n==e?n:(n.constructor!=e.constructor&&(Ea=!0),e)}Vn.prototype.size=1;const DP=$t.replace({});class vA extends Vn{constructor(e,t,i){super(e,t),this.deco=i,this.spaceAbove=0}mainBlock(e,t){return new Xi(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,i,r){return this.spaceAbove&&e<i+this.spaceAbove?new Xi(r,0,i,this.spaceAbove,DP):this.mainBlock(i,r)}lineAt(e,t,i,r,o){let a=this.mainBlock(r,o);return this.spaceAbove?this.blockAt(0,i,r,o).join(a):a}forEachLine(e,t,i,r,o,a){e<=o+this.length&&t>=o&&a(this.lineAt(0,Mt.ByPos,i,r,o))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class mi extends vA{constructor(e,t,i){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,t){return new Xi(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,i){let r=i[0];return i.length==1&&(r instanceof mi||r instanceof kn&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof kn?r=new mi(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):Vn.of(i)}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class kn extends Vn{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,o=r-i+1,a,u=0;if(e.lineWrapping){let f=Math.min(this.height,e.lineHeight*o);a=f/o,this.length>o+1&&(u=(this.height-f)/(this.length-o-1))}else a=this.height/o;return{firstLine:i,lastLine:r,perLine:a,perChar:u}}blockAt(e,t,i,r){let{firstLine:o,lastLine:a,perLine:u,perChar:f}=this.heightMetrics(t,r);if(t.lineWrapping){let d=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),p=t.doc.lineAt(d),m=u+p.length*f,g=Math.max(i,e-m/2);return new Xi(p.from,p.length,g,m,0)}else{let d=Math.max(0,Math.min(a-o,Math.floor((e-i)/u))),{from:p,length:m}=t.doc.line(o+d);return new Xi(p,m,i+u*d,u,0)}}lineAt(e,t,i,r,o){if(t==Mt.ByHeight)return this.blockAt(e,i,r,o);if(t==Mt.ByPosNoHeight){let{from:v,to:x}=i.doc.lineAt(e);return new Xi(v,x-v,0,0,0)}let{firstLine:a,perLine:u,perChar:f}=this.heightMetrics(i,o),d=i.doc.lineAt(e),p=u+d.length*f,m=d.number-a,g=r+u*m+f*(d.from-o-m);return new Xi(d.from,d.length,Math.max(r,Math.min(g,r+this.height-p)),p,0)}forEachLine(e,t,i,r,o,a){e=Math.max(e,o),t=Math.min(t,o+this.length);let{firstLine:u,perLine:f,perChar:d}=this.heightMetrics(i,o);for(let p=e,m=r;p<=t;){let g=i.doc.lineAt(p);if(p==e){let x=g.number-u;m+=f*x+d*(e-o-x)}let v=f+d*g.length;a(new Xi(g.from,g.length,m,v,0)),m+=v,p=g.to+1}}replace(e,t,i){let r=this.length-t;if(r>0){let o=i[i.length-1];o instanceof kn?i[i.length-1]=new kn(o.length+r):i.push(null,new kn(r-1))}if(e>0){let o=i[0];o instanceof kn?i[0]=new kn(e+o.length):i.unshift(new kn(e-1),null)}return Vn.of(i)}decomposeLeft(e,t){t.push(new kn(e-1),null)}decomposeRight(e,t){t.push(null,new kn(this.length-e-1))}updateHeight(e,t=0,i=!1,r){let o=t+this.length;if(r&&r.from<=t+this.length&&r.more){let a=[],u=Math.max(t,r.from),f=-1;for(r.from>t&&a.push(new kn(r.from-t-1).updateHeight(e,t));u<=o&&r.more;){let p=e.doc.lineAt(u).length;a.length&&a.push(null);let m=r.heights[r.index++],g=0;m<0&&(g=-m,m=r.heights[r.index++]),f==-1?f=m:Math.abs(m-f)>=Gh&&(f=-2);let v=new mi(p,m,g);v.outdated=!1,a.push(v),u+=p+1}u<=o&&a.push(null,new kn(o-u).updateHeight(e,u));let d=Vn.of(a);return(f<0||Math.abs(d.height-this.height)>=Gh||Math.abs(f-this.heightMetrics(e,t).perLine)>=Gh)&&(Ea=!0),wd(this,d)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class NP extends Vn{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,r){let o=i+this.left.height;return e<o?this.left.blockAt(e,t,i,r):this.right.blockAt(e,t,o,r+this.left.length+this.break)}lineAt(e,t,i,r,o){let a=r+this.left.height,u=o+this.left.length+this.break,f=t==Mt.ByHeight?e<a:e<u,d=f?this.left.lineAt(e,t,i,r,o):this.right.lineAt(e,t,i,a,u);if(this.break||(f?d.to<u:d.from>u))return d;let p=t==Mt.ByPosNoHeight?Mt.ByPosNoHeight:Mt.ByPos;return f?d.join(this.right.lineAt(u,p,i,a,u)):this.left.lineAt(u,p,i,r,o).join(d)}forEachLine(e,t,i,r,o,a){let u=r+this.left.height,f=o+this.left.length+this.break;if(this.break)e<f&&this.left.forEachLine(e,t,i,r,o,a),t>=f&&this.right.forEachLine(e,t,i,u,f,a);else{let d=this.lineAt(f,Mt.ByPos,i,r,o);e<d.from&&this.left.forEachLine(e,d.from-1,i,r,o,a),d.to>=e&&d.from<=t&&a(d),t>d.to&&this.right.forEachLine(d.to+1,t,i,u,f,a)}}replace(e,t,i){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,i));let o=[];e>0&&this.decomposeLeft(e,o);let a=o.length;for(let u of i)o.push(u);if(e>0&&EE(o,a-1),t<this.length){let u=o.length;this.decomposeRight(t,o),EE(o,u)}return Vn.of(o)}decomposeLeft(e,t){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(i++,e>=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<i&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?Vn.of(this.break?[e,null,t]:[e,t]):(this.left=wd(this.left,e),this.right=wd(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,r){let{left:o,right:a}=this,u=t+o.length+this.break,f=null;return r&&r.from<=t+o.length&&r.more?f=o=o.updateHeight(e,t,i,r):o.updateHeight(e,t,i),r&&r.from<=u+a.length&&r.more?f=a=a.updateHeight(e,u,i,r):a.updateHeight(e,u,i),f?this.balanced(o,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function EE(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof kn&&(i=n[e+1])instanceof kn&&n.splice(e-1,3,new kn(t.length+1+i.length))}const LP=5;class ab{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof mi?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new mi(i-this.pos,-1,0)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e<t||i.heightRelevant){let r=i.widget?i.widget.estimatedHeight:0,o=i.widget?i.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=t-e;i.block?this.addBlock(new vA(a,r,i)):(a||o||r>=LP)&&this.addLineDeco(r,o,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new mi(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let i=new kn(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof mi)return e;let t=new mi(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof mi)&&!this.isCovered?this.nodes.push(new mi(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let r of this.nodes)r instanceof mi&&r.updateHeight(this.oracle,i),i+=r?r.length:1;return this.nodes}static build(e,t,i,r){let o=new ab(i,e);return ht.spans(t,i,r,o,0),o.finish(i)}}function IP(n,e,t){let i=new BP;return ht.compare(n,e,t,i,0),i.changes}class BP{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,r){(e<t||i&&i.heightRelevant||r&&r.heightRelevant)&&la(e,t,this.changes,5)}}function _P(n,e){let t=n.getBoundingClientRect(),i=n.ownerDocument,r=i.defaultView||window,o=Math.max(0,t.left),a=Math.min(r.innerWidth,t.right),u=Math.max(0,t.top),f=Math.min(r.innerHeight,t.bottom);for(let d=n.parentNode;d&&d!=i.body;)if(d.nodeType==1){let p=d,m=window.getComputedStyle(p);if((p.scrollHeight>p.clientHeight||p.scrollWidth>p.clientWidth)&&m.overflow!="visible"){let g=p.getBoundingClientRect();o=Math.max(o,g.left),a=Math.min(a,g.right),u=Math.max(u,g.top),f=Math.min(d==n.parentNode?r.innerHeight:f,g.bottom)}d=m.position=="absolute"||m.position=="fixed"?p.offsetParent:p.parentNode}else if(d.nodeType==11)d=d.host;else break;return{left:o-t.left,right:Math.max(o,a)-t.left,top:u-(t.top+e),bottom:Math.max(u,f)-(t.top+e)}}function PP(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function zP(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class v0{constructor(e,t,i,r){this.from=e,this.to=t,this.size=i,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let r=e[i],o=t[i];if(r.from!=o.from||r.to!=o.to||r.size!=o.size)return!1}return!0}draw(e,t){return $t.replace({widget:new HP(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class HP extends Pc{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class CE{constructor(e){this.state=e,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=RE,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Kt.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(rb).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new OP(t),this.stateDeco=kE(e),this.heightMap=Vn.empty().applyChanges(this.stateDeco,vt.empty,this.heightOracle.setDoc(e.doc),[new Bi(0,0,0,e.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=$t.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let r=i?t.head:t.anchor;if(!e.some(({from:o,to:a})=>r>=o&&r<=a)){let{from:o,to:a}=this.lineBlockAt(r);e.push(new Ch(o,a))}}return this.viewports=e.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?RE:new ub(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push($u(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=kE(this.state);let r=e.changedRanges,o=Bi.extendWithRanges(r,IP(i,this.stateDeco,e?e.changes:gn.empty(this.state.doc.length))),a=this.heightMap.height,u=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);wE(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=a||Ea)&&(e.flags|=2),u?(this.scrollAnchorPos=e.changes.mapPos(u.from,-1),this.scrollAnchorHeight=u.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let f=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<f.from||t.range.head>f.to)||!this.viewportIsAppropriate(f))&&(f=this.getViewport(0,t));let d=f.from!=this.viewport.from||f.to!=this.viewport.to;this.viewport=f,e.flags|=this.updateForViewport(),(d||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(M_)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),r=this.heightOracle,o=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Kt.RTL:Kt.LTR;let a=this.heightOracle.mustRefreshForWrapping(o)||this.mustMeasureContent==="refresh",u=t.getBoundingClientRect(),f=a||this.mustMeasureContent||this.contentDOMHeight!=u.height;this.contentDOMHeight=u.height,this.mustMeasureContent=!1;let d=0,p=0;if(u.width&&u.height){let{scaleX:A,scaleY:O}=BT(t,u);(A>.005&&Math.abs(this.scaleX-A)>.005||O>.005&&Math.abs(this.scaleY-O)>.005)&&(this.scaleX=A,this.scaleY=O,d|=16,a=f=!0)}let m=(parseInt(i.paddingTop)||0)*this.scaleY,g=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=m||this.paddingBottom!=g)&&(this.paddingTop=m,this.paddingBottom=g,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(f=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let v=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=v&&(this.scrollAnchorHeight=-1,this.scrollTop=v),this.scrolledToBottom=PT(e.scrollDOM);let x=(this.printing?zP:_P)(t,this.paddingTop),w=x.top-this.pixelViewport.top,C=x.bottom-this.pixelViewport.bottom;this.pixelViewport=x;let E=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(E!=this.inView&&(this.inView=E,E&&(f=!0)),!this.inView&&!this.scrollTarget&&!PP(e.dom))return 0;let k=u.width;if((this.contentDOMWidth!=k||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=u.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),f){let A=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(A)&&(a=!0),a||r.lineWrapping&&Math.abs(k-this.contentDOMWidth)>r.charWidth){let{lineHeight:O,charWidth:N,textHeight:M}=e.docView.measureTextSize();a=O>0&&r.refresh(o,O,N,M,Math.max(5,k/N),A),a&&(e.docView.minWidth=0,d|=16)}w>0&&C>0?p=Math.max(w,C):w<0&&C<0&&(p=Math.min(w,C)),wE();for(let O of this.viewports){let N=O.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(O);this.heightMap=(a?Vn.empty().applyChanges(this.stateDeco,vt.empty,this.heightOracle,[new Bi(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new MP(O.from,N))}Ea&&(d|=2)}let T=!this.viewportIsAppropriate(this.viewport,p)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return T&&(d&2&&(d|=this.updateScaler()),this.viewport=this.getViewport(p,this.scrollTarget),d|=this.updateForViewport()),(d&2||T)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,o=this.heightOracle,{visibleTop:a,visibleBottom:u}=this,f=new Ch(r.lineAt(a-i*1e3,Mt.ByHeight,o,0,0).from,r.lineAt(u+(1-i)*1e3,Mt.ByHeight,o,0,0).to);if(t){let{head:d}=t.range;if(d<f.from||d>f.to){let p=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),m=r.lineAt(d,Mt.ByPos,o,0,0),g;t.y=="center"?g=(m.top+m.bottom)/2-p/2:t.y=="start"||t.y=="nearest"&&d<f.from?g=m.top:g=m.bottom-p,f=new Ch(r.lineAt(g-1e3/2,Mt.ByHeight,o,0,0).from,r.lineAt(g+p+1e3/2,Mt.ByHeight,o,0,0).to)}}return f}mapViewport(e,t){let i=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new Ch(this.heightMap.lineAt(i,Mt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,Mt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},i=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,Mt.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(t,Mt.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:u}=this;return(e==0||r<=a-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||o>=u+Math.max(10,Math.min(i,250)))&&r>a-2*1e3&&o<u+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let i=[];for(let r of e)t.touchesRange(r.from,r.to)||i.push(new v0(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return i}ensureLineGaps(e,t){let i=this.heightOracle.lineWrapping,r=i?1e4:2e3,o=r>>1,a=r<<1;if(this.defaultTextDirection!=Kt.LTR&&!i)return[];let u=[],f=(p,m,g,v)=>{if(m-p<o)return;let x=this.state.selection.main,w=[x.from];x.empty||w.push(x.to);for(let E of w)if(E>p&&E<m){f(p,E-10,g,v),f(E+10,m,g,v);return}let C=UP(e,E=>E.from>=g.from&&E.to<=g.to&&Math.abs(E.from-p)<o&&Math.abs(E.to-m)<o&&!w.some(k=>E.from<k&&E.to>k));if(!C){if(m<g.to&&t&&i&&t.visibleRanges.some(T=>T.from<=m&&T.to>=m)){let T=t.moveToLineBoundary(Pe.cursor(m),!1,!0).head;T>p&&(m=T)}let E=this.gapSize(g,p,m,v),k=i||E<2e6?E:2e6;C=new v0(p,m,E,k)}u.push(C)},d=p=>{if(p.length<a||p.type!=Zn.Text)return;let m=VP(p.from,p.to,this.stateDeco);if(m.total<a)return;let g=this.scrollTarget?this.scrollTarget.range.head:null,v,x;if(i){let w=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,C,E;if(g!=null){let k=kh(m,g),T=((this.visibleBottom-this.visibleTop)/2+w)/p.height;C=k-T,E=k+T}else C=(this.visibleTop-p.top-w)/p.height,E=(this.visibleBottom-p.top+w)/p.height;v=Rh(m,C),x=Rh(m,E)}else{let w=m.total*this.heightOracle.charWidth,C=r*this.heightOracle.charWidth,E=0;if(w>2e6)for(let N of e)N.from>=p.from&&N.from<p.to&&N.size!=N.displaySize&&N.from*this.heightOracle.charWidth+E<this.pixelViewport.left&&(E=N.size-N.displaySize);let k=this.pixelViewport.left+E,T=this.pixelViewport.right+E,A,O;if(g!=null){let N=kh(m,g),M=((T-k)/2+C)/w;A=N-M,O=N+M}else A=(k-C)/w,O=(T+C)/w;v=Rh(m,A),x=Rh(m,O)}v>p.from&&f(p.from,v,p,m),x<p.to&&f(x,p.to,p,m)};for(let p of this.viewportLines)Array.isArray(p.type)?p.type.forEach(d):d(p);return u}gapSize(e,t,i,r){let o=kh(r,i)-kh(r,t);return this.heightOracle.lineWrapping?e.height*o:r.total*this.heightOracle.charWidth*o}updateLineGaps(e){v0.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=$t.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];ht.spans(t,this.viewport.from,this.viewport.to,{span(o,a){i.push({from:o,to:a})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let o=0;o<i.length&&!(r&8);o++){let a=this.visibleRanges[o],u=i[o];(a.from!=u.from||a.to!=u.to)&&(r|=4,e&&e.mapPos(a.from,-1)==u.from&&e.mapPos(a.to,1)==u.to||(r|=8))}return this.visibleRanges=i,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||$u(this.heightMap.lineAt(e,Mt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||$u(this.heightMap.lineAt(this.scaler.fromDOM(e),Mt.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return $u(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Ch{constructor(e,t){this.from=e,this.to=t}}function VP(n,e,t){let i=[],r=n,o=0;return ht.spans(t,n,e,{span(){},point(a,u){a>r&&(i.push({from:r,to:a}),o+=a-r),r=u}},20),r<e&&(i.push({from:r,to:e}),o+=e-r),{total:o,ranges:i}}function Rh({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let r=0;;r++){let{from:o,to:a}=e[r],u=a-o;if(i<=u)return o+i;i-=u}}function kh(n,e){let t=0;for(let{from:i,to:r}of n.ranges){if(e<=r){t+=e-i;break}t+=r-i}return t/n.total}function UP(n,e){for(let t of n)if(e(t))return t}const RE={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};function kE(n){let e=n.facet(up).filter(i=>typeof i!="function"),t=n.facet(sb).filter(i=>typeof i!="function");return t.length&&e.push(ht.join(t)),e}class ub{constructor(e,t,i){let r=0,o=0,a=0;this.viewports=i.map(({from:u,to:f})=>{let d=t.lineAt(u,Mt.ByPos,e,0,0).top,p=t.lineAt(f,Mt.ByPos,e,0,0).bottom;return r+=p-d,{from:u,to:f,top:d,bottom:p,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let u of this.viewports)u.domTop=a+(u.top-o)*this.scale,a=u.domBottom=u.domTop+(u.bottom-u.top),o=u.bottom}toDOM(e){for(let t=0,i=0,r=0;;t++){let o=t<this.viewports.length?this.viewports[t]:null;if(!o||e<o.top)return r+(e-i)*this.scale;if(e<=o.bottom)return o.domTop+(e-o.top);i=o.bottom,r=o.domBottom}}fromDOM(e){for(let t=0,i=0,r=0;;t++){let o=t<this.viewports.length?this.viewports[t]:null;if(!o||e<o.domTop)return i+(e-r)/this.scale;if(e<=o.domBottom)return o.top+(e-o.domTop);i=o.bottom,r=o.domBottom}}eq(e){return e instanceof ub?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,i)=>t.from==e.viewports[i].from&&t.to==e.viewports[i].to):!1}}function $u(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new Xi(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(r=>$u(r,e)):n._content)}const Th=Ve.define({combine:n=>n.join(" ")}),Ny=Ve.define({combine:n=>n.indexOf(!0)>-1}),Ly=Ws.newName(),bA=Ws.newName(),xA=Ws.newName(),SA={"&light":"."+bA,"&dark":"."+xA};function Iy(n,e,t){return new Ws(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return n;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):n+" "+i}})}const jP=Iy("."+Ly,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<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"}},SA),qP={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},b0=Me.ie&&Me.ie_version<=11;class FP{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new v_,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(Me.ie&&Me.ie_version<=11||Me.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Me.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Me.chrome&&Me.chrome_version<126)&&(this.editContext=new KP(e),e.state.facet(Yr)&&(e.contentDOM.editContext=this.editContext.editContext)),b0&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.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 t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.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(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(Yr)?i.root.activeElement!=this.dom:!nc(this.dom,r))return;let o=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(o&&o.isWidget()&&o.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Me.ie&&Me.ie_version<=11||Me.android&&Me.chrome)&&!i.state.selection.main.empty&&r.focusNode&&rc(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=xc(e.root);if(!t)return!1;let i=Me.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&$P(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let r=nc(this.dom,i);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&x_(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let i=this.dom;i;)if(i.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=t)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,qP),b0&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),b0&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var i;if(!this.delayedAndroidKey){let r=()=>{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&aa(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.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 e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,r=!1;for(let o of e){let a=this.readMutation(o);a&&(a.typeOver&&(r=!0),t==-1?{from:t,to:i}=a:(t=Math.min(a.from,t),i=Math.max(a.to,i)))}return{from:t,to:i,typeOver:r}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),r=this.selectionChanged&&nc(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new uP(this.view,e,t,i);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let i=this.view.state,r=aA(this.view,t);return this.view.state==i&&(t.domChanged||t.newSel&&!Sd(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type=="attributes"),e.type=="childList"){let i=TE(t,e.previousSibling||e.target.previousSibling,-1),r=TE(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Yr)!=e.state.facet(Yr)&&(e.view.contentDOM.editContext=e.state.facet(Yr)?this.editContext.editContext:null))}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.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 TE(n,e,t){for(;e;){let i=an.get(e);if(i&&i.parent==n)return i;let r=e.parentNode;e=r!=n.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function AE(n,e){let t=e.startContainer,i=e.startOffset,r=e.endContainer,o=e.endOffset,a=n.docView.domAtPos(n.state.selection.main.anchor,1);return rc(a.node,a.offset,r,o)&&([t,i,r,o]=[r,o,t,i]),{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:o}}function $P(n,e){if(e.getComposedRanges){let r=e.getComposedRanges(n.root)[0];if(r)return AE(n,r)}let t=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",i,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",i,!0),t?AE(n,t):null}class KP{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let r=e.state.selection.main,{anchor:o,head:a}=r,u=this.toEditorPos(i.updateRangeStart),f=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:u,drifted:!1});let d=f-u>i.text.length;u==this.from&&o<this.from?u=o:f==this.to&&o>this.to&&(f=o);let p=uA(e.state.sliceDoc(u,f),i.text,(d?r.from:r.to)-u,d?"end":null);if(!p){let g=Pe.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));Sd(g,r)||e.dispatch({selection:g,userEvent:"select"});return}let m={from:p.from+u,to:p.toA+u,insert:vt.of(i.text.slice(p.from,p.toB).split(`
|
|
37
|
+
`))};if((Me.mac||Me.android)&&m.from==a-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(m={from:u,to:f,insert:vt.of([i.text.replace("."," ")])}),this.pendingContextChange=m,!e.state.readOnly){let g=this.to-this.from+(m.to-m.from+m.insert.length);lb(e,m,Pe.single(this.toEditorPos(i.selectionStart,g),this.toEditorPos(i.selectionEnd,g)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),m.from<m.to&&!m.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],o=null;for(let a=this.toEditorPos(i.rangeStart),u=this.toEditorPos(i.rangeEnd);a<u;a++){let f=e.coordsForChar(a);o=f&&new DOMRect(f.left,f.top,f.right-f.left,f.bottom-f.top)||o||new DOMRect,r.push(o)}t.updateCharacterBounds(i.rangeStart,r)},this.handlers.textformatupdate=i=>{let r=[];for(let o of i.getTextFormats()){let a=o.underlineStyle,u=o.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(u)){let f=this.toEditorPos(o.rangeStart),d=this.toEditorPos(o.rangeEnd);if(f<d){let p=`text-decoration: underline ${/^[a-z]/.test(a)?a+" ":a=="Dashed"?"dashed ":a=="Squiggle"?"wavy ":""}${/thin/i.test(u)?1:2}px`;r.push($t.mark({attributes:{style:p}}).range(f,d))}}}e.dispatch({effects:JT.of($t.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let r=xc(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((o,a,u,f,d)=>{if(i)return;let p=d.length-(a-o);if(r&&a>=r.to)if(r.from==o&&r.to==a&&r.insert.eq(d)){r=this.pendingContextChange=null,t+=p,this.to+=p;return}else r=null,this.revertPending(e.state);if(o+=t,a+=t,a<=this.from)this.from+=p,this.to+=p;else if(o<this.to){if(o<this.from||a>this.to||this.to-this.from+d.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(a),d.toString()),this.to+=p}t+=p}),r&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class nt{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(o=>i(o,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||b_(e.parent)||document,this.viewState=new CE(e.state||wt.create(e)),e.scrollTo&&e.scrollTo.is(Sh)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Xl).map(r=>new d0(r));for(let r of this.plugins)r.update(this);this.observer=new FP(this),this.inputState=new dP(this),this.inputState.ensureHandlers(this.plugins),this.docView=new fE(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof Bn?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,r,o=this.state;for(let g of e){if(g.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=g.state}if(this.destroyed){this.viewState.state=o;return}let a=this.hasFocus,u=0,f=null;e.some(g=>g.annotation(mA))?(this.inputState.notifiedFocused=a,u=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,f=gA(o,a),f||(u=1));let d=this.observer.delayedAndroidKey,p=null;if(d?(this.observer.clearDelayedAndroidKey(),p=this.observer.readChange(),(p&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(p=null)):this.observer.clear(),o.facet(wt.phrases)!=this.state.facet(wt.phrases))return this.setState(o);r=vd.create(this,o,e),r.flags|=u;let m=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(m&&(m=m.map(g.changes)),g.scrollIntoView){let{main:v}=g.state.selection;m=new ua(v.empty?v:Pe.cursor(v.head,v.head>v.anchor?-1:1))}for(let v of g.effects)v.is(Sh)&&(m=v.value.clip(this.state))}this.viewState.update(r,m),this.bidiCache=Ed.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(qu)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(Th)!=r.state.facet(Th)&&(this.viewState.mustMeasureContent=!0),(t||i||m||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let g of this.state.facet(Ay))try{g(r)}catch(v){vi(this.state,v,"update listener")}(f||p)&&Promise.resolve().then(()=>{f&&this.state==f.startState&&this.dispatch(f),p&&!aA(this,p)&&d.force&&aa(this.contentDOM,d.key,d.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new CE(e),this.plugins=e.facet(Xl).map(i=>new d0(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new fE(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Xl),i=e.state.facet(Xl);if(t!=i){let r=[];for(let o of i){let a=t.indexOf(o);if(a<0)r.push(new d0(o));else{let u=this.plugins[a];u.mustUpdate=e,r.push(u)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);t!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(i){vi(this.state,i,"doc view update listener")}}}measure(e=!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,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,r=i.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let u=0;;u++){if(a<0)if(PT(i))o=-1,a=this.viewState.heightMap.height;else{let v=this.viewState.scrollAnchorAt(r);o=v.from,a=v.top}this.updateState=1;let f=this.viewState.measure(this);if(!f&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(u>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];f&4||([this.measureRequests,d]=[d,this.measureRequests]);let p=d.map(v=>{try{return v.read(this)}catch(x){return vi(this.state,x),OE}}),m=vd.create(this,this.state,[]),g=!1;m.flags|=f,t?t.flags|=f:t=m,this.updateState=2,m.empty||(this.updatePlugins(m),this.inputState.update(m),this.updateAttrs(),g=this.docView.update(m),g&&this.docViewUpdate());for(let v=0;v<d.length;v++)if(p[v]!=OE)try{let x=d[v];x.write&&x.write(p[v],this)}catch(x){vi(this.state,x)}if(g&&this.docView.updateSelection(!0),!m.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let x=(o<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(o).top)-a;if(x>1||x<-1){r=r+x,i.scrollTop=r/this.scaleY,a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let u of this.state.facet(Ay))u(t)}get themeClasses(){return Ly+" "+(this.state.facet(Ny)?xA:bA)+" "+this.state.facet(Th)}updateAttrs(){let e=ME(this,eA,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Yr)?"true":"false",class:"cm-content",style:`${Me.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),ME(this,rb,t);let i=this.observer.ignore(()=>{let r=sE(this.contentDOM,this.contentAttrs,t),o=sE(this.dom,this.editorAttrs,e);return r||o});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let r of i.effects)if(r.is(nt.announce)){t&&(this.announceDOM.textContent=""),t=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(qu);let e=this.state.facet(nt.cspNonce);Ws.mount(this.root,this.styleModules.concat(jP).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(i=>i.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return y0(this,e,hE(this,e,t,i))}moveByGroup(e,t){return y0(this,e,hE(this,e,t,i=>iP(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),o=i[t?i.length-1:0];return Pe.cursor(o.side(t,r)+e.from,o.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,i=!0){return nP(this,e,t,i)}moveVertically(e,t,i){return y0(this,e,rP(this,e,t,i))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let i=My(this,e,t);return i&&i.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),My(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let r=this.state.doc.lineAt(e),o=this.bidiSpans(r),a=o[xr.find(o,e-r.from,-1,t)];return Sc(i,a.dir==Kt.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(WT)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>YP)return qT(e.length);let t=this.textDirectionAt(e.from),i;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==t&&(o.fresh||jT(o.isolates,i=aE(this,e))))return o.order;i||(i=aE(this,e));let r=T_(e.text,t,i);return this.bidiCache.push(new Ed(e.from,e.to,t,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Me.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{_T(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Sh.of(new ua(typeof e=="number"?Pe.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return Sh.of(new ua(Pe.cursor(i.from),"start","start",i.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return nr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return nr.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=Ws.newName(),r=[Th.of(i),qu.of(Iy(`.${i}`,e))];return t&&t.dark&&r.push(Ny.of(!0)),r}static baseTheme(e){return _c.lowest(qu.of(Iy("."+Ly,e,SA)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),r=i&&an.get(i)||an.get(e);return((t=r?.root)===null||t===void 0?void 0:t.view)||null}}nt.styleModule=qu;nt.inputHandler=QT;nt.clipboardInputFilter=nb;nt.clipboardOutputFilter=ib;nt.scrollHandler=ZT;nt.focusChangeEffect=XT;nt.perLineTextDirection=WT;nt.exceptionSink=GT;nt.updateListener=Ay;nt.editable=Yr;nt.mouseSelectionStyle=YT;nt.dragMovesSelection=KT;nt.clickAddsSelectionRange=$T;nt.decorations=up;nt.blockWrappers=tA;nt.outerDecorations=sb;nt.atomicRanges=Vc;nt.bidiIsolatedRanges=nA;nt.scrollMargins=iA;nt.darkTheme=Ny;nt.cspNonce=Ve.define({combine:n=>n.length?n[0]:""});nt.contentAttributes=rb;nt.editorAttributes=eA;nt.lineWrapping=nt.contentAttributes.of({class:"cm-lineWrapping"});nt.announce=zt.define();const YP=4096,OE={};class Ed{constructor(e,t,i,r,o,a){this.from=e,this.to=t,this.dir=i,this.isolates=r,this.fresh=o,this.order=a}static update(e,t){if(t.empty&&!e.some(o=>o.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:Kt.LTR;for(let o=Math.max(0,e.length-10);o<e.length;o++){let a=e[o];a.dir==r&&!t.touchesRange(a.from,a.to)&&i.push(new Ed(t.mapPos(a.from,1),t.mapPos(a.to,-1),a.dir,a.isolates,!1,a.order))}return i}}function ME(n,e,t){for(let i=n.state.facet(e),r=i.length-1;r>=0;r--){let o=i[r],a=typeof o=="function"?o(n):o;a&&Jv(a,t)}return t}const GP=Me.mac?"mac":Me.windows?"win":Me.linux?"linux":"key";function QP(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let r,o,a,u;for(let f=0;f<t.length-1;++f){const d=t[f];if(/^(cmd|meta|m)$/i.test(d))u=!0;else if(/^a(lt)?$/i.test(d))r=!0;else if(/^(c|ctrl|control)$/i.test(d))o=!0;else if(/^s(hift)?$/i.test(d))a=!0;else if(/^mod$/i.test(d))e=="mac"?u=!0:o=!0;else throw new Error("Unrecognized modifier name: "+d)}return r&&(i="Alt-"+i),o&&(i="Ctrl-"+i),u&&(i="Meta-"+i),a&&(i="Shift-"+i),i}function Ah(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const XP=_c.default(nt.domEventHandlers({keydown(n,e){return ez(WP(e.state),n,e,"editor")}})),wA=Ve.define({enables:XP}),DE=new WeakMap;function WP(n){let e=n.facet(wA),t=DE.get(e);return t||DE.set(e,t=JP(e.reduce((i,r)=>i.concat(r),[]))),t}let Bs=null;const ZP=4e3;function JP(n,e=GP){let t=Object.create(null),i=Object.create(null),r=(a,u)=>{let f=i[a];if(f==null)i[a]=u;else if(f!=u)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},o=(a,u,f,d,p)=>{var m,g;let v=t[a]||(t[a]=Object.create(null)),x=u.split(/ (?!$)/).map(E=>QP(E,e));for(let E=1;E<x.length;E++){let k=x.slice(0,E).join(" ");r(k,!0),v[k]||(v[k]={preventDefault:!0,stopPropagation:!1,run:[T=>{let A=Bs={view:T,prefix:k,scope:a};return setTimeout(()=>{Bs==A&&(Bs=null)},ZP),!0}]})}let w=x.join(" ");r(w,!1);let C=v[w]||(v[w]={preventDefault:!1,stopPropagation:!1,run:((g=(m=v._any)===null||m===void 0?void 0:m.run)===null||g===void 0?void 0:g.slice())||[]});f&&C.run.push(f),d&&(C.preventDefault=!0),p&&(C.stopPropagation=!0)};for(let a of n){let u=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let d of u){let p=t[d]||(t[d]=Object.create(null));p._any||(p._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:m}=a;for(let g in p)p[g].run.push(v=>m(v,By))}let f=a[e]||a.key;if(f)for(let d of u)o(d,f,a.run,a.preventDefault,a.stopPropagation),a.shift&&o(d,"Shift-"+f,a.shift,a.preventDefault,a.stopPropagation)}return t}let By=null;function ez(n,e,t,i){By=e;let r=c_(e),o=Oo(r,0),a=Gl(o)==r.length&&r!=" ",u="",f=!1,d=!1,p=!1;Bs&&Bs.view==t&&Bs.scope==i&&(u=Bs.prefix+" ",fA.indexOf(e.keyCode)<0&&(d=!0,Bs=null));let m=new Set,g=C=>{if(C){for(let E of C.run)if(!m.has(E)&&(m.add(E),E(t)))return C.stopPropagation&&(p=!0),!0;C.preventDefault&&(C.stopPropagation&&(p=!0),d=!0)}return!1},v=n[i],x,w;return v&&(g(v[u+Ah(r,e,!a)])?f=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Me.windows&&e.ctrlKey&&e.altKey)&&!(Me.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(x=Zs[e.keyCode])&&x!=r?(g(v[u+Ah(x,e,!0)])||e.shiftKey&&(w=vc[e.keyCode])!=r&&w!=x&&g(v[u+Ah(w,e,!1)]))&&(f=!0):a&&e.shiftKey&&g(v[u+Ah(r,e,!0)])&&(f=!0),!f&&g(v._any)&&(f=!0)),d&&(f=!0),f&&p&&e.stopPropagation(),By=null,f}class tz extends Pc{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?ic(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),r=Sc(t[0],i.direction!="rtl"),o=parseInt(i.lineHeight);return r.bottom-r.top>o*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+o}:r}ignoreEvent(){return!1}}function aV(n){let e=nr.fromClass(class{constructor(t){this.view=t,this.placeholder=n?$t.set([$t.widget({widget:new tz(n),side:1}).range(0)]):$t.none}get decorations(){return this.view.state.doc.length?$t.none:this.placeholder}},{decorations:t=>t.decorations});return typeof n=="string"?[e,nt.contentAttributes.of({"aria-placeholder":n})]:e}const Oh="-10000px";class nz{constructor(e,t,i,r){this.facet=t,this.createTooltipView=i,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(a=>a);let o=null;this.tooltipViews=this.tooltips.map(a=>o=i(a,o))}update(e,t){var i;let r=e.state.facet(this.facet),o=r.filter(f=>f);if(r===this.input){for(let f of this.tooltipViews)f.update&&f.update(e);return!1}let a=[],u=t?[]:null;for(let f=0;f<o.length;f++){let d=o[f],p=-1;if(d){for(let m=0;m<this.tooltips.length;m++){let g=this.tooltips[m];g&&g.create==d.create&&(p=m)}if(p<0)a[f]=this.createTooltipView(d,f?a[f-1]:null),u&&(u[f]=!!d.above);else{let m=a[f]=this.tooltipViews[p];u&&(u[f]=t[p]),m.update&&m.update(e)}}}for(let f of this.tooltipViews)a.indexOf(f)<0&&(this.removeTooltipView(f),(i=f.destroy)===null||i===void 0||i.call(f));return t&&(u.forEach((f,d)=>t[d]=f),t.length=u.length),this.input=r,this.tooltips=o,this.tooltipViews=a,!0}}function iz(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const x0=Ve.define({combine:n=>{var e,t,i;return{position:Me.ios?"absolute":((e=n.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(r=>r.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||iz}}}),NE=new WeakMap,EA=nr.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(x0);this.position=e.position,this.parent=e.parent,this.classes=n.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 nz(n,CA,(t,i)=>this.createTooltip(t,i),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.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 n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(x0);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),i=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",t.dom.appendChild(r)}return t.dom.style.position=this.position,t.dom.style.top=Oh,t.dom.style.left="0px",this.container.insertBefore(t.dom,i),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(n=i.destroy)===null||n===void 0||n.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:o}=this.manager.tooltipViews[0];if(Me.safari){let a=o.getBoundingClientRect();t=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}else t=!!o.offsetParent&&o.offsetParent!=this.container.ownerDocument.body}if(t||this.position=="absolute")if(this.parent){let o=this.parent.getBoundingClientRect();o.width&&o.height&&(n=o.width/this.parent.offsetWidth,e=o.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=ob(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((o,a)=>{let u=this.manager.tooltipViews[a];return u.getCoords?u.getCoords(o.pos):this.view.coordsAtPos(o.pos)}),size:this.manager.tooltipViews.map(({dom:o})=>o.getBoundingClientRect()),space:this.view.state.facet(x0).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let u of this.manager.tooltipViews)u.dom.style.position="absolute"}let{visible:t,space:i,scaleX:r,scaleY:o}=n,a=[];for(let u=0;u<this.manager.tooltips.length;u++){let f=this.manager.tooltips[u],d=this.manager.tooltipViews[u],{dom:p}=d,m=n.pos[u],g=n.size[u];if(!m||f.clip!==!1&&(m.bottom<=Math.max(t.top,i.top)||m.top>=Math.min(t.bottom,i.bottom)||m.right<Math.max(t.left,i.left)-.1||m.left>Math.min(t.right,i.right)+.1)){p.style.top=Oh;continue}let v=f.arrow?d.dom.querySelector(".cm-tooltip-arrow"):null,x=v?7:0,w=g.right-g.left,C=(e=NE.get(d))!==null&&e!==void 0?e:g.bottom-g.top,E=d.offset||sz,k=this.view.textDirection==Kt.LTR,T=g.width>i.right-i.left?k?i.left:i.right-g.width:k?Math.max(i.left,Math.min(m.left-(v?14:0)+E.x,i.right-w)):Math.min(Math.max(i.left,m.left-w+(v?14:0)-E.x),i.right-w),A=this.above[u];!f.strictSide&&(A?m.top-C-x-E.y<i.top:m.bottom+C+x+E.y>i.bottom)&&A==i.bottom-m.bottom>m.top-i.top&&(A=this.above[u]=!A);let O=(A?m.top-i.top:i.bottom-m.bottom)-x;if(O<C&&d.resize!==!1){if(O<this.view.defaultLineHeight){p.style.top=Oh;continue}NE.set(d,C),p.style.height=(C=O)/o+"px"}else p.style.height&&(p.style.height="");let N=A?m.top-C-x-E.y:m.bottom+x+E.y,M=T+w;if(d.overlap!==!0)for(let D of a)D.left<M&&D.right>T&&D.top<N+C&&D.bottom>N&&(N=A?D.top-C-2-x:D.bottom+x+2);if(this.position=="absolute"?(p.style.top=(N-n.parent.top)/o+"px",LE(p,(T-n.parent.left)/r)):(p.style.top=N/o+"px",LE(p,T/r)),v){let D=m.left+(k?E.x:-E.x)-(T+14-7);v.style.left=D/r+"px"}d.overlap!==!0&&a.push({left:T,top:N,right:M,bottom:N+C}),p.classList.toggle("cm-tooltip-above",A),p.classList.toggle("cm-tooltip-below",!A),d.positioned&&d.positioned(n.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 n of this.manager.tooltipViews)n.dom.style.top=Oh}},{eventObservers:{scroll(){this.maybeMeasure()}}});function LE(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const rz=nt.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:"14px",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"}}}),sz={x:0,y:0},CA=Ve.define({enables:[EA,rz]});function RA(n,e){let t=n.plugin(EA);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}class Zo extends Xs{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Zo.prototype.elementClass="";Zo.prototype.toDOM=void 0;Zo.prototype.mapMode=yi.TrackBefore;Zo.prototype.startSide=Zo.prototype.endSide=-1;Zo.prototype.point=!0;const S0=Ve.define(),oz=Ve.define(),Qh=Ve.define(),IE=Ve.define({combine:n=>n.some(e=>e)});function lz(n){return[az]}const az=nr.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(Qh).map(e=>new _E(n,e)),this.fixed=!n.state.facet(IE);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}if(n.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(IE)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=ht.iter(this.view.state.facet(S0),this.view.viewport.from),i=[],r=this.gutters.map(o=>new uz(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(o.type)){let a=!0;for(let u of o.type)if(u.type==Zn.Text&&a){_y(t,i,u.from);for(let f of r)f.line(this.view,u,i);a=!1}else if(u.widget)for(let f of r)f.widget(this.view,u)}else if(o.type==Zn.Text){_y(t,i,o.from);for(let a of r)a.line(this.view,o,i)}else if(o.widget)for(let a of r)a.widget(this.view,o);for(let o of r)o.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(Qh),t=n.state.facet(Qh),i=n.docChanged||n.heightChanged||n.viewportChanged||!ht.eq(n.startState.facet(S0),n.state.facet(S0),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(n)&&(i=!0);else{i=!0;let r=[];for(let o of t){let a=e.indexOf(o);a<0?r.push(new _E(this.view,o)):(this.gutters[a].update(n),r.push(this.gutters[a]))}for(let o of this.gutters)o.dom.remove(),r.indexOf(o)<0&&o.destroy();for(let o of r)o.config.side=="after"?this.getDOMAfter().appendChild(o.dom):this.dom.appendChild(o.dom);this.gutters=r}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>nt.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let i=t.dom.offsetWidth*e.scaleX,r=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Kt.LTR?{left:i,right:r}:{right:i,left:r}})});function BE(n){return Array.isArray(n)?n:[n]}function _y(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class uz{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=ht.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:r}=this,o=(t.top-this.height)/e.scaleY,a=t.height/e.scaleY;if(this.i==r.elements.length){let u=new kA(e,a,o,i);r.elements.push(u),r.dom.appendChild(u.dom)}else r.elements[this.i].update(e,a,o,i);this.height=t.bottom,this.i++}line(e,t,i){let r=[];_y(this.cursor,r,t.from),i.length&&(r=r.concat(i));let o=this.gutter.config.lineMarker(e,t,r);o&&r.unshift(o);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),r=i?[i]:null;for(let o of e.state.facet(oz)){let a=o(e,t.widget,t);a&&(r||(r=[])).push(a)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class _E{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,r=>{let o=r.target,a;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let f=o.getBoundingClientRect();a=(f.top+f.bottom)/2}else a=r.clientY;let u=e.lineBlockAtHeight(a-e.documentTop);t.domEventHandlers[i](e,u,r)&&r.preventDefault()});this.markers=BE(t.markers(e)),t.initialSpacer&&(this.spacer=new kA(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=BE(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!ht.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class kA{constructor(e,t,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,r)}update(e,t,i,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),cz(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let i="cm-gutterElement",r=this.dom.firstChild;for(let o=0,a=0;;){let u=a,f=o<t.length?t[o++]:null,d=!1;if(f){let p=f.elementClass;p&&(i+=" "+p);for(let m=a;m<this.markers.length;m++)if(this.markers[m].compare(f)){u=m,d=!0;break}}else u=this.markers.length;for(;a<u;){let p=this.markers[a++];if(p.toDOM){p.destroy(r);let m=r.nextSibling;r.remove(),r=m}}if(!f)break;f.toDOM&&(d?r=r.nextSibling:this.dom.insertBefore(f.toDOM(e),r)),d&&a++}this.dom.className=i,this.markers=t}destroy(){this.setMarkers(null,[])}}function cz(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const fz=Ve.define(),hz=Ve.define(),Wl=Ve.define({combine(n){return DT(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let i=Object.assign({},e);for(let r in t){let o=i[r],a=t[r];i[r]=o?(u,f,d)=>o(u,f,d)||a(u,f,d):a}return i}})}});class w0 extends Zo{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function E0(n,e){return n.state.facet(Wl).formatNumber(e,n.state)}const dz=Qh.compute([Wl],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(fz)},lineMarker(e,t,i){return i.some(r=>r.toDOM)?null:new w0(E0(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let r of e.state.facet(hz)){let o=r(e,t,i);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(Wl)!=e.state.facet(Wl),initialSpacer(e){return new w0(E0(e,PE(e.state.doc.lines)))},updateSpacer(e,t){let i=E0(t.view,PE(t.view.state.doc.lines));return i==e.number?e:new w0(i)},domEventHandlers:n.facet(Wl).domEventHandlers,side:"before"}));function uV(n={}){return[Wl.of(n),lz(),dz]}function PE(n){let e=9;for(;e<n;)e=e*10+9;return e}let pz=0;class Ni{constructor(e,t,i,r){this.name=e,this.set=t,this.base=i,this.modified=r,this.id=pz++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof Ni&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let r=new Ni(i,[],null,[]);if(r.set.push(r),t)for(let o of t.set)r.set.push(o);return r}static defineModifier(e){let t=new Cd(e);return i=>i.modified.indexOf(t)>-1?i:Cd.get(i.base||i,i.modified.concat(t).sort((r,o)=>r.id-o.id))}}let mz=0;class Cd{constructor(e){this.name=e,this.instances=[],this.id=mz++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(u=>u.base==e&&gz(t,u.modified));if(i)return i;let r=[],o=new Ni(e.name,r,e,t);for(let u of t)u.instances.push(o);let a=yz(t);for(let u of e.set)if(!u.modified.length)for(let f of a)r.push(Cd.get(u,f));return o}}function gz(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function yz(n){let e=[[]];for(let t=0;t<n.length;t++)for(let i=0,r=e.length;i<r;i++)e.push(e[i].concat(n[t]));return e.sort((t,i)=>i.length-t.length)}function TA(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let r of t.split(" "))if(r){let o=[],a=2,u=r;for(let m=0;;){if(u=="..."&&m>0&&m+3==r.length){a=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(u);if(!g)throw new RangeError("Invalid path: "+r);if(o.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),m+=g[0].length,m==r.length)break;let v=r[m++];if(m==r.length&&v=="!"){a=0;break}if(v!="/")throw new RangeError("Invalid path: "+r);u=r.slice(m)}let f=o.length-1,d=o[f];if(!d)throw new RangeError("Invalid path: "+r);let p=new Ec(i,a,f>0?o.slice(0,f):null);e[d]=p.sort(e[d])}}return AA.add(e)}const AA=new ft({combine(n,e){let t,i,r;for(;n||e;){if(!n||e&&n.depth>=e.depth?(r=e,e=e.next):(r=n,n=n.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let o=new Ec(r.tags,r.mode,r.context);t?t.next=o:i=o,t=o}return i}});class Ec{constructor(e,t,i,r){this.tags=e,this.mode=t,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Ec.empty=new Ec([],2,null);function OA(n,e){let t=Object.create(null);for(let o of n)if(!Array.isArray(o.tag))t[o.tag.id]=o.class;else for(let a of o.tag)t[a.id]=o.class;let{scope:i,all:r=null}=e||{};return{style:o=>{let a=r;for(let u of o)for(let f of u.set){let d=t[f.id];if(d){a=a?a+" "+d:d;break}}return a},scope:i}}function vz(n,e){let t=null;for(let i of n){let r=i.style(e);r&&(t=t?t+" "+r:r)}return t}function bz(n,e,t,i=0,r=n.length){let o=new xz(i,Array.isArray(e)?e:[e],t);o.highlightRange(n.cursor(),i,r,"",o.highlighters),o.flush(r)}class xz{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,r,o){let{type:a,from:u,to:f}=e;if(u>=i||f<=t)return;a.isTop&&(o=this.highlighters.filter(v=>!v.scope||v.scope(a)));let d=r,p=Sz(e)||Ec.empty,m=vz(o,p.tags);if(m&&(d&&(d+=" "),d+=m,p.mode==1&&(r+=(r?" ":"")+m)),this.startSpan(Math.max(t,u),d),p.opaque)return;let g=e.tree&&e.tree.prop(ft.mounted);if(g&&g.overlay){let v=e.node.enter(g.overlay[0].from+u,1),x=this.highlighters.filter(C=>!C.scope||C.scope(g.tree.type)),w=e.firstChild();for(let C=0,E=u;;C++){let k=C<g.overlay.length?g.overlay[C]:null,T=k?k.from+u:f,A=Math.max(t,E),O=Math.min(i,T);if(A<O&&w)for(;e.from<O&&(this.highlightRange(e,A,O,r,o),this.startSpan(Math.min(O,e.to),d),!(e.to>=T||!e.nextSibling())););if(!k||T>i)break;E=k.to+u,E>t&&(this.highlightRange(v.cursor(),Math.max(t,k.from+u),Math.min(i,E),"",x),this.startSpan(Math.min(i,E),d))}w&&e.parent()}else if(e.firstChild()){g&&(r="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,r,o),this.startSpan(Math.min(i,e.to),d)}while(e.nextSibling());e.parent()}}}function Sz(n){let e=n.type.prop(AA);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const Re=Ni.define,Mh=Re(),Ls=Re(),zE=Re(Ls),HE=Re(Ls),Is=Re(),Dh=Re(Is),C0=Re(Is),gr=Re(),ko=Re(gr),pr=Re(),mr=Re(),Py=Re(),Pu=Re(Py),Nh=Re(),_e={comment:Mh,lineComment:Re(Mh),blockComment:Re(Mh),docComment:Re(Mh),name:Ls,variableName:Re(Ls),typeName:zE,tagName:Re(zE),propertyName:HE,attributeName:Re(HE),className:Re(Ls),labelName:Re(Ls),namespace:Re(Ls),macroName:Re(Ls),literal:Is,string:Dh,docString:Re(Dh),character:Re(Dh),attributeValue:Re(Dh),number:C0,integer:Re(C0),float:Re(C0),bool:Re(Is),regexp:Re(Is),escape:Re(Is),color:Re(Is),url:Re(Is),keyword:pr,self:Re(pr),null:Re(pr),atom:Re(pr),unit:Re(pr),modifier:Re(pr),operatorKeyword:Re(pr),controlKeyword:Re(pr),definitionKeyword:Re(pr),moduleKeyword:Re(pr),operator:mr,derefOperator:Re(mr),arithmeticOperator:Re(mr),logicOperator:Re(mr),bitwiseOperator:Re(mr),compareOperator:Re(mr),updateOperator:Re(mr),definitionOperator:Re(mr),typeOperator:Re(mr),controlOperator:Re(mr),punctuation:Py,separator:Re(Py),bracket:Pu,angleBracket:Re(Pu),squareBracket:Re(Pu),paren:Re(Pu),brace:Re(Pu),content:gr,heading:ko,heading1:Re(ko),heading2:Re(ko),heading3:Re(ko),heading4:Re(ko),heading5:Re(ko),heading6:Re(ko),contentSeparator:Re(gr),list:Re(gr),quote:Re(gr),emphasis:Re(gr),strong:Re(gr),link:Re(gr),monospace:Re(gr),strikethrough:Re(gr),inserted:Re(),deleted:Re(),changed:Re(),invalid:Re(),meta:Nh,documentMeta:Re(Nh),annotation:Re(Nh),processingInstruction:Re(Nh),definition:Ni.defineModifier("definition"),constant:Ni.defineModifier("constant"),function:Ni.defineModifier("function"),standard:Ni.defineModifier("standard"),local:Ni.defineModifier("local"),special:Ni.defineModifier("special")};for(let n in _e){let e=_e[n];e instanceof Ni&&(e.name=n)}const cV=OA([{tag:_e.link,class:"tok-link"},{tag:_e.heading,class:"tok-heading"},{tag:_e.emphasis,class:"tok-emphasis"},{tag:_e.strong,class:"tok-strong"},{tag:_e.keyword,class:"tok-keyword"},{tag:_e.atom,class:"tok-atom"},{tag:_e.bool,class:"tok-bool"},{tag:_e.url,class:"tok-url"},{tag:_e.labelName,class:"tok-labelName"},{tag:_e.inserted,class:"tok-inserted"},{tag:_e.deleted,class:"tok-deleted"},{tag:_e.literal,class:"tok-literal"},{tag:_e.string,class:"tok-string"},{tag:_e.number,class:"tok-number"},{tag:[_e.regexp,_e.escape,_e.special(_e.string)],class:"tok-string2"},{tag:_e.variableName,class:"tok-variableName"},{tag:_e.local(_e.variableName),class:"tok-variableName tok-local"},{tag:_e.definition(_e.variableName),class:"tok-variableName tok-definition"},{tag:_e.special(_e.variableName),class:"tok-variableName2"},{tag:_e.definition(_e.propertyName),class:"tok-propertyName tok-definition"},{tag:_e.typeName,class:"tok-typeName"},{tag:_e.namespace,class:"tok-namespace"},{tag:_e.className,class:"tok-className"},{tag:_e.macroName,class:"tok-macroName"},{tag:_e.propertyName,class:"tok-propertyName"},{tag:_e.operator,class:"tok-operator"},{tag:_e.comment,class:"tok-comment"},{tag:_e.meta,class:"tok-meta"},{tag:_e.invalid,class:"tok-invalid"},{tag:_e.punctuation,class:"tok-punctuation"}]);var R0;const Zl=new ft;function wz(n){return Ve.define({combine:n?e=>e.concat(n):void 0})}const Ez=new ft;class er{constructor(e,t,i=[],r=""){this.data=e,this.name=r,wt.prototype.hasOwnProperty("tree")||Object.defineProperty(wt.prototype,"tree",{get(){return Cr(this)}}),this.parser=t,this.extension=[Ra.of(this),wt.languageData.of((o,a,u)=>{let f=VE(o,a,u),d=f.type.prop(Zl);if(!d)return[];let p=o.facet(d),m=f.type.prop(Ez);if(m){let g=f.resolve(a-f.from,u);for(let v of m)if(v.test(g,o)){let x=o.facet(v.facet);return v.type=="replace"?x:x.concat(p)}}return p})].concat(i)}isActiveAt(e,t,i=-1){return VE(e,t,i).type.prop(Zl)==this.data}findRegions(e){let t=e.facet(Ra);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],r=(o,a)=>{if(o.prop(Zl)==this.data){i.push({from:a,to:a+o.length});return}let u=o.prop(ft.mounted);if(u){if(u.tree.prop(Zl)==this.data){if(u.overlay)for(let f of u.overlay)i.push({from:f.from+a,to:f.to+a});else i.push({from:a,to:a+o.length});return}else if(u.overlay){let f=i.length;if(r(u.tree,u.overlay[0].from+a),i.length>f)return}}for(let f=0;f<o.children.length;f++){let d=o.children[f];d instanceof tn&&r(d,o.positions[f]+a)}};return r(Cr(e),0),i}get allowsNesting(){return!0}}er.setState=zt.define();function VE(n,e,t){let i=n.facet(Ra),r=Cr(n).topNode;if(!i||i.allowsNesting)for(let o=r;o;o=o.enter(e,t,Ft.ExcludeBuffers|Ft.EnterBracketed))o.type.isTop&&(r=o);return r}class Rd extends er{constructor(e,t,i){super(e,t,[],i),this.parser=t}static define(e){let t=wz(e.languageData);return new Rd(t,e.parser.configure({props:[Zl.add(i=>i.isTop?t:void 0)]}),e.name)}configure(e,t){return new Rd(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Cr(n){let e=n.field(er.state,!1);return e?e.tree:tn.empty}class Cz{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e<i||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let zu=null;class kd{constructor(e,t,i=[],r,o,a,u,f){this.parser=e,this.state=t,this.fragments=i,this.tree=r,this.treeLen=o,this.viewport=a,this.skipped=u,this.scheduleOn=f,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new kd(e,t,[],tn.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Cz(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=tn.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(Uo.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Uo.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=zu;zu=this;try{return e()}finally{zu=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=UE(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:r,treeLen:o,viewport:a,skipped:u}=this;if(this.takeTree(),!e.empty){let f=[];if(e.iterChangedRanges((d,p,m,g)=>f.push({fromA:d,toA:p,fromB:m,toB:g})),i=Uo.applyChanges(i,f),r=tn.empty,o=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){u=[];for(let d of this.skipped){let p=e.mapPos(d.from,1),m=e.mapPos(d.to,-1);p<m&&u.push({from:p,to:m})}}}return new kd(this.parser,t,i,r,o,a,u,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:r,to:o}=this.skipped[i];r<e.to&&o>e.from&&(this.fragments=UE(this.fragments,r,o),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends dT{createParse(t,i,r){let o=r[0].from,a=r[r.length-1].to;return{parsedPos:o,advance(){let f=zu;if(f){for(let d of r)f.tempSkipped.push(d);e&&(f.scheduleOn=f.scheduleOn?Promise.all([f.scheduleOn,e]):e)}return this.parsedPos=a,new tn(ni.none,[],[],a-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return zu}}function UE(n,e,t){return Uo.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Ca{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new Ca(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=kd.create(e.facet(Ra).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new Ca(i)}}er.state=so.define({create:Ca.init,update(n,e){for(let t of e.effects)if(t.is(er.setState))return t.value;return e.startState.facet(Ra)!=e.state.facet(Ra)?Ca.init(e.state):n.apply(e)}});let MA=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(MA=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const k0=typeof navigator<"u"&&(!((R0=navigator.scheduling)===null||R0===void 0)&&R0.isInputPending)?()=>navigator.scheduling.isInputPending():null,Rz=nr.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(er.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(er.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=MA(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:r}}=this.view,o=i.field(er.state);if(o.tree==o.context.tree&&o.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!k0?Math.max(25,e.timeRemaining()-5):1e9),u=o.context.treeLen<r&&i.doc.length>r+1e3,f=o.context.work(()=>k0&&k0()||Date.now()>a,r+(u?0:1e5));this.chunkBudget-=Date.now()-t,(f||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:er.setState.of(new Ca(o.context))})),this.chunkBudget>0&&!(f&&!u)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>vi(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ra=Ve.define({combine(n){return n.length?n[0]:null},enables:n=>[er.state,Rz,nt.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class kz{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const Tz=Ve.define(),DA=Ve.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Az(n){let e=n.facet(DA);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function hV(n,e){let t="",i=n.tabSize,r=n.facet(DA)[0];if(r==" "){for(;e>=i;)t+=" ",e-=i;r=" "}for(let o=0;o<e;o++)t+=r;return t}function dV(n,e){n instanceof wt&&(n=new NA(n));for(let i of n.state.facet(Tz)){let r=i(n,e);if(r!==void 0)return r}let t=Cr(n.state);return t.length>=e?Oz(n,t,e):null}class NA{constructor(e,t={}){this.state=e,this.options=t,this.unit=Az(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:o}=this.options;return r!=null&&r>=i.from&&r<=i.to?o&&r==e?{text:"",from:e}:(t<0?r<e:r<=e)?{text:i.text.slice(r-i.from),from:r}:{text:i.text.slice(0,r-i.from),from:i.from}:i}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:r}=this.lineAt(e,t);return i.slice(e-r,Math.min(i.length,e+100-r))}column(e,t=1){let{text:i,from:r}=this.lineAt(e,t),o=this.countColumn(i,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(o+=a-this.countColumn(i,i.search(/\S|$/))),o}countColumn(e,t=e.length){return s_(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:r}=this.lineAt(e,t),o=this.options.overrideIndentation;if(o){let a=o(r);if(a>-1)return a}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const LA=new ft;function Oz(n,e,t){let i=e.resolveStack(t),r=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(r!=i.node){let o=[];for(let a=r;a&&!(a.from<i.node.from||a.to>i.node.to||a.from==i.node.from&&a.type==i.node.type);a=a.parent)o.push(a);for(let a=o.length-1;a>=0;a--)i={node:o[a],next:i}}return IA(i,n,t)}function IA(n,e,t){for(let i=n;i;i=i.next){let r=Dz(i.node);if(r)return r(cb.create(e,t,i))}return 0}function Mz(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Dz(n){let e=n.type.prop(LA);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(ft.closedBy))){let r=n.lastChild,o=r&&i.indexOf(r.name)>-1;return a=>Bz(a,!0,1,void 0,o&&!Mz(a)?r.from:void 0)}return n.parent==null?Nz:null}function Nz(){return 0}class cb extends NA{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new cb(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Lz(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return IA(this.context.next,this.base,this.pos)}}function Lz(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function Iz(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let r=n.options.simulateBreak,o=n.state.doc.lineAt(t.from),a=r==null||r<=o.from?o.to:Math.min(o.to,r);for(let u=t.to;;){let f=e.childAfter(u);if(!f||f==i)return null;if(!f.type.isSkipped){if(f.from>=a)return null;let d=/^ */.exec(o.text.slice(t.to-o.from))[0].length;return{from:t.from,to:t.to+d}}u=f.to}}function Bz(n,e,t,i,r){let o=n.textAfter,a=o.match(/^\s*/)[0].length,u=i&&o.slice(a,a+i.length)==i||r==n.pos+a,f=Iz(n);return f?u?n.column(f.from):n.column(f.to):n.baseIndent+(u?0:n.unit*t)}function _z({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const Pz=new ft;class fb{constructor(e,t){this.specs=e;let i;function r(u){let f=Ws.newName();return(i||(i=Object.create(null)))["."+f]=u,f}const o=typeof t.all=="string"?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof er?u=>u.prop(Zl)==a.data:a?u=>u==a:void 0,this.style=OA(e.map(u=>({tag:u.tag,class:u.class||r(Object.assign({},u,{tag:null}))})),{all:o}).style,this.module=i?new Ws(i):null,this.themeType=t.themeType}static define(e,t){return new fb(e,t||{})}}const zy=Ve.define(),zz=Ve.define({combine(n){return n.length?[n[0]]:null}});function T0(n){let e=n.facet(zy);return e.length?e:n.facet(zz)}function pV(n,e){let t=[Vz],i;return n instanceof fb&&(n.module&&t.push(nt.styleModule.of(n.module)),i=n.themeType),i?t.push(zy.computeN([nt.darkTheme],r=>r.facet(nt.darkTheme)==(i=="dark")?[n]:[])):t.push(zy.of(n)),t}class Hz{constructor(e){this.markCache=Object.create(null),this.tree=Cr(e.state),this.decorations=this.buildDeco(e,T0(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Cr(e.state),i=T0(e.state),r=i!=T0(e.startState),{viewport:o}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<o.to&&!r&&t.type==this.tree.type&&a>=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=o.to)}buildDeco(e,t){if(!t||!this.tree.length)return $t.none;let i=new gc;for(let{from:r,to:o}of e.visibleRanges)bz(this.tree,t,(a,u,f)=>{i.add(a,u,this.markCache[f]||(this.markCache[f]=$t.mark({class:f})))},r,o);return i.finish()}}const Vz=_c.high(nr.fromClass(Hz,{decorations:n=>n.decorations})),Uz=1e4,jz="()[]{}",qz=new ft;function Hy(n,e,t){let i=n.prop(e<0?ft.openedBy:ft.closedBy);if(i)return i;if(n.name.length==1){let r=t.indexOf(n.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function Vy(n){let e=n.type.prop(qz);return e?e(n.node):n}function mV(n,e,t,i={}){let r=i.maxScanDistance||Uz,o=i.brackets||jz,a=Cr(n),u=a.resolveInner(e,t);for(let f=u;f;f=f.parent){let d=Hy(f.type,t,o);if(d&&f.from<f.to){let p=Vy(f);if(p&&(t>0?e>=p.from&&e<p.to:e>p.from&&e<=p.to))return Fz(n,e,t,f,p,d,o)}}return $z(n,e,t,a,u.type,r,o)}function Fz(n,e,t,i,r,o,a){let u=i.parent,f={from:r.from,to:r.to},d=0,p=u?.cursor();if(p&&(t<0?p.childBefore(i.from):p.childAfter(i.to)))do if(t<0?p.to<=i.from:p.from>=i.to){if(d==0&&o.indexOf(p.type.name)>-1&&p.from<p.to){let m=Vy(p);return{start:f,end:m?{from:m.from,to:m.to}:void 0,matched:!0}}else if(Hy(p.type,t,a))d++;else if(Hy(p.type,-t,a)){if(d==0){let m=Vy(p);return{start:f,end:m&&m.from<m.to?{from:m.from,to:m.to}:void 0,matched:!1}}d--}}while(t<0?p.prevSibling():p.nextSibling());return{start:f,matched:!1}}function $z(n,e,t,i,r,o,a){let u=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),f=a.indexOf(u);if(f<0||f%2==0!=t>0)return null;let d={from:t<0?e-1:e,to:t>0?e+1:e},p=n.doc.iterRange(e,t>0?n.doc.length:0),m=0;for(let g=0;!p.next().done&&g<=o;){let v=p.value;t<0&&(g+=v.length);let x=e+g*t;for(let w=t>0?0:v.length-1,C=t>0?v.length:-1;w!=C;w+=t){let E=a.indexOf(v[w]);if(!(E<0||i.resolveInner(x+w,1).type!=r))if(E%2==0==t>0)m++;else{if(m==1)return{start:d,end:{from:x+w,to:x+w+1},matched:E>>1==f>>1};m--}}t>0&&(g+=v.length)}return p.done?{start:d,matched:!1}:null}const Kz=Object.create(null),jE=[ni.none],qE=[],FE=Object.create(null),Yz=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Yz[n]=Gz(Kz,e);function A0(n,e){qE.indexOf(n)>-1||(qE.push(n),console.warn(e))}function Gz(n,e){let t=[];for(let u of e.split(" ")){let f=[];for(let d of u.split(".")){let p=n[d]||_e[d];p?typeof p=="function"?f.length?f=f.map(p):A0(d,`Modifier ${d} used at start of tag`):f.length?A0(d,`Tag ${d} used as modifier`):f=Array.isArray(p)?p:[p]:A0(d,`Unknown highlighting tag ${d}`)}for(let d of f)t.push(d)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+t.map(u=>u.id),o=FE[r];if(o)return o.id;let a=FE[r]=ni.define({id:jE.length,name:i,props:[TA({[i]:t})]});return jE.push(a),a.id}Kt.RTL,Kt.LTR;var $E={};class Td{constructor(e,t,i,r,o,a,u,f,d,p=0,m){this.p=e,this.stack=t,this.state=i,this.reducePos=r,this.pos=o,this.score=a,this.buffer=u,this.bufferBase=f,this.curContext=d,this.lookAhead=p,this.parent=m}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let r=e.parser.context;return new Td(e,[],t,i,i,0,[],0,r?new KE(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,r=e&65535,{parser:o}=this.p,a=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),u=o.dynamicPrecedence(r);if(u&&(this.score+=u),i==0){this.pushState(o.getGoto(this.state,r,!0),this.reducePos),r<o.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,a?8:4,!0),this.reduceContext(r,this.reducePos);return}let f=this.stack.length-(i-1)*3-(e&262144?6:0),d=f?this.stack[f-2]:this.p.ranges[0].from,p=this.reducePos-d;p>=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(d==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=p):this.p.lastBigReductionSize<p&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=d,this.p.lastBigReductionSize=p));let m=f?this.stack[f-1]:0,g=this.bufferBase+this.buffer.length-m;if(r<o.minRepeatTerm||e&131072){let v=o.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,d,v,g+4,!0)}if(e&262144)this.state=this.stack[f];else{let v=this.stack[f-3];this.state=o.getGoto(v,r,!0)}for(;this.stack.length>f;)this.stack.pop();this.reduceContext(r,d)}storeNode(e,t,i,r=4,o=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let a=this,u=this.buffer.length;if(u==0&&a.parent&&(u=a.bufferBase-a.parent.bufferBase,a=a.parent),u>0&&a.buffer[u-4]==0&&a.buffer[u-1]>-1){if(t==i)return;if(a.buffer[u-2]>=t){a.buffer[u-2]=i;return}}}if(!o||this.pos==i)this.buffer.push(e,t,i,r);else{let a=this.buffer.length;if(a>0&&(this.buffer[a-4]!=0||this.buffer[a-1]<0)){let u=!1;for(let f=a;f>0&&this.buffer[f-2]>i;f-=4)if(this.buffer[f-1]>=0){u=!0;break}if(u)for(;a>0&&this.buffer[a-2]>i;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,r>4&&(r-=4)}this.buffer[a]=e,this.buffer[a+1]=t,this.buffer[a+2]=i,this.buffer[a+3]=r}}shift(e,t,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let o=e,{parser:a}=this.p;this.pos=r;let u=a.stateFlag(o,1);!u&&(r>i||t<=a.maxNode)&&(this.reducePos=r),this.pushState(o,u?i:Math.min(i,this.reducePos)),this.shiftContext(t,i),t<=a.maxNode&&this.buffer.push(t,i,r,4)}else this.pos=r,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,r,4)}apply(e,t,i,r){e&65536?this.reduce(e):this.shift(e,t,i,r)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new Td(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Qz(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if((i&65536)==0)return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let o=0,a;o<t.length;o+=2)(a=t[o+1])!=this.state&&this.p.parser.hasAction(a,e)&&r.push(t[o],a);if(this.stack.length<120)for(let o=0;r.length<8&&o<t.length;o+=2){let a=t[o+1];r.some((u,f)=>f&1&&u==a)||r.push(t[o],a)}t=r}let i=[];for(let r=0;r<t.length&&i.length<4;r+=2){let o=t[r+1];if(o==this.state)continue;let a=this.split();a.pushState(o,this.pos),a.storeNode(0,a.pos,a.pos,4,!0),a.shiftContext(t[r],this.pos),a.reducePos=this.pos,a.score-=200,i.push(a)}return i}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((t&65536)==0)return!1;if(!e.validAction(this.state,t)){let i=t>>19,r=t&65535,o=this.stack.length-i*3;if(o<0||e.getGoto(this.stack[o],r,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;t=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(r,o)=>{if(!t.includes(r))return t.push(r),e.allActions(r,a=>{if(!(a&393216))if(a&65536){let u=(a>>19)-o;if(u>1){let f=a&65535,d=this.stack.length-u*3;if(d>=0&&e.getGoto(this.stack[d],f,!1)>=0)return u<<19|65536|f}}else{let u=i(a,o+1);if(u!=null)return u}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new KE(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class KE{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class Qz{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class Ad{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Ad(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Ad(this.stack,this.pos,this.index)}}function Lh(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let i=0,r=0;i<n.length;){let o=0;for(;;){let a=n.charCodeAt(i++),u=!1;if(a==126){o=65535;break}a>=92&&a--,a>=34&&a--;let f=a-32;if(f>=46&&(f-=46,u=!0),o+=f,u)break;o*=46}t?t[r++]=o:t=new e(o)}return t}class Xh{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const YE=new Xh;class Xz{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=YE,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,r=this.rangeIndex,o=this.pos+e;for(;o<i.from;){if(!r)return null;let a=this.ranges[--r];o-=i.from-a.to,i=a}for(;t<0?o>i.to:o>=i.to;){if(r==this.ranges.length-1)return null;let a=this.ranges[++r];o+=a.from-i.to,i=a}return o}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,r;if(t>=0&&t<this.chunk.length)i=this.pos+e,r=this.chunk.charCodeAt(t);else{let o=this.resolveOffset(e,1);if(o==null)return-1;if(i=o,i>=this.chunk2Pos&&i<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(i-this.chunk2Pos);else{let a=this.rangeIndex,u=this.range;for(;u.to<=i;)u=this.ranges[++a];this.chunk2=this.input.chunk(this.chunk2Pos=i),i+this.chunk2.length>u.to&&(this.chunk2=this.chunk2.slice(0,u.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=i}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=YE,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return i}}class ca{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;Zz(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}ca.prototype.contextual=ca.prototype.fallback=ca.prototype.extend=!1;ca.prototype.fallback=ca.prototype.extend=!1;class Wz{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Zz(n,e,t,i,r,o){let a=0,u=1<<i,{dialect:f}=t.p.parser;e:for(;(u&n[a])!=0;){let d=n[a+1];for(let v=a+3;v<d;v+=2)if((n[v+1]&u)>0){let x=n[v];if(f.allows(x)&&(e.token.value==-1||e.token.value==x||Jz(x,e.token.value,r,o))){e.acceptToken(x);break}}let p=e.next,m=0,g=n[a+2];if(e.next<0&&g>m&&n[d+g*3-3]==65535){a=n[d+g*3-1];continue e}for(;m<g;){let v=m+g>>1,x=d+v+(v<<1),w=n[x],C=n[x+1]||65536;if(p<w)g=v;else if(p>=C)m=v+1;else{a=n[x+2],e.advance();continue e}}break}}function GE(n,e,t){for(let i=e,r;(r=n[i])!=65535;i++)if(r==t)return i-e;return-1}function Jz(n,e,t,i){let r=GE(t,i,e);return r<0||GE(t,i,n)<r}const fi=typeof process<"u"&&$E&&/\bparse\b/.test($E.LOG);let O0=null;function QE(n,e,t){let i=n.cursor(Ft.IncludeAnonymous);for(i.moveTo(e);;)if(!(t<0?i.childBefore(e):i.childAfter(e)))for(;;){if((t<0?i.to<e:i.from>e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(n.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:n.length}}class e9{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?QE(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?QE(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let i=this.trees[t],r=this.index[t];if(r==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=i.children[r],a=this.start[t]+i.positions[r];if(a>e)return this.nextStart=a,null;if(o instanceof tn){if(a==e){if(a<this.safeFrom)return null;let u=a+o.length;if(u<=this.safeTo){let f=o.prop(ft.lookAhead);if(!f||u+f<this.fragment.to)return o}}this.index[t]++,a+o.length>=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+o.length}}}class t9{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new Xh)}getActions(e){let t=0,i=null,{parser:r}=e.p,{tokenizers:o}=r,a=r.stateSlot(e.state,3),u=e.curContext?e.curContext.hash:0,f=0;for(let d=0;d<o.length;d++){if((1<<d&a)==0)continue;let p=o[d],m=this.tokens[d];if(!(i&&!p.fallback)&&((p.contextual||m.start!=e.pos||m.mask!=a||m.context!=u)&&(this.updateCachedToken(m,p,e),m.mask=a,m.context=u),m.lookAhead>m.end+25&&(f=Math.max(m.lookAhead,f)),m.value!=0)){let g=t;if(m.extended>-1&&(t=this.addActions(e,m.extended,m.end,t)),t=this.addActions(e,m.value,m.end,t),!p.extend&&(i=m,t>g))break}}for(;this.actions.length>t;)this.actions.pop();return f&&e.setLookAhead(f),!i&&e.pos==this.stream.end&&(i=new Xh,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Xh,{pos:i,p:r}=e;return t.start=i,t.end=Math.min(i+1,r.stream.end),t.value=i==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,i){let r=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(r,e),i),e.value>-1){let{parser:o}=i.p;for(let a=0;a<o.specialized.length;a++)if(o.specialized[a]==e.value){let u=o.specializers[a](this.stream.read(e.start,e.end),i);if(u>=0&&i.p.parser.dialect.allows(u>>1)){(u&1)==0?e.value=u>>1:e.extended=u>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,i,r){for(let o=0;o<r;o+=3)if(this.actions[o]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=i,r}addActions(e,t,i,r){let{state:o}=e,{parser:a}=e.p,{data:u}=a;for(let f=0;f<2;f++)for(let d=a.stateSlot(o,f?2:1);;d+=3){if(u[d]==65535)if(u[d+1]==1)d=Kr(u,d+2);else{r==0&&u[d+1]==2&&(r=this.putAction(Kr(u,d+2),t,i,r));break}u[d]==t&&(r=this.putAction(Kr(u,d+1),t,i,r))}return r}}class n9{constructor(e,t,i,r){this.parser=e,this.input=t,this.ranges=r,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 Xz(t,r),this.tokens=new t9(e,this.stream),this.topTerm=e.top[1];let{from:o}=r[0];this.stacks=[Td.start(this,e.top[0],o)],this.fragments=i.length&&this.stream.end-o>e.bufferLength*4?new e9(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],r,o;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let u=e[a];for(;;){if(this.tokens.mainToken=null,u.pos>t)i.push(u);else{if(this.advanceStack(u,i,e))continue;{r||(r=[],o=[]),r.push(u);let f=this.tokens.getMainToken(u);o.push(f.value,f.end)}}break}}if(!i.length){let a=r&&r9(r);if(a)return fi&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw fi&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let a=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,o,i);if(a)return fi&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(i.length>a)for(i.sort((u,f)=>f.score-u.score);i.length>a;)i.pop();i.some(u=>u.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let a=0;a<i.length-1;a++){let u=i[a];for(let f=a+1;f<i.length;f++){let d=i[f];if(u.sameState(d)||u.buffer.length>500&&d.buffer.length>500)if((u.score-d.score||u.buffer.length-d.buffer.length)>0)i.splice(f--,1);else{i.splice(a--,1);continue e}}}i.length>12&&(i.sort((a,u)=>u.score-a.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let a=1;a<i.length;a++)i[a].pos<this.minStackPos&&(this.minStackPos=i[a].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,i){let r=e.pos,{parser:o}=this,a=fi?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let d=e.curContext&&e.curContext.tracker.strict,p=d?e.curContext.hash:0;for(let m=this.fragments.nodeAt(r);m;){let g=this.parser.nodeSet.types[m.type.id]==m.type?o.getGoto(e.state,m.type.id):-1;if(g>-1&&m.length&&(!d||(m.prop(ft.contextHash)||0)==p))return e.useNode(m,g),fi&&console.log(a+this.stackID(e)+` (via reuse of ${o.getName(m.type.id)})`),!0;if(!(m instanceof tn)||m.children.length==0||m.positions[0]>0)break;let v=m.children[0];if(v instanceof tn&&m.positions[0]==0)m=v;else break}}let u=o.stateSlot(e.state,4);if(u>0)return e.reduce(u),fi&&console.log(a+this.stackID(e)+` (via always-reduce ${o.getName(u&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let f=this.tokens.getActions(e);for(let d=0;d<f.length;){let p=f[d++],m=f[d++],g=f[d++],v=d==f.length||!i,x=v?e:e.split(),w=this.tokens.mainToken;if(x.apply(p,m,w?w.start:x.pos,g),fi&&console.log(a+this.stackID(x)+` (via ${(p&65536)==0?"shift":`reduce of ${o.getName(p&65535)}`} for ${o.getName(m)} @ ${r}${x==e?"":", split"})`),v)return!0;x.pos>r?t.push(x):i.push(x)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return XE(e,t),!0}}runRecovery(e,t,i){let r=null,o=!1;for(let a=0;a<e.length;a++){let u=e[a],f=t[a<<1],d=t[(a<<1)+1],p=fi?this.stackID(u)+" -> ":"";if(u.deadEnd&&(o||(o=!0,u.restart(),fi&&console.log(p+this.stackID(u)+" (restarted)"),this.advanceFully(u,i))))continue;let m=u.split(),g=p;for(let v=0;v<10&&m.forceReduce()&&(fi&&console.log(g+this.stackID(m)+" (via force-reduce)"),!this.advanceFully(m,i));v++)fi&&(g=this.stackID(m)+" -> ");for(let v of u.recoverByInsert(f))fi&&console.log(p+this.stackID(v)+" (via recover-insert)"),this.advanceFully(v,i);this.stream.end>u.pos?(d==u.pos&&(d++,f=0),u.recoverByDelete(f,d),fi&&console.log(p+this.stackID(u)+` (via recover-delete ${this.parser.getName(f)})`),XE(u,i)):(!r||r.score<m.score)&&(r=m)}return r}stackToTree(e){return e.close(),tn.build({buffer:Ad.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(O0||(O0=new WeakMap)).get(e);return t||O0.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function XE(n,e){for(let t=0;t<e.length;t++){let i=e[t];if(i.pos==n.pos&&i.sameState(n)){e[t].score<n.score&&(e[t]=n);return}}e.push(n)}class i9{constructor(e,t,i){this.source=e,this.flags=t,this.disabled=i}allows(e){return!this.disabled||this.disabled[e]==0}}class Od extends dT{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let u=0;u<e.repeatNodeCount;u++)t.push("");let i=Object.keys(e.topRules).map(u=>e.topRules[u][1]),r=[];for(let u=0;u<t.length;u++)r.push([]);function o(u,f,d){r[u].push([f,f.deserialize(String(d))])}if(e.nodeProps)for(let u of e.nodeProps){let f=u[0];typeof f=="string"&&(f=ft[f]);for(let d=1;d<u.length;){let p=u[d++];if(p>=0)o(p,f,u[d++]);else{let m=u[d+-p];for(let g=-p;g>0;g--)o(u[d++],f,m);d++}}}this.nodeSet=new $v(t.map((u,f)=>ni.define({name:f>=this.minRepeatTerm?void 0:u,id:f,props:r[f],top:i.indexOf(f)>-1,error:f==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(f)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=uT;let a=Lh(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let u=0;u<this.specializerSpecs.length;u++)this.specialized[u]=this.specializerSpecs[u].term;this.specializers=this.specializerSpecs.map(WE),this.states=Lh(e.states,Uint32Array),this.data=Lh(e.stateData),this.goto=Lh(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(u=>typeof u=="number"?new ca(a,u):u),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let r=new n9(this,e,t,i);for(let o of this.wrappers)r=o(r,e,t,i);return r}getGoto(e,t,i=!1){let r=this.goto;if(t>=r[0])return-1;for(let o=r[t+1];;){let a=r[o++],u=a&1,f=r[o++];if(u&&i)return f;for(let d=o+(a>>1);o<d;o++)if(r[o]==e)return f;if(u)return-1}}hasAction(e,t){let i=this.data;for(let r=0;r<2;r++)for(let o=this.stateSlot(e,r?2:1),a;;o+=3){if((a=i[o])==65535)if(i[o+1]==1)a=i[o=Kr(i,o+2)];else{if(i[o+1]==2)return Kr(i,o+2);break}if(a==t||a==0)return Kr(i,o+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),r=i?t(i):void 0;for(let o=this.stateSlot(e,1);r==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=Kr(this.data,o+2);else break;r=t(Kr(this.data,o+1))}return r}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Kr(this.data,i+2);else break;if((this.data[i+2]&1)==0){let r=this.data[i+1];t.some((o,a)=>a&1&&o==r)||t.push(this.data[i],r)}}return t}configure(e){let t=Object.assign(Object.create(Od.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(o=>o.from==i);return r?r.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,r)=>{let o=e.specializers.find(u=>u.from==i.external);if(!o)return i;let a=Object.assign(Object.assign({},i),{external:o.to});return t.specializers[r]=WE(a),a})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map(()=>!1);if(e)for(let o of e.split(" ")){let a=t.indexOf(o);a>=0&&(i[a]=!0)}let r=null;for(let o=0;o<t.length;o++)if(!i[o])for(let a=this.dialects[t[o]],u;(u=this.data[a++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[u]=1;return new i9(e,i,r)}static deserialize(e){return new Od(e)}}function Kr(n,e){return n[e]|n[e+1]<<16}function r9(n){let e=null;for(let t of n){let i=t.p.stoppedAt;(t.pos==t.p.stream.end||i!=null&&t.pos>i)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function WE(n){if(n.external){let e=n.extend?1:0;return(t,i)=>n.external(t,i)<<1|e}return n.get}class BA{constructor(e,t,i,r){this.state=e,this.pos=t,this.explicit=i,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=Cr(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),r=t.text.slice(i-t.from,this.pos-t.from),o=r.search(PA(e,!1));return o<0?null:{from:i+o,to:this.pos,text:r.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,i){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function ZE(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function s9(n){let e=Object.create(null),t=Object.create(null);for(let{label:r}of n){e[r[0]]=!0;for(let o=1;o<r.length;o++)t[r[o]]=!0}let i=ZE(e)+ZE(t)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function _A(n){let e=n.map(r=>typeof r=="string"?{label:r}:r),[t,i]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:s9(e);return r=>{let o=r.matchBefore(i);return o||r.explicit?{from:o?o.from:r.pos,options:e,validFor:t}:null}}function o9(n,e){return t=>{for(let i=Cr(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class JE{constructor(e,t,i,r){this.completion=e,this.source=t,this.match=i,this.score=r}}function jo(n){return n.selection.main.from}function PA(n,e){var t;let{source:i}=n,r=e&&i[0]!="^",o=i[i.length-1]!="$";return!r&&!o?n:new RegExp(`${r?"^":""}(?:${i})${o?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const zA=rl.define();function l9(n,e,t,i){let{main:r}=n.selection,o=t-r.from,a=i-r.from;return{...n.changeByRange(u=>{if(u!=r&&t!=i&&n.sliceDoc(u.from+o,u.from+a)!=n.sliceDoc(t,i))return{range:u};let f=n.toText(e);return{changes:{from:u.from+o,to:i==r.from?u.to:u.from+a,insert:f},range:Pe.cursor(u.from+o+f.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const eC=new WeakMap;function a9(n){if(!Array.isArray(n))return n;let e=eC.get(n);return e||eC.set(n,e=_A(n)),e}const Md=zt.define(),Cc=zt.define();class u9{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let i=Oo(e,t),r=Gl(i);this.chars.push(i);let o=e.slice(t,t+r),a=o.toUpperCase();this.folded.push(Oo(a==o?o.toLowerCase():a,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:i,any:r,precise:o,byWord:a}=this;if(t.length==1){let k=Oo(e,0),T=Gl(k),A=T==e.length?0:-100;if(k!=t[0])if(k==i[0])A+=-200;else return null;return this.ret(A,[0,T])}let u=e.indexOf(this.pattern);if(u==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let f=t.length,d=0;if(u<0){for(let k=0,T=Math.min(e.length,200);k<T&&d<f;){let A=Oo(e,k);(A==t[d]||A==i[d])&&(r[d++]=k),k+=Gl(A)}if(d<f)return null}let p=0,m=0,g=!1,v=0,x=-1,w=-1,C=/[a-z]/.test(e),E=!0;for(let k=0,T=Math.min(e.length,200),A=0;k<T&&m<f;){let O=Oo(e,k);u<0&&(p<f&&O==t[p]&&(o[p++]=k),v<f&&(O==t[v]||O==i[v]?(v==0&&(x=k),w=k+1,v++):v=0));let N,M=O<255?O>=48&&O<=57||O>=97&&O<=122?2:O>=65&&O<=90?1:0:(N=KB(O))!=N.toLowerCase()?1:N!=N.toUpperCase()?2:0;(!k||M==1&&C||A==0&&M!=0)&&(t[m]==O||i[m]==O&&(g=!0)?a[m++]=k:a.length&&(E=!1)),A=M,k+=Gl(O)}return m==f&&a[0]==0&&E?this.result(-100+(g?-200:0),a,e):v==f&&x==0?this.ret(-200-e.length+(w==e.length?0:-100),[0,w]):u>-1?this.ret(-700-e.length,[u,u+this.pattern.length]):v==f?this.ret(-900-e.length,[x,w]):m==f?this.result(-100+(g?-200:0)+-700+(E?0:-1100),a,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,i){let r=[],o=0;for(let a of t){let u=a+(this.astral?Gl(Oo(i,a)):1);o&&r[o-1]==a?r[o-1]=u:(r[o++]=a,r[o++]=u)}return this.ret(e-i.length,r)}}class c9{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),i=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return i==null?null:(this.matched=[0,t.length],this.score=i+(e.length==this.pattern.length?0:-100),this)}}const yn=Ve.define({combine(n){return DT(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:f9,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>tC(e(i),t(i)),optionClass:(e,t)=>i=>tC(e(i),t(i)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function tC(n,e){return n?e?n+" "+e:n:e}function f9(n,e,t,i,r,o){let a=n.textDirection==Kt.RTL,u=a,f=!1,d="top",p,m,g=e.left-r.left,v=r.right-e.right,x=i.right-i.left,w=i.bottom-i.top;if(u&&g<Math.min(x,v)?u=!1:!u&&v<Math.min(x,g)&&(u=!0),x<=(u?g:v))p=Math.max(r.top,Math.min(t.top,r.bottom-w))-e.top,m=Math.min(400,u?g:v);else{f=!0,m=Math.min(400,(a?e.right:r.right-e.left)-30);let k=r.bottom-e.bottom;k>=w||k>e.top?p=t.bottom-e.top:(d="bottom",p=e.bottom-t.top)}let C=(e.bottom-e.top)/o.offsetHeight,E=(e.right-e.left)/o.offsetWidth;return{style:`${d}: ${p/C}px; max-width: ${m/E}px`,class:"cm-completionInfo-"+(f?a?"left-narrow":"right-narrow":u?"left":"right")}}function h9(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,r,o){let a=document.createElement("span");a.className="cm-completionLabel";let u=t.displayLabel||t.label,f=0;for(let d=0;d<o.length;){let p=o[d++],m=o[d++];p>f&&a.appendChild(document.createTextNode(u.slice(f,p)));let g=a.appendChild(document.createElement("span"));g.appendChild(document.createTextNode(u.slice(p,m))),g.className="cm-completionMatchedText",f=m}return f<u.length&&a.appendChild(document.createTextNode(u.slice(f))),a},position:50},{render(t){if(!t.detail)return null;let i=document.createElement("span");return i.className="cm-completionDetail",i.textContent=t.detail,i},position:80}),e.sort((t,i)=>t.position-i.position).map(t=>t.render)}function M0(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let r=Math.floor(e/t);return{from:r*t,to:(r+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class d9{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:f=>this.placeInfo(f),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:o,selected:a}=r.open,u=e.state.facet(yn);this.optionContent=h9(u),this.optionClass=u.optionClass,this.tooltipClass=u.tooltipClass,this.range=M0(o.length,a,u.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",f=>{let{options:d}=e.state.field(t).open;for(let p=f.target,m;p&&p!=this.dom;p=p.parentNode)if(p.nodeName=="LI"&&(m=/-(\d+)$/.exec(p.id))&&+m[1]<d.length){this.applyCompletion(e,d[+m[1]]),f.preventDefault();return}}),this.dom.addEventListener("focusout",f=>{let d=e.state.field(this.stateField,!1);d&&d.tooltip&&e.state.facet(yn).closeOnBlur&&f.relatedTarget!=e.contentDOM&&e.dispatch({effects:Cc.of(null)})}),this.showOptions(o,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let i=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=r){let{options:o,selected:a,disabled:u}=i.open;(!r.open||r.open.options!=o)&&(this.range=M0(o.length,a,e.state.facet(yn).maxRenderedOptions),this.showOptions(o,i.id)),this.updateSel(),u!=((t=r.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!u)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=M0(t.options.length,t.selected,this.view.state.facet(yn).maxRenderedOptions),this.showOptions(t.options,e.id));let i=this.updateSelectedOption(t.selected);if(i){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:o}=r;if(!o)return;let a=typeof o=="string"?document.createTextNode(o):o(r);if(!a)return;"then"in a?a.then(u=>{u&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(u,r)}).catch(u=>vi(this.view.state,u,"completion info")):(this.addInfoPane(a,r),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:o}=e;i.appendChild(r),this.infoDestroy=o||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!="LI"||!i.id?r--:r==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return t&&m9(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),o=this.space;if(!o){let a=this.dom.ownerDocument.documentElement;o={left:0,top:0,right:a.clientWidth,bottom:a.clientHeight}}return r.top>Math.min(o.bottom,t.bottom)-10||r.bottom<Math.max(o.top,t.top)+10?null:this.view.state.facet(yn).positionInfo(this.view,t,r,i,o,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,i){const r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true"),r.setAttribute("aria-label",this.view.state.phrase("Completions")),r.addEventListener("mousedown",a=>{a.target==r&&a.preventDefault()});let o=null;for(let a=i.from;a<i.to;a++){let{completion:u,match:f}=e[a],{section:d}=u;if(d){let g=typeof d=="string"?d:d.name;if(g!=o&&(a>i.from||i.from==0))if(o=g,typeof d!="string"&&d.header)r.appendChild(d.header(d));else{let v=r.appendChild(document.createElement("completion-section"));v.textContent=g}}const p=r.appendChild(document.createElement("li"));p.id=t+"-"+a,p.setAttribute("role","option");let m=this.optionClass(u);m&&(p.className=m);for(let g of this.optionContent){let v=g(u,this.view.state,this.view,f);v&&p.appendChild(v)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.to<e.length&&r.classList.add("cm-completionListIncompleteBottom"),r}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function p9(n,e){return t=>new d9(t,n,e)}function m9(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),r=t.height/n.offsetHeight;i.top<t.top?n.scrollTop-=(t.top-i.top)/r:i.bottom>t.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/r)}function nC(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function g9(n,e){let t=[],i=null,r=null,o=p=>{t.push(p);let{section:m}=p.completion;if(m){i||(i=[]);let g=typeof m=="string"?m:m.name;i.some(v=>v.name==g)||i.push(typeof m=="string"?{name:g}:m)}},a=e.facet(yn);for(let p of n)if(p.hasResult()){let m=p.result.getMatch;if(p.result.filter===!1)for(let g of p.result.options)o(new JE(g,p.source,m?m(g):[],1e9-t.length));else{let g=e.sliceDoc(p.from,p.to),v,x=a.filterStrict?new c9(g):new u9(g);for(let w of p.result.options)if(v=x.match(w.label)){let C=w.displayLabel?m?m(w,v.matched):[]:v.matched,E=v.score+(w.boost||0);if(o(new JE(w,p.source,C,E)),typeof w.section=="object"&&w.section.rank==="dynamic"){let{name:k}=w.section;r||(r=Object.create(null)),r[k]=Math.max(E,r[k]||-1e9)}}}}if(i){let p=Object.create(null),m=0,g=(v,x)=>(v.rank==="dynamic"&&x.rank==="dynamic"?r[x.name]-r[v.name]:0)||(typeof v.rank=="number"?v.rank:1e9)-(typeof x.rank=="number"?x.rank:1e9)||(v.name<x.name?-1:1);for(let v of i.sort(g))m-=1e5,p[v.name]=m;for(let v of t){let{section:x}=v.completion;x&&(v.score+=p[typeof x=="string"?x:x.name])}}let u=[],f=null,d=a.compareCompletions;for(let p of t.sort((m,g)=>g.score-m.score||d(m.completion,g.completion))){let m=p.completion;!f||f.label!=m.label||f.detail!=m.detail||f.type!=null&&m.type!=null&&f.type!=m.type||f.apply!=m.apply||f.boost!=m.boost?u.push(p):nC(p.completion)>nC(f)&&(u[u.length-1]=p),f=p.completion}return u}class Jl{constructor(e,t,i,r,o,a){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=r,this.selected=o,this.disabled=a}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Jl(this.options,iC(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,r,o,a){if(r&&!a&&e.some(d=>d.isPending))return r.setDisabled();let u=g9(e,t);if(!u.length)return r&&e.some(d=>d.isPending)?r.setDisabled():null;let f=t.facet(yn).selectOnOpen?0:-1;if(r&&r.selected!=f&&r.selected!=-1){let d=r.options[r.selected].completion;for(let p=0;p<u.length;p++)if(u[p].completion==d){f=p;break}}return new Jl(u,iC(i,f),{pos:e.reduce((d,p)=>p.hasResult()?Math.min(d,p.from):d,1e8),create:w9,above:o.aboveCursor},r?r.timestamp:Date.now(),f,!1)}map(e){return new Jl(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Jl(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Dd{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new Dd(x9,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(yn),o=(i.override||t.languageDataAt("autocomplete",jo(t)).map(a9)).map(f=>(this.active.find(p=>p.source==f)||new _i(f,this.active.some(p=>p.state!=0)?1:0)).update(e,i));o.length==this.active.length&&o.every((f,d)=>f==this.active[d])&&(o=this.active);let a=this.open,u=e.effects.some(f=>f.is(hb));a&&e.docChanged&&(a=a.map(e.changes)),e.selection||o.some(f=>f.hasResult()&&e.changes.touchesRange(f.from,f.to))||!y9(o,this.active)||u?a=Jl.build(o,t,this.id,a,i,u):a&&a.disabled&&!o.some(f=>f.isPending)&&(a=null),!a&&o.every(f=>!f.isPending)&&o.some(f=>f.hasResult())&&(o=o.map(f=>f.hasResult()?new _i(f.source,0):f));for(let f of e.effects)f.is(VA)&&(a=a&&a.setSelected(f.value,this.id));return o==this.active&&a==this.open?this:new Dd(o,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?v9:b9}}function y9(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t<n.length&&!n[t].hasResult();)t++;for(;i<e.length&&!e[i].hasResult();)i++;let r=t==n.length,o=i==e.length;if(r||o)return r==o;if(n[t++].result!=e[i++].result)return!1}}const v9={"aria-autocomplete":"list"},b9={};function iC(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const x9=[];function HA(n,e){if(n.isUserEvent("input.complete")){let i=n.annotation(zA);if(i&&e.activateOnCompletion(i))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class _i{constructor(e,t,i=!1){this.source=e,this.state=t,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let i=HA(e,t),r=this;(i&8||i&16&&this.touches(e))&&(r=new _i(r.source,0)),i&4&&r.state==0&&(r=new _i(this.source,1)),r=r.updateFor(e,i);for(let o of e.effects)if(o.is(Md))r=new _i(r.source,1,o.value);else if(o.is(Cc))r=new _i(r.source,0);else if(o.is(hb))for(let a of o.value)a.source==r.source&&(r=a);return r}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(jo(e.state))}}class fa extends _i{constructor(e,t,i,r,o,a){super(e,3,t),this.limit=i,this.result=r,this.from=o,this.to=a}hasResult(){return!0}updateFor(e,t){var i;if(!(t&3))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let o=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),u=jo(e.state);if(u>a||!r||t&2&&(jo(e.startState)==this.from||u<this.limit))return new _i(this.source,t&4?1:0);let f=e.changes.mapPos(this.limit);return S9(r.validFor,e.state,o,a)?new fa(this.source,this.explicit,f,r,o,a):r.update&&(r=r.update(r,o,a,new BA(e.state,u,!1)))?new fa(this.source,this.explicit,f,r,r.from,(i=r.to)!==null&&i!==void 0?i:jo(e.state)):new _i(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new fa(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new _i(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function S9(n,e,t,i){if(!n)return!1;let r=e.sliceDoc(t,i);return typeof n=="function"?n(r,t,i,e):PA(n,!0).test(r)}const hb=zt.define({map(n,e){return n.map(t=>t.map(e))}}),VA=zt.define(),zn=so.define({create(){return Dd.start()},update(n,e){return n.update(e)},provide:n=>[CA.from(n,e=>e.tooltip),nt.contentAttributes.from(n,e=>e.attrs)]});function db(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(zn).active.find(r=>r.source==e.source);return i instanceof fa?(typeof t=="string"?n.dispatch({...l9(n.state,t,i.from,i.to),annotations:zA.of(e.completion)}):t(n,e.completion,i.from,i.to),!0):!1}const w9=p9(zn,db);function Ih(n,e="option"){return t=>{let i=t.state.field(zn,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<t.state.facet(yn).interactionDelay)return!1;let r=1,o;e=="page"&&(o=RA(t,i.open.tooltip))&&(r=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:a}=i.open.options,u=i.open.selected>-1?i.open.selected+r*(n?1:-1):n?0:a-1;return u<0?u=e=="page"?0:a-1:u>=a&&(u=e=="page"?a-1:0),t.dispatch({effects:VA.of(u)}),!0}}const E9=n=>{let e=n.state.field(zn,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet(yn).interactionDelay?!1:db(n,e.open.options[e.open.selected])},D0=n=>n.state.field(zn,!1)?(n.dispatch({effects:Md.of(!0)}),!0):!1,C9=n=>{let e=n.state.field(zn,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Cc.of(null)}),!0)};class R9{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const k9=50,T9=1e3,A9=nr.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(zn).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(zn),t=n.state.facet(yn);if(!n.selectionSet&&!n.docChanged&&n.startState.field(zn)==e)return;let i=n.transactions.some(o=>{let a=HA(o,t);return a&8||(o.selection||o.docChanged)&&!(a&3)});for(let o=0;o<this.running.length;o++){let a=this.running[o];if(i||a.context.abortOnDocChange&&n.docChanged||a.updates.length+n.transactions.length>k9&&Date.now()-a.time>T9){for(let u of a.context.abortListeners)try{u()}catch(f){vi(this.view.state,f)}a.context.abortListeners=null,this.running.splice(o--,1)}else a.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(o=>o.effects.some(a=>a.is(Md)))&&(this.pendingStart=!0);let r=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(o=>o.isPending&&!this.running.some(a=>a.active.source==o.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let o of n.transactions)o.isUserEvent("input.type")?this.composing=2:this.composing==2&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(zn);for(let t of e.active)t.isPending&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(yn).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=jo(e),i=new BA(e,t,n.explicit,this.view),r=new R9(n,i);this.running.push(r),Promise.resolve(n.source(i)).then(o=>{r.context.aborted||(r.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:Cc.of(null)}),vi(this.view.state,o)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(yn).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(yn),i=this.view.state.field(zn);for(let r=0;r<this.running.length;r++){let o=this.running[r];if(o.done===void 0)continue;if(this.running.splice(r--,1),o.done){let u=jo(o.updates.length?o.updates[0].startState:this.view.state),f=Math.min(u,o.done.from+(o.active.explicit?0:1)),d=new fa(o.active.source,o.active.explicit,f,o.done,o.done.from,(n=o.done.to)!==null&&n!==void 0?n:u);for(let p of o.updates)d=d.update(p,t);if(d.hasResult()){e.push(d);continue}}let a=i.active.find(u=>u.source==o.active.source);if(a&&a.isPending)if(o.done==null){let u=new _i(o.active.source,0);for(let f of o.updates)u=u.update(f,t);u.isPending||e.push(u)}else this.startQuery(a)}(e.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:hb.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(zn,!1);if(e&&e.tooltip&&this.view.state.facet(yn).closeOnBlur){let t=e.open&&RA(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Cc.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Md.of(!1)}),20),this.composing=0}}}),O9=typeof navigator=="object"&&/Win/.test(navigator.platform),M9=_c.highest(nt.domEventHandlers({keydown(n,e){let t=e.state.field(zn,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(O9&&n.altKey)||n.metaKey)return!1;let i=t.open.options[t.open.selected],r=t.active.find(a=>a.source==i.source),o=i.completion.commitCharacters||r.result.commitCharacters;return o&&o.indexOf(n.key)>-1&&db(e,i),!1}})),D9=nt.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"}}}),UA=new class extends Xs{};UA.startSide=1;UA.endSide=-1;function gV(n={}){return[M9,zn,yn.of(n),A9,L9,D9]}const N9=[{key:"Ctrl-Space",run:D0},{mac:"Alt-`",run:D0},{mac:"Alt-i",run:D0},{key:"Escape",run:C9},{key:"ArrowDown",run:Ih(!0)},{key:"ArrowUp",run:Ih(!1)},{key:"PageDown",run:Ih(!0,"page")},{key:"PageUp",run:Ih(!1,"page")},{key:"Enter",run:E9}],L9=_c.highest(wA.computeN([yn],n=>n.facet(yn).defaultKeymap?[N9]:[]));function yV(n){let e=n.field(zn,!1);return e&&e.active.some(t=>t.isPending)?"pending":e&&e.active.some(t=>t.state!=0)?"active":null}const I9=36,rC=1,B9=2,$l=3,N0=4,_9=5,P9=6,z9=7,H9=8,V9=9,U9=10,j9=11,q9=12,F9=13,$9=14,K9=15,Y9=16,G9=17,sC=18,Q9=19,jA=20,qA=21,oC=22,X9=23,W9=24;function Uy(n){return n>=65&&n<=90||n>=97&&n<=122||n>=48&&n<=57}function Z9(n){return n>=48&&n<=57||n>=97&&n<=102||n>=65&&n<=70}function Do(n,e,t){for(let i=!1;;){if(n.next<0)return;if(n.next==e&&!i){n.advance();return}i=t&&!i&&n.next==92,n.advance()}}function J9(n,e){e:for(;;){if(n.next<0)return;if(n.next==36){n.advance();for(let t=0;t<e.length;t++){if(n.next!=e.charCodeAt(t))continue e;n.advance()}if(n.next==36){n.advance();return}}else n.advance()}}function e7(n,e){let t="[{<(".indexOf(String.fromCharCode(e)),i=t<0?e:"]}>)".charCodeAt(t);for(;;){if(n.next<0)return;if(n.next==i&&n.peek(1)==39){n.advance(2);return}n.advance()}}function jy(n,e){for(;!(n.next!=95&&!Uy(n.next));)e!=null&&(e+=String.fromCharCode(n.next)),n.advance();return e}function t7(n){if(n.next==39||n.next==34||n.next==96){let e=n.next;n.advance(),Do(n,e,!1)}else jy(n)}function lC(n,e){for(;n.next==48||n.next==49;)n.advance();e&&n.next==e&&n.advance()}function aC(n,e){for(;;){if(n.next==46){if(e)break;e=!0}else if(n.next<48||n.next>57)break;n.advance()}if(n.next==69||n.next==101)for(n.advance(),(n.next==43||n.next==45)&&n.advance();n.next>=48&&n.next<=57;)n.advance()}function uC(n){for(;!(n.next<0||n.next==10);)n.advance()}function To(n,e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)==n)return!0;return!1}const L0=` \r
|
|
38
|
+
`;function FA(n,e,t){let i=Object.create(null);i.true=i.false=_9,i.null=i.unknown=P9;for(let r of n.split(" "))r&&(i[r]=jA);for(let r of e.split(" "))r&&(i[r]=qA);for(let r of(t||"").split(" "))r&&(i[r]=W9);return i}const n7="array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying ",i7="absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone ",qy={backslashEscapes:!1,hashComments:!1,spaceAfterDashes:!1,slashComments:!1,doubleQuotedStrings:!1,doubleDollarQuotedStrings:!1,unquotedBitLiterals:!1,treatBitsAsBytes:!1,charSetCasts:!1,plsqlQuotingMechanism:!1,operatorChars:"*+-%<>!=&|~^/",specialVar:"?",identifierQuotes:'"',caseInsensitiveIdentifiers:!1,words:FA(i7,n7)};function r7(n,e,t,i){let r={};for(let o in qy)r[o]=(n.hasOwnProperty(o)?n:qy)[o];return e&&(r.words=FA(e,t||"",i)),r}function $A(n){return new Wz(e=>{var t;let{next:i}=e;if(e.advance(),To(i,L0)){for(;To(e.next,L0);)e.advance();e.acceptToken(I9)}else if(i==36&&n.doubleDollarQuotedStrings){let r=jy(e,"");e.next==36&&(e.advance(),J9(e,r),e.acceptToken($l))}else if(i==39||i==34&&n.doubleQuotedStrings)Do(e,i,n.backslashEscapes),e.acceptToken($l);else if(i==35&&n.hashComments||i==47&&e.next==47&&n.slashComments)uC(e),e.acceptToken(rC);else if(i==45&&e.next==45&&(!n.spaceAfterDashes||e.peek(1)==32))uC(e),e.acceptToken(rC);else if(i==47&&e.next==42){e.advance();for(let r=1;;){let o=e.next;if(e.next<0)break;if(e.advance(),o==42&&e.next==47){if(r--,e.advance(),!r)break}else o==47&&e.next==42&&(r++,e.advance())}e.acceptToken(B9)}else if((i==101||i==69)&&e.next==39)e.advance(),Do(e,39,!0),e.acceptToken($l);else if((i==110||i==78)&&e.next==39&&n.charSetCasts)e.advance(),Do(e,39,n.backslashEscapes),e.acceptToken($l);else if(i==95&&n.charSetCasts)for(let r=0;;r++){if(e.next==39&&r>1){e.advance(),Do(e,39,n.backslashEscapes),e.acceptToken($l);break}if(!Uy(e.next))break;e.advance()}else if(n.plsqlQuotingMechanism&&(i==113||i==81)&&e.next==39&&e.peek(1)>0&&!To(e.peek(1),L0)){let r=e.peek(1);e.advance(2),e7(e,r),e.acceptToken($l)}else if(To(i,n.identifierQuotes)){const r=i==91?93:i;Do(e,r,!1),e.acceptToken(Q9)}else if(i==40)e.acceptToken(z9);else if(i==41)e.acceptToken(H9);else if(i==123)e.acceptToken(V9);else if(i==125)e.acceptToken(U9);else if(i==91)e.acceptToken(j9);else if(i==93)e.acceptToken(q9);else if(i==59)e.acceptToken(F9);else if(n.unquotedBitLiterals&&i==48&&e.next==98)e.advance(),lC(e),e.acceptToken(oC);else if((i==98||i==66)&&(e.next==39||e.next==34)){const r=e.next;e.advance(),n.treatBitsAsBytes?(Do(e,r,n.backslashEscapes),e.acceptToken(X9)):(lC(e,r),e.acceptToken(oC))}else if(i==48&&(e.next==120||e.next==88)||(i==120||i==88)&&e.next==39){let r=e.next==39;for(e.advance();Z9(e.next);)e.advance();r&&e.next==39&&e.advance(),e.acceptToken(N0)}else if(i==46&&e.next>=48&&e.next<=57)aC(e,!0),e.acceptToken(N0);else if(i==46)e.acceptToken($9);else if(i>=48&&i<=57)aC(e,!1),e.acceptToken(N0);else if(To(i,n.operatorChars)){for(;To(e.next,n.operatorChars);)e.advance();e.acceptToken(K9)}else if(To(i,n.specialVar))e.next==i&&e.advance(),t7(e),e.acceptToken(G9);else if(i==58||i==44)e.acceptToken(Y9);else if(Uy(i)){let r=jy(e,String.fromCharCode(i));e.acceptToken(e.next==46||e.peek(-r.length-1)==46?sC:(t=n.words[r.toLowerCase()])!==null&&t!==void 0?t:sC)}})}const KA=$A(qy),s7=Od.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,nodeProps:[["isolate",-4,1,2,3,19,""]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,KA],topRules:{Script:[0,25]},tokenPrec:0});function Fy(n){let e=n.cursor().moveTo(n.from,-1);for(;/Comment/.test(e.name);)e.moveTo(e.from,-1);return e.node}function Rc(n,e){let t=n.sliceString(e.from,e.to),i=/^([`'"\[])(.*)([`'"\]])$/.exec(t);return i?i[2]:t}function Nd(n){return n&&(n.name=="Identifier"||n.name=="QuotedIdentifier")}function o7(n,e){if(e.name=="CompositeIdentifier"){let t=[];for(let i=e.firstChild;i;i=i.nextSibling)Nd(i)&&t.push(Rc(n,i));return t}return[Rc(n,e)]}function cC(n,e){for(let t=[];;){if(!e||e.name!=".")return t;let i=Fy(e);if(!Nd(i))return t;t.unshift(Rc(n,i)),e=Fy(i)}}function l7(n,e){let t=Cr(n).resolveInner(e,-1),i=u7(n.doc,t);return t.name=="Identifier"||t.name=="QuotedIdentifier"||t.name=="Keyword"?{from:t.from,quoted:t.name=="QuotedIdentifier"?n.doc.sliceString(t.from,t.from+1):null,parents:cC(n.doc,Fy(t)),aliases:i}:t.name=="."?{from:e,quoted:null,parents:cC(n.doc,t),aliases:i}:{from:e,quoted:null,parents:[],empty:!0,aliases:i}}const a7=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function u7(n,e){let t;for(let r=e;!t;r=r.parent){if(!r)return null;r.name=="Statement"&&(t=r)}let i=null;for(let r=t.firstChild,o=!1,a=null;r;r=r.nextSibling){let u=r.name=="Keyword"?n.sliceString(r.from,r.to).toLowerCase():null,f=null;if(!o)o=u=="from";else if(u=="as"&&a&&Nd(r.nextSibling))f=Rc(n,r.nextSibling);else{if(u&&a7.has(u))break;a&&Nd(r)&&(f=Rc(n,r))}f&&(i||(i=Object.create(null)),i[f]=o7(n,a)),a=/Identifier$/.test(r.name)?r:null}return i}function c7(n,e,t){return t.map(i=>({...i,label:i.label[0]==n?i.label:n+i.label+e,apply:void 0}))}const f7=/^\w*$/,h7=/^[`'"\[]?\w*[`'"\]]?$/;function fC(n){return n.self&&typeof n.self.label=="string"}class pb{constructor(e,t){this.idQuote=e,this.idCaseInsensitive=t,this.list=[],this.children=void 0}child(e){let t=this.children||(this.children=Object.create(null)),i=t[e];return i||(e&&!this.list.some(r=>r.label==e)&&this.list.push(hC(e,"type",this.idQuote,this.idCaseInsensitive)),t[e]=new pb(this.idQuote,this.idCaseInsensitive))}maybeChild(e){return this.children?this.children[e]:null}addCompletion(e){let t=this.list.findIndex(i=>i.label==e.label);t>-1?this.list[t]=e:this.list.push(e)}addCompletions(e){for(let t of e)this.addCompletion(typeof t=="string"?hC(t,"property",this.idQuote,this.idCaseInsensitive):t)}addNamespace(e){Array.isArray(e)?this.addCompletions(e):fC(e)?this.addNamespace(e.children):this.addNamespaceObject(e)}addNamespaceObject(e){for(let t of Object.keys(e)){let i=e[t],r=null,o=t.replace(/\\?\./g,u=>u=="."?"\0":u).split("\0"),a=this;fC(i)&&(r=i.self,i=i.children);for(let u=0;u<o.length;u++)r&&u==o.length-1&&a.addCompletion(r),a=a.child(o[u].replace(/\\\./g,"."));a.addNamespace(i)}}}function hC(n,e,t,i){return new RegExp("^[a-z_][a-z_\\d]*$",i?"i":"").test(n)?{label:n,type:e}:{label:n,type:e,apply:t+n+YA(t)}}function YA(n){return n==="["?"]":n}function d7(n,e,t,i,r,o){var a;let u=((a=o?.spec.identifierQuotes)===null||a===void 0?void 0:a[0])||'"',f=new pb(u,!!o?.spec.caseInsensitiveIdentifiers),d=r?f.child(r):null;return f.addNamespace(n),e&&(d||f).addCompletions(e),t&&f.addCompletions(t),d&&f.addCompletions(d.list),i&&f.addCompletions((d||f).child(i).list),p=>{let{parents:m,from:g,quoted:v,empty:x,aliases:w}=l7(p.state,p.pos);if(x&&!p.explicit)return null;w&&m.length==1&&(m=w[m[0]]||m);let C=f;for(let k of m){for(;!C.children||!C.children[k];)if(C==f&&d)C=d;else if(C==d&&i)C=C.child(i);else return null;let T=C.maybeChild(k);if(!T)return null;C=T}let E=C.list;if(C==f&&w&&(E=E.concat(Object.keys(w).map(k=>({label:k,type:"constant"})))),v){let k=v[0],T=YA(k),A=p.state.sliceDoc(p.pos,p.pos+1)==T;return{from:g,to:A?p.pos+1:void 0,options:c7(k,T,E),validFor:h7}}else return{from:g,options:E,validFor:f7}}}function p7(n){return n==qA?"type":n==jA?"keyword":"variable"}function m7(n,e,t){let i=Object.keys(n).map(r=>t(e?r.toUpperCase():r,p7(n[r])));return o9(["QuotedIdentifier","String","LineComment","BlockComment","."],_A(i))}let g7=s7.configure({props:[LA.add({Statement:_z()}),Pz.add({Statement(n,e){return{from:Math.min(n.from+100,e.doc.lineAt(n.from).to),to:n.to}},BlockComment(n){return{from:n.from+2,to:n.to-2}}}),TA({Keyword:_e.keyword,Type:_e.typeName,Builtin:_e.standard(_e.name),Bits:_e.number,Bytes:_e.string,Bool:_e.bool,Null:_e.null,Number:_e.number,String:_e.string,Identifier:_e.name,QuotedIdentifier:_e.special(_e.string),SpecialVar:_e.special(_e.name),LineComment:_e.lineComment,BlockComment:_e.blockComment,Operator:_e.operator,"Semi Punctuation":_e.punctuation,"( )":_e.paren,"{ }":_e.brace,"[ ]":_e.squareBracket})]});class kc{constructor(e,t,i){this.dialect=e,this.language=t,this.spec=i}get extension(){return this.language.extension}configureLanguage(e,t){return new kc(this.dialect,this.language.configure(e,t),this.spec)}static define(e){let t=r7(e,e.keywords,e.types,e.builtin),i=Rd.define({name:"sql",parser:g7.configure({tokenizers:[{from:KA,to:$A(t)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new kc(t,i,e)}}function y7(n,e){return{label:n,type:e,boost:-1}}function v7(n,e=!1,t){return m7(n.dialect.words,e,t||y7)}function b7(n){return n.schema?d7(n.schema,n.tables,n.schemas,n.defaultTable,n.defaultSchema,n.dialect||mb):()=>null}function x7(n){return n.schema?(n.dialect||mb).language.data.of({autocomplete:b7(n)}):[]}function vV(n={}){let e=n.dialect||mb;return new kz(e.language,[x7(n),e.language.data.of({autocomplete:v7(e,n.upperCaseKeywords,n.keywordCompletion)})])}const mb=kc.define({}),GA=["abs","changes","char","coalesce","glob","hex","ifnull","iif","instr","last_insert_rowid","length","like","likelihood","likely","load_extension","lower","ltrim","max","min","random","randomblob","replace","round","rtrim","soundex","sqlite_compileoption_get","sqlite_compileoption_used","sqlite_source_id","sqlite_version","substr","substring","total_changes","trim","typeof","unhex","unicode","unistr_quote","unistr","unlikely","upper","zeroblob","date","datetime","julianday","strftime","time","timediff","unixepoch","avg","count","count","group_concat","max","min","sum","total","acos","asin","atan","atan2","ceil","ceiling","cos","cosh","degrees","exp","floor","ln","log","log10","mod","pi","pow","power","radians","rand","sign","sin","sinh","sqrt","tan","tanh","trunc","json_array_length","json_extract","json_insert","json_patch","json_quote","json_remove","json_replace","json_set","json_type","json_valid","json"],S7=["ABORT","ADD","AFTER","ALL","ALTER","ALWAYS","ANALYZE","AND","AS","ASC","ATTACH","AUTOINCREMENT","BEFORE","BEGIN","BETWEEN","BY","CASCADE","CASE","CAST","CHECK","COLLATE","COLUMN","COMMIT","CONFLICT","CONSTRAINT","CREATE","CROSS","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","DATABASE","DEFAULT","DEFERRABLE","DEFERRED","DELETE","DESC","DETACH","DISTINCT","DROP","EACH","ELSE","ESCAPE","EXCEPT","EXCLUSIVE","EXISTS","EXPLAIN","FAIL","FOR","FOREIGN","FROM","FULL","GENERATED","GLOB","GROUP","HAVING","IF","IGNORE","IMMEDIATE","IN","INDEX","INITIALLY","INNER","INSERT","INSTEAD","INTERSECT","INTO","IS","ISNULL","JOIN","KEY","LEFT","LIKE","LIMIT","MATCH","NATURAL","NOT","NOTNULL","NULL","OF","OFFSET","ON","OR","ORDER","OUTER","PLAN","PRAGMA","PRIMARY","QUERY","RAISE","REFERENCES","REGEXP","REINDEX","RENAME","REPLACE","RESTRICT","RIGHT","ROLLBACK","ROW","SELECT","SET","TABLE","TEMP","TEMPORARY","THEN","TO","TRANSACTION","TRIGGER","UNION","UNIQUE","UPDATE","USING","VACUUM","VALUES","VIEW","VIRTUAL","WHEN","WHERE"],w7=["BIGINT","INT","INT2","INT8","INTEGER","MEDIUMINT","SMALLINT","TINYINT","UNSIGNED BIG INT","CHARACTER","CLOB","NATIVE CHARACTER","NCHAR","NVARCHAR","TEXT","VARCHAR","VARYING CHARACTER","DOUBLE PRECISION","DOUBLE","FLOAT","REAL","BOOLEAN","DATE","DATETIME","DECIMAL","NUMERIC","BLOB"],bV=kc.define({keywords:[...S7,...GA,...w7].join(" ").toLowerCase(),builtin:"",types:"",operatorChars:"*/+-%<>!=~",doubleQuotedStrings:!0,charSetCasts:!1}),E7=/^\s+/,C7=/^(`([^`\n]|``)+`|"([^"\n]|"")+"|\[[^\]\n]+\]|[a-zA-Z_][a-zA-Z0-9_]*)/,R7=/^(?:'(?:[^'\n]|'')*'|"(?:[^"\n]|"")*")/,k7=/^\d+(\.\d+)?/,T7=/^:[a-zA-Z_][a-zA-Z0-9_]*/,A7=/^(--.*|\/\*[\s\S]*?\*\/)/,O7=/^(::|<>|!=|<=|>=|=|<|>|\+|-|\*|\/)/,M7=/^[`,;().]/,D7=[{matchToken:n=>E7.exec(n)?.[0]??null,type:"WHITESPACE"},{matchToken:n=>C7.exec(n)?.[0]??null,type:"IDENTIFIER"},{matchToken:n=>R7.exec(n)?.[0]??null,type:"STRING"},{matchToken:n=>k7.exec(n)?.[0]??null,type:"NUMBER"},{matchToken:n=>T7.exec(n)?.[0]??null,type:"PLACEHOLDER"},{matchToken:n=>A7.exec(n)?.[0]??null,type:"COMMENT"},{matchToken:n=>O7.exec(n)?.[0]??null,type:"OPERATOR"},{matchToken:n=>M7.exec(n)?.[0]??null,type:"PUNCTUATION"}];function ka(n,e){try{const t=new Array,i=n.length;let r=0,o="";for(;r<i;){let a=!1;const u=n.substring(r);for(const{type:f,matchToken:d}of D7){const p=d(u);if(p){o!==""&&(t.push({type:"UNKNOWN",value:o}),o=""),t.push({type:f,value:p}),r+=p.length,a=!0;break}}a||(o+=u[0],r++)}return o!==""&&t.push({type:"UNKNOWN",value:o}),t}catch{return[{type:"SQL",value:n}]}}function xV(n,e){const t=ka(n).filter(o=>o.type!=="WHITESPACE"),i=N7(t,GA).map(o=>o.value).join("").trim(),r=ka(i).filter(o=>o.type!=="WHITESPACE");if(r.length!==t.length)throw new Error("Fail to format the query");for(let o=0;o<r.length;o++){const a=t[o],u=r[o];if(a.value!==u.value)throw new Error(`Fail to format the query at token #${o}: "${a.value}" -> "${u.value}"`)}return i}function N7(n,e){const t=new Array,i=new Set(e.map(o=>o.toUpperCase()));let r=new Array;for(let o=0;o<n.length;o++){const a=n[o],u=o>0?n[o-1]:void 0,f=a.value.toUpperCase();if(a.type==="COMMENT"){Bh(t)&&hi(t,r),t.push(a),hi(t,r);continue}if(["SELECT","SET","WHERE"].includes(f)){for(;["SET","JOIN"].includes($r(r)??"");)r.pop();Bh(t)&&hi(t,r),t.push(a),r.push(f),hi(t,r);continue}if(["INNER","LEFT","RIGHT"].includes(f)){$r(r)!=="JOIN"&&r.push("JOIN"),hi(t,r),t.push(a);continue}if(f==="FROM"){$r(r)==="SELECT"&&r.pop(),hi(t,r),t.push(a);continue}if(["VALUES","ORDER","GROUP","LIMIT","OFFSET","HAVING"].includes(f)){["SET","WHERE"].includes($r(r)??"")&&r.pop(),hi(t,r),t.push(a);continue}if(["AND","OR"].includes(f)){$r(r)!=="LPAREN-INLINE"&&hi(t,r),t.push(a);continue}if(f===","){t.push(a),$r(r)!=="LPAREN-INLINE"&&hi(t,r);continue}if(f==="("){let d=!0;const p=u?.type==="IDENTIFIER"&&i.has(u?.value.toUpperCase());(p||dC(n,o,2)==="INTO"||dC(n,o)==="VALUES")&&(d=!1),["TABLE"].includes(($y(n,o,2)?.value??"").toUpperCase())&&$y(n,o)?.type==="IDENTIFIER"&&(d=!0),Bh(t)&&!p&&t.push({type:"WHITESPACE",value:" "}),r.push(d?"LPAREN":"LPAREN-INLINE"),t.push(a),d&&hi(t,r);continue}if(f===")"){for(;r.length>0&&!["LPAREN","LPAREN-INLINE"].includes($r(r)??"");)r.pop();$r(r)==="LPAREN"?(r.pop(),hi(t,r)):$r(r)==="LPAREN-INLINE"&&r.pop(),t.push(a);continue}if(f===";"){t.push(a),r=[],hi(t,r),hi(t,r);continue}if([",","."].includes(f)){t.push(a);continue}Bh(t)&&t.push({type:"WHITESPACE",value:" "}),t.push(a)}return t}function $r(n,e=1){return n.length-e>=0?n[n.length-e]:void 0}function hi(n,e){const t=e.reduce((r,o)=>o==="LPAREN-INLINE"?r:r+1,0);n.push({type:"WHITESPACE",value:`
|
|
39
|
+
`+" ".repeat(t)})}function $y(n,e,t=1){const i=e-t;if(!(e-t<0))return n[i]}function dC(n,e,t=1){return($y(n,e,t)?.value??"").toUpperCase()}function Bh(n){if(n.length===0)return!1;const e=n[n.length-1];return!(e.type==="WHITESPACE"||e.value==="."||e.value==="(")}function L7(n){try{const e=ka(n,"sqlite").filter(r=>r.type!=="WHITESPACE"),t=e.findIndex(r=>r.value.toUpperCase()==="FROM");if(t===-1)return"";const i=e[t+1];return!i||i.type!=="IDENTIFIER"?"":i.value}catch{return""}}function I7(n){if(n instanceof Error)return n.message;if(typeof n=="object"&&n!==null&&"errors"in n){const e=n.errors;if(Array.isArray(e)&&e.length>0&&e[0]?.message)return e[0].message}if(typeof n=="string")return n;try{const e=String(n);return e==="[object Object]"?JSON.stringify(n):e}catch{return"Unknown error"}}function B7(n){return`'${n.replace(/'/g,"''")}'`}function _7(n){if(n===void 0)return"DEFAULT";if(n===null)return"NULL";if(typeof n=="string")return B7(n);if(typeof n=="number"||typeof n=="bigint")return n.toString();throw n instanceof ArrayBuffer||Array.isArray(n)?new Error("Blob escape is not supported yet"):new Error(n.toString()+" is unrecognized type of value")}function QA({headers:n,rows:e,transformHeader:t,transformValue:i}){const r=new Set,o=n.map((u,f)=>{const d=t(u,f);let p=d.name,m=1;for(;r.has(p);)p=`${d.name}_${m++}`;return r.add(p),{...d,name:p}}),a=e.map(u=>o.reduce((f,d,p)=>(f[d.name]=i?i(u[p],d):u[p],f),{}));return{headers:o,rows:a}}async function SV(n,e,t){const i=new Array,r=new Array,o=e.length;function a(u,f=!1){t?.({error:f,logs:i,progress:u,total:o})}for(let u=0;u<e.length;u++){const f=e[u],d=f,p={order:u,sql:d,start:Date.now()};i.push(p),a(u+1);try{const m=await n.query(d);if(p.end=Date.now(),p.stats=m.stat,m.stat={...m.stat,requestDurationMs:p.end?p.end-p.start:null},m.headers.length>0){const g=L7(d);r.push({sql:f,order:u,predictedTableName:g,result:m})}a(u+1)}catch(m){p.end=Date.now(),p.error=I7(m),a(u+1,!0);break}}return{logs:i,result:r}}function P7({data:n}){let t=n.rows.map(r=>({...r,children:[]}));const i=t.reduce((r,o)=>({...r,[o.id]:o}),{});for(const r of t)r.parent&&i[r.parent]?.children.push(r);return t=t.filter(r=>r.parent===0),Y.jsx("div",{className:"h-full w-full grow overflow-auto p-8",children:Y.jsx("div",{className:"font-mono text-sm",children:Y.jsx(XA,{data:t})})})}function XA({data:n}){return Y.jsx(Y.Fragment,{children:n.map(e=>{const{label:t,performance:i}=z7(e.detail);return Y.jsxs(S.Fragment,{children:[Y.jsxs("div",{className:"flex h-8 items-center gap-2",children:[Y.jsx("div",{className:$o("inline-flex rounded-full border",{"bg-green-500":i==="fast","bg-red-500":i==="slow","bg-yellow-500":i==="medium","bg-gray-500":i==="neutral"}),style:{width:10,height:10,marginLeft:-5}}),Y.jsx("div",{children:t})]}),Y.jsx("div",{className:"border-l pl-4",children:Y.jsx(XA,{data:e.children})})]},e.id)})})}function z7(n){return n.startsWith("SCAN ")?{performance:"slow",label:Y.jsxs("div",{className:"flex items-center",children:[Y.jsx("strong",{children:"SCAN "}),Y.jsxs("span",{className:"mx-2 flex items-center gap-2 rounded border border-border p-1",children:[Y.jsx(lR,{}),n.substring(5)]})]})}:n.startsWith("CORRELATED ")?{performance:"slow",label:Y.jsxs("div",{children:[Y.jsx(V2,{side:"bottom",content:Y.jsxs("div",{className:"flex flex-col gap-2",children:[Y.jsxs("div",{children:["This subquery depends on values from the outer query, so it's evaluated once per outer row."," ",Y.jsx("strong",{className:"text-red-500",children:"Can be slow on large inputs"}),"."]}),Y.jsx("div",{className:"text-green-500",children:"Mitigate by indexing the correlated columns or rewriting as a JOIN + aggregate."})]}),children:Y.jsx("strong",{className:"cursor-pointer underline",children:"CORRELATED"})}),Y.jsx("span",{children:n.substring(10)})]})}:n.startsWith("SEARCH ")?{performance:"fast",label:Y.jsxs("div",{children:[Y.jsx("strong",{children:"SEARCH "}),Y.jsx("span",{children:n.substring(6)})]})}:n.startsWith("USE TEMP B-TREE FOR ORDER BY")||n.startsWith("USE TEMP B-TREE FOR GROUP BY")||n.startsWith("USE TEMP B-TREE FOR DISTINCT")?{performance:"medium",label:Y.jsx(V2,{side:"bottom",content:Y.jsxs("div",{className:"flex flex-col gap-2",children:[Y.jsxs("div",{children:["SQLite can’t return rows in the requested order/grouping directly, so it gathers them into a temporary structure and processes them before returning results."," ",Y.jsx("span",{className:"text-red-500",children:"This adds extra work and grows with result size."})]}),Y.jsx("div",{className:"text-green-500",children:"Add an index that matches the clause (ORDER BY / GROUP BY / DISTINCT) to avoid the temp structure."})]}),children:Y.jsx("strong",{className:"cursor-pointer underline",children:n})})}:{label:Y.jsx("span",{children:n}),performance:"neutral"}}class H7{dialect="sqlite";isSupportDropTable=!0;isSupportEditTable=!0;isSupportExplain=!1;isSupportReturningValue=!1;isSupportRowid=!1}class V7 extends H7{constructor(e){super(),this.conn=e}escapeValue(e){return _7(e)}getColumnTypeHint(){return null}async query(e){return this.conn.query(e)}async transaction(e){return this.conn.transaction(e)}async batch(e){if(this.conn.batch)return this.conn.batch(e);const t=[];for(const i of e){const r=await this.query(i);t.push(r)}return t}async dropTable(e,t){await this.query(`DROP TABLE ${this.escapeId(e)}.${this.escapeId(t)}`)}generateTableSchemaStatement(e){throw new Error("Not yet implemented")}async findFirst(e,t,i){const r=Object.entries(i).map(([a,u])=>`${this.escapeId(a)} = ${this.escapeValue(u)}`).join(" AND "),o=`SELECT * FROM ${this.escapeId(e)}.${this.escapeId(t)} ${r?"WHERE "+r:""} LIMIT 1 OFFSET 0`;return this.query(o)}createMutationStatements(e,t,i,r){r&&i.forEach(a=>U7(a,r));const o=this.isSupportRowid&&!r?.withoutRowId;return i.map(a=>a.operation==="INSERT"?F7(this,e,t,a.values,this.isSupportReturningValue,o):a.operation==="DELETE"?K7(this,e,t,a.where):$7(this,e,t,a.values,a.where,this.isSupportReturningValue,o))}async mutateTableRows(e,t,i,r){const o=this.createMutationStatements(e,t,i,r),a=await this.transaction(o),u=[];for(let f=0;f<a.length;f++){const d=a[f],p=i[f];if(!d||!p){u.push({});continue}const{operation:m}=p;if(m==="UPDATE"){if(d.rows.length===1)u.push({record:d.rows[0]});else{const g=await this.findFirst(e,t,p.where);u.push({lastId:d.lastInsertRowid,record:g.rows[0]})}continue}if(m==="INSERT"){if(d.rows.length===1)u.push({record:d.rows[0]});else if(p.autoIncrementPkColumn){const g=await this.findFirst(e,t,{[p.autoIncrementPkColumn]:d.lastInsertRowid});u.push({lastId:d.lastInsertRowid,record:g.rows[0]})}else if(p.pk?.length){const g=p.pk.reduce((x,w)=>(x[w]=p.values[w],x),{}),v=await this.findFirst(e,t,g);u.push({lastId:d.lastInsertRowid,record:v.rows[0]})}else u.push({});continue}u.push({})}return u}buildExplainStatement(e){throw new Error("Not implemented")}getQueryTabOverride(e,t){return null}}function U7(n,e){const{operation:t}=n,{pk:i,autoIncrement:r}=e,o=t!=="INSERT"?n.where:{},a=t!=="DELETE"?n.values:{},u=i.some(d=>o[d]==null),f=i.some(d=>(d in a?a[d]:o[d])==null);if(i.length===0)throw new Error("This table has no primary key. Unsafe to perform insert, update, or delete operations.");switch(t){case"DELETE":if(u)throw new Error("Cannot delete a row with NULL in primary key columns.");break;case"UPDATE":if(u)throw new Error("Cannot update a row with NULL in primary key columns.");if(f)throw new Error("Cannot update a row causing NULL in primary key columns.");break;case"INSERT":{const d=i[0];if(r&&d&&a[d]===null)throw new Error("Cannot insert a row with NULL in the auto-increment primary key column.");if(!r&&f)throw new Error("Cannot insert a row with NULL in primary key columns.");break}}}function WA(n,e){const t=Object.entries(e).map(([i,r])=>r==null?`${n.escapeId(i)} IS NULL`:`${n.escapeId(i)} = ${n.escapeValue(r)}`).join(" AND ");return t.length>0?"WHERE "+t:null}function j7(n,e){return Object.entries(e).map(([t,i])=>`${n.escapeId(t)} = ${n.escapeValue(i)}`).join(", ")}function q7(n,e){const t=[],i=[];for(const[r,o]of Object.entries(e))t.push(n.escapeId(r)),i.push(n.escapeValue(o));return`(${t.join(", ")}) VALUES(${i.join(", ")})`}function F7(n,e,t,i,r,o){return["INSERT INTO",`${n.escapeId(e)}.${n.escapeId(t)}`,q7(n,i),r?`RETURNING ${o?"rowid, ":""}*`:""].join(" ")}function $7(n,e,t,i,r,o,a){return["UPDATE",`${n.escapeId(e)}.${n.escapeId(t)}`,"SET",j7(n,i),WA(n,r),o?`RETURNING ${a?"rowid, ":""}*`:""].filter(Boolean).join(" ")}function K7(n,e,t,i){return["DELETE FROM",`${n.escapeId(e)}.${n.escapeId(t)}`,WA(n,i)].filter(Boolean).join(" ")}function ZA(n,e){if(n===e)return!0;if(n===null||e===null||typeof n!="object"||typeof e!="object"||Array.isArray(n)!==Array.isArray(e))return!1;const t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!ZA(n[r],e[r]))return!1;return!0}function pC(n,e){const t={...n};for(const i of e)delete t[i];return t}function I0(n){return n.length>=2&&n.startsWith("(")&&n.endsWith(")")?n:`(${n})`}function B0(n,e){const t=[n.escapeId(e.name),e.type];e.constraint?.primaryKey&&t.push(["PRIMARY KEY",e.constraint.primaryKeyOrder,e.constraint.primaryKeyConflict?`ON CONFLICT ${e.constraint.primaryKeyConflict}`:void 0,e.constraint.autoIncrement?"AUTOINCREMENT":void 0].filter(Boolean).join(" ")),e.constraint?.unique&&t.push(["UNIQUE",e.constraint.uniqueConflict?`ON CONFLICT ${e.constraint.uniqueConflict}`:void 0].filter(Boolean).join(" ")),e.constraint?.notNull&&t.push(["NOT NULL",e.constraint.notNullConflict?`ON CONFLICT ${e.constraint.notNullConflict}`:void 0].filter(Boolean).join(" ")),e.constraint?.defaultValue&&t.push(["DEFAULT",n.escapeValue(e.constraint.defaultValue)].join(" ")),e.constraint?.defaultExpression&&t.push(["DEFAULT",I0(e.constraint.defaultExpression)].join(" ")),e.constraint?.generatedExpression&&t.push(["GENERATED ALWAYS AS",I0(e.constraint.generatedExpression),e.constraint.generatedType].join(" ")),e.constraint?.checkExpression&&t.push("CHECK "+I0(e.constraint.checkExpression));const i=e.constraint?.foreignKey?.foreignTableName,r=(e.constraint?.foreignKey?.foreignColumns??[void 0])[0];return i&&r&&t.push(["REFERENCES",n.escapeId(i)+`(${n.escapeId(r)})`].join(" ")),t.join(" ")}function Y7(n,e){return e.primaryKey?`PRIMARY KEY (${e.primaryColumns?.map(n.escapeId).join(", ")})`:e.unique?`UNIQUE (${e.uniqueColumns?.map(n.escapeId).join(", ")})`:e.checkExpression!==void 0?`CHECK (${e.checkExpression})`:e.foreignKey?`FOREIGN KEY (${e.foreignKey.columns?.map(n.escapeId).join(", ")}) REFERENCES ${n.escapeId(e.foreignKey.foreignTableName??"")} (${e.foreignKey.foreignColumns?.map(n.escapeId).join(", ")})`:""}function G7(n,e){const t=!e.name.old,i=[];for(const o of e.columns)o.new===null?i.push(`DROP COLUMN ${n.escapeId(o.old?.name??"")}`):o.old===null?t?i.push(B0(n,o.new)):i.push("ADD "+B0(n,o.new)):(o.new.name!==o.old.name&&i.push(`RENAME COLUMN ${n.escapeId(o.old.name)} TO ${n.escapeId(o.new.name)}`),ZA(pC(o.old,["name"]),pC(o.new,["name"]))||i.push(`ALTER COLUMN ${n.escapeId(o.new.name)} TO ${B0(n,o.new)}`));for(const o of e.constraints)o.new&&t&&i.push(Y7(n,o.new));if(t||e.name.new!==e.name.old&&i.push(`RENAME TO ${n.escapeId(e.name.new??"")}`),t)return[`CREATE TABLE ${n.escapeId(e.schemaName??"main")}.${n.escapeId(e.name.new||"no_table_name")}(
|
|
40
|
+
${i.map(o=>" "+o).join(`,
|
|
41
|
+
`)}
|
|
42
|
+
)`];const r=`ALTER TABLE ${n.escapeId(e.schemaName??"main")}.${n.escapeId(e.name.old??"")} `;return i.map(o=>r+o)}function Ky(n){let e=n.replace(/^["`[]/g,"");return e=e.replace(/["`\]]$/g,""),e=e.replace(/""/g,'"'),e}class dp{constructor(e){for(this.tokens=e;this.tokens.length>0&&this.tokens[0].type==="WHITESPACE";)this.tokens.shift();for(;this.tokens.length>0&&this.tokens[this.tokens.length-1].type==="WHITESPACE";)this.tokens.pop();this.tokens=e}ptr=0;getPointer(){return this.ptr}toStringRange(e,t){return this.tokens.slice(e,t).map(i=>i.value).join("")}read(){return this.end()?"":this.tokens[this.ptr].value}consumeBlock(){return this.match("(")?this.consumeParen().toString():this.consume()}currentType(){return this.tokens[this.ptr].type}consumeParen(){if(this.read()!=="(")throw new Error("Expecting (");const e=this.ptr+1;let t=1;for(;t>0;){if(!this.next())throw new Error("Expecting closing paren");this.read()==="("&&t++,this.read()===")"&&t--}const i=new dp(this.tokens.slice(e,this.ptr));return this.next(),i}consume(){const e=this.read();return this.next(),e}consumeIdentifier(){const e=Ky(this.read());return this.next(),e}expectToken(e){if(!this.match(e))throw new Error(`Expecting ${e}`);this.next()}expectTokenOptional(e){this.match(e)&&this.next()}expectTokensOptional(e){if(e.length===0)return;const[t]=e;if(this.match(t)){this.next();for(const i of e.slice(1))this.expectToken(i)}}expectTokens(e){for(const t of e)this.expectToken(t)}next(){for(this.ptr=this.ptr+1;this.ptr<this.tokens.length;this.ptr++)if(this.currentType()!=="WHITESPACE")return!0;return!1}match(e){return this.end()?!1:this.read().toLowerCase()===e.toLowerCase()}matchTokens(e){return e.some(t=>this.read().toLowerCase()===t.toLowerCase())}end(){return this.ptr>=this.tokens.length}toString(){return this.tokens.map(e=>e.value).join("")}toStringWithParen(){return"("+this.toString()+")"}}function Q7(n,e){const t=e.consumeIdentifier();if(!t)return null;let i=e.read();[",","CHECK","COLLATE","CONSTRAINT","DEFAULT","GENERATED","NOT","PRIMARY","REFERENCES","UNIQUE"].includes(i.toUpperCase())?i="":e.next(),e.match("(")&&(i+=e.consumeParen().toStringWithParen());const r=pi(n,e);return{name:t,pk:r?.primaryKey,constraint:r,type:i}}function _0(n){if(n.match("ON")&&(n.next(),!!n.match("CONFLICT")&&(n.next(),!n.end()))){const e=n.read().toUpperCase();return n.next(),e}}function Ku(n){const e=[];for(;!n.end()&&(e.push(n.consumeIdentifier()),!!n.match(","));)n.next();return e}function pi(n,e){if(e.match("CONSTRAINT")){e.next();const t=e.consume();return{...pi(n,e),name:t}}else if(e.match("PRIMARY")){let t,i,r=!1;if(e.next(),!e.match("KEY"))throw new Error("PRIMARY must follow by KEY");e.next(),e.match("(")&&(i=Ku(e.consumeParen())),e.match("ASC")?(t="ASC",e.next()):e.match("DESC")&&(t="DESC",e.next());const o=_0(e);return e.match("AUTOINCREMENT")&&(r=!0,e.next()),{primaryKey:!0,primaryKeyOrder:t,primaryColumns:i,autoIncrement:r,primaryKeyConflict:o,...pi(n,e)}}else if(e.match("NOT")){if(e.next(),!e.match("NULL"))throw new Error("NOT should follow by NULL");return e.next(),{notNull:!0,notNullConflict:_0(e),...pi(n,e)}}else{if(e.match("NULL"))return e.next(),{notNull:!1,...pi(n,e)};if(e.match("UNIQUE")){let t;return e.next(),e.read()==="("&&(t=Ku(e.consumeParen())),{unique:!0,uniqueConflict:_0(e),uniqueColumns:t,...pi(n,e)}}else if(e.match("DEFAULT")){let t,i;return e.next(),e.currentType()==="STRING"?(t=e.read().slice(1,-1),e.next()):e.currentType()==="OPERATOR"?e.match("+")?(e.next(),t=Number(e.read()),e.next()):e.match("-")&&(e.next(),t=-Number(e.read()),e.next()):e.currentType()==="NUMBER"?(t=Number(e.read()),e.next()):e.match("(")?i=e.consumeParen().toString():(e.match("current_timestamp")||e.match("current_time")||e.match("current_date")||e.match("true")||e.match("false")||e.match("null"))&&(i=e.read(),e.next()),{defaultValue:t,defaultExpression:i,...pi(n,e)}}else{if(e.match("CHECK"))return e.next(),{checkExpression:e.consumeBlock(),...pi(n,e)};if(e.match("COLLATE")){e.next();const t=e.read();return e.next(),{collate:t,...pi(n,e)}}else if(e.match("FOREIGN")){if(e.next(),!e.match("KEY"))throw new Error("FOREIGN should follow by KEY");e.next();const t=e.consumeParen(),i=Ku(t),r=pi(n,e);return{foreignKey:{foreignSchemaName:n,foreignTableName:r?.foreignKey?.foreignTableName??"",foreignColumns:r?.foreignKey?.foreignColumns??[],columns:i}}}else if(e.match("REFERENCES")){e.next();const t=e.consumeIdentifier();let i=[];for(;!e.end()&&!e.match("(")&&!e.match(",");)e.next();return e.match("(")&&(i=Ku(e.consumeParen())),{foreignKey:{foreignSchemaName:n,foreignTableName:t,foreignColumns:i},...pi(n,e)}}else if(e.match("GENERATED")){if(e.next(),!e.match("ALWAYS"))throw new Error("GENERATED should follow by ALWAYS");if(e.next(),!e.match("AS"))throw new Error("GENERATED ALWAYS should follow by AS");e.next();const t=e.consumeBlock();return{generatedType:e.match("STORED")?"STORED":"VIRTUAL",generatedExpression:t,...pi(n,e)}}}}}function X7(n,e){let t=!0,i=!1;const r=new Array,o=new Array;for(;t;){if(t=!1,e.matchTokens(["CHECK","CONSTRAINT","FOREIGN","PRIMARY","UNIQUE"])){const a=pi(n,e);a&&(i=!0,o.push(a),t=!0)}else if(!i){const a=Q7(n,e);a&&(r.push(a),t=!0)}for(;e.read()!==","&&!e.end();)e.next();if(e.end())break;e.next()}for(const a of o)if(a.primaryKey&&a.primaryColumns)for(const u of a.primaryColumns){const f=r.find(d=>u.toLowerCase()===d.name.toLowerCase());f&&(f.pk=!0)}for(const a of r){const u=a.constraint?.foreignKey;u?.foreignColumns&&u.foreignColumns.length===0&&(u.foreignColumns=[a.name])}return{columns:r,constraints:o}}function W7(n){if(!n)return{};let e,t;const i=n;for(;!i.end();)i.match("content")?(i.next(),i.match("=")&&(i.next(),i.end()||(e=Ky(i.read()),i.next()))):i.match("content_rowid")&&(i.next(),i.match("=")&&(i.next(),i.end()||(t=Ky(i.read()),i.next()))),i.next();return{content:e,contentRowId:t}}function Yy(n){if(n.match("WITHOUT")){if(n.next(),n.match("ROWID"))return n.next(),n.match(",")?(n.next(),{withoutRowId:!0,...Yy(n)}):{withoutRowId:!0}}else if(n.match("STRICT"))return n.next(),n.match(",")?(n.next(),{strict:!0,...Yy(n)}):{strict:!0}}function mC(n,e){const t=new dp(ka(e).filter(f=>f.type!=="COMMENT"));t.expectToken("CREATE"),t.expectTokenOptional("TEMP"),t.expectTokenOptional("TEMPORARY"),t.expectTokenOptional("VIRTUAL"),t.expectToken("TABLE"),t.expectTokensOptional(["IF","NOT","EXISTS"]);const i=t.consumeIdentifier();let r;t.match("USING")&&(t.next(),t.match("FTS5")&&(t.next(),r=W7(t.consumeParen())));const o=t.match("(")?X7(n,t.consumeParen()):{columns:[],constraints:[]},a=o.columns.filter(f=>f.pk).map(f=>f.name),u=o.columns.some(f=>!!f.constraint?.autoIncrement);return{schemaName:n,tableName:i,...o,autoIncrement:u,fts5:r,pk:a,...Yy(t)}}function Z7(n){const e=new dp(ka(n)),t={columns:[],name:"",tableName:"",type:"KEY"};return e.expectToken("CREATE"),e.match("UNIQUE")&&(t.type="UNIQUE",e.next()),e.expectToken("INDEX"),e.expectTokensOptional(["IF","NOT","EXISTS"]),t.name=e.consumeIdentifier(),e.expectToken("ON"),t.tableName=e.consumeIdentifier(),e.match("(")&&(t.columns=Ku(e.consumeParen())),t}class JA extends V7{isSupportEditTable=!0;isSupportExplain=!0;isSupportReturningValue=!0;isSupportRowid=!0;escapeId(e){return`"${e.replace(/"/g,'""')}"`}getColumnTypeHint(e){return e?(e=e.toUpperCase(),e.includes("TEXT")||e.includes("CHAR")||e.includes("CLOB")||e.includes("STRING")?"TEXT":e.includes("INT")||e.includes("NUMBER")||e.includes("REAL")||e.includes("DOUBLE")||e.includes("FLOAT")?"NUMBER":e.includes("BLOB")?"BLOB":"TEXT"):null}async schemas(){const e="main",t=await this.query("SELECT * FROM sqlite_master;");let i=new Array;const r=t.rows;for(const u of r){if(u.type==="table"){try{i.push({type:"table",schemaName:e,name:u.name,tableSchema:{...mC(e,u.sql),createScript:u.sql}})}catch{console.warn(`Failed to parse schema for table: ${u.name}`),i.push({type:"table",name:u.name,schemaName:e})}continue}if(u.type==="trigger"){i.push({type:"trigger",name:u.name,tableName:u.tbl_name,schemaName:e});continue}u.type==="view"&&i.push({type:"view",name:u.name,schemaName:e})}const o=i.filter(u=>u.tableSchema?.fts5).map(u=>u.name),a=new Set(o.map(u=>[`${u}_content`,`${u}_idx`,`${u}_docsize`,`${u}_config`,`${u}_data`]).flat());return i=i.filter(u=>!a.has(u.name)),{[e]:i}}async tableSchema(e,t){const i=`SELECT * FROM ${this.escapeId(e)}.sqlite_schema WHERE tbl_name = ${this.escapeValue(t)} AND "type" IN ('table', 'view', 'index');`,o=(await this.query(i)).rows,a=o.filter(d=>d.type==="index"&&d.sql!==null),u=new Array;for(const d of a)try{u.push(Z7(d.sql))}catch{continue}const f=o.find(d=>d.type==="table"||d.type==="view");if(!f)throw new Error("Unexpected error finding table "+t);if(f.type==="view")return this.getFallbackTableSchema(e,t);try{const d=f.sql,p={...mC(e,d),createScript:d,indexes:u,schemaName:e,type:"table"};return p.fts5?{...await this.getFallbackTableSchema(e,t),fts5:p.fts5}:p}catch{throw new Error(`Failed to parse CREATE TABLE script for '${t}'`)}}async getFallbackTableSchema(e,t){const i=`SELECT * FROM ${this.escapeId(e)}.pragma_table_info(${this.escapeValue(t)});`,a=(await this.query(i)).rows.map(u=>({name:u.name,pk:!!u.pk,type:u.type}));return{autoIncrement:!1,columns:a,pk:a.filter(u=>u.pk).map(u=>u.name),schemaName:e,tableName:t}}async selectTable(e,t,i){const r=await this.tableSchema(e,t),{limit:o,offset:a,orderByColumn:u,orderByDirection:f}=i,d=!r.fts5&&r.pk.length===0&&!r.withoutRowId&&!r.columns.find(k=>k.name==="rowid")&&r.type==="table";d&&(r.columns=[{constraint:{primaryKey:!0,autoIncrement:!0},name:"rowid",type:"INTEGER"},...r.columns],r.pk=["rowid"],r.autoIncrement=!0);const p=`${this.escapeId(e)}.${this.escapeId(t)}`;let m="*";d?m="rowid, *":r.fts5&&(m="rank, *");const g=`SELECT ${m} FROM ${p}`,v=u&&f&&["ASC","DESC"].includes(f)?`ORDER BY ${this.escapeId(u)} ${f}`:"",x=`LIMIT ${this.escapeValue(o)} OFFSET ${this.escapeValue(a)}`,w=i.whereRaw?`WHERE ${i.whereRaw}`:"",C=[g,w,v,x].filter(Boolean).join(" "),E=await this.conn.query(C);return r.fts5?{result:E,schema:{...r,columns:[{name:"rank",type:"INTEGER"},...r.columns]}}:{result:E,schema:r}}generateTableSchemaStatement(e){return G7(this,e)}buildExplainStatement(e){const r=ka(e.trim()).filter(o=>o.type!=="COMMENT").map(o=>o.value==="?"?{type:"STRING",value:"''"}:o).map(o=>o.value).join("").replace(/^(?!EXPLAIN\s+QUERY\s+PLAN\b)(?:EXPLAIN\b(?:\s+ANALYZE\b)?\s*)?/i,"EXPLAIN QUERY PLAN ");if(!r.startsWith("EXPLAIN QUERY PLAN "))throw new Error("Explain statement must start with EXPLAIN QUERY PLAN");return r}getQueryTabOverride(e,t){return e.toUpperCase().startsWith("EXPLAIN QUERY PLAN ")?{component:P7({data:t}),icon:oR,label:"Explain"}:null}}class J7{constructor(e){this.databaseId=e}async query(e){const[t]=await this.transaction([e]);if(!t)throw new Error("No result returned from query");return t}async transaction(e){const t=e.map(r=>r.trim().replace(/;+$/,"")),i=await B6({body:{sql:t.join(";")},path:{database_id:this.databaseId}});if(!i.data?.result)throw new Error("Invalid response: missing result data");return i.data.result.map(r=>this.transformResult(r))}transformResult(e){const t=e.results?.rows??[];return{...QA({headers:e.results?.columns??[],rows:t,transformHeader:i=>({name:i,displayName:i})}),lastInsertRowid:e.meta?.last_row_id,stat:{queryDurationMs:e.meta?.duration??null,rowsAffected:e.meta?.changes??0,rowsRead:e.meta?.rows_read??null,rowsWritten:e.meta?.rows_written??null,rowCount:t.length}}}}class eH extends JA{constructor(e){super(new J7(e))}async schemas(){const e=await super.schemas(),t=new Set(["_cf_METADATA"]);return Object.fromEntries(Object.entries(e).map(([i,r])=>[i,r.filter(o=>!t.has(o.name))]))}}const tH=()=>Ia(()=>import("./_databaseId-DWcfgBis.js"),__vite__mapDeps([4,1,5,2])),nH=$s("/d1/$databaseId")({component:Ta(tH,"component"),loader:async n=>({tables:((await new eH(n.params.databaseId).schemas()).main??[]).filter(o=>o.type==="table"||o.type==="view").map(o=>({label:o.name,value:o.name})).sort((o,a)=>o.label.localeCompare(a.label))}),validateSearch:n=>({table:typeof n.table=="string"?n.table:void 0})}),iH=()=>Ia(()=>import("./index-KG4JeHCX.js"),__vite__mapDeps([6,1,3])),rH=$s("/do/$className/")({component:Ta(iH,"component"),loader:async({params:n})=>{const i=((await qd()).data?.result??[]).find(u=>u.class===n.className||u.name===n.className||u.id===n.className);if(!i?.id)throw new Error(`Durable Object class "${n.className}" not found`);const r=await _6({path:{id:i.id},query:{limit:50}}),o=r.data?.result??[],a=r.data?.result_info?.cursor??null;return{cursor:a,hasMore:!!a,namespaceId:i.id,objects:o}}});class sH{constructor(e,t,i){if(this.namespaceId=e,this.objectId=t,this.objectName=i,!t&&!i)throw new Error("Either `objectId` or `objectName` must be provided to identify the Durable Object")}async query(e){const[t]=await this.transaction([e]);if(!t)throw new Error("No result returned from query");return t}async transaction(e){const i=e.map(a=>a.trim().replace(/;+$/,"")).map(a=>({sql:a})),r=this.objectId?{durable_object_id:this.objectId,queries:i}:{durable_object_name:this.objectName,queries:i},o=await P6({body:r,path:{namespace_id:this.namespaceId}});if(!o.data?.result)throw new Error("Invalid response: missing result data");return o.data.result.map(a=>this.transformResult(a))}transformResult(e){const t=e.rows??[];return{...QA({headers:e.columns??[],rows:t,transformHeader:i=>({name:i,displayName:i})}),stat:{queryDurationMs:null,rowsAffected:0,rowsRead:e.meta?.rows_read??null,rowsWritten:e.meta?.rows_written??null,rowCount:t.length}}}}class oH extends JA{constructor(e,t,i){super(new sH(e,t,i))}async schemas(){const e=await super.schemas(),t=new Set(["_cf_METADATA"]);return Object.fromEntries(Object.entries(e).map(([i,r])=>[i,r.filter(o=>!t.has(o.name))]))}}const lH=()=>Ia(()=>import("./_objectId-X6x-JUph.js"),__vite__mapDeps([7,1,5,2])),aH=$s("/do/$className/$objectId")({component:Ta(lH,"component"),loader:async({params:n})=>{const i=((await qd()).data?.result??[]).find(f=>f.class===n.className||f.name===n.className||f.id===n.className);if(!i?.id)throw new Error(`Durable Object class "${n.className}" not found`);const u=((await new oH(i.id,n.objectId).schemas()).main??[]).filter(f=>f.type==="table"||f.type==="view").map(f=>({label:f.name,value:f.name})).sort((f,d)=>f.label.localeCompare(d.label));return{namespaceId:i.id,tables:u}},validateSearch:n=>({table:typeof n.table=="string"?n.table:void 0})}),uH=TB.update({id:"/",path:"/",getParentRoute:()=>La}),cH=OB.update({id:"/kv/$namespaceId",path:"/kv/$namespaceId",getParentRoute:()=>La}),gb=DB.update({id:"/do/$className",path:"/do/$className",getParentRoute:()=>La}),fH=nH.update({id:"/d1/$databaseId",path:"/d1/$databaseId",getParentRoute:()=>La}),hH=rH.update({id:"/",path:"/",getParentRoute:()=>gb}),dH=aH.update({id:"/$objectId",path:"/$objectId",getParentRoute:()=>gb}),pH={DoClassNameObjectIdRoute:dH,DoClassNameIndexRoute:hH},mH=gb._addFileChildren(pH),gH={IndexRoute:uH,D1DatabaseIdRoute:fH,DoClassNameRoute:mH,KvNamespaceIdRoute:cH},yH=La._addFileChildren(gH)._addFileTypes(),vH=r6({routeTree:yH,basepath:"/cdn-cgi/explorer/"}),gC=document.getElementById("root");gC&&h6.createRoot(gC).render(Y.jsx(S.StrictMode,{children:Y.jsx(l6,{router:vH})}));export{hV as $,h3 as A,bH as B,es as C,I7 as D,nt as E,so as F,Bn as G,Ve as H,TH as I,DT as J,Pe as K,eH as L,AH as M,NA as N,VC as O,kH as P,zt as Q,OB as R,SB as S,OH as T,gn as U,Wr as V,rl as W,dV as X,rV as Y,s_ as Z,Vi as _,$o as a,vt as a0,Cr as a1,mV as a2,Zi as a3,ft as a4,Kt as a5,Az as a6,DA as a7,aV as a8,wt as a9,_H as aA,PH as aB,UH as aC,jH as aD,VH as aE,bI as aF,FH as aG,XH as aH,JH as aI,GH as aJ,Q5 as aK,$H as aL,ZH as aM,WH as aN,qH as aO,KH as aP,QH as aQ,YH as aR,tV as aS,eV as aT,DH as aU,LH as aV,NH as aW,nr as aa,$t as ab,uV as ac,gV as ad,vV as ae,wA as af,D0 as ag,yV as ah,E9 as ai,xV as aj,pV as ak,bV as al,cV as am,ei as an,ZA as ao,V2 as ap,Zy as aq,SV as ar,kc as as,ka as at,sR as au,lR as av,nV as aw,HH as ax,BH as ay,zH as az,L6 as b,wH as c,EH as d,CH as e,Fv as f,xH as g,nH as h,Jn as i,Y as j,bB as k,sV as l,rH as m,_6 as n,xB as o,Fd as p,Ud as q,S as r,aH as s,oH as t,Vd as u,MH as v,N6 as w,IH as x,RH as y,iV as z};
|