neko-harness 0.1.0 → 0.2.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/dist/client/assets/index-CxnbrvVk.css +2 -0
- package/dist/client/assets/index-D6NpJLXy.js +88 -0
- package/dist/client/index.html +2 -2
- package/dist/gateway.js +166 -120
- package/dist/neko.js +223 -66
- package/package.json +1 -1
- package/dist/client/assets/index-B1I59uXv.js +0 -88
- package/dist/client/assets/index-U3kl-2BJ.css +0 -2
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function te(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=M(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(te(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ne(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function re(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ie=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function ae(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ie)}catch(e){ie(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function oe(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ae(oe.bind(null,e))}var se={map:ne,forEach:function(e,t,n){ne(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ne(e,function(){t++}),t},toArray:function(e){return ne(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=se,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=oe,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!ee.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)ee.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:re}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ae,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),p=o(((e,t)=>{t.exports=f()})),m=l(d(),1),h=p(),g=m.createContext(void 0),_=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,h.jsx)(g.Provider,{value:e,children:t})),v={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},y=new class{#e=v;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function b(e){setTimeout(e,0)}var x=typeof window>`u`||`Deno`in globalThis;function S(){}function C(e,t){return typeof e==`function`?e(t):e}function w(e){return typeof e==`number`&&e>=0&&e!==1/0}function T(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ee(e,t){return typeof e==`function`?e(t):e}function E(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==O(o,t.options))return!1}else if(!A(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function D(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(k(t.options.mutationKey)!==k(a))return!1}else if(!A(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function O(e,t){return(t?.queryKeyHashFn||k)(e)}function k(e){return JSON.stringify(e,(e,t)=>ne(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function A(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!A(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!A(e[r],t[r]))return!1;return!0}return!1}var j=Object.prototype.hasOwnProperty;function te(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=M(e)&&M(t);if(!r&&!(ne(e)&&ne(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:j.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=te(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function M(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ne(e){if(!re(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!re(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function re(e){return Object.prototype.toString.call(e)===`[object Object]`}function ie(e){return new Promise(t=>{y.setTimeout(t,e)})}function ae(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:te(e,t)}function oe(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function se(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ce=Symbol();function le(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ce?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ue(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var de=()=>x,fe=()=>de(),pe=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},me=new class extends pe{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},he=b;function N(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=he,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var P=N(),ge=new class extends pe{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function _e(e){return Math.min(1e3*2**e,3e4)}function ve(e){return(e??`online`)!==`online`||ge.isOnline()}var ye=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function be(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(S);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new ye(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>me.isFocused()&&(e.networkMode===`always`||ge.isOnline())&&e.canRun(),p=()=>ve(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(fe()?0:3),a=e.retryDelay??_e,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),ie(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var xe=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),w(this.gcTime)&&(this.#e=y.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(fe()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(y.clearTimeout(this.#e),this.#e=void 0)}};function Se(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ue(e,()=>t.signal,()=>n=!0)},u=le(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?se:oe;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?we:Ce,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Ce(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Ce(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function we(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Te=class extends xe{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Oe(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Oe(this.options);e.data!==void 0&&(this.setState(De(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ae(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(S).catch(S):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>ee(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ce||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>ee(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!T(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=le(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Se(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=be({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ye&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ye){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ee(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...De(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),P.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Ee(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ve(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function De(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Oe(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var ke=class extends xe{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ae(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=be({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),P.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ae(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var je=class extends pe{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new ke({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Me(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Me(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Me(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Me(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){P.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>D(t,e))}findAll(e={}){return this.getAll().filter(t=>D(e,t))}notify(e){P.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return P.batch(()=>Promise.all(e.map(e=>e.continue().catch(S))))}};function Me(e){return e.options.scope?.id}var Ne=class extends pe{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??O(r,t),a=this.get(i);return a||(a=new Te({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){P.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>E(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>E(e,t)):t}notify(e){P.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){P.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){P.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Pe=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ne,this.#t=e.mutationCache||new je,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=me.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ge.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ee(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=C(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return P.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;P.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return P.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=P.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(S).catch(S)}invalidateQueries(e,t={}){return P.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=P.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(S)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(S)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(ee(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(ee(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(S).catch(S)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(S).catch(S)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ge.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(k(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{A(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(k(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{A(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=O(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===ce&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Fe=m.useLayoutEffect;function Ie(e){return e[e.length-1]}function Le(e,t){return typeof e==`function`?e(t):e}var Re=Object.prototype.hasOwnProperty;function ze(e){for(let t in e)if(Re.call(e,t))return!0;return!1}var Be=()=>Object.create(null),Ve=(e,t)=>He(e,t,!0);function He(e,t,n,r=0){if(e===t)return e;if(r++>500)return t;let i=Array.isArray(e)&&Array.isArray(t);if(!i&&!(Ue(e)&&Ue(t)))return t;let a=Object.keys(e),o=a.length,s=Object.keys(t),c=s.length;if(i?o!==e.length||c!==t.length||o&&Ie(a)!==`${o-1}`||c&&Ie(s)!==`${c-1}`:o!==Object.getOwnPropertyNames(e).length||c!==Object.getOwnPropertyNames(t).length||Object.getOwnPropertySymbols(t).length)return t;let l=0,u,d,f;if(i){for(;l<c&&(f=l,d=e[f],u=t[f],u=d===u?d:typeof d==`object`?He(d,u,n,r):u,u===d);l++);if(l===c&&o===c)return e}else{let i=o===c,p=!0;for(;l<c;l++){f=s[l],d=e[f];let o=t[f];u=d===o?d:typeof d==`object`?He(d,o,n,r):o,i&&=u===d&&(a[l]===f||Re.call(e,f)),p&&=Object.is(u,o),a[l]=u}if(i)return Object.getOwnPropertySymbols(e).length?t:e;if(p)return t}let p=i?s.fill(0):n?Be():{};for(let o=0;o<c;o++)f=i?o:s[o],i?(d=e[f],o>l&&(u=t[f],u=d===u?d:typeof d==`object`?He(d,u,n,r):u),p[f]=o<l?d:u):p[f]=a[o];return p}function Ue(e){return!e||typeof e!=`object`?!1:(Object.getPrototypeOf(e)?.constructor??Object)===Object}function We(e,t,n,r){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0,a=e.length;i<a;i++){let a=e[i],o=t[i];if(a!==o&&!We(a,o,n,r))return!1}return!0}if(Ue(e)&&Ue(t)){if(n){for(let i in t)if((r||t[i]!==void 0)&&!We(e[i],t[i],n,r))return!1;return!0}let i=0;if(r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;for(let a in t)if((r||t[a]!==void 0)&&(i--===0||!We(e[a],t[a],n,r)))return!1;return i===0}return!1}var Ge=/[\x00-\x1f\x7f"<>`{}]/g;function Ke(e){return e.replace(Ge,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function qe(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return Ke(t)}var Je=[`http:`,`https:`,`mailto:`,`tel:`];function Ye(e){if(e[0]!==`/`&&e.includes(`:`))return/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e)?.[1]?.replace(/[\t\n\r]/g,``).toLowerCase()}var Xe=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function Ze(e,t){if(!e)return!1;if(Xe.test(e))return!0;let n=Ye(e);return n?!t.has(n):!1}function Qe(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){let n=/%25|%5C/gi,r=0,i;for(t=``;(i=n.exec(e))!==null;)t+=qe(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=qe(r?e.slice(r):e)}return t}function $e(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function et(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function tt(){throw Error(`Invariant failed`)}function nt(e){return e.replace(/\/{2,}/g,`/`)}function rt(e){return e===`/`?e:e.replace(/^\/+/,``)}function it(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function at(e){return it(rt(e))}function ot(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function st(e,t,n=`never`,r){if(t.includes(`//`)&&(t=nt(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=nt(e)),o=e.split(`/`);o.length>1&&Ie(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(Ie(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?nt(s):s)||`/`;return a&&r&&r.set(a,c),c}function ct(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=new RegExp([...t.keys()].join(`|`).replace(/[.*()]/g,`\\$&`),`g`);return e=>e.replace(n,e=>t.get(e)??e)}function lt(e){return e==null||e===``}function ut(e,t,n){if(typeof t!=`string`)return``+(t??void 0);let r=e===`_splat`;if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let i=encodeURIComponent(t);return r&&(i=i.replaceAll(`%2F`,`/`)),n?n(i):i}function dt(e,t,n,r,i){let a=e.endsWith(`/`)?`/`:``,o=``;for(let e of t){if(typeof e==`string`){o+=e;continue}let[t,s,c,l]=e,u=t===2,d=u&&l!==void 0?l+a:l,f=n[s];if(t!==3||f!=null){if(i&&(i[s]=f,u&&(i[`*`]=f)),u&<(f)){if(c===`/`&&!d)continue;f=``}o+=c+ut(s,f,r)+(d||``)}}return o+a||`/`}function ft(e){return e?.isNotFound===!0}function pt(){try{return sessionStorage}catch{return}}var mt=`tsr-scroll-restoration-v1_3`,ht=pt();function gt(){try{return JSON.parse(ht?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var _t=gt(),vt=`data-scroll-restoration-id`,yt=e=>e.state.__TSR_key||e.href;function bt(e){let t=e.getAttribute(vt);if(t)return`[${vt}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var xt=!1,St=`window`;function Ct(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function wt(e){let t=new Set;for(let n of e){if(n===St)continue;let e=Ct(n);e&&t.add(e)}return t}function Tt(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||yt,a=new Set,o=e=>{let t=_t[e]||={};for(let e of a)e===document?t[St]={scrollX,scrollY}:e.isConnected&&(t[bt(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,xt=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{xt||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,o(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{ht?.setItem(mt,JSON.stringify(_t))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),!r.r&&(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.n,c=r.h,l;if(a.clear(),r.n=!0,r.h=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.e&&d&&d!==u){let e=_t[d];if(e){let t=_t[u];for(let n in e){if(n===St){if(s)continue}else{let e=Ct(n);if(!e||s&&o&&(l??=wt(o),l.has(e)))continue}t||=_t[u]={},t[n]??=e[n]}}}xt=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=wt(o));let t=e&&i&&c,s=r.e?_t[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===St){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Ct(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{xt=!1}}))}function Et(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function Dt(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Ot(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Dt(r):Array.isArray(t)?t.push(Dt(r)):n[e]=[t,Dt(r)]}return n}var kt=/^(?:\s|["[{\d-]|fa|nu|tr)/,At=Mt(JSON.parse),jt=Nt(JSON.stringify,JSON.parse);function Mt(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.slice(1));let r=Ot(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!kt.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function Nt(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!kt.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Et(e,r);return t?`?${t}`:``}}var Pt=`__root__`;function Ft(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function It(e){return e instanceof Response&&!!e.options}function Lt(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var Rt=4,zt=5;function Bt(e){let t=e.names;if(t)return t;let n=[];for(let t of e)typeof t!=`string`&&n.push(t[1]);return e.names=n}function Vt(e,t,n){let r=e.slice(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,`_splat`,``,void 0]:[1,r.slice(1),``,``];let i=r.indexOf(`{`);if(i>=0){let a=r.indexOf(`}`,i),o=r.charCodeAt(i+1)===45,s=i+(o?3:2);if(a>=0&&r.charCodeAt(s-1)===36&&(!o||s<a)){let c=r.slice(s,a);return[o?3:c?1:2,c||`_splat`,r.slice(0,i),e.slice(t+a+1,c?n:e.length)]}}return r}function Ht(e,t,n,r,i,a){let o=n,s=t.fullPath??t.from,c=t.options,l=s.length,u=s.endsWith(`/`)?l-1:l,d=c?.caseSensitive??e,f=c?.params?.parse??c?.parseParams,p,m=a?n-1:0;if(!r||s.includes(`$`)){p=a?.slice()??[];let e=Ie(p);e&&typeof e!=`string`&&e[0]===2&&(p[p.length-1]=[e[0],e[1],e[2],e[3]===void 0?void 0:e[3]+s.substring(n-(s[n-2]===`/`?2:1),u)],m=l)}for(;o<l;){let e=o,t=s.indexOf(`/`,e),n=t===-1?l:t,a=Vt(s,e,n);o=n+1;let c;if(typeof a==`string`){if(!r)continue;let e=a,t;d?t=r.static??=new Map:(e=a.toLowerCase(),t=r.staticInsensitive??=new Map);let n=t.get(e);if(n)c=n;else{let n=Wt(r);c=n,t.set(e,n)}}else{let t=a[0],h=a[2],g=a[3]??``;if(t===2&&(n=l,o=n+1),p&&m<n&&(m<e-1&&p.push(s.slice(m,e-1)),a[2]=`/`+h,t===2&&a[3]!==void 0&&u<l&&(a[3]=g.slice(0,-1)),p.push(a),m=n),!r)continue;let _=d&&!!(h||g);d||(h=h.toLowerCase(),g=g.toLowerCase());let v=t===1?r.dynamic??=[]:t===3?r.optional??=[]:r.wildcard??=[],y=t!==2&&!f&&v.find(e=>!e.parse&&e.caseSensitive===_&&e.prefix===h&&e.suffix===g);if(y)c=y;else{let e=Wt(r,t,_,h,g);c=e,v.push(e),v.length===2&&i?.push(v)}}r=c}p&&m<u&&p.push(s.slice(m,u));let h=p?.slice();if(!r)return h;if(f&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf(`/`)+1)===95){let e=Wt(r,zt);(r.pathless??=[]).push(e),r=e}let g=(t.path||!t.children)&&!t.isRoot;if(g&&u<l){let e=Wt(r,Rt);r.index=e,r=e}return r.parse=f??null,r.priority=c?.params?.priority??0,r.route||(r.data=h,g&&(r.route=t)),[r,o,h]}function Ut(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Wt(e,t=0,n,r,i){return{kind:t,depth:e?e.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:e,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function Gt(e,t){let n=Wt(),r=[];function i(e,t,n,a){let[o,s,c]=Ht(!1,e,t,n,r,a);if(e.children)for(let t of e.children)i(t,s,o,c)}for(let t of e)i(t,1,n);for(let e of r)e.sort(Ut);t.masksTree=n,t.flatCache=Lt(1e3)}function Kt(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=Xt(e,t.masksTree);return t.flatCache.set(e,r),r}function qt(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Wt(),Ht(t,{from:e},1,o),i.singleCache.set(a,o)),Xt(r,o,n)}function Jt(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Xt(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Qt(a.route)),t.matchCache.set(r,a),a}function Yt(e,t=!1){let n=Wt(),r=[],i={},a={},o=0;function s(e,n,c,l){if(e.init(o),e.id in i&&tt(),i[e.id]=e,o!==0&&e.path){let t=it(e.fullPath);(!a[t]||e.fullPath.endsWith(`/`))&&(a[t]=e)}o++;let[u,d,f]=Ht(t,e,n,c,r,l);if(e._interpolation=f,e.children)for(let t of e.children)s(t,d,u,f)}s(e,1,n);for(let e of r)e.sort(Ut);return{processedTree:{segmentTree:n,singleCache:Lt(1e3),matchCache:Lt(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function Xt(e,t,n=!1){let r=e.split(`/`),i=en(e,r,t,n);if(!i)return null;let[a]=Zt(e,r,i);return{route:i.node.route,rawParams:a}}function Zt(e,t,n){let r=$t(n.node),i=n.node.data&&Bt(n.node.data),a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.param??0;for(;s<r.length;o++,s++,c++){let u=r[s];if(u.kind===Rt)break;if(u.kind===zt){o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1||u.kind===3){let e=i[l++];if(u.kind===3&&n.skipped&1<<s){o--,c=f-1;continue}let t=u.suffix||u.prefix?d.substring(u.prefix.length,d.length-u.suffix.length):d;(t||u.kind===1)&&(a[e]=decodeURIComponent(t))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,param:l}]}function Qt(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function $t(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function en(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!Ie(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!an(l,n))continue;if(i.parse){if(!rn(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==Rt&&an(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===Rt||i.kind===2)&&an(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(rn(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&nn(f,o))return n;an(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+tn(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+tn(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+tn(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+tn(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function tn(e,t){return 2**(e-t-1)}function nn(e,t){return e===2**(t-1)-1}function rn(e,t,n){let r,i;try{[r,i]=Zt(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function an(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Rt)>(e.node.kind===Rt)||t.node.kind===Rt==(e.node.kind===Rt)&&t.node.depth>e.node.depth)))}function on(e,t,n){let r=at(e),i=`/${r}`,a=t?i:i.toLowerCase(),o=`${a}/`,s={input:({url:e})=>{let n=t?e.pathname:e.pathname.toLowerCase();return n===a?e.pathname=`/`:n.startsWith(o)&&(e.pathname=e.pathname.slice(i.length)),e},output:({url:e})=>(e.pathname=nt(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>sn(n,s.input({url:e})),output:({url:e})=>s.output({url:cn(n,e)})}:s}function sn(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function cn(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function ln(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{et(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var un=`__TSR_index`,dn=`popstate`,fn=`beforeunload`,pn=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function mn(e){let t=pn.exec(e);return t?`/`+e.slice(t[0].length):e}function hn(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
|
|
2
|
-
\r`.includes(e)?``:encodeURIComponent(e))),mn(e)}function gn(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async n=>{let r=n.navigateOpts?.ignoreBlocker?void 0:e.getBlockers?.();if(typeof document<`u`&&r?.length&&(n.type===`PUSH`||n.type===`REPLACE`))for(let i of r){let r=yn(n.path,n.state);if(await i.blockerFn({currentLocation:t,nextLocation:r,action:n.type})){e.onBlocked?.();return}}n.task()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[un];i=_n(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[un];i=_n(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[un]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r,_getBlockers:()=>e.getBlockers?.()??[]}}function _n(e,t){let n=bn();return{...t,key:n,__TSR_key:n,[un]:e}}function vn(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=t=>hn(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>yn(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=bn();t.history.replaceState({[un]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=yn(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[un]-l.state[un],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0||typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=gn({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:s,flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(fn,x,{capture:!0}),t.removeEventListener(dn,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return S._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(fn,x,{capture:!0}),t.addEventListener(dn,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function yn(e,t){let n=hn(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=bn();t={[un]:0,key:e,__TSR_key:e}}return{href:n,pathname:n.slice(0,r>-1?i>-1?Math.min(r,i):r:i>-1?i:n.length),hash:r>-1?n.slice(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t}}function bn(){return(Math.random()+1).toString(36).slice(7)}function xn(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function Sn(e){return e.pathname+e.search+e.hash}function Cn(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function wn(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Tn({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function En(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function Dn(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var On=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={n:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options;this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:vn()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`;let n=this.options.basepath??`/`,r=this.options.rewrite,i=this.basepath!==n||t?.rewrite!==r||t?.caseSensitive!==this.options.caseSensitive;if(i&&(this.basepath=n,this.rewrite=n!==`/`&&at(n)?on(n,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;e=this.buildRouteTree(),this.setRoutes(e)}if(this.stores)i&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=ln(this.latestLocation,e),Tt(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Yt(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&Gt(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:Lt(1e3)}},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i},a)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:Qe(e),external:!1,searchStr:o,search:Ve(t?.search,i),hash:Qe(r.slice(1)),state:He(t?.state,a)}}let o=sn(this.rewrite,new URL(i,this.origin)),s=this.options.parseSearch(o.search),c=this.options.stringifySearch(s);return o.search=c,{href:o.href.replace(o.origin,``),publicHref:i,pathname:Qe(mn(o.pathname)),external:!!this.rewrite&&xn(o,this.origin),searchStr:c,search:Ve(t?.search,s),hash:Qe(o.hash.slice(1)),state:He(t?.state,a)}},r=n(e,e.state),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i,{...i.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return e.maskedLocation=r,e}return r},this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=Jt(it(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{{let t=this.staticLocations.get(e);if(t)return t}let t=!1,n=(n={})=>{if(n.href){let e=yn(n.href,{});n={...n,to:sn(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=e._fromLocation||this._pendingLocation||this.latestLocation,i,a=()=>(t=!0,r),o=()=>i??=this.matchRoutesLightweight(a()),s=n.to?`${n.to}`:`.`,c=st(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),l=this.routesByPath[it(c)],u=c.includes(`$`),d;if(l)d=l._branch??=Qt(l);else if(u)d=[];else{let[e,t,n]=this.getMatchedRoutes(c);d=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(d=[...d,this.options.notFoundRoute])}let f=u?l?._interpolation??Ht(!1,{fullPath:c},0):void 0,p;for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){let e=o()[3];if(p??=Nn(n.params,e),!ze(p))break;p===e&&(p=Object.assign(Be(),p));try{Object.assign(p,t(p))}catch{}}}p??=Nn(n.params,Pn(n.params,f)?o()[3]:Fn);let m=e.leaveParams?c:mn(Qe(f?dt(c,f,p,this.pathParamsDecoder):c)),h=In(d,e._includeValidateSearch),g=()=>{let t=o()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,Mn(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},_=h.length?Ln(h,g(),n):n.search===!0?g():typeof n.search==`function`?n.search(g()):n.search||Fn,v=this.options.stringifySearch(_),y=n.hash===!0?a().hash:typeof n.hash==`function`?n.hash(a().hash):n.hash||void 0,b=y?`#${y}`:``,x=n.state?n.state===!0?a().state:typeof n.state==`function`?n.state(a().state):n.state:Fn,S=`${m}${v}${b}`,C,w,T=!1;if(this.rewrite){let e=new URL(S,this.origin),t=e.origin,n=cn(this.rewrite,e);C=Sn(e),xn(n,t)?(w=n.href,T=!0):w=mn(Sn(n))}else C=$e(S),w=C;return{publicHref:w,href:C,pathname:m,search:_,searchStr:v,state:x,hash:y??``,external:T,unmaskOnReload:n.unmaskOnReload}},r=n(e);if(e.mask)r.maskedLocation=n({from:e.from,...e.mask});else if(this.options.routeMasks){let t=Kt(r.pathname,this.processedTree);if(t){let i=Object.assign(Be(),t.rawParams),{from:a,params:o,...s}=t.route,c=Nn(o,i);r.maskedLocation=n({from:e.from,...s,params:c})}}return!t&&e._fromLocation&&this.staticLocations.set(e,r),r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return kn(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=it(this.latestLocation.href)===it(n.href)&&We(Tn(n.state),Tn(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state={...o.state,__hashScrollIntoViewOptions:a??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.n=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=n?Ye(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return kn(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.h=e.action.type===`PUSH`||e.action.type===`REPLACE`),await Ar(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(wn(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set,a=e=>{(!n||n(e))&&i.add(e.id)};t.forEach(a),this._cache.forEach(a),r?.forEach(e=>e.forEach(a)),this._tx?.[3].forEach(a);let o=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),o.push(e));let s=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&Cn(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(s);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i){let t=this._flights?.get(e);this._flights?.delete(e),t&&!t[2]&&o.push(t[1])}for(let e of o)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(Xe.test(n)||(r=Ye(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:xn(e,this.origin)||(n=Sn(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=Hn,this.preloadRoute=e=>jr(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?st(e.from||``,e.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=qt(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!We(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?We(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=ct(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??jt,parseSearch:e.parseSearch??At,protocolAllowlist:e.protocolAllowlist??Je}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=Ht(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:it(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Rn(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,f,p;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=Mn(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof An||(r=new An(e.message,{cause:e})),t?.throwOnError)throw r;l=n,f={},p=r}}let m=``,h=``;try{m=i.options.loaderDeps?.({search:l})??``,h=m&&JSON.stringify(m)||``}catch(e){if(t?.throwOnError)throw e;p??=e}let g=Be(),_=i._interpolation?dt(i.fullPath,i._interpolation,r,this.pathParamsDecoder,g):i.fullPath,v=i.id+_+h,y=u(i,n),b=this._cache.get(v)??(y?.id===v?y:void 0);d=b?._strictParams??Object.assign(g,d);let x;if(!b)try{zn(i,d)}catch(e){if(x=ft(e)||It(e)?e:new jn(e.message,{cause:e}),t?.throwOnError)throw x}let S=y?`stay`:`enter`,C;if(b)C={...b,cause:S,search:Ve(y?y.search:b.search,l),_strictSearch:f,searchError:p};else{let e=Cn(i)?`pending`:`success`;C={id:v,ssr:i.options.ssr,index:n,routeId:i.id,params:y?.params??d,_strictParams:d,pathname:_,updatedAt:Date.now(),search:y?Ve(y.search,l):l,_strictSearch:f,searchError:p,status:e,isFetching:!1,error:void 0,paramsError:x,context:{},abortController:t?._controller??new AbortController,cause:S,loaderDeps:y?He(y.loaderDeps,m):m,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let w=s===i.id;C._notFound&&!w&&(C.error=void 0),C._notFound=w,c[n]=C}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?Ve(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=Ie(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=Ie(a),c={...e.search};for(let e of a)try{Object.assign(c,Mn(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=o;for(let t of a)try{zn(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}};async function kn(e,t,{replace:n,ignoreBlocker:r}){if(!Ze(t,e.protocolAllowlist)){if(!r){let t=e.history._getBlockers();for(let r of t)if(r?.blockerFn&&await r.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?`REPLACE`:`PUSH`}))return}e.history._ignoreNextBeforeUnload?.(t),n?window.location.replace(t):window.location.href=t}}var An=class extends Error{},jn=class extends Error{};function Mn(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new An(`Async validation not supported`);if(n.issues)throw new An(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Nn(e,t){if(e===void 0||e===!0)return t;let n=Object.create(null);return e===!1||e===null?n:typeof e==`function`?(Object.assign(n,t),Object.assign(n,e(n))):Object.assign(n,t,e)}function Pn(e,t){return typeof e==`function`?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(t=>typeof t!=`string`&&!Re.call(e,t[1]))}var Fn=Object.freeze({});function In(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r].options;`search`in i?i.search?.middlewares&&n.push(...i.search.middlewares):(i.preSearchFilters||i.postSearchFilters)&&n.push(({search:e,next:t})=>{let n=t(i.preSearchFilters?i.preSearchFilters.reduce((e,t)=>t(e),e):e);return i.postSearchFilters?i.postSearchFilters.reduce((e,t)=>t(e),n):n});let a=i.validateSearch;t&&a&&n.push(({search:e,next:t,meta:n})=>{let r=t(e);try{let e=Mn(a,r);if(n&&e)for(let t in e)t in r||(n.defaulted||=new Map).set(t,e[t]);return{...r,...e}}catch{}return r})}return n}function Ln(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=Le(n.search,i);return a&&(a.explicit=e),e}return e[t]({search:i,next:(e,n)=>{if(n){let n=a||{};return{search:r(t+1,e,n),meta:n}}return r(t+1,e,a)},meta:a})};return r(0,t)}function Rn(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return Pt}function zn(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Bn(e,t){return e.options[t]?.preload?.()}function Vn(e,t){let n=Bn(e,`component`),r=Bn(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Hn(e,t,n){let r=()=>t===!1?void 0:t?Bn(e,t):Vn(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Un(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}function Wn(e,t,n){let r=e._tx;return t&&r?.[2]===n&&!r[3].some(e=>e.routeId===t)}var Gn=0,Kn=1,qn=2,Jn=3,Yn=[4];function Xn(e){return typeof e[0]==`number`}function Zn(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function Qn(e,t){return e.routesById[t.routeId]}function $n(e,t,n){return It(e)?[Jn,e]:ft(e)?(e.routeId||=n,[qn,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[Kn,e]):[Gn,e]}function er(e,t){let n=$n(t,!0,e.id);if(n[0]!==Kn)return n;try{e.options.onError?.(n[1])}catch(t){n=$n(t,!0,e.id)}return n}function tr(e,t,n,r,i){return i[0].signal.aborted?Yn:_r(e,t,n,er(n,r),i)}async function nr(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=Qn(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return ir(e,r),[i,tr(e,t,u,a,n)]}if(c.aborted)return[i,Yn];let p=r.paramsError??r.searchError;if(p!==void 0)return ir(e,r),[i,tr(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{sr(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?Zn(a,c):a);if(c.aborted)return[i,Yn];let s=_r(e,t,u,$n(o,!1,u.id),n);if(s[0]!==Gn)return ir(e,r),[i,s];r.context={...r.context,...o}}catch(a){return ir(e,r),[i,tr(e,t,u,a,n)]}finally{r.status=h,sr(e,r,!1,n[0])}}i()}function rr(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function ir(e,t){let n=t._flight;t._flight=void 0,rr(e,t,n)?.abort()}function ar(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=rr(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function or(e){for(let t of e){let e=t._flight;e&&e[2]++}}function sr(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function cr(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function lr(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return Yn;if(!i)return[Gn,void 0];let l=n._flight;sr(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(cr(e,t,n,r,s,a,!!o[3]))).then(e=>$n(e,!1,r.id),e=>$n(e,!0,r.id)).then(t=>(t[0]!==Gn&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===Kn&&l[2]?er(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],_r(e,t,r,await Zn(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return ir(e,n),Yn}finally{sr(e,n,!1,s)}}function ur(e,t,n){t[0]!==Jn&&(e.status=`success`,e.error=void 0,t[0]===Gn?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function dr(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&ir(e,r)}function fr(e,t){return t[0]===Kn||t[0]===qn?{...e,status:t[0]===Kn?`error`:`notFound`,error:t[1],_flight:void 0}:e}function pr(e,t,n,r,i,a,o){let s=t[1][n],c=Qn(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(cr(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=Yn)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,ir(e,s),p=tr(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,rr(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?lr(e,t,s,c,g,i,a).then(t=>(ur(s,t,l),t[0]===Gn&&(m&&!a[0].signal.aborted&&dr(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[Gn,s.loaderData]),T=(async()=>{try{let e=Hn(c,void 0,C);e&&await Zn(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,tr(e,t,c,r,a)]}let r=await w;x&&r[0]===Gn&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,T]),!y)return w.then(e=>fr(s,e));let ee={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let E=lr(e,t,ee,c,g,i,a).then(e=>(s.isFetching=!1,ur(ee,e,!1),e));return(t[2]??=[]).push([n,E,T,ee]),E.then(e=>fr(ee,e))}async function mr(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=Qn(e,t[n]);try{let e=Hn(i,!1);e&&await Zn(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function hr(e,t){t[2]&&=(ar(e,t[2].map(e=>e[3])),void 0)}async function gr(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=Jn)throw[a,t];!i&&t[0]!==Gn&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===Jn)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function _r(e,t,n,r,i,a){for(;r[0]===Jn;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[Jn,t]:[Jn,t,a]}return[Jn,o,n]}catch(e){r=a?[Kn,e]:er(n,e),a=!0}}return r}async function vr(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===qn?mr(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=Jn)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==Gn&&t[0]<Jn&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=Jn){let n=s[1];if(n[0]!==Jn||n[1].options.reloadDocument||n[2])return hr(e,t),n;c=!0,s=[0,[Kn,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===Kn?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=Qn(e,u);try{await Zn(i?Promise.resolve().then(()=>Hn(m,l===Kn?`errorComponent`:`notFoundComponent`)):Promise.all([Hn(m),Hn(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return hr(e,t),Yn}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),hr(e,t),ar(e,o),p()):u.status=`success`}return t}async function yr(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=Qn(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await Zn(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function br(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await mr(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=pr(e,i,t,u,f,r,l)},m=await nr(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===qn){let t=await mr(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=Jn&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=vr(e,i,u,r[0],gr(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=gr(i[2],void 0,void 0,h.then(e=>Xn(e)?0:Un(n).length,()=>0))),o=await h}catch(t){if(hr(e,i),t===a&&a.aborted)return Yn;throw t}return Xn(o)?o:yr(e,o,a,r[6]===n.length?r[6]:0)}function xr(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=Qn(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>xr(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function Sr(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function Cr(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Un(t[3]).some(e=>e.id===n[1]))return;let i;try{await Zn(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function wr(e,t){e._committed=t,e.stores.setMatches(t)}function Tr(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=Un(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e<n.length;e++){let t=n[e];(e<s||t.status===`success`)&&r.add(t.id)}for(let n of[...i,...o.values()]){if(n.status!==`success`||r.has(n.id))continue;let i=Qn(e,n);!i.options.loader||t-n.updatedAt>=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=En(n);wr(e,n),ar(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),Dn(e,i,n,a,l,t)}async function Er(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function Dr(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function Or(e,t,n,r,i){let a=n.map(e=>({...e}));or(a);for(let t of r)ir(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await vr(e,o,r,t[0],i)}catch(t){throw ar(e,a),t}if(Xn(s))ar(e,a),s[0]===Jn&&e._tx===t&&e._committed===n&&await Dr(e,t,s);else if(await yr(e,s,t[0].signal),e._tx!==t||e._committed!==n)ar(e,a);else{for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),ir(e,n))}wr(e,a),ar(e,n,a)}}async function kr(e,t,n,r,i,a){let o=await br(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(Xn(o)){let n=o[0]===Jn&&e._tx===t;if((!n||o[1].options.reloadDocument)&&Sr(e,t),ar(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){Sr(e,t);return}await Dr(e,t,o);return}let s=o[1];if(e._tx===t&&await Cr(e,t),e._tx!==t){Sr(e,t),ar(e,s),hr(e,o);return}let c=t[2],l=wn(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await Cr(e,t),e._tx!==t){Sr(e,t),ar(e,s),hr(e,o);return}let n=await e.startTransition(()=>{Sr(e,t),Tr(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);e._tx===t?(u?.length&&Or(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)):hr(e,o)})}async function Ar(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=wn(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await Er(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});or(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){ar(e,m),await Er(e,n);return}e._preflight=void 0;let g,_=()=>kr(e,y,f,()=>xr(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>Er(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&sr(e,t,!1)}n[0].abort(),ar(e,n[3],y[3],!0)}e._tx===y?(e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&xr(e,y),g?.(_()),await y[5]):(ar(e,y[3]),y[3]=[],g?.(),await Er(e,y))}async function jr(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),or(a),o=(e._preloads??=new Map).set(i,a),s=await br(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),ar(e,a)),i.abort()}if(!Xn(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){ft(e)||console.error(e);return}}}var Mr=`Error preloading route! ☝️`,Nr=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Pt:this.parentRoute||tt();let r=n?Pt:t?.path;r&&r!==`/`&&(r=rt(r));let i=t?.id||r,a=n?Pt:nt((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:nt(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=it(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Ft({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},Pr=class extends Nr{constructor(e){super(e)}},Fr=class extends m.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?m.createElement(this.props.errorComponent??Ir,{error:e[0],reset:this.reset}):this.props.children}};function Ir({error:e}){let[t,n]=m.useState(!1);return(0,h.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,h.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,h.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,h.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,h.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,h.jsx)(`div`,{children:(0,h.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,h.jsx)(`code`,{children:e.message}):null})}):null]})}var Lr=()=>!0,Rr=()=>!1;function zr({children:e,fallback:t=null}){return(0,h.jsx)(m.Fragment,{children:Br()?e:t})}function Br(e=!0){return m.useSyncExternalStore(Vr,Lr,e?Rr:Lr)}function Vr(){return()=>{}}var Hr=m.createContext(null);function Ur(e){return m.useContext(Hr)}function Wr(e,t){let n=e.stores.location,r=new Set,i,a,o=n=>{Wn(e,t,n)||(i=n,r.forEach(e=>e()))};return[()=>i??n.get(),e=>(r.size||(i=n.get(),a=n.subscribe(o).unsubscribe),r.add(e),()=>{r.delete(e),r.size||(a(),i=void 0)})]}var Gr=m.createContext(void 0),Kr=m.createContext(void 0);function qr({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0)n=e.nextSub;else{for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Jr(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Yr=[],Xr=0,{link:Zr,unlink:Qr,propagate:$r,checkDirty:ei,shallowPropagate:ti}=qr({update(e){return e._update()},notify(e){Yr[ri++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,si(e))}}),ni=0,ri=0,ii,ai=0;function oi(e){try{++ai,e()}finally{--ai||ci()}}function si(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Qr(n,e)}function ci(){if(!(ai>0)){for(;ni<ri;){let e=Yr[ni];Yr[ni++]=void 0,e.notify()}ni=0,ri=0}}function li(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return ii!==void 0&&Zr(i,ii,Xr),i._snapshot},subscribe(e){let t=Jr(e),n={current:!1},r=ui(()=>{i.get(),n.current?(ii=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=ii,o=t?.compare??Object.is;if(n)ii=i,++Xr,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{ii=a,n&&(i.flags&=-5),si(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&ei(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&ti(e)}}else e&32&&(i.flags=e&-33);return ii!==void 0&&Zr(i,ii,Xr),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&($r(e),ti(e),ci())}},i}function ui(e){let t=()=>{let t=ii;ii=n,++Xr,n.depsTail=void 0,n.flags=6;try{return e()}finally{ii=t,n.flags&=-5,si(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&ei(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,si(this)}};return t(),n}var di=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),fi=o(((e,t)=>{t.exports=di()})),pi=o((e=>{var t=d(),n=fi();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),mi=o(((e,t)=>{t.exports=pi()}))();function hi(e,t){return e===t}function gi(e,t=e=>e,n){let r=n?.compare??hi,i=(0,m.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,m.useCallback)(()=>e.get(),[e]);return(0,mi.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var _i={};function vi(e,t){let n=m.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=He(n.current,i):i}}function yi(e){let t=Ur(),n=m.useContext(e.from?Kr:Gr),r=e.from??n,i=t.stores.getMatchStore(r),a=vi(e,t),o=gi(i,e=>e?a(e):_i);if(o!==_i)return o;(e.shouldThrow??!0)&&tt()}function bi(e){return yi({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function xi(e){let{select:t,...n}=e;return yi({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Si(e){return yi({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Ci(e){return yi({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function wi(e){let t=Ur();return m.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Ti(e){return yi({...e,select:t=>e.select?e.select(t.context):t.context})}function Ei(...e){let t=m.useRef(e),n=t.current;return e.forEach((e,t)=>{We(n[t],e,!1,!0)||(n[t]=e)}),t.current}function Di(e,t){e.preloadRoute(t).catch(e=>{console.warn(e),console.warn(Mr)})}function Oi(e,t){let n=typeof e==`string`&&Ye(e);if(n)return t.has(n)?e:null}function ki(e,t,n,r){let i=ot(e.pathname,r),a=ot(t.pathname,r);return(n?.exact?i!==a:!i.startsWith(a)||i.length!==a.length&&i[a.length]!==`/`)||(n?.includeSearch??!0)&&!We(e.search,t.search,!n?.exact,n?.explicitUndefined)?!1:!n?.includeHash||e.hash===t.hash}function Ai(e,t,n){let r=Ur(),i=m.useRef(null),a=m.useCallback(e=>{if(i.current=e,typeof t==`function`)return t(e);t&&(t.current=e)},[t]),{activeOptions:o,to:s,preload:c,preloadDelay:l,disabled:u,target:d,onClick:f,onBlur:p,onFocus:h,onMouseEnter:g,onMouseLeave:_,onTouchStart:v}=e,[y,b,x]=Ei(e.search,e.params,o),S=m.useContext(Gr),C=(r.stores._linkScopes??={})[S]??=Wr(r,S),[w,T,ee]=m.useMemo(()=>{let t=Oi(s,r.protocolAllowlist);if(t!==void 0){let n=[t??void 0];return[e,()=>n]}let n={...e},i,a,o,c=()=>{let e=C[0]();if(e!==i){n._fromLocation=e;let t=r.buildLocation(n),o=Ri(t,r,u),s=u||o&&!Ye(o)?ki(e,t,x,r.basepath):void 0;(!a||a[0]!==o||a[1]!==s)&&(a=[o,s]),i=e}return a};return[n,c,x?.includeHash&&(()=>{let e=c();return e[1]?o??=[e[0],!1]:e})]},[r,C,e.from,e.hash,e.href,s,y,b,e.state,e.mask,e.unsafeRelative,x,u]),[E,D]=m.useSyncExternalStore(C[1],T,ee||T),O=D===void 0&&E,k=u||E===void 0,A=m.useRef(!1),j=e.reloadDocument||O||k?!1:c??r.options.defaultPreload,te=l??r.options.defaultPreloadDelay??0,M=m.useCallback(e=>{let t=e?.isIntersecting;t??j===`intent`?te?i.t??=setTimeout(()=>{i.t=void 0,Di(r,w)},te):Di(r,w):t===!1&&Ii(i)},[r,w,i,j,te]);m.useEffect(()=>{if(!j)return;j===`render`&&!A.current&&(A.current=!0,Di(r,w));let e=!0,t;return j===`viewport`&&i.current&&typeof IntersectionObserver==`function`&&(t=new IntersectionObserver(t=>{e&&M(t.pop())},{rootMargin:`100px`}),t.observe(i.current)),()=>{e=!1,t?.disconnect(),Ii(i)}},[r,w,j,M,i]);let ne=Pi(e,n);if(ne.ref=t?a:i,O)return ne.href=O,ne;let re=t=>{let n=d??t.currentTarget.getAttribute(`target`);!k&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&(!n||n===`_self`)&&t.button===0&&(t.preventDefault(),Ii(i),r.navigate({...e,_fromLocation:w._fromLocation}))},ie=()=>{j===`intent`&&Di(r,w)},ae=()=>{j===`intent`&&Ii(i)};return ne.onClick=Li(f,re),ne.onBlur=Li(p,ae),ne.onFocus=Li(h,M),ne.onMouseEnter=Li(g,M),ne.onMouseLeave=Li(_,ae),ne.onTouchStart=Li(v,ie),Fi(ne,e,D,E,k,n)}var ji={},Mi={className:`active`},Ni=new Set([`to`,`params`,`search`,`hash`,`state`,`mask`,`from`,`unsafeRelative`,`reloadDocument`,`preload`,`preloadDelay`,`preloadIntentProximity`,`hashScrollIntoView`,`replace`,`startTransition`,`resetScroll`,`viewTransition`,`ignoreBlocker`,`activeProps`,`inactiveProps`,`activeOptions`,`_asChild`]);function Pi(e,t){let n={};for(let r in e)Ni.has(r)||r===`type`&&t!==void 0||r===`disabled`&&t===`a`||(n[r]=e[r]);return n}function Fi(e,t,n,r,i,a){let{activeProps:o,inactiveProps:s,className:c,style:l,target:u}=t,d=Le(n?o:s,{})??(n?Mi:ji);Object.assign(e,d),e.href=r,a!==`a`&&(e.disabled=i),e.target=u;let f=d.style;(l||f)&&(e.style=l&&f?{...l,...f}:l||f);let p=d.className;return(c||p)&&(e.className=c?p?`${c} ${p}`:c:p),i&&(e.role=`link`,e[`aria-disabled`]=!0),n&&(e[`data-status`]=`active`,e[`aria-current`]=`page`),e}var Ii=e=>{clearTimeout(e.t),e.t=void 0},Li=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function Ri(e,t,n){if(n)return;let r=e.maskedLocation??e,i=r.external?r.publicHref:t.history.createHref(r.publicHref)||`/`;if(!r.external&&i===r.publicHref||!Ze(i,t.protocolAllowlist))return i}var zi=m.memo(m.forwardRef((e,t)=>{let n=e._asChild||`a`,r=Ai(e,t,n),i=typeof e.children==`function`?e.children({isActive:r[`data-status`]===`active`}):e.children;return m.createElement(n,r,i)}),Bi);function Bi(e,t){let n=0;for(let r in t)if(n++,e[r]!==t[r]&&(!Ni.has(r)||!We(e[r],t[r],!1,!0)))return!1;for(let t in e)n--;return n===0}var Vi=class extends Nr{constructor(e){super(e),this.useMatch=e=>yi({...e,from:this.id}),this.useRouteContext=e=>Ti({...e,from:this.id}),this.useSearch=e=>Ci({...e,from:this.id}),this.useParams=e=>Si({...e,from:this.id}),this.useLoaderDeps=e=>xi({...e,from:this.id}),this.useLoaderData=e=>bi({...e,from:this.id}),this.useNavigate=()=>wi({from:this.fullPath}),this.Link=m.forwardRef((e,t)=>(0,h.jsx)(zi,{ref:t,from:this.fullPath,...e}))}};function Hi(e){return new Vi(e)}var Ui=class extends Pr{constructor(e){super(e),this.useMatch=e=>yi({...e,from:this.id}),this.useRouteContext=e=>Ti({...e,from:this.id}),this.useSearch=e=>Ci({...e,from:this.id}),this.useParams=e=>Si({...e,from:this.id}),this.useLoaderDeps=e=>xi({...e,from:this.id}),this.useLoaderData=e=>bi({...e,from:this.id}),this.useNavigate=()=>wi({from:this.fullPath}),this.Link=m.forwardRef((e,t)=>(0,h.jsx)(zi,{ref:t,from:this.fullPath,...e}))}};function Wi(e){return new Ui(e)}function Gi(e){let t=Ur(),n=`not-found-${gi(t.stores.location,e=>e.pathname)}-${gi(t.stores.status)}`;return(0,h.jsx)(Fr,{getResetKey:()=>n,onCatch:(t,n)=>{if(ft(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(ft(t))return e.fallback?.(t);throw t},children:e.children})}function Ki(){return(0,h.jsx)(`p`,{children:`Not Found`})}function qi(e,t,n){return t.options.notFoundComponent?(0,h.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,h.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,h.jsx)(Ki,{})}function Ji(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,h.jsx)(n,{}):null}var Yi=(e,t)=>e[0]===t[0]&&e[1]===t[1],Xi=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,Zi=m.memo(function({routeId:e}){let t=Ur();return Qi(t,gi(t.stores.getMatchStore(e)))});function Qi(e,t){let n=e.routesById[t.routeId],r=Ji(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=Xi(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s)),l=(0,h.jsx)($i,{match:t});s&&(l=(0,h.jsx)(zr,{fallback:r,children:l})),o&&(l=(0,h.jsx)(Gi,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return m.createElement(o,e)},children:l})),i&&(l=(0,h.jsx)(Fr,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(ft(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:l})),c&&(l=(0,h.jsx)(m.Suspense,{fallback:r,children:l}));let u=n.isRoot&&n.options.shellComponent;return u?(0,h.jsx)(Gr.Provider,{value:t.routeId,children:(0,h.jsxs)(u,{children:[l,null]})}):(0,h.jsxs)(Gr.Provider,{value:t.routeId,children:[l,null]})}var $i=m.memo(function({match:e}){let t=Ur(),n=e.routeId,r=t.routesById[n],i=m.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=m.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,h.jsx)(e,{},i):(0,h.jsx)(ea,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!Xi(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return Ji(t,r)}if(e.status===`notFound`)return qi(t,r,e.error);if(e.status===`error`)throw e.error;return a}),ea=m.memo(function(){let e=Ur(),t=m.useContext(Gr),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=gi(a,e=>[!!e._notFound,e.error],{compare:Yi}),i=gi(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return qi(e,e.routesById[t],r);if(!i)return null;let a=(0,h.jsx)(Zi,{routeId:i});return t===`__root__`?(0,h.jsx)(m.Suspense,{fallback:Ji(e),children:a}):a});function ta(e,t){let n=e[1];e.length=0,n?.(t)}function na({t:e}){let t=Ur(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{ta(n,!1),n.push(i,a),e(t),m.startTransition(r)}),Fe(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(it(r.publicHref)!==it(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...wn(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function ra(){let e=Ur(),t=e.routesById[Pt],n=Ji(e,t),r=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(na,{t:m.useState()[1]}),e.ssr?(0,h.jsx)(ia,{}):(0,h.jsx)(m.Suspense,{fallback:n,children:(0,h.jsx)(ia,{})})]});return e.options.InnerWrap?(0,h.jsx)(e.options.InnerWrap,{children:r}):r}function ia(){let e=Ur(),t=e._rendered,n=gi(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;Fe(()=>{t[0]===n&&ta(t,!0)},[t,n]);let a=i?(0,h.jsx)(Zi,{routeId:i}):null;return e.options.disableGlobalCatchBoundary?a:(0,h.jsx)(Fr,{getResetKey:()=>r,onCatch:void 0,children:a})}var aa=e=>({createMutableStore:li,createReadonlyStore:li,batch:oi}),oa=e=>new sa(e),sa=class extends On{constructor(e){super(e,aa)}};function F({router:e,children:t,...n}){ze(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,h.jsx)(Hr.Provider,{value:e,children:t});return e.options.Wrap?(0,h.jsx)(e.options.Wrap,{children:r}):r}function ca({router:e,...t}){return(0,h.jsx)(F,{router:e,...t,children:(0,h.jsx)(ra,{})})}var la=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-T<w)}function E(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ee());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(E)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,k=O.port2;O.port1.onmessage=E,D=function(){k.postMessage(null)}}else D=function(){_(E,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ua=o(((e,t)=>{t.exports=la()})),da=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),fa=o(((e,t)=>{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)}}n(),t.exports=da()})),pa=o((e=>{var t=ua(),n=d(),r=fa();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function p(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function h(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var y=null,b=null;function x(e,t,n){return e===n||e===t&&(y=e,!0)}function S(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function C(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function w(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var T=Object.assign,ee=Symbol.for(`react.element`),E=Symbol.for(`react.transitional.element`),D=Symbol.for(`react.portal`),O=Symbol.for(`react.fragment`),k=Symbol.for(`react.strict_mode`),A=Symbol.for(`react.profiler`),j=Symbol.for(`react.consumer`),te=Symbol.for(`react.context`),M=Symbol.for(`react.forward_ref`),ne=Symbol.for(`react.suspense`),re=Symbol.for(`react.suspense_list`),ie=Symbol.for(`react.memo`),ae=Symbol.for(`react.lazy`),oe=Symbol.for(`react.activity`),se=Symbol.for(`react.legacy_hidden`),ce=Symbol.for(`react.memo_cache_sentinel`),le=Symbol.for(`react.view_transition`),ue=Symbol.for(`react.recoverable`),de=Symbol.iterator;function fe(e){return typeof e!=`object`||!e?null:(e=de&&e[de]||e[`@@iterator`],typeof e==`function`?e:null)}var pe=Symbol.for(`react.client.reference`);function me(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case O:return`Fragment`;case A:return`Profiler`;case k:return`StrictMode`;case ne:return`Suspense`;case re:return`SuspenseList`;case oe:return`Activity`;case le:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case D:return`Portal`;case te:return e.displayName||`Context`;case j:return(e._context.displayName||`Context`)+`.Consumer`;case M:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ie:return t=e.displayName||null,t===null?me(e.type)||`Memo`:t;case ae:t=e._payload,e=e._init;try{return me(e(t))}catch{}}return null}var he=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ge={pending:!1,data:null,method:null,action:null},_e=[],ve=-1;function ye(e){return{current:e}}function be(e){0>ve||(e.current=_e[ve],_e[ve]=null,ve--)}function xe(e,t){ve++,_e[ve]=e.current,e.current=t}var Se=ye(null),Ce=ye(null),we=ye(null),Te=ye(null);function Ee(e,t){switch(xe(we,t),xe(Ce,e),xe(Se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?yp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=yp(t),e=bp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}be(Se),xe(Se,e)}function De(){be(Se),be(Ce),be(we)}function Oe(e){var t=e.memoizedState;t!==null&&(mh._currentValue=t.memoizedState,xe(Te,e)),t=Se.current;var n=bp(t,e.type);t!==n&&(xe(Ce,e),xe(Se,n))}function ke(e){Ce.current===e&&(be(Se),be(Ce)),Te.current===e&&(be(Te),mh._currentValue=ge)}var Ae,je;function Me(e){if(Ae===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ae=t&&t[1]||``,je=-1<e.stack.indexOf(`
|
|
3
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
-
`+Ae+e+je}var Ne=!1;function Pe(e,t){if(!e||Ne)return``;Ne=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
|
-
`),l=s.split(`
|
|
6
|
-
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
7
|
-
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ne=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Me(n):``}function Fe(e,t){switch(e.tag){case 26:case 27:case 5:return Me(e.type);case 16:return Me(`Lazy`);case 13:return e.child!==t&&t!==null?Me(`Suspense Fallback`):Me(`Suspense`);case 19:return Me(`SuspenseList`);case 0:case 15:return Pe(e.type,!1);case 11:return Pe(e.type.render,!1);case 1:return Pe(e.type,!0);case 31:return Me(`Activity`);case 30:return Me(`ViewTransition`);default:return``}}function Ie(e){try{var t=``,n=null;do t+=Fe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
-
Error generating stack: `+e.message+`
|
|
9
|
-
`+e.stack}}var Le=Object.prototype.hasOwnProperty,Re=t.unstable_scheduleCallback,ze=t.unstable_cancelCallback,Be=t.unstable_shouldYield,Ve=t.unstable_requestPaint,He=t.unstable_now,Ue=t.unstable_getCurrentPriorityLevel,We=t.unstable_ImmediatePriority,Ge=t.unstable_UserBlockingPriority,Ke=t.unstable_NormalPriority,qe=t.unstable_LowPriority,Je=t.unstable_IdlePriority,Ye=t.log,Xe=t.unstable_setDisableYieldValue,Ze=null,Qe=null;function $e(e){if(typeof Ye==`function`&&Xe(e),Qe&&typeof Qe.setStrictMode==`function`)try{Qe.setStrictMode(Ze,e)}catch{}}var et=Math.clz32?Math.clz32:rt,tt=Math.log,nt=Math.LN2;function rt(e){return e>>>=0,e===0?32:31-(tt(e)/nt|0)|0}var it=256,at=262144,ot=4194304;function st(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ct(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=st(n))):i=st(o):i=st(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=st(n))):i=st(o)):i=st(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function lt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ut(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-et(n),i=1<<r;t|=e[r],n&=~i}return t}function dt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 ft(){var e=ot;return ot<<=1,!(ot&62914560)&&(ot=4194304),e}function pt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function mt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ht(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-et(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&>(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function gt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-et(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function _t(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-et(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function vt(e,t){var n=t&-t;return n=n&42?1:yt(n),(n&(e.suspendedLanes|t))===0?n:0}function yt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function bt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function xt(){var e=P.p;return e===0?(e=window.event,e===void 0?32:Ah(e.type)):e}function St(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var Ct=Math.random().toString(36).slice(2),wt=`__reactFiber$`+Ct,Tt=`__reactProps$`+Ct,Et=`__reactContainer$`+Ct,Dt=`__reactEvents$`+Ct,Ot=`__reactListeners$`+Ct,kt=`__reactHandles$`+Ct,At=`__reactResources$`+Ct,jt=`__reactMarker$`+Ct,Mt=`__reactLoad$`+Ct;function Nt(e){delete e[wt],delete e[Tt],delete e[Ot],delete e[kt]}function Pt(e){var t;if(t=e[wt])return t;for(var n=e.parentNode;n;){if(t=n[Et]||n[wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ym(e);e!==null;){if(n=e[wt])return n;e=ym(e)}return t}e=n,n=e.parentNode}return null}function Ft(e){if(e=e[wt]||e[Et]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function It(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Lt(e){var t=e[At];return t||=e[At]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Rt(e){e[jt]=!0}function zt(e){e[Mt]=void 0}var Bt=new Set,Vt={};function Ht(e,t){Ut(e,t),Ut(e+`Capture`,t)}function Ut(e,t){for(Vt[e]=t,e=0;e<t.length;e++)Bt.add(t[e])}var Wt=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]*$`),Gt={},Kt={};function qt(e){return Le.call(Kt,e)?!0:Le.call(Gt,e)?!1:Wt.test(e)?Kt[e]=!0:(Gt[e]=!0,!1)}var Jt=!1;function Yt(){var e=Jt;return Jt=!1,e}function Xt(e,t,n){if(qt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Zt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Qt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function $t(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function en(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function tn(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function nn(e){if(!e._valueTracker){var t=en(e)?`checked`:`value`;e._valueTracker=tn(e,t,``+e[t])}}function rn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=en(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var an=/[\n"\\]/g;function on(e){return e.replace(an,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function sn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+$t(t)):e.value!==``+$t(t)&&(e.value=``+$t(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):ln(e,$t(n)):o===`number`&&e.value==t?ln(e,$t(e.value)):ln(e,$t(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+$t(s):e.removeAttribute(`name`)}function cn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){nn(e);return}n=n==null?``:``+$t(n),t=t==null?n:``+$t(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),nn(e)}function ln(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function un(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+$t(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function dn(e,t,n){t!=null&&(t=``+$t(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+$t(n)}function fn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(he(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=$t(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),nn(e)}function pn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var mn=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 hn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||mn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function gn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Jt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(hn(e,a,r),Jt=!0)}else for(var o in t)t.hasOwnProperty(o)&&hn(e,o,t[o])}function _n(e){if(e.indexOf(`-`)===-1)return!1;switch(e){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 vn=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`],[`maskType`,`mask-type`],[`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`]]),yn=/^[\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 bn(e){return yn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function xn(){}var Sn=null;function Cn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wn=null,Tn=null;function En(e){var t=Ft(e);if(t&&(e=t.stateNode)){var n=e[Tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(sn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+on(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Tt]||null;if(!a)throw Error(i(90));sn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&rn(r)}break a;case`textarea`:dn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&un(e,!!n.multiple,t,!1)}}}var Dn=!1;function On(e,t,n){if(Dn)return e(t,n);Dn=!0;try{return e(t)}finally{if(Dn=!1,(wn!==null||Tn!==null)&&(Kd(),wn&&(t=wn,e=Tn,Tn=wn=null,En(t),e)))for(t=0;t<e.length;t++)En(e[t])}}function kn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Tt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var An=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,jn=!1;if(An)try{var Mn={};Object.defineProperty(Mn,"passive",{get:function(){jn=!0}}),window.addEventListener(`test`,Mn,Mn),window.removeEventListener(`test`,Mn,Mn)}catch{jn=!1}var Nn=null,Pn=null,Fn=null;function In(){if(Fn)return Fn;var e,t=Pn,n=t.length,r,i=`value`in Nn?Nn.value:Nn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Fn=i.slice(e,1<r?1-r:void 0)}function Ln(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Rn(){return!0}function zn(){return!1}function Bn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Rn:zn,this.isPropagationStopped=zn,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Rn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Rn)},persist:function(){},isPersistent:Rn}),t}var Vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hn=Bn(Vn),Un=T({},Vn,{view:0,detail:0}),Wn=Bn(Un),Gn,Kn,qn,Jn=T({},Un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ar,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==qn&&(qn&&e.type===`mousemove`?(Gn=e.screenX-qn.screenX,Kn=e.screenY-qn.screenY):Kn=Gn=0,qn=e),Gn)},movementY:function(e){return`movementY`in e?e.movementY:Kn}}),Yn=Bn(Jn),Xn=Bn(T({},Jn,{dataTransfer:0})),Zn=Bn(T({},Un,{relatedTarget:0})),Qn=Bn(T({},Vn,{animationName:0,elapsedTime:0,pseudoElement:0})),$n=Bn(T({},Vn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),er=Bn(T({},Vn,{data:0})),tr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},nr={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`},rr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function ir(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rr[e])?!!t[e]:!1}function ar(){return ir}var or=Bn(T({},Un,{key:function(e){if(e.key){var t=tr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Ln(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?nr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ar,charCode:function(e){return e.type===`keypress`?Ln(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Ln(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),sr=Bn(T({},Jn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),cr=Bn(T({},Vn,{submitter:0})),lr=Bn(T({},Un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ar})),ur=Bn(T({},Vn,{propertyName:0,elapsedTime:0,pseudoElement:0})),dr=Bn(T({},Jn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),fr=Bn(T({},Vn,{newState:0,oldState:0,source:0})),pr=[9,13,27,32],mr=An&&`CompositionEvent`in window,hr=null;An&&`documentMode`in document&&(hr=document.documentMode);var gr=An&&`TextEvent`in window&&!hr,_r=An&&(!mr||hr&&8<hr&&11>=hr),vr=` `,yr=!1;function br(e,t){switch(e){case`keyup`:return pr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function xr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Sr=!1;function Cr(e,t){switch(e){case`compositionend`:return xr(t);case`keypress`:return t.which===32?(yr=!0,vr):null;case`textInput`:return e=t.data,e===vr&&yr?null:e;default:return null}}function wr(e,t){if(Sr)return e===`compositionend`||!mr&&br(e,t)?(e=In(),Fn=Pn=Nn=null,Sr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return _r&&t.locale!==`ko`?null:t.data;default:return null}}var Tr={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 Er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Tr[e.type]:t===`textarea`}function Dr(e,t,n,r){wn?Tn?Tn.push(r):Tn=[r]:wn=r,t=np(t,`onChange`),0<t.length&&(n=new Hn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Or=null,kr=null;function Ar(e){Yf(e,0)}function jr(e){if(rn(It(e)))return e}function Mr(e,t){if(e===`change`)return t}var Nr=!1;if(An){var Pr;if(An){var Fr=`oninput`in document;if(!Fr){var Ir=document.createElement(`div`);Ir.setAttribute(`oninput`,`return;`),Fr=typeof Ir.oninput==`function`}Pr=Fr}else Pr=!1;Nr=Pr&&(!document.documentMode||9<document.documentMode)}function Lr(){Or&&(Or.detachEvent(`onpropertychange`,Rr),kr=Or=null)}function Rr(e){if(e.propertyName===`value`&&jr(kr)){var t=[];Dr(t,kr,e,Cn(e)),On(Ar,t)}}function zr(e,t,n){e===`focusin`?(Lr(),Or=t,kr=n,Or.attachEvent(`onpropertychange`,Rr)):e===`focusout`&&Lr()}function Br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return jr(kr)}function Vr(e,t){if(e===`click`)return jr(t)}function Hr(e,t){if(e===`input`||e===`change`)return jr(t)}function Ur(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Wr=typeof Object.is==`function`?Object.is:Ur;function Gr(e,t){if(Wr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Le.call(t,i)||!Wr(e[i],t[i]))return!1}return!0}function Kr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function qr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jr(e,t){var n=qr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=qr(n)}}function Yr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Kr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Kr(e.document)}return t}function Zr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Qr=An&&`documentMode`in document&&11>=document.documentMode,$r=null,ei=null,ti=null,ni=!1;function ri(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ni||$r==null||$r!==Kr(r)||(r=$r,`selectionStart`in r&&Zr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ti&&Gr(ti,r)||(ti=r,r=np(ei,`onSelect`),0<r.length&&(t=new Hn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=$r)))}function ii(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ai={animationend:ii(`Animation`,`AnimationEnd`),animationiteration:ii(`Animation`,`AnimationIteration`),animationstart:ii(`Animation`,`AnimationStart`),transitionrun:ii(`Transition`,`TransitionRun`),transitionstart:ii(`Transition`,`TransitionStart`),transitioncancel:ii(`Transition`,`TransitionCancel`),transitionend:ii(`Transition`,`TransitionEnd`)},oi={},si={};An&&(si=document.createElement(`div`).style,`AnimationEvent`in window||(delete ai.animationend.animation,delete ai.animationiteration.animation,delete ai.animationstart.animation),`TransitionEvent`in window||delete ai.transitionend.transition);function ci(e){if(oi[e])return oi[e];if(!ai[e])return e;var t=ai[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in si)return oi[e]=t[n];return e}var li=ci(`animationend`),ui=ci(`animationiteration`),di=ci(`animationstart`),fi=ci(`transitionrun`),pi=ci(`transitionstart`),mi=ci(`transitioncancel`),hi=ci(`transitionend`),gi=new Map,_i=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);_i.push(`scrollEnd`);function vi(e,t){gi.set(e,t),Ht(t,[e])}var yi=0;function bi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Dd.identifierPrefix;var n=yi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function xi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Fd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function Si(e,t){return e=xi(e),t=xi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Ci=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},wi=[],Ti=0,Ei=0;function Di(){for(var e=Ti,t=Ei=Ti=0;t<e;){var n=wi[t];wi[t++]=null;var r=wi[t];wi[t++]=null;var i=wi[t];wi[t++]=null;var a=wi[t];if(wi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ji(n,i,a)}}function Oi(e,t,n,r){wi[Ti++]=e,wi[Ti++]=t,wi[Ti++]=n,wi[Ti++]=r,Ei|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ki(e,t,n,r){return Oi(e,t,n,r),Mi(e)}function Ai(e,t){return Oi(e,null,null,t),Mi(e)}function ji(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-et(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Mi(e){if(50<Id)throw Id=0,Ld=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ni={};function Pi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fi(e,t,n,r){return new Pi(e,t,n,r)}function Ii(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Li(e,t){var n=e.alternate;return n===null?(n=Fi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ri(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function zi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ii(r)&&(s=1);else if(typeof r==`string`)s=eh(e,n,Se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case oe:return e=Fi(31,n,t,a),e.elementType=oe,e.lanes=o,e;case O:return Bi(n.children,a,o,t);case k:s=8,a|=24;break;case A:return e=Fi(12,n,t,a|2),e.elementType=A,e.lanes=o,e;case ne:return e=Fi(13,n,t,a),e.elementType=ne,e.lanes=o,e;case re:return e=Fi(19,n,t,a),e.elementType=re,e.lanes=o,e;case se:case le:return e=a|32,e=Fi(30,n,t,e),e.elementType=le,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case te:s=10;break a;case j:s=9;break a;case M:s=11;break a;case ie:s=14;break a;case ae:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Fi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Bi(e,t,n,r){return e=Fi(7,e,r,t),e.lanes=n,e}function Vi(e,t,n){return e=Fi(6,e,null,t),e.lanes=n,e}function Hi(e){var t=Fi(18,null,null,0);return t.stateNode=e,t}function Ui(e,t,n){return t=Fi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Wi=new WeakMap;function Gi(e,t){if(typeof e==`object`&&e){var n=Wi.get(e);return n===void 0?(t={value:e,source:t,stack:Ie(t)},Wi.set(e,t),t):n}return{value:e,source:t,stack:Ie(t)}}var Ki=[],qi=0,Ji=null,Yi=0,Xi=[],Zi=0,Qi=null,$i=1,ea=``;function ta(e,t){Ki[qi++]=Yi,Ki[qi++]=Ji,Ji=e,Yi=t}function na(e,t,n){Xi[Zi++]=$i,Xi[Zi++]=ea,Xi[Zi++]=Qi,Qi=e;var r=$i;e=ea;var i=32-et(r)-1;r&=~(1<<i),n+=1;var a=32-et(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,$i=1<<32-et(t)+i|n<<i|r,ea=a+e}else $i=1<<a|n<<i|r,ea=e}function ra(e){e.return!==null&&(ta(e,1),na(e,1,0))}function ia(e){for(;e===Ji;)Ji=Ki[--qi],Ki[qi]=null,Yi=Ki[--qi],Ki[qi]=null;for(;e===Qi;)Qi=Xi[--Zi],Xi[Zi]=null,ea=Xi[--Zi],Xi[Zi]=null,$i=Xi[--Zi],Xi[Zi]=null}function aa(e,t){Xi[Zi++]=$i,Xi[Zi++]=ea,Xi[Zi++]=Qi,$i=t.id,ea=t.overflow,Qi=e}var oa=null,sa=null,F=!1,ca=null,la=!1,da=Error(i(519));function pa(e){throw ya(Gi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),da}function ma(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[wt]=e,t[Tt]=r,n){case`dialog`:W(`cancel`,t),W(`close`,t);break;case`iframe`:case`object`:case`embed`:W(`load`,t);break;case`video`:case`audio`:for(n=0;n<qf.length;n++)W(qf[n],t);break;case`source`:W(`error`,t);break;case`img`:case`image`:case`link`:W(`error`,t),W(`load`,t);break;case`details`:W(`toggle`,t);break;case`input`:W(`invalid`,t),cn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:W(`invalid`,t);break;case`textarea`:W(`invalid`,t),fn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||cp(t.textContent,n)?(r.popover!=null&&(W(`beforetoggle`,t),W(`toggle`,t)),r.onScroll!=null&&W(`scroll`,t),r.onScrollEnd!=null&&W(`scrollend`,t),r.onClick!=null&&(t.onclick=xn),t=!0):t=!1,t||pa(e,!0)}function ha(e){for(oa=e.return;oa;)switch(oa.tag){case 5:case 31:case 13:la=!1;return;case 27:case 3:la=!0;return;default:oa=oa.return}}function ga(e){if(e!==oa)return!1;if(!F)return ha(e),F=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Sp(e.type,e.memoizedProps)),n=!n),n&&sa&&pa(e),ha(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));sa=vm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));sa=vm(e)}else t===27?(t=sa,jp(e.type)?(e=_m,_m=null,sa=e):sa=t):sa=oa?gm(e.stateNode.nextSibling):null;return!0}function _a(){sa=oa=null,F=!1}function va(){var e=ca;return e!==null&&(yd===null?yd=e:yd.push.apply(yd,e),ca=null),e}function ya(e){ca===null?ca=[e]:ca.push(e)}var ba=ye(null),xa=null,Sa=null;function Ca(e,t,n){xe(ba,t._currentValue),t._currentValue=n}function wa(e){e._currentValue=ba.current,be(ba)}function Ta(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ea(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ta(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ta(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Ta(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Da(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Wr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Te.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[mh]:e.push(mh))}a=a.return}return e!==null&&Ea(t,e,n,r),t.flags|=262144,e!==null}function Oa(e){for(e=e.firstContext;e!==null;){if(!Wr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ka(e){xa=e,Sa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Aa(e){return Ma(xa,e)}function ja(e,t){return xa===null&&ka(e),Ma(e,t)}function Ma(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Sa===null){if(e===null)throw Error(i(308));Sa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Sa=Sa.next=t;return n}var Na=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Pa=t.unstable_scheduleCallback,Fa=t.unstable_NormalPriority,Ia={$$typeof:te,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function La(){return{controller:new Na,data:new Map,refCount:0}}function Ra(e){e.refCount--,e.refCount===0&&Pa(Fa,function(){e.controller.abort()})}function za(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ba=null;function Va(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ha=null,Ua=0,Wa=0,Ga=null;function Ka(e,t){if(Ha===null){var n=Ha=[];Ua=0,Wa=Hf(),Ga={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ua++,t.then(qa,qa),t}function qa(){if(--Ua===0&&(Ba=null,Ha!==null)){Ga!==null&&(Ga.status=`fulfilled`);var e=Ha;Ha=null,Wa=0,Ga=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ja(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ya=N.S;N.S=function(e,t){if(Sd=He(),typeof t==`object`&&t&&typeof t.then==`function`&&Ka(e,t),Ba!==null)for(var n=Of;n!==null;)za(n,Ba),n=n.next;if(n=e.types,n!==null){for(var r=Of;r!==null;)za(r,n),r=r.next;if(Wa!==0){r=Ba,r===null&&(r=Ba=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ya!==null&&Ya(e,t)};var Xa=ye(null);function Za(){var e=Xa.current;return e===null?id.pooledCache:e}function Qa(e,t){t===null?xe(Xa,Xa.current):xe(Xa,t.pool)}function $a(){var e=Za();return e===null?null:{parent:Ia._currentValue,pool:e}}var eo=Error(i(460)),to=Error(i(474)),no=Error(i(542)),ro={then:function(){}};function io(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ao(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(xn,xn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,lo(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(xn,xn);else{if(e=id,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,lo(e),e}throw so=t,eo}}function oo(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(so=e,eo):e}}var so=null;function co(){if(so===null)throw Error(i(459));var e=so;return so=null,e}function lo(e){if(e===eo||e===no)throw Error(i(483))}var uo=null,fo=0;function po(e){var t=fo;return fo+=1,uo===null&&(uo=[]),ao(uo,e,t)}function mo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ho(e,t){throw t.$$typeof===ee?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function go(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Li(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Vi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===O?(e=d(e,t,n.props.children,r,n.key),mo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ae&&oo(i)===t.type)?(t=a(t,n.props),mo(t,n),t.return=e,t):(t=zi(n.type,n.key,n.props,null,e.mode,r),mo(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ui(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Bi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Vi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case E:return n=zi(t.type,t.key,t.props,null,e.mode,n),mo(n,t),n.return=e,n;case D:return t=Ui(t,e.mode,n),t.return=e,t;case ae:return t=oo(t),f(e,t,n)}if(he(t)||fe(t))return t=Bi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,po(t),n);if(t.$$typeof===te)return f(e,ja(e,t),n);ho(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case E:return n.key===i?l(e,t,n,r):null;case D:return n.key===i?u(e,t,n,r):null;case ae:return n=oo(n),p(e,t,n,r)}if(he(n)||fe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,po(n),r);if(n.$$typeof===te)return p(e,t,ja(e,n),r);ho(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case E:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case D:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ae:return r=oo(r),m(e,t,n,r,i)}if(he(r)||fe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,po(r),i);if(r.$$typeof===te)return m(e,t,n,ja(t,r),i);ho(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),F&&ta(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return F&&ta(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),F&&ta(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),F&&ta(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return F&&ta(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),F&&ta(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===O&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case E:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===O){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),mo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ae&&oo(l)===r.type){n(e,r.sibling),c=a(r,o.props),mo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===O?(c=Bi(o.props.children,e.mode,c,o.key),mo(c,o),c.return=e,e=c):(c=zi(o.type,o.key,o.props,null,e.mode,c),mo(c,o),c.return=e,e=c)}return s(e);case D:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ui(o,e.mode,c),c.return=e,e=c}return s(e);case ae:return o=oo(o),_(e,r,o,c)}if(he(o))return h(e,r,o,c);if(fe(o)){if(l=fe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,po(o),c);if(o.$$typeof===te)return _(e,r,ja(e,o),c);ho(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Vi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{fo=0;var i=_(e,t,n,r);return uo=null,i}catch(t){if(t===eo||t===no)throw t;var a=Fi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var _o=go(!0),vo=go(!1),yo=!1;function bo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function So(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Co(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,rd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Mi(e),ji(e,null,n),t}return Oi(e,r,t,n),Mi(e)}function wo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}function To(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Eo=!1;function Do(){if(Eo){var e=Ga;if(e!==null)throw e}}function Oo(e,t,n,r){Eo=!1;var i=e.updateQueue;yo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(ad&f)===f:(r&f)===f){f!==0&&f===Wa&&(Eo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:yo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),pd|=o,e.lanes=o,e.memoizedState=d}}function ko(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ao(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)ko(n[e],t)}var jo=ye(null),Mo=ye(0);function No(e,t){e=dd,xe(Mo,e),xe(jo,t),dd=e|t.baseLanes}function Po(){xe(Mo,dd),xe(jo,jo.current)}function Fo(){dd=Mo.current,be(jo),be(Mo)}var Io=ye(null),Lo=null;function Ro(e){var t=e.alternate;xe(Uo,Uo.current&1),xe(Io,e),Lo===null&&(t===null||jo.current!==null||t.memoizedState!==null)&&(Lo=e)}function zo(e){xe(Uo,Uo.current),xe(Io,e),Lo===null&&(Lo=e)}function Bo(e){e.tag===22?(xe(Uo,Uo.current),xe(Io,e),Lo===null&&(Lo=e)):Vo()}function Vo(){xe(Uo,Uo.current),xe(Io,Io.current)}function Ho(e){be(Io),Lo===e&&(Lo=null),be(Uo)}var Uo=ye(0);function Wo(e,t){xe(Io,Io.current),xe(Uo,t)}function Go(e){be(Uo),be(Io),Lo===e&&(Lo=null)}function Ko(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||pm(n)||mm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var qo=0,I=null,Jo=null,Yo=null,L=!1,Xo=!1,Zo=!1,Qo=0,$o=0,es=null,ts=0;function ns(){throw Error(i(321))}function rs(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Wr(e[n],t[n]))return!1;return!0}function is(e,t,n,r,i,a){return qo=a,I=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?gc:_c,Zo=!1,a=n(r,i),Zo=!1,Xo&&(a=os(t,n,r,i)),as(e),a}function as(e){N.H=hc;var t=Jo!==null&&Jo.next!==null;if(qo=0,Yo=Jo=I=null,L=!1,$o=0,es=null,t)throw Error(i(300));e===null||Pc||(e=e.dependencies,e!==null&&Oa(e)&&(Pc=!0))}function os(e,t,n,r){I=e;var a=0;do{if(Xo&&(es=null),$o=0,Xo=!1,25<=a)throw Error(i(301));if(a+=1,Yo=Jo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=vc,o=t(n,r)}while(Xo);return o}function ss(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?ms(t):t,e=e.useState()[0],(Jo===null?null:Jo.memoizedState)!==e&&(I.flags|=1024),t}function cs(){var e=Qo!==0;return Qo=0,e}function ls(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function us(e){if(L){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}L=!1}qo=0,Yo=Jo=I=null,Xo=!1,$o=Qo=0,es=null}function ds(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yo===null?I.memoizedState=Yo=e:Yo=Yo.next=e,Yo}function fs(){if(Jo===null){var e=I.alternate;e=e===null?null:e.memoizedState}else e=Jo.next;var t=Yo===null?I.memoizedState:Yo.next;if(t!==null)Yo=t,Jo=e;else{if(e===null)throw I.alternate===null?Error(i(467)):Error(i(310));Jo=e,e={memoizedState:Jo.memoizedState,baseState:Jo.baseState,baseQueue:Jo.baseQueue,queue:Jo.queue,next:null},Yo===null?I.memoizedState=Yo=e:Yo=Yo.next=e}return Yo}function ps(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ms(e){var t=$o;return $o+=1,es===null&&(es=[]),e=ao(es,e,t),t=I,(Yo===null?t.memoizedState:Yo.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?gc:_c),e}function hs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ms(e);if(e.$$typeof===ue)return;if(e.$$typeof===te)return Aa(e)}throw Error(i(438,String(e)))}function gs(e){var t=null,n=I.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=I.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ps(),I.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ce;return t.index++,n}function _s(e,t){return typeof t==`function`?t(e):t}function vs(e){return ys(fs(),Jo,e)}function ys(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(qo&f)===f:(ad&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Wa&&(d=!0);else if((qo&p)===p){u=u.next,p===Wa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,I.lanes|=p,pd|=p;f=u.action,Zo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,I.lanes|=f,pd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Wr(o,e.memoizedState)&&(Pc=!0,d&&(n=Ga,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function bs(e){var t=fs(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Wr(o,t.memoizedState)||(Pc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function xs(e,t,n){var r=I,a=fs(),o=F;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Wr((Jo||a).memoizedState,n);if(s&&(a.memoizedState=n,Pc=!0),a=a.queue,Ws(Cs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Yo!==null&&!!(Yo.memoizedState.tag&1),zs(e?9:8,{destroy:void 0},R.bind(null,r,a,n,t),null),e){if(r.flags|=2048,id===null)throw Error(i(349));o||qo&127||Ss(r,t,n)}return n}function Ss(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=I.updateQueue,t===null?(t=ps(),I.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function R(e,t,n,r){t.value=n,t.getSnapshot=r,ws(t)&&Ts(e)}function Cs(e,t,n){return n(function(){ws(t)&&Ts(e)})}function ws(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Wr(e,n)}catch{return!0}}function Ts(e){var t=Ai(e,2);t!==null&&Vd(t,e,2)}function Es(e){var t=ds();if(typeof e==`function`){var n=e;if(e=n(),Zo){$e(!0);try{n()}finally{$e(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:e},t}function Ds(e,t,n,r){return e.baseState=n,ys(e,Jo,typeof r==`function`?r:_s)}function Os(e,t,n,r,a){if(fc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,ks(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ks(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};o.types=a===null?null:a.types,N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),As(e,t,s)}catch(n){Ms(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),As(e,t,a)}catch(n){Ms(e,t,n)}}function As(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){js(e,t,n)},function(n){return Ms(e,t,n)}):js(e,t,n)}function js(e,t,n){t.status=`fulfilled`,t.value=n,Ns(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ks(e,n)))}function Ms(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ns(t),t=t.next;while(t!==r)}e.action=null}function Ns(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ps(e,t){return t}function z(e,t){if(F){var n=id.formState;if(n!==null){a:{var r=I;if(F){if(sa){b:{for(var i=sa,a=la;i.nodeType!==8;)if(!a||(i=gm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){sa=gm(i.nextSibling),r=i.data===`F!`;break a}}pa(r)}r=!1}r&&(t=n[0])}}return n=ds(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ps,lastRenderedState:t},n.queue=r,n=lc.bind(null,I,r),r.dispatch=n,r=Es(!1),a=dc.bind(null,I,!1,r.queue),r=ds(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Os.bind(null,I,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Fs(e){return Is(fs(),Jo,e)}function Is(e,t,n){if(t=ys(e,t,Ps)[0],e=vs(_s)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ms(t)}catch(e){throw e===eo?no:e}else r=t;t=fs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(I.flags|=2048,zs(9,{destroy:void 0},Ls.bind(null,i,n),null)),[r,a,e]}function Ls(e,t){e.action=t}function Rs(e){var t=fs(),n=Jo;if(n!==null)return Is(t,n,e);fs(),t=t.memoizedState,n=fs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function zs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=I.updateQueue,t===null&&(t=ps(),I.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Bs(){return fs().memoizedState}function Vs(e,t,n,r){var i=ds();I.flags|=e,i.memoizedState=zs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Hs(e,t,n,r){var i=fs();r=r===void 0?null:r;var a=i.memoizedState.inst;Jo!==null&&r!==null&&rs(r,Jo.memoizedState.deps)?i.memoizedState=zs(t,a,n,r):(I.flags|=e,i.memoizedState=zs(1|t,a,n,r))}function Us(e,t){Vs(8390656,8,e,t)}function Ws(e,t){Hs(2048,8,e,t)}function Gs(e){I.flags|=4;var t=I.updateQueue;if(t===null)t=ps(),I.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ks(e){var t=fs().memoizedState;return Gs({ref:t,nextImpl:e}),function(){if(rd&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function qs(e,t){return Hs(4,2,e,t)}function B(e,t){return Hs(4,4,e,t)}function Js(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function V(e,t,n){n=n==null?null:n.concat([e]),Hs(4,4,Js.bind(null,t,e),n)}function Ys(){}function H(e,t){var n=fs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&rs(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Xs(e,t){var n=fs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&rs(t,r[1]))return r[0];if(r=e(),Zo){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r}function Zs(e,t,n){return n===void 0||qo&1073741824&&!(ad&261930)?e.memoizedState=t:(e.memoizedState=n,e=zd(),I.lanes|=e,pd|=e,n)}function Qs(e,t,n,r){return Wr(n,t)?n:jo.current===null?!(qo&106)||qo&1073741824&&!(ad&261930)?(Pc=!0,e.memoizedState=n):(e=zd(),I.lanes|=e,pd|=e,t):(e=Zs(e,n,r),Wr(e,t)||(Pc=!0),e)}function $s(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};s.types=o===null?null:o.types,N.T=s,dc(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?uc(e,t,Ja(c,r),Rd(e)):uc(e,t,r,Rd(e))}catch(n){uc(e,t,{then:function(){},status:`rejected`,reason:n},Rd())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function ec(){}function tc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=nc(e).queue;$s(e,a,t,ge,n===null?ec:function(){return rc(e),n(r)})}function nc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ge,baseState:ge,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:ge},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rc(e){var t=nc(e);t.next===null&&(t=e.alternate.memoizedState),uc(e,t.next.queue,{},Rd())}function ic(){return Aa(mh)}function ac(){return fs().memoizedState}function oc(){return fs().memoizedState}function sc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Rd();e=So(n);var r=Co(t,e,n);r!==null&&(Vd(r,t,n),wo(r,t,n)),t={cache:La()},e.payload=t;return}t=t.return}}function cc(e,t,n){var r=Rd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},fc(e)?pc(t,n):(n=ki(e,t,n,r),n!==null&&(Vd(n,e,r),mc(n,t,r)))}function lc(e,t,n){uc(e,t,n,Rd())}function uc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(fc(e))pc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Wr(s,o))return Oi(e,t,i,0),id===null&&Di(),!1}catch{}if(n=ki(e,t,i,r),n!==null)return Vd(n,e,r),mc(n,t,r),!0}return!1}function dc(e,t,n,r){if(r={lane:2,revertLane:Hf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},fc(e)){if(t)throw Error(i(479))}else t=ki(e,n,r,2),t!==null&&Vd(t,e,2)}function fc(e){var t=e.alternate;return e===I||t!==null&&t===I}function pc(e,t){Xo=L=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}var hc={readContext:Aa,use:hs,useCallback:ns,useContext:ns,useEffect:ns,useImperativeHandle:ns,useLayoutEffect:ns,useInsertionEffect:ns,useMemo:ns,useReducer:ns,useRef:ns,useState:ns,useDebugValue:ns,useDeferredValue:ns,useTransition:ns,useSyncExternalStore:ns,useId:ns,useHostTransitionStatus:ns,useFormState:ns,useActionState:ns,useOptimistic:ns,useMemoCache:ns,useCacheRefresh:ns,useEffectEvent:ns},gc={readContext:Aa,use:hs,useCallback:function(e,t){return ds().memoizedState=[e,t===void 0?null:t],e},useContext:Aa,useEffect:Us,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Vs(4194308,4,Js.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vs(4194308,4,e,t)},useInsertionEffect:function(e,t){Vs(4,2,e,t)},useMemo:function(e,t){var n=ds();t=t===void 0?null:t;var r=e();if(Zo){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ds();if(n!==void 0){var i=n(t);if(Zo){$e(!0);try{n(t)}finally{$e(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=cc.bind(null,I,e),[r.memoizedState,e]},useRef:function(e){var t=ds();return e={current:e},t.memoizedState=e},useState:function(e){e=Es(e);var t=e.queue,n=lc.bind(null,I,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ys,useDeferredValue:function(e,t){return Zs(ds(),e,t)},useTransition:function(){var e=Es(!1);return e=$s.bind(null,I,e.queue,!0,!1),ds().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=I,a=ds();if(F){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),id===null)throw Error(i(349));ad&127||Ss(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Us(Cs.bind(null,r,o,e),[e]),r.flags|=2048,zs(9,{destroy:void 0},R.bind(null,r,o,n,t),null),n},useId:function(){var e=ds(),t=id.identifierPrefix;if(F){var n=ea,r=$i;n=(r&~(1<<32-et(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Qo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=ts++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ic,useFormState:z,useActionState:z,useOptimistic:function(e){var t=ds();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=dc.bind(null,I,!0,n),n.dispatch=t,[e,t]},useMemoCache:gs,useCacheRefresh:function(){return ds().memoizedState=sc.bind(null,I)},useEffectEvent:function(e){var t=ds(),n={impl:e};return t.memoizedState=n,function(){if(rd&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},_c={readContext:Aa,use:hs,useCallback:H,useContext:Aa,useEffect:Ws,useImperativeHandle:V,useInsertionEffect:qs,useLayoutEffect:B,useMemo:Xs,useReducer:vs,useRef:Bs,useState:function(){return vs(_s)},useDebugValue:Ys,useDeferredValue:function(e,t){return Qs(fs(),Jo.memoizedState,e,t)},useTransition:function(){var e=vs(_s)[0],t=fs().memoizedState;return[typeof e==`boolean`?e:ms(e),t]},useSyncExternalStore:xs,useId:ac,useHostTransitionStatus:ic,useFormState:Fs,useActionState:Fs,useOptimistic:function(e,t){return Ds(fs(),Jo,e,t)},useMemoCache:gs,useCacheRefresh:oc,useEffectEvent:Ks},vc={readContext:Aa,use:hs,useCallback:H,useContext:Aa,useEffect:Ws,useImperativeHandle:V,useInsertionEffect:qs,useLayoutEffect:B,useMemo:Xs,useReducer:bs,useRef:Bs,useState:function(){return bs(_s)},useDebugValue:Ys,useDeferredValue:function(e,t){var n=fs();return Jo===null?Zs(n,e,t):Qs(n,Jo.memoizedState,e,t)},useTransition:function(){var e=bs(_s)[0],t=fs().memoizedState;return[typeof e==`boolean`?e:ms(e),t]},useSyncExternalStore:xs,useId:ac,useHostTransitionStatus:ic,useFormState:Rs,useActionState:Rs,useOptimistic:function(e,t){var n=fs();return Jo===null?(n.baseState=e,[e,n.queue.dispatch]):Ds(n,Jo,e,t)},useMemoCache:gs,useCacheRefresh:oc,useEffectEvent:Ks};function yc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var bc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Rd(),i=So(r);i.payload=t,n!=null&&(i.callback=n),t=Co(e,i,r),t!==null&&(Vd(t,e,r),wo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Rd(),i=So(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Co(e,i,r),t!==null&&(Vd(t,e,r),wo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Rd(),r=So(n);r.tag=2,t!=null&&(r.callback=t),t=Co(e,r,n),t!==null&&(Vd(t,e,n),wo(t,e,n))}};function xc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Gr(n,r)||!Gr(i,a):!0}function Sc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&bc.enqueueReplaceState(t,t.state,null)}function Cc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function wc(e){Ci(e)}function Tc(e){console.error(e)}function Ec(e){Ci(e)}function Dc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Oc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function kc(e,t,n){return n=So(n),n.tag=3,n.payload={element:null},n.callback=function(){Dc(e,t)},n}function Ac(e){return e=So(e),e.tag=3,e}function jc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Oc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Oc(t,n,r),typeof i!=`function`&&(Td===null?Td=new Set([this]):Td.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Mc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Da(t,n,a,!0),n=Io.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Lo===null?$d():n.alternate===null&&fd===0&&(fd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ro?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Sf(e,r,a)),!1;case 22:return n.flags|=65536,r===ro?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Sf(e,r,a)),!1}throw Error(i(435,n.tag))}return Sf(e,r,a),$d(),!1}if(F)return t=Io.current,t===null?(r!==da&&(t=Error(i(423),{cause:r}),ya(Gi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Gi(r,n),a=kc(e.stateNode,r,a),To(e,a),fd!==4&&(fd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==da&&(e=Error(i(422),{cause:r}),ya(Gi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Gi(o,n),vd===null?vd=[o]:vd.push(o),fd!==4&&(fd=2),t===null)return!0;r=Gi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=kc(n.stateNode,r,e),To(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Td===null||!Td.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ac(a),jc(a,e,n,r),To(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Nc=Error(i(461)),Pc=!1;function Fc(e,t,n,r){t.child=e===null?vo(t,null,n,r):_o(t,e.child,n,r)}function Ic(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ka(t),r=is(e,t,n,o,a,i),s=cs(),e!==null&&!Pc?(ls(e,t,i),ul(e,t,i)):(F&&s&&ra(t),t.flags|=1,Fc(e,t,r,i),t.child)}function Lc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ii(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Rc(e,t,a,r,i)):(e=zi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!dl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Gr:n,n(o,r)&&e.ref===t.ref)return ul(e,t,i)}return t.flags|=1,e=Li(a,r),e.ref=t.ref,e.return=t,t.child=e}function Rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Gr(a,r)&&e.ref===t.ref){if(Pc=!1,t.pendingProps=r=a,dl(e,i))e.flags&131072&&(Pc=!0);else return t.lanes=e.lanes,ul(e,t,i)}}return Kc(e,t,n,r,i)}function zc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Vc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Qa(t,a===null?null:a.cachePool),a===null?Po():No(t,a),Bo(t);else return r=t.lanes=536870912,Vc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Qa(t,null),Po(),Vo()):(Qa(t,a.cachePool),No(t,a),Vo(),t.memoizedState=null);return Fc(e,t,i,n),t.child}function Bc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vc(e,t,n,r,i){var a=Za();return a=a===null?null:{parent:Ia._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Qa(t,null),Po(),Bo(t),e!==null&&Da(e,t,r,!0),t.childLanes=i,null}function Hc(e,t){return t=tl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Uc(e,t,n){return _o(t,e.child,null,n),e=Hc(t,t.pendingProps),e.flags|=2,Ho(t),t.memoizedState=null,e}function Wc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(F){if(r.mode===`hidden`)return e=Hc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Bc(null,e);if(zo(t),(e=sa)?(e=fm(e,la),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qi===null?null:{id:$i,overflow:ea},retryLane:536870912,hydrationErrors:null},n=Hi(e),n.return=t,t.child=n,oa=t,sa=null)):e=null,e===null)throw pa(t);return t.lanes=536870912,null}return Hc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(zo(t),a){if(t.flags&256)t.flags&=-257,t=Uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Pc||Da(e,t,n,!1),a=(n&e.childLanes)!==0,Pc||a){if(jo.current===null){if(r=id,r!==null&&(s=vt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ai(e,s),Vd(r,e,s),Nc;$d()}t=Uc(e,t,n)}else e=o.treeContext,sa=gm(s.nextSibling),oa=t,F=!0,ca=null,la=!1,e!==null&&aa(t,e),t=Hc(t,r),t.flags|=134221824;return t}return e=Li(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Kc(e,t,n,r,i){return ka(t),n=is(e,t,n,r,void 0,i),r=cs(),e!==null&&!Pc?(ls(e,t,i),ul(e,t,i)):(F&&r&&ra(t),t.flags|=1,Fc(e,t,n,i),t.child)}function qc(e,t,n,r,i,a){return ka(t),t.updateQueue=null,n=os(t,r,n,i),as(e),r=cs(),e!==null&&!Pc?(ls(e,t,a),ul(e,t,a)):(F&&r&&ra(t),t.flags|=1,Fc(e,t,n,a),t.child)}function Jc(e,t,n,r,i){if(ka(t),t.stateNode===null){var a=Ni,o=n.contextType;typeof o==`object`&&o&&(a=Aa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=bc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},bo(t),o=n.contextType,a.context=typeof o==`object`&&o?Aa(o):Ni,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(yc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&bc.enqueueReplaceState(a,a.state,null),Oo(t,r,a,i),Do(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Cc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ni,typeof u==`object`&&u&&(o=Aa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Sc(t,a,r,o),yo=!1;var f=t.memoizedState;a.state=f,Oo(t,r,a,i),Do(),l=t.memoizedState,s||f!==l||yo?(typeof d==`function`&&(yc(t,n,d,r),l=t.memoizedState),(c=yo||xc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,xo(e,t),o=t.memoizedProps,u=Cc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ni,typeof l==`object`&&l&&(c=Aa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Sc(t,a,r,c),yo=!1,f=t.memoizedState,a.state=f,Oo(t,r,a,i),Do();var p=t.memoizedState;o!==d||f!==p||yo||e!==null&&e.dependencies!==null&&Oa(e.dependencies)?(typeof s==`function`&&(yc(t,n,s,r),p=t.memoizedState),(u=yo||xc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Oa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Gc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=_o(t,e.child,null,i),t.child=_o(t,null,n,i)):Fc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ul(e,t,i),e}function Yc(e,t,n,r){return _a(),t.flags|=256,Fc(e,t,n,r),t.child}var Xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zc(e){return{baseLanes:e,cachePool:$a()}}function Qc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=gd),e}function $c(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Uo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(F){if(i?Ro(t):Vo(),(e=sa)?(e=fm(e,la),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qi===null?null:{id:$i,overflow:ea},retryLane:536870912,hydrationErrors:null},n=Hi(e),n.return=t,t.child=n,oa=t,sa=null)):e=null,e===null)throw pa(t);return t.lanes=mm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Vo(),i=t.mode,a=tl({mode:`hidden`,children:a},i),r=Bi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Zc(n),r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Bc(null,r)):(Ro(t),el(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return rl(e,t,a,o,r,c,s,n)}return i?(Vo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Li(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Bi(i,a,n,null),i.flags|=2):i=Li(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Bc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Zc(n):(a=i.cachePool,a===null?a=$a():(s=Ia._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Bc(e.child,r)):(Ro(t),n=e.child,e=n.sibling,n=Li(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function el(e,t){return t=tl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function tl(e,t){return e=Fi(22,e,null,t),e.lanes=0,e}function nl(e,t,n){return _o(t,e.child,null,n),e=el(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Ro(t),t.flags&=-257,nl(e,t,c)):t.memoizedState===null?(Vo(),o=a.fallback,s=t.mode,a=tl({mode:`visible`,children:a.children},s),o=Bi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,_o(t,e.child,null,c),a=t.child,a.memoizedState=Zc(c),a.childLanes=Qc(e,r,c),t.memoizedState=Xc,Bc(null,a)):(Vo(),t.child=e.child,t.flags|=128,null);if(Ro(t),mm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ya({value:a,source:null,stack:null})),nl(e,t,c)}if(Pc||Da(e,t,c,!1),r=(c&e.childLanes)!==0,Pc||r){if(jo.current!==null)return nl(e,t,c);if(r=id,r!==null&&(a=vt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ai(e,a),Vd(r,e,a),Nc;return pm(o)||$d(),nl(e,t,c)}return pm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,sa=gm(o.nextSibling),oa=t,F=!0,ca=null,la=!1,e!==null&&aa(t,e),t=el(t,a.children),t.flags|=134221824,t)}function il(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ta(e.return,t,n)}function al(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ko(n)===null&&(t=e),e=e.sibling}return t}function ol(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function sl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function cl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Uo.current;if(t.flags&128)return Wo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Wo(t,o),i===`backwards`&&e!==null?(sl(e),Fc(e,t,r,n),sl(e)):Fc(e,t,r,n),r=F?Yi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&il(e,n,t);else if(e.tag===19)il(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,sl(t)),ol(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ko(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ol(t,!0,n,null,a,r);break;case`together`:ol(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ol(t,!1,i,n,a,r)}return t.child}function ll(e,t,n){var r=t.pendingProps;return Ca(t,t.type,r.value),Fc(e,t,r.children,n),t.child}function ul(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),pd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Da(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function dl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Oa(e)))}function fl(e,t,n){switch(t.tag){case 3:Ee(t,t.stateNode.containerInfo),Ca(t,Ia,e.memoizedState.cache),_a();break;case 27:case 5:Oe(t);break;case 4:Ee(t,t.stateNode.containerInfo);break;case 10:Ca(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,zo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Ro(t),t.flags|=128,null;r=Da(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?$c(e,t,n):(Ro(t),e=ul(e,t,n),e===null?null:e.sibling)}Ro(t);break;case 19:if(t.flags&128)return cl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Da(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return cl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Wo(t,Uo.current),r)break;return null;case 22:return t.lanes=0,zc(e,t,n,t.pendingProps);case 24:Ca(t,Ia,e.memoizedState.cache)}return ul(e,t,n)}function pl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Pc=!0;else{if(!dl(e,n)&&!(t.flags&128))return Pc=!1,fl(e,t,n);Pc=!!(e.flags&131072)}}else Pc=!1,F&&t.flags&1048576&&na(t,Yi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=oo(t.elementType),t.type=e,typeof e==`function`)Ii(e)?(r=Cc(e,r),t.tag=1,t=Jc(null,t,e,r,n)):(t.tag=0,t=Kc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===M){t.tag=11,t=Ic(null,t,e,r,n);break a}if(a===ie){t.tag=14,t=Lc(null,t,e,r,n);break a}if(a===te){t.tag=10,t.type=e,t=ll(null,t,n);break a}}throw t=me(e)||e,Error(i(306,t,``))}}return t;case 0:return Kc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Cc(r,t.pendingProps),Jc(e,t,r,a,n);case 3:a:{if(Ee(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,xo(e,t),Oo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ca(t,Ia,r),r!==o.cache&&Ea(t,[Ia],n,!0),Do(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Yc(e,t,r,n);break a}if(r!==a){a=Gi(Error(i(424)),t),ya(a),t=Yc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(sa=gm(e.firstChild),oa=t,F=!0,ca=null,la=!0,n=vo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(_a(),r===a){t=ul(e,t,n);break a}Fc(e,t,r,n)}t=t.child}return t;case 26:return Gc(e,t),e===null?(n=Bm(t.type,null,t.pendingProps,null))?t.memoizedState=n:F||(t.stateNode=xp(t.type,t.pendingProps,we.current,t)):t.memoizedState=Bm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Oe(t),e===null&&F&&(r=t.stateNode=Sm(t.type,t.pendingProps,we.current),oa=t,la=!0,a=sa,jp(t.type)?(_m=a,sa=gm(r.firstChild)):sa=a),Fc(e,t,t.pendingProps.children,n),Gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&F&&((a=r=sa)&&(r=um(r,t.type,t.pendingProps,la),r===null?a=!1:(t.stateNode=r,oa=t,sa=gm(r.firstChild),la=!1,a=!0)),a||pa(t)),Oe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Sp(a,o)?r=null:s!==null&&Sp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=is(e,t,ss,null,null,n),mh._currentValue=a),Gc(e,t),Fc(e,t,r,n),t.child;case 6:return e===null&&F&&((e=n=sa)&&(n=dm(n,t.pendingProps,la),n===null?e=!1:(t.stateNode=n,oa=t,sa=null,e=!0)),e||pa(t)),null;case 13:return $c(e,t,n);case 4:return Ee(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=_o(t,null,r,n):Fc(e,t,r,n),t.child;case 11:return Ic(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Gc(e,t),Fc(e,t,r,n),t.child;case 8:return Fc(e,t,t.pendingProps.children,n),t.child;case 12:return Fc(e,t,t.pendingProps.children,n),t.child;case 10:return ll(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ka(t),a=Aa(a),r=r(a),t.flags|=1,Fc(e,t,r,n),t.child;case 14:return Lc(e,t,t.type,t.pendingProps,n);case 15:return Rc(e,t,t.type,t.pendingProps,n);case 19:return cl(e,t,n);case 31:return Wc(e,t,n);case 22:return zc(e,t,n,t.pendingProps);case 24:return ka(t),r=Aa(Ia),e===null?(a=Za(),a===null&&(a=id,o=La(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},bo(t),Ca(t,Ia,a)):((e.lanes&n)!==0&&(xo(e,t),Oo(t,null,null,n),Do()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ca(t,Ia,r),r!==a.cache&&Ea(t,[Ia],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ca(t,Ia,r))),Fc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:F&&ra(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Gc(e,t),Fc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ml(e){e.flags|=4}function hl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?th(t,r):th(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Xd())e.flags|=8192;else throw so=ro,to}}else e.flags&=-16777217}function gl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!nh(t)){if(Xd())e.flags|=8192;else throw so=ro,to}}function _l(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ft(),e.lanes|=t,_d|=t)}function vl(e,t){if(!F)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function yl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function bl(e,t,n){var r=t.pendingProps;switch(ia(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yl(t),null;case 1:return yl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),wa(Ia),De(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ga(t)?ml(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,va())),yl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ml(t),o===null?(yl(t),hl(t,a,null,r,n)):(yl(t),gl(t,o))):o?o===e.memoizedState?(yl(t),t.flags&=-16777217):(ml(t),yl(t),gl(t,o)):(e=e.memoizedProps,e!==r&&ml(t),yl(t),hl(t,a,e,r,n)),null;case 27:if(ke(t),n=we.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return yl(t),t.subtreeFlags&=-33554433,null}e=Se.current,ga(t)?ma(t,e):(e=Sm(a,r,n),t.stateNode=e,ml(t))}return yl(t),t.subtreeFlags&=-33554433,null;case 5:if(ke(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return yl(t),t.subtreeFlags&=-33554433,null}if(o=Se.current,ga(t))ma(t,o);else{var s=vp(we.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[wt]=t,o[Tt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(dp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&ml(t)}}return yl(t),t.subtreeFlags&=-33554433,hl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=we.current,ga(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=oa,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[wt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||cp(e.nodeValue,n)),e||pa(t,!0)}else e=vp(e).createTextNode(r),e[wt]=t,t.stateNode=e}return yl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ga(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[wt]=t}else _a(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),e=!1}else n=va(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ho(t),t):(Ho(t),null);if(t.flags&128)throw Error(i(558))}return yl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ga(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[wt]=t}else _a(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),a=!1}else a=va(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ho(t),t):(Ho(t),null)}return Ho(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),_l(t,t.updateQueue),yl(t),null);case 4:return De(),e===null&&Qf(t.stateNode.containerInfo),t.flags|=67108864,yl(t),null;case 10:return wa(t.type),yl(t),null;case 19:if(Go(t),r=t.memoizedState,r===null)return yl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)vl(r,!1);else{if(fd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ko(e),o!==null){for(t.flags|=128,vl(r,!1),e=o.updateQueue,t.updateQueue=e,_l(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ri(n,e),n=n.sibling;return Wo(t,Uo.current&1|2),F&&ta(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&He()>Cd&&(t.flags|=128,a=!0,vl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Ko(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,_l(t,e),vl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!F)return yl(t),null}else 2*He()-r.renderingStartTime>Cd&&n!==536870912&&(t.flags|=128,a=!0,vl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=He(),e.sibling=null,o=Uo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||F?Wo(t,o):(n=o,xe(Io,t),xe(Uo,n),Lo===null&&(Lo=t)),F&&ta(t,r.treeForkCount),e}return yl(t),null;case 22:case 23:return Ho(t),Fo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(yl(t),t.subtreeFlags&6&&(t.flags|=8192)):yl(t),n=t.updateQueue,n!==null&&_l(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&be(Xa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),wa(Ia),yl(t),null;case 25:return null;case 30:return t.flags|=33554432,yl(t),null}throw Error(i(156,t.tag))}function xl(e,t){switch(ia(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return wa(Ia),De(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ke(t),null;case 31:if(t.memoizedState!==null){if(Ho(t),t.alternate===null)throw Error(i(340));_a()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ho(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));_a()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Go(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return De(),null;case 10:return wa(t.type),null;case 22:case 23:return Ho(t),Fo(),e!==null&&be(Xa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return wa(Ia),null;case 25:return null;default:return null}}function Sl(e,t){switch(ia(t),t.tag){case 3:wa(Ia),De();break;case 26:case 27:case 5:ke(t);break;case 4:De();break;case 31:t.memoizedState!==null&&Ho(t);break;case 13:Ho(t);break;case 19:Go(t);break;case 10:wa(t.type);break;case 22:case 23:Ho(t),Fo(),e!==null&&be(Xa);break;case 24:wa(Ia)}}function Cl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){xf(t,t.return,e)}}function wl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){xf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){xf(t,t.return,e)}}function Tl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ao(t,n)}catch(t){xf(e,e.return,t)}}}function El(e,t,n){n.props=Cc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){xf(e,t,n)}}function Dl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=bi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Up(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Wp(e);p(e.child,!1,am,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){xf(e,t,n)}}function Ol(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){xf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){xf(e,t,n)}else n.current=null}}function kl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)sm(e.stateNode,t[n])}function Al(e){for(var t=e.return;t!==null&&(Nl(t)&&sm(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function jl(e){for(var t=e.return;t!==null&&(Nl(t)&&cm(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function Ml(e){return e.tag===5||e.tag===3||e.tag===27}function Nl(e){return e&&e.tag===7&&e.stateNode!==null}function Pl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){xf(e,e.return,t)}}function Fl(e,t,n){try{var r=e.stateNode;pp(r,e.type,n,t),r[Tt]=t}catch(t){xf(e,e.return,t)}}function Il(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&jp(e.type)||e.tag===4}function Ll(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Il(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&jp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=xn)),kl(e,r),Jt=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,jp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),kl(e,r),Jt=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,jp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(zl(e,t,n,r),e=e.sibling;e!==null;)zl(e,t,n,r),e=e.sibling}function Bl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);dp(t,r,n),t[wt]=e,t[Tt]=n}catch(t){xf(e,e.return,t)}}var Vl=!1,Hl=null;function Ul(e){(e.tag===30||e.subtreeFlags&33554432)&&(Vl=!0)}var Wl=null;function Gl(){var e=Wl;return Wl=null,e}var Kl=0;function ql(e,t,n,r,i){return Kl=0,Jl(e.child,t,n,r,i)}function Jl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Lp(o);r.push(s),s.view&&(a=!0)}else a||Lp(o).view&&(a=!0);Vl=!0,Pp(o,Kl===0?t:t+`_`+Kl,n),Kl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Jl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Yl(e,t){for(;e!==null;)e.tag===5?Fp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Yl(e.child,t)),e=e.sibling}function Xl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Xl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=Si(t.default,t.share),t!==`none`&&(ql(e,n,t,null,!1)||Yl(e.child,!1))}e=e.sibling}}function Zl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=bi(r,n),a=Si(r.default,n.paired?r.share:r.enter);a===`none`?Xl(e):ql(e,i,a,null,!1)?(Xl(e),n.paired||t||Bd(e,r.onEnter)):Yl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e,t),e=e.sibling;else Xl(e)}function Ql(e){if(Hl!==null&&Hl.size!==0){var t=Hl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=Si(n.default,n.share);if(a!==`none`&&(ql(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Bd(e,n.onShare)):Yl(e.child,!1)),t.delete(r),t.size===0)break}}}Ql(e)}e=e.sibling}}}function $l(e){if(e.tag===30){var t=e.memoizedProps,n=bi(t,e.stateNode),r=Hl===null?void 0:Hl.get(n),i=Si(t.default,r===void 0?t.exit:t.share);i!==`none`&&(ql(e,n,i,null,!1)?r===void 0?Bd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Hl.delete(n),Bd(e,t.onShare)):Yl(e.child,!1)),Hl!==null&&Ql(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Hl!==null&&Ql(e)}function eu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=bi(t,e.stateNode);t=Si(t.default,t.update),e.flags&=-5,t!==`none`&&ql(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&eu(e);e=e.sibling}}function tu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Yl(e.child,!1))}tu(e)}e=e.sibling}}function nu(e){if(e.tag===30)e.stateNode.paired=null,Yl(e.child,!1),tu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)nu(e),e=e.sibling;else tu(e)}function ru(e){for(e=e.child;e!==null;)e.tag===30?Yl(e.child,!1):e.subtreeFlags&33554432&&ru(e),e=e.sibling}function iu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Kl<a.length){var l=a[Kl],u=Lp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Pp(c,Kl===0?n:n+`_`+Kl,i),s&&e.flags&4||(Wl===null&&(Wl=[]),Wl.push(c,Kl===0?r:r+`_`+Kl,t.memoizedProps)),Kl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:iu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function au(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=bi(n,r),a=Si(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Rp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Kl=0,i=iu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Bd(e,n.onUpdate))}else e.subtreeFlags&33554432&&au(e,t);e=e.sibling}}var ou=!1,su=!1,cu=!1,lu=!1,uu=typeof WeakSet==`function`?WeakSet:Set,du=null,fu=!1,pu=!1,mu=!1,hu=!1;function gu(e,t,n){if(e=e.containerInfo,gp=Ch,e=Xr(e),Zr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(_p={focusedElem:e,selectionRange:r},Ch=!1,n=(n&335544064)===n,du=t,t=n?9270:1024;du!==null;){if(e=du,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&$l(r[a]);if(e.alternate===null&&e.flags&2)n&&Ul(e),_u(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&$l(r),_u(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ul(e),_u(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,du=r):(n&&eu(e),_u(n))}}Hl=null}function _u(e){for(;du!==null;){var t=du,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Cc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){xf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)lm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:lm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=bi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=Si(a.default,a.update),a!==`none`&&ql(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,du=r;break}du=t.return}}function vu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ru(e,n),r&4&&Cl(5,n);break;case 1:if(Ru(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){xf(n,n.return,e)}else{var i=Cc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){xf(n,n.return,e)}}}r&64&&Tl(n),r&512&&Dl(n,n.return);break;case 3:if(Ru(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ao(e,t)}catch(e){xf(n,n.return,e)}}break;case 27:t===null&&r&4&&Bl(n);case 26:case 5:Ru(e,n),t===null&&r&4&&Pl(n),r&512&&Dl(n,n.return);break;case 12:Ru(e,n);break;case 31:Ru(e,n),r&4&&Du(e,n);break;case 13:Ru(e,n),r&4&&Ou(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Tf.bind(null,n),hm(e,n))));break;case 22:if(r=n.memoizedState!==null||ou,!r){var a=t!==null&&t.memoizedState!==null||su;t=ou,i=su,ou=r,(su=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Bu(e,n,r)):Ru(e,n),ou=t,su=i}break;case 30:Ru(e,n),r&512&&Dl(n,n.return);break;case 7:r&512&&Dl(n,n.return);default:Ru(e,n)}}function yu(e,t){for(e=e.child;e!==null;)bu(e,t),e=e.sibling}function bu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){xf(e,e.return,t)}xu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Jt=!0}catch(t){xf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Np(s,!0):Np(e.stateNode,!1)}catch(t){xf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&yu(e,t);break;default:yu(e,t)}}function xu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:bu(n,r);break a;case 22:n.memoizedState===null&&xu(n,r);break a;default:xu(n,r)}}e=e.sibling}}function Su(e){var t=e.alternate;t!==null&&(e.alternate=null,Su(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Nt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Cu=null,wu=!1;function Tu(e,t,n){for(n=n.child;n!==null;)Eu(e,t,n),n=n.sibling}function Eu(e,t,n){if(Qe&&typeof Qe.onCommitFiberUnmount==`function`)try{Qe.onCommitFiberUnmount(Ze,n)}catch{}switch(n.tag){case 26:su||Ol(n,t),Tu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!su&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:su||Ol(n,t),jl(n);var r=Cu,i=wu;jp(n.type)&&(Cu=n.stateNode,wu=!1),Tu(e,t,n),Cm(n.stateNode,n.type,n.memoizedProps),Cu=r,wu=i;break;case 5:su||Ol(n,t),jl(n);case 6:if(n.tag===6&&jl(n),r=Cu,i=wu,Cu=null,Tu(e,t,n),Cu=r,wu=i,Cu!==null){if(wu)try{(Cu.nodeType===9?Cu.body:Cu.nodeName===`HTML`?Cu.ownerDocument.body:Cu).removeChild(n.stateNode),Jt=!0}catch(e){xf(n,t,e)}else try{Cu.removeChild(n.stateNode),Jt=!0}catch(e){xf(n,t,e)}}break;case 18:Cu!==null&&(wu?(e=Cu,Mp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Jh(e)):Mp(Cu,n.stateNode));break;case 4:r=Cu,i=wu,Cu=n.stateNode.containerInfo,wu=!0,Tu(e,t,n),Cu=r,wu=i;break;case 0:case 11:case 14:case 15:wl(2,n,t),su||wl(4,n,t),Tu(e,t,n);break;case 1:su||(Ol(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&El(n,t,r)),Tu(e,t,n);break;case 21:Tu(e,t,n);break;case 22:su=(r=su)||n.memoizedState!==null,Tu(e,t,n),su=r;break;case 30:Ol(n,t),Tu(e,t,n);break;case 7:su||Ol(n,t),Tu(e,t,n);break;default:Tu(e,t,n)}}function Du(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Jh(e)}catch(e){xf(t,t.return,e)}}}function Ou(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Jh(e)}catch(e){xf(t,t.return,e)}}function ku(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new uu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new uu),t;default:throw Error(i(435,e.tag))}}function Au(e,t){var n=ku(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ef.bind(null,e,t);t.then(r,r)}})}function ju(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(jp(l.type)){Cu=l.stateNode,wu=!1;break a}break;case 5:Cu=l.stateNode,wu=!1;break a;case 3:case 4:Cu=l.stateNode.containerInfo,wu=!0;break a}l=l.return}if(Cu===null)throw Error(i(160));Eu(s,c,o),Cu=null,wu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Nu(t,e,n),t=t.sibling}var Mu=null;function Nu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}ju(t,e,n),Pu(e),a&4&&(wl(3,e,e.return),Cl(3,e),wl(5,e,e.return));break;case 1:ju(t,e,n),Pu(e),a&512&&(su||r===null||Ol(r,r.return)),a&64&&ou&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Mu,ju(t,e,n),Pu(e),a&512&&(su||r===null||Ol(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(ou)e.stateNode=xp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[jt]||r[wt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),dp(r,t,n),r[wt]=e,Rt(r),t=r;break a;case`link`:if(o=Qm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),dp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Qm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),dp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[wt]=e,Rt(r),t=r}e.stateNode=t}}else ou||$m(o,e.type,e.stateNode)}else e.stateNode=qm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Fl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||su||t.parentNode.removeChild(t)):a.count--,n===null?ou||$m(o,e.type,e.stateNode):qm(o,n,e.memoizedProps))}break;case 27:ju(t,e,n),Pu(e),a&512&&(su||r===null||Ol(r,r.return)),r!==null&&a&4&&Fl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=cu,cu=!1,ju(t,e,n),cu=o,Pu(e),a&512&&(su||r===null||Ol(r,r.return)),e.flags&32){t=e.stateNode;try{pn(t,``),Jt=!0}catch(t){xf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Fl(e,t,r===null?t:r.memoizedProps)),a&1024&&(lu=!0);break;case 6:if(ju(t,e,n),Pu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Jt=!0}catch(t){xf(e,e.return,t)}}break;case 3:if(Jt=!1,Zm=null,o=Mu,Mu=Dm(t.containerInfo),ju(t,e,n),Mu=o,Pu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Jh(t.containerInfo)}catch(t){xf(e,e.return,t)}lu&&(lu=!1,Fu(e)),Jt=!1;break;case 4:a=cu,cu=ou,r=Yt(),o=Mu,Mu=Dm(e.stateNode.containerInfo),ju(t,e,n),Pu(e),Mu=o,Jt&&pu&&(mu=!0),Jt=r,cu=a;break;case 12:ju(t,e,n),Pu(e);break;case 31:ju(t,e,n),Pu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 13:ju(t,e,n),Pu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(xd=He()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=ou,l=su,u=cu;ou=c||o,cu=u||o,su=l||s,ju(t,e,n),su=l,cu=u,ou=c,Pu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||ou||su||(t=s||su,n=ou,r=su,ou=o||ou,su=t,zu(e,2),ou=n,su=r),!o&&cu||yu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Au(e,n))));break;case 19:ju(t,e,n),Pu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 30:a&512&&(su||r===null||Ol(r,r.return)),a=Yt(),o=pu,s=(n&335544064)===n,c=e.memoizedProps,pu=s&&Si(c.default,c.update)!==`none`,ju(t,e,n),Pu(e),s&&r!==null&&Jt&&(e.flags|=4),pu=o,Jt=a;break;case 21:break;case 7:a&512&&(su||r===null||Ol(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:ju(t,e,n),Pu(e)}}function Pu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Il(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Nl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Ml(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;zl(e,Ll(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(pn(l,``),n.flags&=-33),zl(e,Ll(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Rl(e,Ll(e),u,s);break;default:throw Error(i(161))}}catch(t){xf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Fu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Ch=!0,t.reset(),Ch=!1),e=e.sibling}}function Iu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Lu(t,e),t=t.sibling;else au(t,!1)}function Lu(e,t){var n=e.alternate;if(n===null)Zl(e,!1);else switch(e.tag){case 3:if(hu=fu=!1,Gl(),Iu(t,e),!fu&&!mu){if(e=Wl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Fp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),hu=!0}Wl=null;break;case 5:Iu(t,e);break;case 4:r=fu,fu=!1,Iu(t,e),fu&&(mu=!0),fu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Iu(t,e):Zl(e,!1));break;case 30:r=fu,i=Gl(),fu=!1,Iu(t,e),fu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=bi(a,o),o=bi(n.memoizedProps,o);var s=Si(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Kl=0,t=iu(e,n,t,o,s,a,!0),Kl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Bd(e,e.memoizedProps.onUpdate),Wl=i):i!==null&&(i.push.apply(i,Wl),Wl=i),fu=e.flags&32?!0:r;break;default:Iu(t,e)}}function Ru(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)vu(e,t.alternate,t),t=t.sibling}function zu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:wl(4,n,n.return),zu(n,r);break;case 1:Ol(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&El(n,n.return,i),zu(n,r);break;case 27:r&2&&Cm(n.stateNode,n.type,n.memoizedProps);case 5:Ol(n,n.return),n.tag!==5&&n.tag!==27||jl(n),zu(n,r);break;case 6:jl(n);break;case 26:Ol(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||su||i.parentNode.removeChild(i),zu(n,r);break;case 22:n.memoizedState===null&&zu(n,r);break;case 30:Ol(n,n.return),zu(n,r);break;case 7:Ol(n,n.return);default:zu(n,r)}e=e.sibling}}function Bu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Bu(i,a,n),Cl(4,a);break;case 1:if(Bu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){xf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)ko(l[i],c)}catch(e){xf(r,r.return,e)}}s&&o&64&&Tl(a),Dl(a,a.return);break;case 27:n&2&&Bl(a);case 5:a.tag!==5&&a.tag!==27||Al(a),Bu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 6:Al(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ou||$m(Dm(c.ownerDocument),a.type,c),Bu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 12:Bu(i,a,n);break;case 31:Bu(i,a,n),s&&o&4&&Du(i,a);break;case 13:Bu(i,a,n),s&&o&4&&Ou(i,a);break;case 22:a.memoizedState===null&&Bu(i,a,n),Dl(a,a.return);break;case 30:Bu(i,a,n),Dl(a,a.return);break;case 7:Dl(a,a.return);default:Bu(i,a,n)}t=t.sibling}}function Vu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ra(n))}function Hu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ra(e))}function Uu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Wu(e,t,n,r),t=t.sibling;else i&&ru(t)}function Wu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&nu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Uu(e,t,n,r),a&2048&&Cl(9,t);break;case 1:Uu(e,t,n,r);break;case 3:Uu(e,t,n,r),i&&hu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ra(a)));break;case 12:if(a&2048){Uu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){xf(t,t.return,e)}}else Uu(e,t,n,r);break;case 31:Uu(e,t,n,r);break;case 13:Uu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&nu(t),o._visibility&2?Uu(e,t,n,r):(o._visibility|=2,Gu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&nu(s),o._visibility&2?Uu(e,t,n,r):Ku(e,t)),a&2048&&Vu(s,t);break;case 24:Uu(e,t,n,r),a&2048&&Hu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Yl(a.child,!0),Yl(t.child,!0))),Uu(e,t,n,r);break;default:Uu(e,t,n,r)}}function Gu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Gu(a,o,s,c,i),Cl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Gu(a,o,s,c,i)):u._visibility&2?Gu(a,o,s,c,i):Ku(a,o),i&&l&2048&&Vu(o.alternate,o);break;case 24:Gu(a,o,s,c,i),i&&l&2048&&Hu(o.alternate,o);break;default:Gu(a,o,s,c,i)}t=t.sibling}}function Ku(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ku(n,r),i&2048&&Vu(r.alternate,r);break;case 24:Ku(n,r),i&2048&&Hu(r.alternate,r);break;default:Ku(n,r)}t=t.sibling}}var qu=8192;function Ju(e,t,n){if(e.subtreeFlags&qu)for(e=e.child;e!==null;)Yu(e,t,n),e=e.sibling}function Yu(e,t,n){switch(e.tag){case 26:Ju(e,t,n),e.flags&qu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ih(n,e)):ah(n,Mu,e.memoizedState,e.memoizedProps));break;case 5:Ju(e,t,n),e.flags&qu&&(e=e.stateNode,(t&335544128)===t&&ih(n,e));break;case 3:case 4:var r=Mu;Mu=Dm(e.stateNode.containerInfo),Ju(e,t,n),Mu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=qu,qu=16777216,Ju(e,t,n),qu=r):Ju(e,t,n));break;case 30:if((e.flags&qu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Hl===null&&(Hl=new Map),Hl.set(r,i)}Ju(e,t,n);break;default:Ju(e,t,n)}}function Xu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Zu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];du=r,ed(r,e)}Xu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Qu(e),e=e.sibling}function Qu(e){switch(e.tag){case 0:case 11:case 15:Zu(e),e.flags&2048&&wl(9,e,e.return);break;case 3:Zu(e);break;case 12:Zu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,$u(e)):Zu(e);break;default:Zu(e)}}function $u(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];du=r,ed(r,e)}Xu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:wl(8,t,t.return),$u(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,$u(t));break;default:$u(t)}e=e.sibling}}function ed(e,t){for(;du!==null;){var n=du;switch(n.tag){case 0:case 11:case 15:wl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ra(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,du=r;else a:for(n=e;du!==null;){r=du;var i=r.sibling,a=r.return;if(Su(r),r===n){du=null;break a}if(i!==null){i.return=a,du=i;break a}du=a}}}var td={getCacheForType:function(e){var t=Aa(Ia),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Aa(Ia).controller.signal}},nd=typeof WeakMap==`function`?WeakMap:Map,rd=0,id=null,U=null,ad=0,od=0,sd=null,cd=!1,ld=!1,ud=!1,dd=0,fd=0,pd=0,md=0,hd=0,gd=0,_d=0,vd=null,yd=null,bd=!1,xd=0,Sd=0,Cd=1/0,wd=null,Td=null,Ed=0,Dd=null,Od=null,kd=0,Ad=0,jd=null,Md=null,Nd=null,Pd=null,Fd=null,Id=0,Ld=null;function Rd(){return rd&2&&ad!==0?ad&-ad:N.T===null?xt():Hf()}function zd(){if(gd===0){if(!(ad&536870912)||F){var e=at;at<<=1,!(at&3932160)&&(at=262144),gd=e}else gd=536870912}return e=Io.current,e!==null&&(e.flags|=32),gd}function Bd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Up(bi(e.memoizedProps,n))),Pd===null&&(Pd=[]),Pd.push(t.bind(null,r))}}function Vd(e,t,n){(e===id&&(od===2||od===9)||e.cancelPendingCommit!==null)&&(Jd(e,0),Gd(e,ad,gd,!1)),mt(e,n),(!(rd&2)||e!==id)&&(e===id&&(!(rd&2)&&(md|=n),fd===4&&Gd(e,ad,gd,!1)),Pf(e))}function Hd(e,t,n){if(rd&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||lt(e,t),a=r?nf(e,t):ef(e,t,!0),o=r;do{if(a===0){ld&&!r&&Gd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Wd(n))a=ef(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=vd;var l=c.current.memoizedState.isDehydrated;if(l&&(Jd(c,s).flags|=256),s=ef(c,s,!1),s!==2&&s!==6){if(ud&&!l){c.errorRecoveryDisabledLanes|=o,md|=o,a=4;break a}o=yd,yd=a,o!==null&&(yd===null?yd=o:yd.push.apply(yd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Jd(e,0),Gd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Gd(r,t,gd,!cd);break a;case 2:yd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=xd+300-He(),10<a)){if(Gd(r,t,gd,!cd),ct(r,0,!0)!==0)break a;kd=t,r.timeoutHandle=Tp(Ud.bind(null,r,n,yd,wd,bd,t,gd,md,_d,cd,o,`Throttled`,-0,0),a);break a}Ud(r,n,yd,wd,bd,t,gd,md,_d,cd,o,null,-0,0)}break}}while(1);Pf(e)}function Ud(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xn},Hl=null,Yu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=lh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?xd-He():(a&4194048)===a?Sd-He():0,m=sh(d,m),m!==null)?(kd=a,e.cancelPendingCommit=m(uf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Gd(e,a,o,!l)):uf(e,t,a,n,r,i,o,s,c,l,u,d)}function Wd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Wr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Gd(e,t,n,r){t=ut(e,t),t&=~hd,t&=~md,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-et(i),o=1<<a;r[a]=-1,i&=~o}n!==0&>(e,n,t)}function Kd(){return rd&6?!0:(Ff(0,!1),!1)}function qd(){if(U!==null){if(od===0)var e=U.return;else e=U,Sa=xa=null,us(e),uo=null,fo=0,e=U;for(;e!==null;)Sl(e.alternate,e),e=e.return;U=null}}function Jd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Ep(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),kd=0,qd(),id=e,U=n=Li(e.current,null),ad=t,od=0,sd=null,cd=!1,ld=lt(e,t),ud=!1,_d=gd=hd=md=pd=fd=0,yd=vd=null,bd=!1,dd=ut(e,t),Di(),n}function Yd(e,t){I=null,N.H=hc,t===eo||t===no?(t=co(),od=3):t===to?(t=co(),od=4):od=t===Nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,sd=t,U===null&&(fd=1,Dc(e,Gi(t,e.current)))}function Xd(){var e=Io.current;return e===null?!0:(ad&4194048)===ad?Lo===null:(ad&62914560)===ad||ad&536870912?e===Lo:!1}function Zd(){var e=N.H;return N.H=hc,e===null?hc:e}function Qd(){var e=N.A;return N.A=td,e}function $d(){fd=4,cd||(ad&4194048)!==ad&&Io.current!==null||(ld=!0),!(pd&134217727)&&!(md&134217727)||id===null||Gd(id,ad,gd,!1)}function ef(e,t,n){var r=rd;rd|=2;var i=Zd(),a=Qd();(id!==e||ad!==t)&&(wd=null,Jd(e,t)),t=!1;var o=fd;a:do try{if(od!==0&&U!==null){var s=U,c=sd;switch(od){case 8:qd(),o=6;break a;case 3:case 2:case 9:case 6:Io.current===null&&(t=!0);var l=od;if(od=0,sd=null,sf(e,s,c,l),n&&ld){o=0;break a}break;default:l=od,od=0,sd=null,sf(e,s,c,l)}}tf(),o=fd;break}catch(t){Yd(e,t)}while(1);return t&&e.shellSuspendCounter++,Sa=xa=null,rd=r,N.H=i,N.A=a,U===null&&(id=null,ad=0,Di()),o}function tf(){for(;U!==null;)af(U)}function nf(e,t){var n=rd;rd|=2;var r=Zd(),a=Qd();id!==e||ad!==t?(wd=null,Cd=He()+500,Jd(e,t)):ld=lt(e,t);a:do try{if(od!==0&&U!==null){t=U;var o=sd;b:switch(od){case 1:od=0,sd=null,sf(e,t,o,1);break;case 2:case 9:if(io(o)){od=0,sd=null,of(t);break}t=function(){od!==2&&od!==9||id!==e||(od=7),Pf(e)},o.then(t,t);break a;case 3:od=7;break a;case 4:od=5;break a;case 7:io(o)?(od=0,sd=null,of(t)):(od=0,sd=null,sf(e,t,o,7));break;case 5:var s=null;switch(U.tag){case 26:s=U.memoizedState;case 5:case 27:var c=U;if(s?nh(s):c.stateNode.complete){od=0,sd=null;var l=c.sibling;if(l!==null)U=l;else{var u=c.return;u===null?U=null:(U=u,cf(u))}break b}}od=0,sd=null,sf(e,t,o,5);break;case 6:od=0,sd=null,sf(e,t,o,6);break;case 8:qd(),fd=6;break a;default:throw Error(i(462))}}rf();break}catch(t){Yd(e,t)}while(1);return Sa=xa=null,N.H=r,N.A=a,rd=n,U===null?(id=null,ad=0,Di(),fd):0}function rf(){for(;U!==null&&!Be();)af(U)}function af(e){var t=pl(e.alternate,e,dd);e.memoizedProps=e.pendingProps,t===null?cf(e):U=t}function of(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=qc(n,t,t.pendingProps,t.type,void 0,ad);break;case 11:t=qc(n,t,t.pendingProps,t.type.render,t.ref,ad);break;case 5:us(t);var r=t;r===oa&&(F?(ha(r),r.tag===5&&r.stateNode!=null&&(sa=r.stateNode)):(ha(r),F=!0));default:Sl(n,t),t=U=Ri(t,dd),t=pl(n,t,dd)}e.memoizedProps=e.pendingProps,t===null?cf(e):U=t}function sf(e,t,n,r){Sa=xa=null,us(t),uo=null,fo=0;var i=t.return;try{if(Mc(e,i,t,n,ad)){fd=1,Dc(e,Gi(n,e.current)),U=null;return}}catch(t){if(i!==null)throw U=i,t;fd=1,Dc(e,Gi(n,e.current)),U=null;return}t.flags&32768?(F||r===1?e=!0:ld||ad&536870912?e=!1:(cd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Io.current,r!==null&&r.tag===13&&(r.flags|=16384))),lf(t,e)):cf(t)}function cf(e){var t=e;do{if(t.flags&32768){lf(t,cd);return}e=t.return;var n=bl(t.alternate,t,dd);if(n!==null){U=n;return}if(t=t.sibling,t!==null){U=t;return}U=t=e}while(t!==null);fd===0&&(fd=5)}function lf(e,t){do{var n=xl(e.alternate,e);if(n!==null){n.flags&=32767,U=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){U=e;return}U=e=n}while(e!==null);fd=6,U=null}function uf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do vf();while(Ed!==0);if(rd&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===id&&(U=id=null,ad=0),Od=t,Dd=e,kd=n,jd=a,Md=r,df(e,t,n,s,c,l,f)}}function df(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Ad=s,s|=Ei,ht(e,n,s,r,i,a),Pd=null,(n&335544064)===n?(Fd=Va(e),r=10262):(Fd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Df(Ke,function(){return yf(),null})):(e.callbackNode=null,e.callbackPriority=0),Vl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=N.T,N.T=null,i=P.p,P.p=2,a=rd,rd|=4;try{gu(e,t,n)}finally{rd=a,P.p=i,N.T=r}}Ed=1,Vl?Nd=Vp(o,e.containerInfo,Fd,mf,hf,pf,gf,yf,ff,null,null):(mf(),hf(),gf())}function ff(e){if(Ed!==0){var t=Dd.onRecoverableError;t(e,{componentStack:null})}}function pf(){Ed===3&&(Ed=0,Lu(Od,Dd),Ed=4)}function mf(){if(Ed===1){Ed=0;var e=Dd,t=Od,n=kd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=N.T,N.T=null;var i=P.p;P.p=2;var a=rd;rd|=4;try{pu=mu=!1,Nu(t,e,n),n=_p;var o=Xr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Yr(s.ownerDocument.documentElement,s)){if(c!==null&&Zr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Jr(s,h),v=Jr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Ch=!!gp,_p=gp=null}finally{rd=a,P.p=i,N.T=r}}e.current=t,Ed=2}}function hf(){if(Ed===2){Ed=0;var e=Dd,t=Od,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=rd;rd|=4;try{vu(e,t.alternate,t)}finally{rd=i,P.p=r,N.T=n}}Ed=3}}function gf(){if(Ed===4||Ed===3){Ed=0;var e=Nd;Nd=null,Ve();var t=Dd,n=Od,r=kd,i=Md,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Ed=5:(Ed=0,Od=Dd=null,_f(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Td=null),bt(r),n=n.stateNode,Qe&&typeof Qe.onCommitFiberRoot==`function`)try{Qe.onCommitFiberRoot(Ze,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=N.T,a=P.p,P.p=2,N.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{N.T=n,P.p=a}}if(i=Pd,o=Fd,Fd=null,i!==null&&(Pd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);kd&3&&vf(),Pf(t),a=t.pendingLanes,r&261930&&a&42?t===Ld?Id++:(Id=0,Ld=t):(Id=0,Ld=null),Ff(0,!1)}}function _f(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ra(t)))}function vf(){return Nd!==null&&(Nd.skipTransition(),Nd=null),mf(),hf(),gf(),yf()}function yf(){if(Ed!==5)return!1;var e=Dd,t=Ad;Ad=0;var n=bt(kd),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=jd,jd=null;var o=Dd,s=kd;if(Ed=0,Od=Dd=null,kd=0,rd&6)throw Error(i(331));var c=rd;if(rd|=4,Qu(o.current),Wu(o,o.current,s,n),rd=c,Ff(0,!1),Qe&&typeof Qe.onPostCommitFiberRoot==`function`)try{Qe.onPostCommitFiberRoot(Ze,o)}catch{}return!0}finally{P.p=a,N.T=r,_f(e,t)}}function bf(e,t,n){t=Gi(n,t),t=kc(e.stateNode,t,2),e=Co(e,t,2),e!==null&&(mt(e,2),Pf(e))}function xf(e,t,n){if(e.tag===3)bf(e,e,n);else for(;t!==null;){if(t.tag===3){bf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Td===null||!Td.has(r))){e=Gi(n,e),n=Ac(2),r=Co(t,n,2),r!==null&&(jc(n,r,t,e),mt(r,2),Pf(r));break}}t=t.return}}function Sf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new nd;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ud=!0,i.add(n),e=Cf.bind(null,e,t,n),t.then(e,e))}function Cf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,id===e&&(ad&n)===n&&(fd===4||fd===3&&(ad&62914560)===ad&&300>He()-xd?rd&2?hd|=n:Jd(e,0):hd|=n,_d===ad&&(_d=0)),Pf(e)}function wf(e,t){t===0&&(t=ft()),e=Ai(e,t),e!==null&&(mt(e,t),Pf(e))}function Tf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wf(e,n)}function Ef(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),wf(e,n)}function Df(e,t){return Re(e,t)}var Of=null,kf=null,Af=!1,jf=!1,Mf=!1,Nf=0;function Pf(e){e!==kf&&e.next===null&&(kf===null?Of=kf=e:kf=kf.next=e),jf=!0,Af||(Af=!0,Vf())}function Ff(e,t){if(!Mf&&jf){Mf=!0;do for(var n=!1,r=Of;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-et(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Bf(r,a))}else a=ad,a=ct(r,r===id?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||lt(r,a)||(n=!0,Bf(r,a))}r=r.next}while(n);Mf=!1}}function If(){Lf()}function Lf(){jf=Af=!1;var e=0;Nf!==0&&wp()&&(e=Nf);for(var t=He(),n=null,r=Of;r!==null;){var i=r.next,a=Rf(r,t);a===0?(r.next=null,n===null?Of=i:n.next=i,i===null&&(kf=n)):(n=r,(e!==0||a&3)&&(jf=!0)),r=i}Ed!==0&&Ed!==5||Ff(e,!1),Nf!==0&&(Nf=0)}function Rf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-et(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=dt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=id,n=ad,n=ct(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(od===2||od===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ze(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||lt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ze(r),bt(n)){case 2:case 8:n=Ge;break;case 32:n=Ke;break;case 268435456:n=Je;break;default:n=Ke}return r=zf.bind(null,e),n=Re(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ze(r),e.callbackPriority=2,e.callbackNode=null,2}function zf(e,t){if(Ed!==0&&Ed!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(vf()&&e.callbackNode!==n)return null;var r=ad;return r=ct(e,e===id?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Hd(e,r,t),Rf(e,He()),e.callbackNode!=null&&e.callbackNode===n?zf.bind(null,e):null)}function Bf(e,t){if(vf())return null;Hd(e,t,!0)}function Vf(){kp(function(){rd&6?Re(We,If):Lf()})}function Hf(){if(Nf===0){var e=Wa;e===0&&(e=it,it<<=1,!(it&261888)&&(it=256)),Nf=e}return Nf}function Uf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:bn(e)}function Wf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Uf((i[Tt]||null).action),o=r.submitter;o&&(t=(t=o[Tt]||null)?Uf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Hn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Nf!==0){var e=new FormData(i,o);tc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),tc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Gf=0;Gf<_i.length;Gf++){var Kf=_i[Gf];vi(Kf.toLowerCase(),`on`+(Kf[0].toUpperCase()+Kf.slice(1)))}vi(li,`onAnimationEnd`),vi(ui,`onAnimationIteration`),vi(di,`onAnimationStart`),vi(`dblclick`,`onDoubleClick`),vi(`focusin`,`onFocus`),vi(`focusout`,`onBlur`),vi(fi,`onTransitionRun`),vi(pi,`onTransitionStart`),vi(mi,`onTransitionCancel`),vi(hi,`onTransitionEnd`),Ut(`onMouseEnter`,[`mouseout`,`mouseover`]),Ut(`onMouseLeave`,[`mouseout`,`mouseover`]),Ut(`onPointerEnter`,[`pointerout`,`pointerover`]),Ut(`onPointerLeave`,[`pointerout`,`pointerover`]),Ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var qf=`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(` `),Jf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(qf));function Yf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Ci(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Ci(e)}i.currentTarget=null,a=c}}}}function W(e,t){var n=t[Dt];n===void 0&&(n=t[Dt]=new Set);var r=e+`__bubble`;n.has(r)||($f(t,e,2,!1),n.add(r))}function Xf(e,t,n){var r=0;t&&(r|=4),$f(n,e,r,t)}var Zf=`_reactListening`+Math.random().toString(36).slice(2);function Qf(e){if(!e[Zf]){e[Zf]=!0,Bt.forEach(function(t){t!==`selectionchange`&&(Jf.has(t)||Xf(t,!1,e),Xf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Zf]||(t[Zf]=!0,Xf(`selectionchange`,!1,t))}}function $f(e,t,n,r){switch(Ah(t)){case 2:var i=wh;break;case 8:i=Th;break;default:i=Eh}n=i.bind(null,t,n,e),i=void 0,!jn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function ep(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Pt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}On(function(){var r=a,i=Cn(n),s=[];a:{var c=gi.get(e);if(c!==void 0){var l=Hn,u=e;switch(e){case`keypress`:if(Ln(n)===0)break a;case`keydown`:case`keyup`:l=or;break;case`focusin`:u=`focus`,l=Zn;break;case`focusout`:u=`blur`,l=Zn;break;case`beforeblur`:case`afterblur`:l=Zn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Yn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Xn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=lr;break;case li:case ui:case di:l=Qn;break;case hi:l=ur;break;case`scroll`:case`scrollend`:l=Wn;break;case`wheel`:l=dr;break;case`copy`:case`cut`:case`paste`:l=$n;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=sr;break;case`submit`:l=cr;break;case`toggle`:case`beforetoggle`:l=fr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=kn(m,p),g!=null&&d.push(tp(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==Sn&&(u=n.relatedTarget||n.fromElement)&&(Pt(u)||u[Et]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Pt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Yn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=sr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:It(c),h=l==null?u:It(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Pt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,rp):null,c!==null&&ip(s,u,c,d,!1),l!==null&&f!==null&&ip(s,f,l,d,!0)))}a:{if(c=r?It(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Mr;else if(Er(c)){if(Nr)_=Hr;else{_=Br;var v=zr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&_n(r.elementType)&&(_=Mr):_=Vr;if(_&&=_(e,r)){Dr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?It(r):window,e){case`focusin`:(Er(v)||v.contentEditable===`true`)&&($r=v,ei=r,ti=null);break;case`focusout`:ti=ei=$r=null;break;case`mousedown`:ni=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ni=!1,ri(s,n,i);break;case`selectionchange`:if(Qr)break;case`keydown`:case`keyup`:ri(s,n,i)}var y;if(mr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else Sr?br(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(_r&&n.locale!==`ko`&&(Sr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Sr&&(y=In()):(Nn=i,Pn=`value`in Nn?Nn.value:Nn.textContent,Sr=!0)),v=np(r,b),0<v.length&&(b=new er(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=xr(n),y!==null&&(b.data=y)))),(y=gr?Cr(e,n):wr(e,n))&&(b=np(r,`onBeforeInput`),0<b.length&&(v=new er(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Wf(s,e,r,n,i)}Yf(s,t)})}function tp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function np(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=kn(e,n),i!=null&&r.unshift(tp(e,i,a)),i=kn(e,t),i!=null&&r.push(tp(e,i,a))),e.tag===3)return r;e=e.return}return[]}function rp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ip(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=kn(n,a),l!=null&&o.unshift(tp(n,l,c))):i||(l=kn(n,a),l!=null&&o.push(tp(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ap=/\r\n?/g,op=/\u0000|\uFFFD/g;function sp(e){return(typeof e==`string`?e:``+e).replace(ap,`
|
|
10
|
-
`).replace(op,``)}function cp(e,t){return t=sp(t),sp(e)===t}function lp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&pn(e,``+r);else return;break;case`className`:Zt(e,`class`,r);break;case`tabIndex`:Zt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Zt(e,n,r);break;case`style`:gn(e,r,o);return;case`data`:if(t!==`object`){Zt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=bn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&lp(e,t,`name`,a.name,a,null),lp(e,t,`formEncType`,a.formEncType,a,null),lp(e,t,`formMethod`,a.formMethod,a,null),lp(e,t,`formTarget`,a.formTarget,a,null)):(lp(e,t,`encType`,a.encType,a,null),lp(e,t,`method`,a.method,a,null),lp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=bn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=xn);return;case`onScroll`:r!=null&&W(`scroll`,e);return;case`onScrollEnd`:r!=null&&W(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=bn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`: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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:W(`beforetoggle`,e),W(`toggle`,e),Xt(e,`popover`,r);break;case`xlinkActuate`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Xt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=vn.get(n)||n,Xt(e,n,r);else return}Jt=!0}function up(e,t,n,r,a,o){switch(n){case`style`:gn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)pn(e,``+r);else return;break;case`onScroll`:r!=null&&W(`scroll`,e);return;case`onScrollEnd`:r!=null&&W(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=xn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Vt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Tt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Jt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Xt(e,n,r)}return}Jt=!0}function dp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:W(`error`,e),W(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:lp(e,t,o,s,n,null)}}a&&lp(e,t,`srcSet`,n.srcSet,n,null),r&&lp(e,t,`src`,n.src,n,null);return;case`input`:W(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:lp(e,t,r,d,n,null)}}cn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in W(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:lp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&un(e,!!r,n,!0):un(e,!!r,t,!1);return;case`textarea`:for(s in W(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:lp(e,t,s,c,n,null)}fn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:lp(e,t,l,r,n,null)}return;case`dialog`:W(`beforetoggle`,e),W(`toggle`,e),W(`cancel`,e),W(`close`,e);break;case`iframe`:case`object`:W(`load`,e);break;case`video`:case`audio`:for(r=0;r<qf.length;r++)W(qf[r],e);break;case`image`:W(`error`,e),W(`load`,e);break;case`details`:W(`toggle`,e);break;case`embed`:case`source`:case`link`:W(`error`,e),W(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:lp(e,t,u,r,n,null)}return;default:if(_n(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&up(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&lp(e,t,c,r,n,null))}var fp={};function pp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||lp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Jt=!0),o=m;break;case`name`:m!==f&&(Jt=!0),a=m;break;case`checked`:m!==f&&(Jt=!0),u=m;break;case`defaultChecked`:m!==f&&(Jt=!0),d=m;break;case`value`:m!==f&&(Jt=!0),s=m;break;case`defaultValue`:m!==f&&(Jt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&lp(e,t,p,m,r,f)}}sn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||lp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Jt=!0),p=o;break;case`defaultValue`:o!==l&&(Jt=!0),c=o;break;case`multiple`:o!==l&&(Jt=!0),s=o;default:o!==l&&lp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?un(e,!!n,n?[]:``,!1):un(e,!!n,t,!0)):un(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:lp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Jt=!0),p=a;break;case`defaultValue`:a!==o&&(Jt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&lp(e,t,s,a,r,o)}dn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:lp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Jt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:lp(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&lp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:lp(e,t,u,p,r,m)}return;default:if(_n(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&up(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||up(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&lp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||lp(e,t,f,p,r,m)}function mp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function hp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&mp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&mp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var gp=null,_p=null;function vp(e){return e.nodeType===9?e:e.ownerDocument}function yp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function bp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function xp(e,t,n,r){return n=vp(n).createElement(e),n[wt]=r,n[Tt]=t,dp(n,e,t),Rt(n),n}function Sp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Cp=null;function wp(){var e=window.event;return e&&e.type===`popstate`?e!==Cp&&(Cp=e,!0):(Cp=null,!1)}var Tp=typeof setTimeout==`function`?setTimeout:void 0,Ep=typeof clearTimeout==`function`?clearTimeout:void 0,Dp=typeof Promise==`function`?Promise:void 0,Op=typeof requestAnimationFrame==`function`?requestAnimationFrame:Tp,kp=typeof queueMicrotask==`function`?queueMicrotask:Dp===void 0?Tp:function(e){return Dp.resolve(null).then(e).catch(Ap)};function Ap(e){setTimeout(function(){throw e})}function jp(e){return e===`head`}function Mp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Jh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)wm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,wm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[jt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&wm(e.ownerDocument.body)}n=i}while(n);Jh(t)}function Np(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Pp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Fp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Ip(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Lp(e){return Ip(e.getBoundingClientRect(),getComputedStyle(e),e)}function Rp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Ip(t,n,e)}function zp(e){return e.documentElement.clientHeight}function Bp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Vp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(zp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=rh(f),u>oh){s.length=o;break}f=new Promise(Bp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Hp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Hp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Hp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Hp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Up(e){return{name:e,group:new Hp(`group`,e),imagePair:new Hp(`image-pair`,e),old:new Hp(`old`,e),new:new Hp(`new`,e)}}function Wp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Wp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Yp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=qp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Gp,e,s,r)}this._eventListeners=a}};function Gp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Wp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Yp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=qp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Kp,e,n,i),r.splice(t,1),a!==null&&a()}};function Kp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function qp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Jp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Yp(e,t,n,r){if(e.length===0)return-1;r=Jp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Jp(a.optionsOrUseCapture)===r)return i}return-1}Wp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,qp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,qp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Wp.prototype.focus=function(e){p(this._fragmentFiber.child,!0,Xp,e,void 0,void 0)};function Xp(e,t){return e.tag!==6&&(e=v(e),bm(e,t))}Wp.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Zp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Xp(t[n],e);n--);};function Zp(e,t){return t.push(e),!1}Wp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=vp(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Qp,e,void 0,void 0))};function Qp(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Wp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,G,e,void 0,void 0)};function G(e,t){return e.tag===6||(e=v(e),t.observe(e)),!1}Wp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,$p,e,void 0,void 0);for(var n=t=0;n<K.length;n++){var r=K[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):K[t++]=r}K.length=t}};function $p(e,t){return e.tag===6||(e=v(e),t.unobserve(e)),!1}var K=[],em=!1;function tm(e,t,n){K.push({fragmentInstance:e,observer:t,instance:n}),em||(em=!0,xm(function(){em=!1;var e=K;K=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Wp.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,nm,e,void 0,void 0),e};function nm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Wp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Wp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Zp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||rm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function rm(e,t,n,r,i){var a=Pt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function im(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Wp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];p(this._fragmentFiber.child,!1,Zp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),im(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=v(a),im(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function am(e,t){return e=v(e),om(e,t),!1}function om(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function sm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,qp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<K.length;i++){var a=K[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(K[r++]=a)}K.length=r,n.observe(e)}),om(e,t))}function cm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,qp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?tm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function lm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:lm(n),Nt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function um(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[jt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=gm(e.nextSibling),e===null)break}return null}function dm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=gm(e.nextSibling),e===null))return null;return e}function fm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=gm(e.nextSibling),e===null))return null;return e}function pm(e){return e.data===`$?`||e.data===`$~`}function mm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function hm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function gm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var _m=null;function vm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return gm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function ym(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function bm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function xm(e){Op(function(){Op(function(t){return e(t)})})}function Sm(e,t,n){switch(t=vp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Cm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&lp(e,t,r,null,fp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===xn&&(e.onclick=null),Nt(e)}function wm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Nt(e)}var Tm=new Map,Em=new Set;function Dm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Om=P.d;P.d={f:km,r:Am,D:Nm,C:Pm,L:Fm,m:Im,X:Rm,S:Lm,M:zm};function km(){var e=Om.f(),t=Kd();return e||t}function Am(e){var t=Ft(e);t!==null&&t.tag===5&&t.type===`form`?rc(t):Om.r(e)}var jm=typeof document>`u`?null:document;function Mm(e,t,n){var r=jm;if(r&&typeof t==`string`&&t){var i=on(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Em.has(i)||(Em.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),dp(t,`link`,e),Rt(t),r.head.appendChild(t)))}}function Nm(e){Om.D(e),Mm(`dns-prefetch`,e,null)}function Pm(e,t){Om.C(e,t),Mm(`preconnect`,e,t)}function Fm(e,t,n){Om.L(e,t,n);var r=jm;if(r&&e&&t){var i=`link[rel="preload"][as="`+on(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+on(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+on(n.imageSizes)+`"]`)):i+=`[href="`+on(e)+`"]`;var a=i;switch(t){case`style`:a=Vm(e);break;case`script`:a=Gm(e)}if(!(Tm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Tm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Hm(a))||t===`script`&&r.querySelector(Km(a))))){var o=r.createElement(`link`);dp(o,`link`,e),t===`style`&&(o[Mt]=!0,o.onload=o.onerror=function(){zt(o)}),Rt(o),r.head.appendChild(o)}}}function Im(e,t){Om.m(e,t);var n=jm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+on(r)+`"][href="`+on(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Gm(e)}if(!Tm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),Tm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Km(a)))return}r=n.createElement(`link`),dp(r,`link`,e),Rt(r),n.head.appendChild(r)}}}function Lm(e,t,n){Om.S(e,t,n);var r=jm;if(r&&e){var i=Lt(r).hoistableStyles,a=Vm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Hm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Tm.get(a))&&Ym(e,n);var c=o=r.createElement(`link`);Rt(c),dp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Jm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Rm(e,t){Om.X(e,t);var n=jm;if(n&&e){var r=Lt(n).hoistableScripts,i=Gm(e),a=r.get(i);a||(a=n.querySelector(Km(i)),a||(e=T({src:e,async:!0},t),(t=Tm.get(i))&&Xm(e,t),a=n.createElement(`script`),Rt(a),dp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zm(e,t){Om.M(e,t);var n=jm;if(n&&e){var r=Lt(n).hoistableScripts,i=Gm(e),a=r.get(i);a||(a=n.querySelector(Km(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=Tm.get(i))&&Xm(e,t),a=n.createElement(`script`),Rt(a),dp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bm(e,t,n,r){var a=(a=we.current)?Dm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Vm(n.href),t=Lt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Vm(n.href);var o=Lt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Hm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Tm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Tm.set(e,o)),Wm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Gm(n),t=Lt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Vm(e){return`href="`+on(e)+`"`}function Hm(e){return`link[rel="stylesheet"][`+e+`]`}function Um(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Wm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Mt]){r.loading=1;return}}else t=e.createElement(`link`),t[Mt]=!0,t.onload=t.onerror=zt.bind(null,t),dp(t,`link`,n),Rt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Gm(e){return`[src="`+on(e)+`"]`}function Km(e){return`script[async]`+e}function qm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+on(n.href)+`"]`);if(r)return t.instance=r,Rt(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Rt(r),dp(r,`style`,a),Jm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Vm(n.href);var o=e.querySelector(Hm(a));if(o)return t.state.loading|=4,t.instance=o,Rt(o),o;r=Um(n),(a=Tm.get(a))&&Ym(r,a),o=(e.ownerDocument||e).createElement(`link`),Rt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),dp(o,`link`,r),t.state.loading|=4,Jm(o,n.precedence,e),t.instance=o;case`script`:return o=Gm(n.src),(a=e.querySelector(Km(o)))?(t.instance=a,Rt(a),a):(r=n,(a=Tm.get(o))&&(r=T({},n),Xm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Rt(a),dp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Jm(r,n.precedence,e));return t.instance}function Jm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Ym(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Xm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Zm=null;function Qm(e,t,n){if(Zm===null){var r=new Map,i=Zm=new Map;i.set(n,r)}else i=Zm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[jt]||a[wt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function $m(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function eh(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function th(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function nh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ih(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=rh(t),e.suspenseyImages.push(t)),e=uh.bind(e),t.decode().then(e,e))}function ah(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Vm(r.href),a=t.querySelector(Hm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=lh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Rt(a);return}a=t.ownerDocument||t,r=Um(r),(i=Tm.get(i))&&Ym(r,i),a=a.createElement(`link`),Rt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),dp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=lh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var oh=0;function sh(e,t){return e.stylesheets&&e.count===0&&fh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&oh===0&&(oh=62500*hp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>oh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ch(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)fh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function lh(){this.count--,ch(this)}function uh(){this.imgCount--,ch(this)}var dh=null;function fh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,dh=new Map,t.forEach(ph,e),dh=null,lh.call(e))}function ph(e,t){if(!(t.state.loading&4)){var n=dh.get(e);if(n)var r=n.get(null);else{n=new Map,dh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=lh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var mh={$$typeof:te,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_threadCount:0};function hh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,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=pt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pt(0),this.hiddenUpdates=pt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function gh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new hh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Fi(3,null,null,t),e.current=a,a.stateNode=e,t=La(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},bo(a),e}function _h(e){return e?(e=Ni,e):Ni}function vh(e,t,n,r,i,a){i=_h(i),r.context===null?r.context=i:r.pendingContext=i,r=So(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Co(e,r,t),n!==null&&(Vd(n,e,t),wo(n,e,t))}function yh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function bh(e,t){yh(e,t),(e=e.alternate)&&yh(e,t)}function xh(e){if(e.tag===13||e.tag===31){var t=Ai(e,67108864);t!==null&&Vd(t,e,67108864),bh(e,67108864)}}function Sh(e){if(e.tag===13||e.tag===31){var t=Rd();t=yt(t);var n=Ai(e,t);n!==null&&Vd(n,e,t),bh(e,t)}}var Ch=!0;function wh(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,Eh(e,t,n,r)}finally{P.p=a,N.T=i}}function Th(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,Eh(e,t,n,r)}finally{P.p=a,N.T=i}}function Eh(e,t,n,r){if(Ch){var i=Dh(r);if(i===null)ep(e,t,r,Oh,n),Rh(e,r);else if(Bh(i,e,t,n,r))r.stopPropagation();else if(Rh(e,r),t&4&&-1<Lh.indexOf(e)){for(;i!==null;){var a=Ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=st(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-et(o);s.entanglements[1]|=c,o&=~c}Pf(a),!(rd&6)&&(Cd=He()+500,Ff(0,!1))}}break;case 31:case 13:s=Ai(a,2),s!==null&&Vd(s,a,2),Kd(),bh(a,2)}if(a=Dh(r),a===null&&ep(e,t,r,Oh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else ep(e,t,r,null,n)}}function Dh(e){return e=Cn(e),kh(e)}var Oh=null;function kh(e){if(Oh=null,e=Pt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Oh=e,null}function Ah(e){switch(e){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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ue()){case We:return 2;case Ge:return 8;case Ke:case qe:return 32;case Je:return 268435456;default:return 32}default:return 32}}var jh=!1,Mh=null,q=null,Nh=null,Ph=new Map,Fh=new Map,Ih=[],Lh=`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 Rh(e,t){switch(e){case`focusin`:case`focusout`:Mh=null;break;case`dragenter`:case`dragleave`:q=null;break;case`mouseover`:case`mouseout`:Nh=null;break;case`pointerover`:case`pointerout`:Ph.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Fh.delete(t.pointerId)}}function zh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ft(t),t!==null&&xh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Bh(e,t,n,r,i){switch(t){case`focusin`:return Mh=zh(Mh,e,t,n,r,i),!0;case`dragenter`:return q=zh(q,e,t,n,r,i),!0;case`mouseover`:return Nh=zh(Nh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ph.set(a,zh(Ph.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Fh.set(a,zh(Fh.get(a)||null,e,t,n,r,i)),!0}return!1}function Vh(e){var t=Pt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,St(e.priority,function(){Sh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,St(e.priority,function(){Sh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Hh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Dh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Sn=r,n.target.dispatchEvent(r),Sn=null}else return t=Ft(n),t!==null&&xh(t),e.blockedOn=n,!1;t.shift()}return!0}function Uh(e,t,n){Hh(e)&&n.delete(t)}function Wh(){jh=!1,Mh!==null&&Hh(Mh)&&(Mh=null),q!==null&&Hh(q)&&(q=null),Nh!==null&&Hh(Nh)&&(Nh=null),Ph.forEach(Uh),Fh.forEach(Uh)}function Gh(e,n){e.blockedOn===n&&(e.blockedOn=null,jh||(jh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Wh)))}var Kh=null;function qh(e){Kh!==e&&(Kh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Kh===e&&(Kh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(kh(r||n)===null)continue;break}var a=Ft(n);a!==null&&(e.splice(t,3),t-=3,tc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Jh(e){function t(t){return Gh(t,e)}Mh!==null&&Gh(Mh,e),q!==null&&Gh(q,e),Nh!==null&&Gh(Nh,e),Ph.forEach(t),Fh.forEach(t);for(var n=0;n<Ih.length;n++){var r=Ih[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ih.length&&(n=Ih[0],n.blockedOn===null);)Vh(n),n.blockedOn===null&&Ih.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Tt]||null;if(typeof a==`function`)o||qh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Tt]||null)s=o.formAction;else if(kh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),qh(n)}}}function Yh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Xh(e){this._internalRoot=e}Zh.prototype.render=Xh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;vh(n,Rd(),e,t,null,null)},Zh.prototype.unmount=Xh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vh(e.current,2,null,e,null,null),Kd(),t[Et]=null}};function Zh(e){this._internalRoot=e}Zh.prototype.unstable_scheduleHydration=function(e){if(e){var t=xt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ih.length&&t!==0&&t<Ih[n].priority;n++);Ih.splice(n,0,e),n===0&&Vh(e)}};var Qh=n.version;if(Qh!==`19.3.0`)throw Error(i(527,Qh,`19.3.0`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var $h={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var eg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!eg.isDisabled&&eg.supportsFiber)try{Ze=eg.inject($h),Qe=eg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=wc,s=Tc,c=Ec;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=gh(e,1,!1,null,null,n,r,null,o,s,c,Yh),e[Et]=t.current,Qf(e),new Xh(t)}})),ma=o(((e,t)=>{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)}}n(),t.exports=pa()}))(),ha=Object.freeze({token:Symbol(`chord.abortSignal`)}),ga=class{get abortSignal(){return this.value(ha)}},_a=class extends ga{#e;constructor(e){super(),this.#e=e}value(e){}toString(){return this.#e}},va=class extends ga{#e;#t;#n;constructor(e,t,n){super(),this.#e=e,this.#t=t,this.#n=n}value(e){return e.token===this.#t.token?this.#n:this.#e.value(e)}toString(){return`${this.#e}.WithValue(${this.#t.token.description??`anonymous`})`}},ya=new _a(`[Context BACKGROUND_CONTEXT]`);new _a(`[Context TODO_CONTEXT]`);function ba(e,t,n){return new va(n,e,t)}function xa(e,t){let n=t.abortSignal;return ba(ha,n===void 0?e:AbortSignal.any([n,e]),t)}function Sa(e){let t=new AbortController;return{context:xa(t.signal,e),cancel:e=>t.abort(e)}}function Ca(e,t){let n=t.abortSignal;return n===void 0?e:n.aborted?Promise.reject(wa(n)):new Promise((t,r)=>{let i=()=>r(wa(n));n.addEventListener(`abort`,i,{once:!0}),e.then(e=>{n.removeEventListener(`abort`,i),t(e)},e=>{n.removeEventListener(`abort`,i),r(e)})})}function wa(e){let t=e.reason;return t instanceof Error?t:new DOMException(`The operation was aborted`,`AbortError`)}var Ta=class extends Error{code;constructor(e,t){super(t),this.name=`RemoteServiceError`,this.code=e}},Ea,Da=class{#e;#t;#n;constructor(e,t){this.#e=e,this.#t=t}view(e){return new Oa(this,e,this.#t).proxy}bind(e){this.#n=e}unbind(){this.#n=void 0}resolve(e,t){t();let n=this.#n;if(n===void 0)throw Error(`Service ${this.#e} is disconnected`);return{value:Reflect.get(n,e,n),receiver:n}}},Oa=class{#e;#t;#n;#r=new Map;proxy;constructor(e,t,n){this.#e=e,this.#t=t,this.#n=n,this.proxy=new Proxy(Object.create(null),{get:(e,t)=>this.#i(t)})}#i(e){let t=()=>this.#e.resolve(e,this.#t),n=t().value;if(!Aa(n)||typeof n!=`function`&&!this.#n)return n;let r=this.#r.get(e);return r===void 0&&(r=new ka(t,typeof n==`function`),this.#r.set(e,r)),r.proxy}},ka=class{#e;#t=new Map;proxy;constructor(e,t){this.#e=e;let n=t?()=>void 0:Object.create(null);this.proxy=new Proxy(n,{apply:(e,t,n)=>this.#n(n),get:(e,t)=>this.#r(t)})}#n(e){let{value:t,receiver:n}=this.#e();if(typeof t!=`function`)throw TypeError(`Service member is not callable`);return Reflect.apply(t,n,e)}#r(e){let t=()=>{let t=this.#e();if(!Aa(t.value))throw TypeError(`Service member does not have properties`);return{value:Reflect.get(t.value,e,t.value),receiver:t.value}},n=t().value;if(typeof n!=`function`)return n;let r=this.#t.get(e);return r===void 0&&(r=new Ea(t,!0),this.#t.set(e,r)),r.proxy}};Ea=ka;function Aa(e){return typeof e==`object`&&!!e||typeof e==`function`}var ja=class{#e=new Map;#t=new Set;#n;#r;#i=!1;constructor(e){this.#r=e.ready,this.#n=e.onError}get observerCount(){return this.#t.size}values(){return this.#e.values()}get(e){return this.#e.get(e)}insert(e){if(this.#c(),this.#e.has(e.key))throw Error(`Keyed service already has a live instance with key ${e.key}`);this.#e.set(e.key,e),this.#r&&this.#o(e)}replace(e){this.#c();let t=this.#e.get(e.key);if(t!==void 0){if(t.generation===e.generation)throw Error(`Keyed service repeated a live generation`);this.#a(t)}this.#e.set(e.key,e),this.#r&&this.#o(e)}remove(e){this.#e.get(e.key)===e&&this.#a(e)}ready(){if(this.#c(),!this.#r){this.#r=!0;for(let e of this.#e.values())this.#o(e)}}reset(){if(!this.#i){this.#r=!1;for(let e of[...this.#e.values()])this.#a(e)}}observe(e){this.#c();let t={handler:e,tasks:new Map,closed:!1};if(this.#t.add(t),this.#r)for(let e of this.#e.values())this.#s(t,e);return()=>{if(!t.closed){t.closed=!0;for(let e of t.tasks.values())e.cancel();t.tasks.clear(),this.#t.delete(t)}}}dispose(){if(!this.#i){this.#i=!0;for(let e of this.#t){e.closed=!0;for(let t of e.tasks.values())t.cancel();e.tasks.clear()}this.#t.clear();for(let e of[...this.#e.values()])e.deactivate();this.#e.clear()}}#a(e){if(this.#e.get(e.key)===e){this.#e.delete(e.key),e.deactivate();for(let t of this.#t)t.tasks.get(e)?.cancel(),t.tasks.delete(e)}}#o(e){for(let t of this.#t)this.#s(t,e)}#s(e,t){if(e.closed||e.tasks.has(t))return;let{context:n,cancel:r}=Sa(ya);e.tasks.set(t,{cancel:r});try{Promise.resolve(e.handler(t.service,n)).catch(e=>{n.abortSignal?.aborted||this.#n(Ma(e))})}catch(e){n.abortSignal?.aborted||this.#n(Ma(e))}}#c(){if(this.#i)throw Error(`Keyed service directory is disposed`)}};function Ma(e){return e instanceof Error?e:Error(String(e))}function Na(e){return Pa(e,new Set)}function Pa(e,t){if(e===null||typeof e==`string`||typeof e==`boolean`)return!0;if(typeof e==`number`)return Number.isFinite(e);if(Array.isArray(e)){if(Object.getPrototypeOf(e)!==Array.prototype)return!1;let n=Reflect.ownKeys(e);if(n.length!==e.length+1||n.some(e=>typeof e!=`string`)||t.has(e))return!1;t.add(e);try{for(let n=0;n<e.length;n++){let r=Object.getOwnPropertyDescriptor(e,String(n));if(r===void 0||!r.enumerable||!(`value`in r)||!Pa(r.value,t))return!1}return!0}finally{t.delete(e)}}if(typeof e!=`object`||!e)return!1;let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null||Reflect.ownKeys(e).some(e=>typeof e!=`string`)||t.has(e))return!1;t.add(e);try{for(let n of Object.values(Object.getOwnPropertyDescriptors(e)))if(!n.enumerable||!(`value`in n)||!Pa(n.value,t))return!1;return!0}finally{t.delete(e)}}var Fa=e=>typeof e==`object`&&!!e,Ia=e=>e.length>0&&e[0][0]===`r`,La=new Set([`__proto__`,`constructor`,`prototype`]),Ra=class extends Error{segment;constructor(e){super(`unsafe path segment: ${String(e)}`),this.segment=e,this.name=`UnsafePathError`}};function za(e){if(!Array.isArray(e)||e.length===0)throw TypeError(`op is not a tuple`);switch(e[0]){case`r`:if(e.length!==2)throw TypeError(`r arity`);return;case`s`:if(e.length!==3)throw TypeError(`s arity`);Ba(e[1],!0);return;case`d`:if(e.length!==2)throw TypeError(`d arity`);Ba(e[1],!0);return;case`a`:if(e.length!==3||typeof e[2]!=`string`)throw TypeError(`a shape`);Ba(e[1],!0);return;case`t`:if(e.length!==3||!Number.isInteger(e[2])||e[2]<0)throw TypeError(`t shape`);Ba(e[1],!0);return;case`p`:if(e.length!==5)throw TypeError(`p arity`);if(Ba(e[1]),!Number.isInteger(e[2])||e[2]<0)throw TypeError(`p index`);if(!Number.isInteger(e[3])||e[3]<0)throw TypeError(`p remove`);if(!Array.isArray(e[4]))throw TypeError(`p items`);return;case`m`:if(e.length!==3)throw TypeError(`m arity`);Ba(e[1]),Va(e[2]);return;default:throw TypeError(`unknown op verb: ${String(e[0])}`)}}function Ba(e,t=!1){if(!Array.isArray(e))throw TypeError(`path is not an array`);if(t&&e.length===0)throw TypeError(`path is empty`);Ua(e)}function Va(e){if(!Array.isArray(e))throw TypeError(`m permutation is not an array`);let t=new Uint8Array(e.length);for(let n of e){if(!Number.isInteger(n)||n<0||n>=e.length||t[n]!==0)throw TypeError(`m permutation is not a bijection`);t[n]=1}}function Ha(e){if(!Array.isArray(e)||e.length===0)throw TypeError(`op is not a tuple`);let[t]=e,n=e=>{if(typeof e==`number`){if(!Number.isInteger(e)||e<0)throw TypeError(`bad path id`)}else{if(!Array.isArray(e))throw TypeError(`path is not an array`);Ua(e)}};switch(t){case`r`:if(e.length!==2)throw TypeError(`r arity`);return;case`s`:if(e.length===3)n(e[1]);else if(e.length!==2)throw TypeError(`s arity`);return;case`d`:if(e.length===2)n(e[1]);else if(e.length!==1)throw TypeError(`d arity`);return;case`a`:if(e.length===3){if(n(e[1]),typeof e[2]!=`string`)throw TypeError(`a value`)}else if(e.length===2){if(typeof e[1]!=`string`)throw TypeError(`a value`)}else throw TypeError(`a arity`);return;case`t`:if(e.length===3){if(n(e[1]),!Number.isInteger(e[2])||e[2]<0)throw TypeError(`t count`)}else if(e.length===2){if(!Number.isInteger(e[1])||e[1]<0)throw TypeError(`t count`)}else throw TypeError(`t arity`);return;case`p`:{let[t,r,i]=e.length===5?[e[2],e[3],e[4]]:e.length===4?[e[1],e[2],e[3]]:[];if(i===void 0)throw TypeError(`p arity`);if(e.length===5&&n(e[1]),!Number.isInteger(t)||t<0)throw TypeError(`p index`);if(!Number.isInteger(r)||r<0)throw TypeError(`p remove`);if(!Array.isArray(i))throw TypeError(`p items`);return}case`m`:if(e.length===3)n(e[1]);else if(e.length!==2)throw TypeError(`m arity`);Va(e[e.length-1]);return;case`#`:if(e.length!==3||!Number.isInteger(e[1])||e[1]<0||!Array.isArray(e[2]))throw TypeError(`# shape`);Ua(e[2]);return;default:throw TypeError(`unknown op verb: ${String(t)}`)}}function Ua(e){for(let t of e)if(typeof t==`string`){if(La.has(t))throw new Ra(t)}else if(!Number.isInteger(t)||t<0)throw new Ra(t)}function Wa(e,t){if(t>e.length)throw new Ra(t)}var Ga=class extends Error{path;constructor(e){super(`unresolvable path: ${JSON.stringify(e)}`),this.path=e,this.name=`PathError`}};function Ka(e,t){let n=e;for(let e of t){if(za(e),e[0]===`r`){n=e[1];continue}let t=e[1];if(Ua(t),e[0]===`p`){let r=t.length===0?n:Za(n,t);if(!Array.isArray(r))throw new Ga(t);r.splice(e[2],e[3]);let i=1e4;for(let t=0;t<e[4].length;t+=i)r.splice(e[2]+t,0,...e[4].slice(t,t+i));continue}if(e[0]===`m`){let r=t.length===0?n:Za(n,t);if(!Array.isArray(r)||r.length!==e[2].length)throw new Ga(t);let i=r.slice();for(let t=0;t<e[2].length;t++)r[t]=i[e[2][t]];continue}let r=Za(n,t.slice(0,-1)),i=t[t.length-1];if(Array.isArray(r)){if(typeof i!=`number`)throw new Ra(i);Wa(r,i)}let a=e=>{Object.defineProperty(r,i,{value:e,writable:!0,enumerable:!0,configurable:!0})},o=()=>Object.hasOwn(r,i)?r[i]:void 0;switch(e[0]){case`s`:a(e[2]);break;case`d`:if(Array.isArray(r)){if(typeof i!=`number`||i>=r.length)throw new Ga(t);r.splice(i,1)}else delete r[i];break;case`a`:{let n=o();if(typeof n!=`string`)throw new Ga(t);a(`${n}${e[2]}`);break}case`t`:{let n=o();if(typeof n!=`string`)throw new Ga(t);a(n.slice(e[2]));break}}}return n}function qa(e,t){return Ja(e,[t])}function Ja(e,t){let n=e,r=new WeakSet;for(let e of t)for(let t of e)za(t),t[0]===`r`?n=t[1]:(n=Ya(n,t[0]===`p`||t[0]===`m`?t[1]:t[1].slice(0,-1),r),n=Ka(n,[t]));return n}function Ya(e,t,n){let r=e=>{if(Array.isArray(e))return e.slice();if(!Fa(e))throw new Ga(t);let n=Object.create(Object.getPrototypeOf(e)===null?null:Object.prototype);for(let t of Object.keys(e))Object.defineProperty(n,t,{value:e[t],writable:!0,enumerable:!0,configurable:!0});return n};if(!Fa(e))throw new Ga(t);let i;n.has(e)?i=e:(i=r(e),n.add(i));let a=i;for(let e of t){if(!Object.hasOwn(a,e))throw new Ga(t);if(Array.isArray(a)&&typeof e!=`number`)throw new Ra(e);let i=a[e];if(!Fa(i))throw new Ga(t);if(n.has(i)){a=i;continue}let o=r(i);Object.defineProperty(a,e,{value:o,writable:!0,enumerable:!0,configurable:!0}),n.add(o),a=o}return i}function Xa(e,t){let n=e;for(let e of t){if(!Fa(n))throw new Ga(t);if(Array.isArray(n)&&typeof e!=`number`)throw new Ra(e);if(!Object.hasOwn(n,e))throw new Ga(t);n=n[e]}return n}function Za(e,t){let n=Xa(e,t);if(!Fa(n))throw new Ga(t);return n}function Qa(){let e=new Map;return{decode(t){let n,r=[];for(let i of t){if(Ha(i),i[0]===`#`){Ua(i[2]),e.set(i[1],i[2]);continue}if(i[0]===`r`){r.push(i),e.clear(),n=void 0;continue}let t=i[0]===`d`&&i.length===1||i[0]!==`d`&&i[0]!==`p`&&i.length===2||i[0]===`p`&&i.length===4,a;if(t){if(n===void 0)throw new Ga([]);a=n}else{let t=i[1];if(typeof t==`number`){let n=e.get(t);if(n===void 0)throw new Ga(t);a=n}else a=t;n=a}if(i[0]!==`p`&&i[0]!==`m`&&a.length===0)throw new Ga(a);switch(i[0]){case`s`:r.push([`s`,a,t?i[1]:i[2]]);break;case`d`:r.push([`d`,a]);break;case`a`:r.push([`a`,a,t?i[1]:i[2]]);break;case`t`:r.push([`t`,a,t?i[1]:i[2]]);break;case`p`:{let[e,n,o]=t?[i[1],i[2],i[3]]:[i[2],i[3],i[4]];r.push([`p`,a,e,n,o]);break}case`m`:r.push([`m`,a,t?i[1]:i[2]])}}return r}}}var $a=e=>typeof e==`object`&&!!e,eo=class{#e=new WeakSet;validate(e){return this.#t(e,new Set,new WeakSet)}#t(e,t,n){if(!$a(e)||this.#e.has(e))return $a(e)?e:to(e);if(n.has(e))return e;if(t.has(e))throw TypeError(`Replicated state cannot contain cycles`);t.add(e);try{if(Array.isArray(e)){ro(e);for(let r=0;r<e.length;r++)this.#t(e[r],t,n)}else{no(e);for(let r of Reflect.ownKeys(e)){if(typeof r==`symbol`)throw TypeError(`Replicated state cannot contain symbol properties`);let i=Object.getOwnPropertyDescriptor(e,r);if(i===void 0||!i.enumerable||!(`value`in i))throw TypeError(`Replicated state objects must contain enumerable data properties`);this.#t(i.value,t,n)}}return n.add(e),this.#e.add(e),e}finally{t.delete(e)}}};function to(e){if(e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&Number.isFinite(e))return e;throw TypeError(`Replicated state values must be strict JSON`)}function no(e){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)throw TypeError(`Replicated state containers must be plain objects or arrays`)}function ro(e){let t=Reflect.ownKeys(e);if(t.length!==e.length+1||t.some(e=>typeof e!=`string`))throw TypeError(`Replicated state arrays must be dense and contain only indexed entries`);for(let t=0;t<e.length;t++){let n=Object.getOwnPropertyDescriptor(e,String(t));if(n===void 0||!n.enumerable||!(`value`in n)||n.value===void 0)throw TypeError(`Replicated state arrays must contain enumerable indexed data properties with defined values`)}}var io=class{#e;#t;#n=[];#r=!1;#i=!1;#a=!1;constructor(e,t){this.#e=e,this.#t=t}push(e){if(!this.#a){if(this.#n.length===100){let e=this.#i?void 0:this.#n[0];this.#n.length=0,e!==void 0&&this.#n.push(e)}this.#n.push(e)}}drain(){if(!(this.#r||this.#a)){this.#r=!0;for(let e=this.#n.shift();e!==void 0;e=this.#n.shift()){this.#i=!0;try{let t=this.#e(e.value,e.context,e.delivery);if(so(t)){Promise.resolve(t).then(()=>this.#o(),e=>{this.#s(e),this.#o()});return}}catch(e){this.#s(e)}}this.#r=!1}}clear(){this.#n.length=0}close(){this.#a=!0,this.clear()}#o(){this.#r=!1,this.drain()}#s(e){try{this.#t(lo(e))}catch(e){co(lo(e))}}},ao=class{#e=new Set;#t;#n=new eo;#r;#i;constructor(e){this.#t=e}get value(){return this.#r}subscribe(e){let t=new io(e,this.#t);return this.#e.add(t),this.#r!==void 0&&(t.push({value:this.#r,context:oo(),delivery:{kind:`hydrate`,sequence:this.#i}}),t.drain()),()=>{t.close(),this.#e.delete(t)}}hydrate(e,t,n){let r;try{if(!Ia(t))throw Error(`Replicated state snapshot is not a base operation batch`);r=this.#n.validate(qa(void 0,t))}catch(e){throw this.clear(),e}this.#i=e,this.#r=r,this.#a(n,{kind:`hydrate`,sequence:e})}update(e,t,n){if(this.#i===void 0||this.#r===void 0)throw Error(`Replicated state received an update before hydration`);if(e!==this.#i+1)throw this.clear(),Error(`Replicated state update sequence has a gap`);let r;try{r=this.#n.validate(qa(this.#r,t))}catch(e){throw this.clear(),e}this.#i=e,this.#r=r,this.#a(n,{kind:`update`,sequence:e})}clear(){this.#r=void 0,this.#i=void 0;for(let e of this.#e)e.clear()}#a(e,t){if(this.#r===void 0)return;let n={value:this.#r,context:e,delivery:t},r=[...this.#e];for(let e of r)e.push(n);for(let e of r)e.drain()}};function oo(){return ya}function so(e){return(typeof e==`object`&&!!e||typeof e==`function`)&&typeof e.then==`function`}function co(e){queueMicrotask(()=>{throw e})}function lo(e){return e instanceof Error?e:Error(String(e))}var uo=class{#e;#t;#n;#r;#i;#a;value;#o;#s;constructor(e,t,n,r,i,a){this.#e=e,this.#t=t,this.#n=n,this.#i=r,this.#a=i,this.#r=new ao(a);let o=()=>{};this.value=new Proxy(o,{apply:(e,t,n)=>this.#u(n),get:(e,t)=>{if(t===`value`)return this.#a(),this.#l(`state`),this.#r.value;if(t===`subscribe`)return this.#c.bind(this);if(t===Symbol.toStringTag)return`RemoteServiceMember`}})}setDescription(e){if(this.#o!==void 0&&this.#o!==e)throw Error(`Remote service member ${this.#e}.${this.#t} changed kind`);if(this.#o=e,this.#s!==void 0&&this.#s!==e)throw new Ta(`service_member_mismatch`,`Remote service member ${this.#e}.${this.#t} is ${e}, not ${this.#s}`)}hydrate(e,t,n){this.setDescription(`state`),this.#r.hydrate(e,t,n)}update(e,t,n){this.setDescription(`state`),this.#r.update(e,t,n)}clear(){this.#r.clear()}#c(e){if(this.#a(),typeof e!=`function`)throw TypeError(`Replicated state subscription listener must be a function`);return this.#l(`state`),this.#r.subscribe(e)}#l(e){if(this.#s!==void 0&&this.#s!==e)throw new Ta(`service_member_mismatch`,`Remote service member ${this.#e}.${this.#t} was used as two different kinds`);if(this.#s=e,this.#o!==void 0&&this.#o!==e)throw new Ta(`service_member_mismatch`,`Remote service member ${this.#e}.${this.#t} is ${this.#o}, not ${e}`)}#u(e){if(this.#a(),this.#l(`method`),!this.#i())return Promise.reject(new Ta(`service_stale_instance`,`Remote service ${this.#e} binding is closed`));let t=e.at(-1);if(!vo(t))return Promise.reject(new Ta(`service_invalid_value`,`Remote service method ${this.#e}.${this.#t} requires a trailing Context`));let n=e.slice(0,-1);return this.#n(n,t)}},fo=class{#e;#t;#n;#r;#i=new Map;#a=new Map;#o;#s;proxy;constructor(e,t,n,r,i,a){this.#e=e,this.#t=t,this.#n=n,this.#o=r,this.#s=i,this.#r=a,this.proxy=new Proxy(Object.create(null),{get:(e,t)=>{if(typeof t==`string`)return this.#c(t).value}})}install(e,t){if(!_o(e.instance,this.#t))throw Error(`Remote service snapshot has the wrong address`);let n=go(e.members);for(let e of this.#i.keys())if(!n.has(e))throw new Ta(`service_member_not_found`,`Unknown remote service member ${this.#e}.${e}`);this.#a.clear();for(let[e,t]of n)this.#a.set(e,t.kind);for(let e of n.values()){let n=this.#i.get(e.name);e.kind===`state`?(n??this.#c(e.name)).hydrate(e.sequence,e.ops,t):n?.setDescription(e.kind)}}update(e,t,n,r){if(this.#a.get(e)!==`state`)throw Error(`Remote service update targets non-state member ${this.#e}.${e}`);this.#c(e).update(t,n,r)}clear(){for(let e of this.#i.values())e.clear()}#c(e){let t=this.#i.get(e);if(t!==void 0)return t;t=new uo(this.#e,e,(t,n)=>this.#n.invoke({serviceId:this.#e,...this.#t===void 0?{}:{instance:this.#t},member:e,args:t},n),this.#o,this.#s,this.#r);let n=this.#a.get(e);return n!==void 0&&t.setDescription(n),this.#i.set(e,t),t}},po=class{#e;#t;#n;#r;#i;#a;#o;#s;#c=!1;#l;#u=0;constructor(e,t,n,r,i,a){this.#e=e,this.#t=t,this.#n=n,this.#r=r,this.#i=i,this.#l=a,this.#a=new ja({ready:!1,onError:n})}observe(e){if(this.#c)throw Error(`Remote keyed service binding is closed`);let t=!1,n=this.#a.observe((n,r)=>{let i=new Da(this.#e.id,!0);return i.bind(n),e(i.view(()=>{if(this.#r(),t||r.abortSignal?.aborted)throw new Ta(`service_stale_instance`,`Remote service ${this.#e.id} observation is closed`)}),r)});if(this.#l&&this.#s===void 0){let e=this.#u,t=this.#f(e);this.#s=t,t.catch(t=>{!this.#c&&this.#u===e&&this.#l&&this.#n(yo(t))})}return()=>{t||(t=!0,n(),this.#a.observerCount===0&&this.#i())}}async rebind(e,t){if(this.#c)return;this.#l=e;let n=++this.#u;if(await this.#d(t,!1),!(this.#c||this.#u!==n||this.#l!==e)&&e&&this.#a.observerCount>0){let e=this.#f(n);this.#s=e,await e}}ready(){return this.#s??Promise.resolve()}async close(e){this.#c||(this.#c=!0,this.#u+=1,await this.#d(e,!0),this.#a.dispose())}async#d(e,t){this.#a.reset();let n=this.#s;this.#s=void 0;let r=this.#o;this.#o=void 0,await Promise.all([t?n?.catch(()=>{}):void 0,r===void 0?void 0:r.close(e)])}async#f(e){let t=await this.#t.subscribe(this.#e.id,`keyed`,(t,n)=>{this.#u===e&&this.#p(t,n)},ya);if(this.#c||!this.#l||this.#u!==e)await t.close(ya);else{if(this.#o=t,t.snapshot.mode!==`keyed`||t.snapshot.serviceId!==this.#e.id)throw Error(`Remote service ${this.#e.id} returned the wrong keyed snapshot`);for(let e of t.snapshot.instances)this.#m(e,oo());t.activate(),this.#a.ready()}}#p(e,t){if(!this.#c)try{switch(e.type){case`reset`:{ho(e.snapshot,this.#e.id,`keyed`);let n=new Map(e.snapshot.instances.map(e=>[e.instance.key,e]));for(let e of[...this.#a.values()])n.get(e.key)?.instance?.generation!==e.generation&&this.#a.remove(e);for(let e of n.values()){let n=this.#a.get(e.instance.key);n===void 0?this.#m(e,t):n.facade.install(e,t)}break}case`unavailable`:case`replaced`:throw Error(`Keyed service received a singleton lifecycle update`);case`spawned`:this.#m(e.instance,t);break;case`closed`:{let t=this.#a.get(e.instance.key);t?.generation===e.instance.generation&&this.#a.remove(t);break}case`state`:{if(e.instance===void 0)throw Error(`Keyed state update has no instance address`);let n=this.#a.get(e.instance.key);if(n?.generation!==e.instance.generation)return;n.facade.update(e.member,e.sequence,e.ops,t);break}}}catch(e){this.#n(yo(e))}}#m(e,t){let n=e.instance;if(n===void 0)throw Error(`Keyed service instance snapshot has no address`);let r=!0,i=new fo(this.#e.id,n,this.#t,()=>r&&!this.#c,this.#r,this.#n);i.install(e,t),this.#a.replace({key:n.key,generation:n.generation,service:i.proxy,facade:i,deactivate:()=>{r=!1,i.clear()}})}},mo=class{#e;#t=new Set;#n;#r=new Map;#i;#a=new Map;#o=new Map;#s;#c=0;#l=Promise.resolve();#u=!1;constructor(e){this.#e=e.transport;let t=e.services.map(({id:e})=>e);if(new Set(t).size!==t.length)throw TypeError(`Remote service binding has duplicate service IDs`);for(let e of t)this.#t.add(e);this.#n=e.onError??(()=>{}),this.#i=e.assertAccess??(()=>{}),this.#s=e.bound??!0}use(e){this.#p(e),this.#m(e.id,`singleton`);let t=this.#a.get(e.id);if(t!==void 0)return t.facade.proxy;if(t={facade:void 0,active:!0,revision:0},t.facade=new fo(e.id,void 0,this.#e,()=>t.active&&!this.#u&&this.#s,()=>this.#f(),this.#n),this.#a.set(e.id,t),this.#c+=1,this.#s){let n=t.revision,r=this.#d(e.id,t,n);t.starting=r,r.catch(e=>{t.active&&t.revision===n&&!this.#u&&this.#s&&this.#n(yo(e))})}return t.facade.proxy}observe(e,t){this.#p(e),this.#m(e.id,`keyed`);let n=this.#o.get(e.id);return n===void 0&&(n=new po(e,this.#e,this.#n,()=>this.#f(),()=>{this.#o.get(e.id)===n&&(this.#o.delete(e.id),this.#c+=1,n.close(ya).catch(this.#n))},this.#s),this.#o.set(e.id,n),this.#c+=1),n.observe(t)}async ready(e){if(this.#u)throw Error(`Remote service binding is disposed`);for(;;){let t=this.#c,n=[this.#l,...[...this.#a.values()].flatMap(e=>e.starting===void 0?[]:[e.starting]),...[...this.#o.values()].map(e=>e.ready())];if(await Ca(Promise.all(n).then(()=>void 0),e),this.#u)throw Error(`Remote service binding is disposed`);if(t===this.#c)return}}async rebind(e,t){if(this.#u)throw Error(`Remote service binding is disposed`);this.#s=e,this.#c+=1;let n=[];for(let[r,i]of this.#a){i.revision+=1,i.facade.clear();let a=i.subscription;delete i.subscription;let o=i.revision,s=(async()=>{await a?.close(t),e&&await this.#d(r,i,o)})();i.starting=s,n.push(s)}for(let r of this.#o.values())n.push(r.rebind(e,t));let r=(async()=>{let e=(await Promise.allSettled(n)).filter(e=>e.status===`rejected`);if(e.length>0)throw AggregateError(e.map(({reason:e})=>e),`Failed to rebind services`)})();this.#l=r,await r}async dispose(e){if(this.#u)return;this.#u=!0;let t=[];for(let n of this.#a.values())n.active=!1,n.facade.clear(),n.starting&&t.push(n.starting.catch(()=>{})),n.subscription&&t.push(Promise.resolve(n.subscription.close(e)));for(let n of this.#o.values())t.push(n.close(e));this.#a.clear(),this.#o.clear();let n=(await Promise.allSettled(t)).filter(e=>e.status===`rejected`);if(n.length>0)throw AggregateError(n.map(({reason:e})=>e),`Failed to dispose services`)}async#d(e,t,n){let r=await this.#e.subscribe(e,`singleton`,(r,i)=>{if(t.active&&t.revision===n)try{if(r.type===`reset`){ho(r.snapshot,e,`singleton`);let n=r.snapshot.instances[0];n===void 0?t.facade.clear():t.facade.install(n,i)}else if(r.type===`unavailable`)t.facade.clear();else if(r.type===`replaced`){if(r.snapshot.instance!==void 0)throw Error(`Singleton replacement has an instance address`);t.facade.install(r.snapshot,i)}else r.type===`state`&&r.instance===void 0&&t.facade.update(r.member,r.sequence,r.ops,i)}catch(e){this.#n(yo(e))}},ya);if(!t.active||this.#u||!this.#s||t.revision!==n){await r.close(ya);return}t.subscription=r;let i=r.snapshot;if(i.mode!==`singleton`||i.serviceId!==e||i.instances.length!==1)throw Error(`Remote service ${e} returned an invalid singleton snapshot`);t.facade.install(i.instances[0],oo()),r.activate()}#f(){if(this.#u)throw Error(`Remote service binding is disposed`);this.#i()}#p(e){if(e.local)throw new Ta(`service_not_allowed`,`Service ${e.id} is process-local`)}#m(e,t){if(this.#u)throw Error(`Remote service binding is disposed`);if(!this.#t.has(e))throw new Ta(`service_not_allowed`,`Remote service ${e} is not allowlisted`);let n=this.#r.get(e);if(n!==void 0&&n!==t)throw new Ta(`service_mode_mismatch`,`Remote service ${e} is already used as ${n}`);this.#r.set(e,t)}};function ho(e,t,n){if(e.serviceId!==t||e.mode!==n||n===`singleton`&&e.instances.length>1)throw Error(`Remote service reset has the wrong service or mode`);let r=new Set;for(let t of e.instances){if(n===`singleton`?t.instance!==void 0:t.instance===void 0)throw Error(`Remote service reset has an invalid instance address`);if(t.instance!==void 0){if(r.has(t.instance.key))throw Error(`Remote service reset repeats an instance key`);r.add(t.instance.key)}for(let e of t.members)if(e.kind===`state`&&(e.ops.length!==1||e.ops[0]?.[0]!==`r`))throw Error(`Remote service reset must contain full root replacements`)}}function go(e){let t=new Map;for(let n of e){if(n.name.length===0||t.has(n.name))throw Error(`Remote service has invalid member descriptions`);t.set(n.name,n)}return t}function _o(e,t){return e===void 0||t===void 0?e===t:e.key===t.key&&e.generation===t.generation}function vo(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.value==`function`&&typeof t.toString==`function`}function yo(e){return e instanceof Error?e:Error(String(e))}var bo=`$chord.service`,xo=`catalogue`,So=`subscribe`,Co=`unsubscribe`;function wo(){return{serviceId:bo,member:xo,args:[]}}function To(e,t,n){return{serviceId:bo,member:So,args:[e,t,n]}}function Eo(e){return{serviceId:bo,member:Co,args:[e]}}function Do(e){let t=Fo(e,`service call`);if(Io(t,[`serviceId`,`member`,`args`],[`instance`],`service call`),!Lo(t.serviceId)||!Lo(t.member)||!Array.isArray(t.args))throw TypeError(`Invalid service call`);return t.instance!==void 0&&Po(t.instance),e}function Oo(e){if(!Array.isArray(e))throw TypeError(`Invalid service catalogue`);let t=new Set;for(let n of e){let e=Fo(n,`service catalogue entry`);if(Io(e,[`serviceId`,`mode`],[],`service catalogue entry`),!Lo(e.serviceId)||!Ro(e.mode)||t.has(e.serviceId))throw TypeError(`Invalid service catalogue`);t.add(e.serviceId)}return e}function ko(e){return jo(e,Ha),e}function Ao(e){return Mo(e,Ha),e}function jo(e,t){let n=Fo(e,`service subscription snapshot`);if(Io(n,[`serviceId`,`mode`,`instances`],[],`service subscription snapshot`),!Lo(n.serviceId)||!Ro(n.mode)||!Array.isArray(n.instances))throw TypeError(`Invalid service subscription snapshot`);for(let e of n.instances)No(e,t)}function Mo(e,t){let n=Fo(e,`service provider update`);switch(n.type){case`state`:if(Io(n,[`type`,`member`,`sequence`,`ops`],[`instance`],`state update`),!Lo(n.member)||!zo(n.sequence,1)||!Array.isArray(n.ops))throw TypeError(`Invalid service state update`);n.instance!==void 0&&Po(n.instance);for(let e of n.ops)t(e);return;case`reset`:{Io(n,[`type`,`snapshot`],[],`reset update`),jo(n.snapshot,t);let e=n.snapshot;for(let t of e.instances)for(let e of t.members)if(e.kind===`state`&&(e.ops.length!==1||e.ops[0]?.[0]!==`r`))throw TypeError(`Service reset must contain full root replacements`);return}case`unavailable`:Io(n,[`type`],[],`unavailable update`);return;case`replaced`:Io(n,[`type`,`snapshot`],[],`replacement update`),No(n.snapshot,t);return;case`spawned`:Io(n,[`type`,`instance`],[],`spawn update`),No(n.instance,t);return;case`closed`:Io(n,[`type`,`instance`],[],`close update`),Po(n.instance);return;default:throw TypeError(`Invalid service provider update`)}}function No(e,t){let n=Fo(e,`service instance snapshot`);if(Io(n,[`members`],[`instance`],`service instance snapshot`),n.instance!==void 0&&Po(n.instance),!Array.isArray(n.members))throw TypeError(`Invalid service instance snapshot`);for(let e of n.members){let n=Fo(e,`service member snapshot`);if(n.kind===`method`){if(Io(n,[`name`,`kind`],[],`service method snapshot`),!Lo(n.name))throw TypeError(`Invalid service method snapshot`)}else if(n.kind===`state`){if(Io(n,[`name`,`kind`,`sequence`,`ops`],[],`service state snapshot`),!Lo(n.name)||!zo(n.sequence,0)||!Array.isArray(n.ops))throw TypeError(`Invalid service state snapshot`);for(let e of n.ops)t(e)}else throw TypeError(`Invalid service member snapshot`)}}function Po(e){let t=Fo(e,`service instance address`);if(Io(t,[`key`,`generation`],[],`service instance address`),!Lo(t.key)||!zo(t.generation,1))throw TypeError(`Invalid service instance address`)}function Fo(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`Invalid ${t}`);return e}function Io(e,t,n,r){let i=new Set([...t,...n]);if(t.some(t=>!Object.hasOwn(e,t))||Object.keys(e).some(e=>!i.has(e)))throw TypeError(`Invalid ${r}`)}function Lo(e){return typeof e==`string`&&e.length>0}function Ro(e){return e===`singleton`||e===`keyed`}function zo(e,t){return typeof e==`number`&&Number.isInteger(e)&&e>=t}function Bo(e,t){if(e.length===0)throw TypeError(`Service ID must not be empty`);if(e.startsWith(`$chord.`))throw TypeError(`Service IDs beginning with $chord. are reserved`);return Object.freeze({id:e,local:t?.local??!1})}function Vo(e){return new mo(e)}var Ho=class{#e;#t=new Map;constructor(e){this.#e=e}reset(){this.#t.clear()}add(e,t){let n=Go(e,t);if(this.#t.has(n))throw Error(`Duplicate service state ${qo(e,t)}`);let r=this.#e();return this.#t.set(n,{instance:e,codec:r}),r}get(e,t){let n=this.#t.get(Go(e,t))?.codec;if(n===void 0)throw Error(`Unknown service state ${qo(e,t)}`);return n}removeInstance(e){for(let[t,n]of this.#t)Ko(n.instance,e)&&this.#t.delete(t)}};function Uo(){let e=new Ho(Qa);return{decodeSnapshot(t){return e.reset(),{...t,instances:t.instances.map(t=>Wo(t,e))}},decodeUpdate(t){switch(t.type){case`reset`:return e.reset(),{...t,snapshot:{...t.snapshot,instances:t.snapshot.instances.map(t=>Wo(t,e))}};case`state`:return{...t,ops:e.get(t.instance,t.member).decode(t.ops)};case`replaced`:return e.reset(),{...t,snapshot:Wo(t.snapshot,e)};case`spawned`:return{...t,instance:Wo(t.instance,e)};case`unavailable`:return e.reset(),t;case`closed`:return e.removeInstance(t.instance),t}}}}function Wo(e,t){return{...e,members:e.members.map(n=>n.kind===`state`?{...n,ops:t.add(e.instance,n.name).decode(n.ops)}:n)}}function Go(e,t){return JSON.stringify([e?.key??null,e?.generation??null,t])}function Ko(e,t){return e?.key===t.key&&e.generation===t.generation}function qo(e,t){return e===void 0?t:`${e.key}@${e.generation}.${t}`}var I=4294967296,Jo=4294967295,Yo=512,L=class extends Error{constructor(e){super(e),this.name=`CborError`}},Xo=new TextEncoder,Zo=new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});function Qo(e,t,n){if(!Number.isSafeInteger(t)||t<0||t>n)throw RangeError(`${e} must be an integer between 0 and ${n}`);return t}function $o(e){return{maxByteLength:Qo(`maxByteLength`,e?.maxByteLength??16777216,Jo),maxContainerLength:Qo(`maxContainerLength`,e?.maxContainerLength??1e6,Jo),maxDepth:Qo(`maxDepth`,e?.maxDepth??64,Yo)}}var es=class{bytes;offset=0;options;constructor(e,t){this.bytes=e,this.options=t}decode(){let e=this.readItem(0);if(this.offset!==this.bytes.byteLength)throw new L(`CBOR payload contains trailing data`);return e}readItem(e){if(e>this.options.maxDepth)throw new L(`CBOR nesting depth exceeds configured limit of ${this.options.maxDepth}`);let t=this.readByte(),n=t>>>5,r=t&31;switch(n){case 0:return this.readArgument(r);case 1:{let e=-1-this.readArgument(r);if(!Number.isSafeInteger(e))throw new L(`Decoded CBOR integer is outside the safe range`);return e}case 2:{let e=this.readLength(r,`byte string`,this.options.maxByteLength);return new Uint8Array(this.readBytes(e))}case 3:{let e=this.readLength(r,`text string`,this.options.maxByteLength),t=this.readBytes(e);try{return Zo.decode(t)}catch{throw new L(`CBOR text string contains invalid UTF-8`)}}case 4:{let t=this.readLength(r,`array`,this.options.maxContainerLength),n=[];for(let r=0;r<t;r++)n.push(this.readItem(e+1));return n}case 5:{let t=this.readLength(r,`map`,this.options.maxContainerLength),n={},i=new Set;for(let r=0;r<t;r++){let t=this.readItem(e+1);if(typeof t!=`string`)throw new L(`CBOR map keys must be strings`);if(i.has(t))throw new L(`CBOR map contains a duplicate key`);i.add(t),Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:this.readItem(e+1),writable:!0})}return n}case 6:throw new L(`CBOR tags are not supported`);case 7:return this.readSimple(r);default:throw new L(`Malformed CBOR major type`)}}readSimple(e){switch(e){case 20:return!1;case 21:return!0;case 22:return null;case 27:{let e=this.readBytes(8),t=new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(0,!1);if(!Number.isFinite(t))throw new L(`Decoded CBOR number must be finite`);if(Number.isInteger(t)&&!Number.isSafeInteger(t))throw new L(`Decoded CBOR integer is outside the safe range`);return t}case 31:throw new L(`CBOR break marker is not supported`);default:throw new L(`Unsupported CBOR simple value or floating-point width`)}}readLength(e,t,n){if(e===31)throw new L(`Indefinite-length CBOR ${t}s are not supported`);let r=this.readArgument(e);if(r>n)throw new L(`CBOR ${t} length exceeds configured limit of ${n}`);return r}readArgument(e){if(e<24)return e;switch(e){case 24:return this.readByte();case 25:{let e=this.readBytes(2);return e[0]*256+e[1]}case 26:{let e=this.readBytes(4);return e[0]*16777216+e[1]*65536+e[2]*256+e[3]}case 27:{let e=this.readArgument(26),t=this.readArgument(26);if(e>2097151)throw new L(`Decoded CBOR integer or length is outside the safe range`);return e*I+t}case 31:throw new L(`Indefinite-length CBOR items are not supported`);default:throw new L(`Malformed CBOR additional information`)}}readByte(){if(this.offset>=this.bytes.byteLength)throw new L(`Truncated CBOR payload`);let e=this.bytes[this.offset];return this.offset++,e}readBytes(e){if(e>this.bytes.byteLength-this.offset)throw new L(`Truncated CBOR payload`);let t=this.bytes.subarray(this.offset,this.offset+e);return this.offset+=e,t}};function ts(e,t){if(!(e instanceof Uint8Array))throw TypeError(`CBOR input must be a Uint8Array`);let n=$o(t);if(e.byteLength>n.maxByteLength)throw new L(`CBOR byte length exceeds configured limit of ${n.maxByteLength}`);return new es(e,n).decode()}var ns=class{buffer;offset=0;maxByteLength;constructor(e){this.maxByteLength=e,this.buffer=new Uint8Array(Math.min(256,e))}writeByte(e){this.ensureCapacity(1),this.buffer[this.offset]=e,this.offset++}writeBytes(e){this.ensureCapacity(e.byteLength),this.buffer.set(e,this.offset),this.offset+=e.byteLength}writeUint16(e){this.ensureCapacity(2),this.buffer[this.offset]=e>>>8,this.buffer[this.offset+1]=e,this.offset+=2}writeUint32(e){this.ensureCapacity(4),this.buffer[this.offset]=e>>>24,this.buffer[this.offset+1]=e>>>16,this.buffer[this.offset+2]=e>>>8,this.buffer[this.offset+3]=e,this.offset+=4}writeUint64(e){let t=Math.floor(e/I),n=e-t*I;this.writeUint32(t),this.writeUint32(n)}writeFloat64(e){this.ensureCapacity(9),this.buffer[this.offset]=251,new DataView(this.buffer.buffer).setFloat64(this.offset+1,e,!1),this.offset+=9}finish(){return this.buffer.slice(0,this.offset)}ensureCapacity(e){let t=this.offset+e;if(t>this.maxByteLength)throw new L(`CBOR byte length exceeds configured limit of ${this.maxByteLength}`);if(t<=this.buffer.byteLength)return;let n=Math.max(1,this.buffer.byteLength);for(;n<t;)n=Math.min(this.maxByteLength,Math.max(t,n*2));let r=new Uint8Array(n);r.set(this.buffer),this.buffer=r}};function rs(e,t,n){let r=t<<5;n<24?e.writeByte(r|n):n<=255?(e.writeByte(r|24),e.writeByte(n)):n<=65535?(e.writeByte(r|25),e.writeUint16(n)):n<=4294967295?(e.writeByte(r|26),e.writeUint32(n)):(e.writeByte(r|27),e.writeUint64(n))}function is(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function as(e,t,n){let r=Xo.encode(t);if(r.byteLength>n.maxByteLength)throw new L(`CBOR text string length exceeds configured limit of ${n.maxByteLength}`);if(Zo.decode(r)!==t)throw new L(`CBOR text strings must contain valid Unicode scalar values`);rs(e,3,r.byteLength),e.writeBytes(r)}function os(e,t,n,r,i){if(r>n.maxDepth)throw new L(`CBOR nesting depth exceeds configured limit of ${n.maxDepth}`);if(t===null)e.writeByte(246);else if(typeof t==`boolean`)e.writeByte(t?245:244);else if(typeof t==`number`){if(!Number.isFinite(t))throw new L(`CBOR numbers must be finite`);if(Number.isInteger(t)&&!Object.is(t,-0)){if(!Number.isSafeInteger(t))throw new L(`CBOR integers must be safe JavaScript integers`);t>=0?rs(e,0,t):rs(e,1,-1-t)}else e.writeFloat64(t)}else if(typeof t==`string`)as(e,t,n);else if(t instanceof Uint8Array){if(t.byteLength>n.maxByteLength)throw new L(`CBOR byte string length exceeds configured limit of ${n.maxByteLength}`);rs(e,2,t.byteLength),e.writeBytes(t)}else if(Array.isArray(t)){if(i.has(t))throw new L(`CBOR values must not contain cycles`);if(t.length>n.maxContainerLength)throw new L(`CBOR array length exceeds configured limit of ${n.maxContainerLength}`);i.add(t);try{rs(e,4,t.length);for(let a=0;a<t.length;a++){if(!Object.hasOwn(t,a)||t[a]===void 0)throw new L(`CBOR arrays must not contain holes or undefined values`);os(e,t[a],n,r+1,i)}}finally{i.delete(t)}}else if(is(t)){if(i.has(t))throw new L(`CBOR values must not contain cycles`);for(let e of Object.getOwnPropertySymbols(t))if(Object.prototype.propertyIsEnumerable.call(t,e))throw new L(`CBOR map keys must be strings`);let a=[];for(let e of Object.keys(t)){let n=t[e];n!==void 0&&a.push([e,n])}if(a.length>n.maxContainerLength)throw new L(`CBOR map length exceeds configured limit of ${n.maxContainerLength}`);i.add(t);try{rs(e,5,a.length);for(let[t,o]of a)as(e,t,n),os(e,o,n,r+1,i)}finally{i.delete(t)}}else throw new L(`Unsupported CBOR value type: ${typeof t}`)}function ss(e,t){let n=$o(t),r=new ns(n.maxByteLength);return os(r,e,n,0,new Set),r.finish()}function cs(e,t){return t[e.length]?.(...e)??(()=>{throw Error(`Invalid Arguments`)})()}function ls(e,t,n){return e>=t&&e<=n}function us(e){return e===8205}function ds(e){return ls(e,55296,56319)}function fs(e){return ls(e,127462,127487)}function ps(e){return ls(e,65024,65039)}function ms(e){return ls(e,768,879)||ls(e,6832,6911)||ls(e,7616,7679)||ls(e,65056,65071)}function hs(e){return e>65535?2:1}function gs(e,t){for(;t<e.length;){let n=e.codePointAt(t);if(ms(n)||ps(n))t+=hs(n);else break}return t}function _s(e,t){let n=e.codePointAt(t),r=t+hs(n);for(r=gs(e,r);r<e.length-1&&us(e.codePointAt(r));){let t=e.codePointAt(r+1);r+=1+hs(t),r=gs(e,r)}return fs(n)&&r<e.length&&fs(e.codePointAt(r))&&(r+=hs(e.codePointAt(r))),r}function vs(e){return e>=768&&(ds(e)||ms(e)||ps(e)||us(e))}function ys(e,t){let n=0,r=0;for(;r<e.length;)if(r=_s(e,r),++n>=t)return!0;return!1}function bs(e,t){let n=0,r=0;for(;r<e.length;)if(r=_s(e,r),++n>t)return!1;return!0}function xs(e,t){if(t===0)return!0;if(e.length<t)return!1;let n=0;for(;;){if(vs(e.charCodeAt(n)))return ys(e,t);if(++n>=t)return!0}}function Ss(e,t){if(e.length<=t)return!0;let n=0;for(;;){if(vs(e.charCodeAt(n)))return bs(e,t);if(++n>t)return!1}}function R(e){return Array.isArray(e)}function Cs(e){return z(typeof e,`bigint`)}function ws(e){return z(typeof e,`boolean`)}function Ts(e){if(Ps(e)||!Es(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function Es(e){return z(typeof e,`function`)}function Ds(e){return Number.isInteger(e)}function Os(e){return z(e,null)}function ks(e){return Number.isFinite(e)}function As(e){return js(e)&&!R(e)}function js(e){return z(typeof e,`object`)&&!Os(e)}function Ms(e){return z(typeof e,`string`)}function Ns(e){return z(typeof e,`symbol`)}function Ps(e){return z(e,void 0)}function z(e,t){return e===t}function Fs(e,t){return e>t}function Is(e,t){return e<t}function Ls(e,t){return e<=t}function Rs(e,t){return e>=t}function zs(e,t){if(Cs(e)||Cs(t))return BigInt(e)%BigInt(t)===0n;if(!ks(e)||Ds(e)&&1/t%1==0)return!0;let n=e%t;return Math.min(Math.abs(n),Math.abs(n-t),Math.abs(n+t))<1e-10}function Bs(e){if(!js(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return!Os(t)&&z(typeof t.constructor,`function`)&&!(z(t.constructor,globalThis.Object)||z(t.constructor.name,`Object`))}function Vs(e){return Cs(e)||ws(e)||Os(e)||ks(e)||Ms(e)||Ps(e)}function Hs(e,t){return Ss(e,t)}function Us(e,t){return xs(e,t)}function Ws(e,t,n){return e.every((e,r)=>r<t||n(e,r))}function Gs(e,t){return e.some((e,n)=>t(e,n))}function Ks(e,t){let n=!1;return e.forEach((e,r)=>{t(e,r)&&(n=!0)}),n}function qs(e,t){return e.reduce((e,n,r)=>t(n,r)?++e:e,0)}function B(e,t,n){return z(e.length,0)?n():t(e[0],e.slice(1))}function Js(e){return z(e,`__proto__`)||z(e,`constructor`)||z(e,`prototype`)}function V(e,t){return Js(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function Ys(e){return Object.entries(e)}function H(e){return Object.getOwnPropertyNames(e)}function Xs(e){return Object.getOwnPropertySymbols(e)}function Zs(e){return Object.values(e)}function Qs(e,t){if(!js(t))return!1;let n=H(e);return z(n.length,H(t).length)&&n.every(n=>ec(e[n],t[n]))}function $s(e,t){return R(t)&&z(e.length,t.length)&&e.every((n,r)=>ec(e[r],t[r]))}function ec(e,t){return R(e)?$s(e,t):js(e)?Qs(e,t):z(e,t)}function tc(e){return e instanceof Boolean}function nc(e){return e instanceof Number}function rc(e){return e instanceof String}function ic(e){return globalThis.ArrayBuffer.isView(e)}function ac(e){return e instanceof globalThis.RegExp}function oc(e){return e instanceof globalThis.Date}function sc(e){return e instanceof globalThis.Set}function cc(e){return e instanceof globalThis.Map}var lc={immutableTypes:!1,maxErrors:8,maxInstantiationCount:128,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function uc(){return lc}function dc(e){return V(e,`~refine`)&&R(e[`~refine`])&&Ws(e[`~refine`],0,e=>js(e)&&V(e,`check`)&&V(e,`error`)&&Es(e.check)&&Es(e.error))}function fc(e){return js(e)&&!R(e)}function pc(e){return ws(e)}function mc(e){return fc(e)||pc(e)}function hc(e){return V(e,`additionalItems`)&&mc(e.additionalItems)}function gc(e){return V(e,`additionalProperties`)&&mc(e.additionalProperties)}function _c(e){return V(e,`allOf`)&&R(e.allOf)&&e.allOf.every(e=>mc(e))}function vc(e){return V(e,`$anchor`)&&Ms(e.$anchor)}function yc(e){return V(e,`anyOf`)&&R(e.anyOf)&&e.anyOf.every(e=>mc(e))}function bc(e){return V(e,`const`)}function xc(e){return V(e,`contains`)&&mc(e.contains)}function Sc(e){return V(e,`dependencies`)&&js(e.dependencies)&&Object.values(e.dependencies).every(e=>mc(e)||R(e)&&e.every(e=>Ms(e)))}function Cc(e){return V(e,`dependentRequired`)&&js(e.dependentRequired)&&Object.values(e.dependentRequired).every(e=>R(e)&&e.every(e=>Ms(e)))}function wc(e){return V(e,`dependentSchemas`)&&js(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(e=>mc(e))}function Tc(e){return V(e,`$dynamicAnchor`)&&Ms(e.$dynamicAnchor)}function Ec(e){return V(e,`$dynamicRef`)&&Ms(e.$dynamicRef)}function Dc(e){return V(e,`else`)&&mc(e.else)}function Oc(e){return V(e,`enum`)&&R(e.enum)}function kc(e){return V(e,`exclusiveMaximum`)&&(ks(e.exclusiveMaximum)||Cs(e.exclusiveMaximum))}function Ac(e){return V(e,`exclusiveMinimum`)&&(ks(e.exclusiveMinimum)||Cs(e.exclusiveMinimum))}function jc(e){return V(e,`format`)&&Ms(e.format)}function Mc(e){return V(e,`$id`)&&Ms(e.$id)}function Nc(e){return V(e,`if`)&&mc(e.if)}function Pc(e){return V(e,`items`)&&(mc(e.items)||R(e.items)&&e.items.every(e=>mc(e)))}function Fc(e){return Pc(e)&&R(e.items)}function Ic(e){return V(e,`maximum`)&&(ks(e.maximum)||Cs(e.maximum))}function Lc(e){return V(e,`maxContains`)&&ks(e.maxContains)}function Rc(e){return V(e,`maxItems`)&&ks(e.maxItems)}function zc(e){return V(e,`maxLength`)&&ks(e.maxLength)}function Bc(e){return V(e,`maxProperties`)&&ks(e.maxProperties)}function Vc(e){return V(e,`minimum`)&&(ks(e.minimum)||Cs(e.minimum))}function Hc(e){return V(e,`minContains`)&&ks(e.minContains)}function Uc(e){return V(e,`minItems`)&&ks(e.minItems)}function Wc(e){return V(e,`minLength`)&&ks(e.minLength)}function Gc(e){return V(e,`minProperties`)&&ks(e.minProperties)}function Kc(e){return V(e,`multipleOf`)&&(ks(e.multipleOf)||Cs(e.multipleOf))}function qc(e){return V(e,`not`)&&mc(e.not)}function Jc(e){return V(e,`oneOf`)&&R(e.oneOf)&&e.oneOf.every(e=>mc(e))}function Yc(e){return V(e,`pattern`)&&(Ms(e.pattern)||e.pattern instanceof RegExp)}function Xc(e){return V(e,`patternProperties`)&&js(e.patternProperties)&&Object.values(e.patternProperties).every(e=>mc(e))}function Zc(e){return V(e,`prefixItems`)&&R(e.prefixItems)&&e.prefixItems.every(e=>mc(e))}function Qc(e){return V(e,`properties`)&&js(e.properties)&&Object.values(e.properties).every(e=>mc(e))}function $c(e){return V(e,`propertyNames`)&&(js(e.propertyNames)||mc(e.propertyNames))}function el(e){return V(e,`$recursiveAnchor`)&&ws(e.$recursiveAnchor)}function tl(e){return el(e)&&z(e.$recursiveAnchor,!0)}function nl(e){return V(e,`$recursiveRef`)&&Ms(e.$recursiveRef)}function rl(e){return V(e,`$ref`)&&Ms(e.$ref)}function il(e){return V(e,`required`)&&R(e.required)&&e.required.every(e=>Ms(e))}function al(e){return V(e,`then`)&&mc(e.then)}function ol(e){return V(e,`type`)&&(Ms(e.type)||R(e.type)&&e.type.every(e=>Ms(e)))}function sl(e){return V(e,`uniqueItems`)&&ws(e.uniqueItems)}function cl(e){return V(e,`unevaluatedItems`)&&mc(e.unevaluatedItems)}function ll(e){return V(e,`unevaluatedProperties`)&&mc(e.unevaluatedProperties)}var ul=class{constructor(){let e=new Set,t=new Set;this.stack=[{indices:e,keys:t}]}Push(){let e=new Set,t=new Set;return this.stack.push({indices:e,keys:t}),!0}Pop(){return this.stack.pop(),!0}AddIndex(e){return this.GetIndices().add(e),!0}AddKey(e){return this.GetKeys().add(e),!0}GetIndices(){return this.stack[this.stack.length-1].indices}GetKeys(){return this.stack[this.stack.length-1].keys}Merge(e){for(let t of e)t.GetIndices().forEach(e=>this.GetIndices().add(e)),t.GetKeys().forEach(e=>this.GetKeys().add(e));return!0}};function dl(e,t,n,r){return Ws(n[`~refine`],0,(e,t)=>e.check(r))}function fl(e){return Pc(e)&&R(e.items)}function pl(e,t,n,r){return!fl(n)||Ws(r,0,(r,i)=>Is(i,n.items.length)||Vf(e,t,n.additionalItems,r)&&t.AddIndex(i))}function ml(e){return new RegExp(e,`u`)}function hl(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}$`}function gl(e){let t=[];return Xc(e)&&t.push(...H(e.patternProperties)),Qc(e)&&t.push(...H(e.properties).map(hl)),z(t.length,0)?`(?!)`:`(${t.join(`|`)})`}function _l(e,t,n,r){let i=ml(gl(n));return Ws(H(r),0,(a,o)=>i.test(a)||Vf(e,t,n.additionalProperties,r[a])&&t.AddKey(a))}function vl(e,t,n,r){let i=n.allOf.reduce((t,n)=>{let i=new ul;return Hf(e,i,n,r)?[...t,i]:t},[]);return z(i.length,n.allOf.length)&&t.Merge(i)}function yl(e,t,n,r){let i=n.anyOf.reduce((t,n)=>{let i=new ul;return Hf(e,i,n,r)?[...t,i]:t},[]);return Fs(i.length,0)&&t.Merge(i)}function bl(e,t,n,r){return n}function xl(e,t,n,r){return Vs(n.const)?z(r,n.const):ec(r,n.const)}function Sl(e){return!(Hc(e)&&z(e.minContains,0))}function Cl(e,t,n,r){return!Sl(n)||!z(r.length,0)&&Ks(r,(r,i)=>Hf(e,t,n.contains,r)&&t.AddIndex(i))}function wl(e,t,n,r){let i=z(H(r).length,0),a=Ws(Ys(n.dependencies),0,([n,i])=>!V(r,n)||(R(i)?i.every(e=>V(r,e)):Hf(e,t,i,r)));return i||a}function Tl(e,t,n,r){let i=z(H(r).length,0),a=Ws(Ys(n.dependentRequired),0,([e,t])=>!V(r,e)||t.every(e=>V(r,e)));return i||a}function El(e,t,n,r){let i=z(H(r).length,0),a=Ws(Ys(n.dependentSchemas),0,([n,i])=>!V(r,n)||Hf(e,t,i,r));return i||a}function Dl(e,t,n,r){let i=e.DynamicRef(n)??!1;return mc(i)&&Hf(e,t,i,r)}function Ol(e,t,n,r){return Gs(n.enum,e=>Vs(e)?z(r,e):ec(r,e))}function kl(e,t,n,r){return Is(r,n.exclusiveMaximum)}function Al(e,t,n,r){return Fs(r,n.exclusiveMinimum)}var jl=[0,31,28,31,30,31,30,31,31,30,31,30,31],Ml=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function Nl(e){return e%4==0&&(e%100!=0||e%400==0)}function Pl(e){let t=Ml.exec(e);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r===2&&Nl(n)?29:jl[r])}var Fl=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))?$/;function Il(e,t=!0){let n=Fl.exec(e);if(!n||t&&!n[4]&&!n[5])return!1;let r=+n[1],i=+n[2],a=+n[3];if(r>23||i>59||a>60)return!1;if(n[5]){let e=+n[6],t=+n[7];if(e>23||t>59)return!1}if(a<60)return!0;let o=n[5]===`-`?-1:1,s=+(n[6]||0),c=+(n[7]||0);return((r*60+i-o*(s*60+c))%1440+1440)%1440==1439}function Ll(e){let t=e.split(/T/i);return t.length===2&&Pl(t[0])&&Il(t[1])}var Rl=/^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;function zl(e){return Rl.test(e)}var Bl=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;function Vl(e){return Bl.test(e)}var Hl=/^(?!-).*(?<!-)$/,Ul=/^(?!..--)/,Wl=/^[a-zA-Z0-9-]*$/,Gl=/[^\p{ASCII}]/u,Kl=/[0-9]/,ql=/[\u{0660}-\u{0669}]/u,Jl=/[\u{06f0}-\u{06f9}]/u,Yl=/[\u{002e}\u{002c}\u{003a}\u{002f}]/u,Xl=/[\u{002d}\u{002b}]/u,Zl=/\p{Mn}/u,Ql=/\p{Mc}/u,$l=/[\p{Mn}\p{Mc}\p{Me}]/u,eu=/\p{L}/u,tu=/\p{Nd}/u,nu=/\p{Script=Greek}/u,ru=/\p{Script=Hebrew}/u,iu=/[\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}]/u,au=/[\p{Script=Arabic}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Mandaic}]/u,ou=/[\u{094d}\u{09cd}\u{0a4d}\u{0acd}\u{0b4d}\u{0bcd}\u{0c4d}\u{0ccd}\u{0d3b}\u{0d3c}\u{0d4d}\u{0dca}\u{1b44}\u{1baa}\u{1bab}\u{a9c0}\u{11046}\u{1107f}\u{110b9}\u{11133}\u{11134}\u{111c0}\u{11235}\u{1134d}\u{11442}\u{114c2}\u{115bf}\u{1163f}\u{116b6}\u{11c3f}\u{11d44}\u{11d45}]/u,su=/[\u{0640}\u{07fa}\u{302e}\u{302f}\u{3031}\u{3032}\u{3033}\u{3034}\u{3035}\u{303b}]/u,cu=/[\u{00b7}\u{0375}\u{05f3}\u{05f4}\u{200c}\u{200d}\u{30fb}]/u,lu=/[\u{00df}\u{03c2}\u{06fd}\u{06fe}\u{0f0b}\u{3007}]/u,uu=new RegExp([Kl,Jl].map(e=>e.source).join(`|`),`u`),du=new RegExp([eu,Xl,Yl,tu,Zl,Ql,cu,lu].map(e=>e.source).join(`|`),`u`);function fu(e){return Hl.test(e)&&Ul.test(e)&&Wl.test(e)}var pu=36,mu=1,hu=26,gu=38,_u=700,vu=72,yu=128;function bu(){throw null}function xu(e){return e.toLowerCase().startsWith(`xn--`)}function Su(e,t,n){e=n?Math.floor(e/_u):e>>1,e+=Math.floor(e/t);let r=0;for(;e>455;)e=Math.floor(e/35),r+=pu;return r+Math.floor(36*e/(e+gu))}function Cu(e){let t=[],n=yu,r=0,i=vu,a=e.lastIndexOf(`-`);if(a>0)for(let n=0;n<a;n++){let r=e.charCodeAt(n);r>=128&&bu(),t.push(r)}let o=a<0?0:a+1;for(;o<e.length;){let a=r,s=1,c=pu;for(;;){o>=e.length&&bu();let t=e.charCodeAt(o++),n;t>=97&&t<=122?n=t-97:t>=48&&t<=57?n=t-48+26:bu(),r+=n*s;let a=c<=i?mu:c>=i+hu?hu:c-i;if(n<a)break;s*=pu-a,c+=pu}let l=t.length+1;i=Su(r-a,l,a===0),n+=Math.floor(r/l),r%=l,t.splice(r,0,n),r++}return String.fromCodePoint(...t)}function wu(e){return e<26?String.fromCharCode(e+97):String.fromCharCode(e-26+48)}var Tu=new RegExp(Gl.source,`gu`);function Eu(e){let t=e.replace(Tu,``),n=t.length,r=n>0?[t,`-`]:[],i=Array.from(e,e=>e.codePointAt(0)),a=yu,o=0,s=vu,c=n;for(;c<i.length;){let e=1/0;for(let t of i)t>=a&&t<e&&(e=t);o+=(e-a)*(c+1),a=e;for(let e of i)if(e<a&&o++,e===a){let e=o;for(let t=pu;;t+=pu){let n=t<=s?mu:t>=s+hu?hu:t-s;if(e<n)break;let i=n+(e-n)%(pu-n);r.push(wu(i)),e=Math.floor((e-n)/(pu-n))}r.push(wu(e)),s=Su(o,c+1,c===n),o=0,c++}o++,a++}return r.join(``)}var Du=/^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/,Ou=/^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/,ku=/^(?:R|AL|AN)$/;function Au(e){if(xu(e))try{return Mu(Cu(e.slice(4).toLowerCase()))}catch{return!1}return Mu(e)}function ju(e){let t=String.fromCodePoint(e);return uu.test(t)?`EN`:ql.test(t)?`AN`:Zl.test(t)?`NSM`:ru.test(t)?`R`:au.test(t)?`AL`:eu.test(t)?`L`:`ON`}function Mu(e){for(let t of e)if(ku.test(ju(t.codePointAt(0))))return!0;return!1}function Nu(e){let t=!1,n=Ou,r=!1,i=!1,a=!0;for(let o of e){let e=ju(o.codePointAt(0));if(a){if(e!==`L`&&e!==`R`&&e!==`AL`)return!1;t=e===`R`||e===`AL`,n=t?Du:Ou,a=!1}if(!n.test(e))return!1;e===`EN`?r=!0:e===`AN`&&(i=!0)}return!(t&&r&&i)}function Pu(e){return Gl.test(e)&&Eu(e).length+4>63}function Fu(e){return e[0]===`-`||e[e.length-1]===`-`||e.slice(2).join(``).startsWith(`--`)}function Iu(e){if(Pu(e)||Mu(e)&&!Nu(e))return!1;let t=[...e],n=t.map(e=>e.codePointAt(0)),r=n.length;if(Fu(t)||$l.test(t[0]))return!1;let i=!1;for(let e=0;e<r;e++){let r=n[e],a=t[e];if(su.test(a)||!du.test(a))return!1;iu.test(a)&&(i=!0);let o=n[e-1],s=n[e+1];switch(r){case 183:if(o!==108||s!==108)return!1;break;case 885:if(!s||!nu.test(t[e+1]))return!1;break;case 1523:case 1524:if(!o||!ru.test(t[e-1]))return!1;break;case 8204:if(!o||o<128&&!ou.test(t[e-1]))return!1;break;case 8205:if(!o||!ou.test(t[e-1]))return!1}}return!(e.includes(`・`)&&!i)}function Lu(e){if(!xu(e))return!1;try{let t=e.slice(4).toLowerCase();if(t.lastIndexOf(`-`)===0)return!1;let n=Cu(t);return Gl.test(n)?Iu(n):!1}catch{return!1}}function Ru(e){return e.length>0&&e.length<=63}function zu(e){return Ru(e)&&(Lu(e)||fu(e))}function Bu(e){return e.length===0||e.length>253||e.charCodeAt(e.length-1)===46?!1:e.split(`.`).every(e=>zu(e))}function Vu(e){return e.length>0&&e.length<=63}function Hu(e){return Vu(e)&&(Lu(e)||Iu(e))}function Uu(e){return e.replace(/[\uff01-\uff5e]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248)).normalize(`NFC`).replace(/[\u00ad\u034f\u180b-\u180d\u200b\ufe00-\ufe0f\u{e0100}-\u{e01ef}]/gu,``).replace(/[\u002E\u3002\uFF0E\uFF61]/g,`.`)}function Wu(e){if(e.length===0||e.includes(` `))return!1;let t=Uu(e);if(t.length>253)return!1;let n=t.split(`.`),r=n.some(e=>Au(e));return n.every(e=>Hu(e)&&(!r||Nu(e)))}function Gu(e){return Bu(e)}var Ku=/^(?:[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+)*|"(?:[^"\\]|\\.)*")@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-)(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-))*$/iu;function qu(e){return Ku.test(e.normalize(`NFC`))}function Ju(e){return Wu(e)}var Yu=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;function Xu(e){return Yu.test(e)}var Zu=/^(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:)?[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)$/i;function Qu(e){return Zu.test(e)}var $u=/[\x00-\x20\x7F\\]|%(?![0-9a-fA-F]{2})/,ed=/^[a-zA-Z][a-zA-Z0-9+\-.]*\/\//;function td(e){return!$u.test(e)&&!ed.test(e)&&URL.canParse(e,`http://example.com`)}var nd=2048,rd=/\[[vV][0-9a-fA-F]+\.[^\]]+\]/,id=/[\x00-\x20<>\^`{|}\\]/,U=/%(?![0-9a-fA-F]{2})/;function ad(e){return e.length<nd?e.replace(rd,`[::1]`):e}function od(e){return id.test(e)||U.test(e)?!1:URL.canParse(ad(e))}var sd=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function cd(e){return sd.test(e)}var ld=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function ud(e){return ld.test(e)}function dd(e){try{return new RegExp(e,`u`),!0}catch{return!1}}var fd=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function pd(e){return fd.test(e)}var md=/^(?:[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?)(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function hd(e){return md.test(e)}var gd=/^(?:(?:[^\x00-\x20"<>%\\^`{|}\x7f]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?)*\})*$/i;function _d(e){return gd.test(e)}var vd=/^[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function yd(e){return vd.test(e)}function bd(e){return URL.canParse(e)}var xd=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function Sd(e){return xd.test(e)}var Cd=new Map;function wd(){Cd.clear()}function Td(e,t){return Cd.get(e)?.(t)??!0}function Ed(){wd(),Cd.set(`date-time`,Ll),Cd.set(`date`,Pl),Cd.set(`duration`,zl),Cd.set(`email`,Vl),Cd.set(`hostname`,Gu),Cd.set(`idn-email`,qu),Cd.set(`idn-hostname`,Ju),Cd.set(`ipv4`,Xu),Cd.set(`ipv6`,Qu),Cd.set(`iri-reference`,td),Cd.set(`iri`,od),Cd.set(`json-pointer-uri-fragment`,cd),Cd.set(`json-pointer`,ud),Cd.set(`regex`,dd),Cd.set(`relative-json-pointer`,pd),Cd.set(`time`,Il),Cd.set(`uri-reference`,hd),Cd.set(`uri-template`,_d),Cd.set(`uri`,yd),Cd.set(`url`,bd),Cd.set(`uuid`,Sd)}Ed();function Dd(e,t,n,r){return Td(n.format,r)}function Od(e,t,n,r){let i=!al(n)||n.then,a=!Dc(n)||n.else;return Hf(e,t,n.if,r)?Hf(e,t,i,r):Hf(e,t,a,r)}function kd(e,t,n,r){return Ws(n.items,0,(n,i)=>Ls(r.length,i)||Vf(e,t,n,r[i])&&t.AddIndex(i))}function Ad(e,t,n,r){return Ws(r,Zc(n)?n.prefixItems.length:0,(r,i)=>Vf(e,t,n.items,r)&&t.AddIndex(i))}function jd(e,t,n,r){return Fc(n)?kd(e,t,n,r):Ad(e,t,n,r)}function Md(e){return xc(e)}function Nd(e,t,n,r){return!Md(n)||Ls(qs(r,r=>Hf(e,t,n.contains,r)),n.maxContains)}function Pd(e,t,n,r){return Ls(r,n.maximum)}function Fd(e,t,n,r){return Ls(r.length,n.maxItems)}function Id(e,t,n,r){return Hs(r,n.maxLength)}function Ld(e,t,n,r){return Ls(H(r).length,n.maxProperties)}function Rd(e){return xc(e)}function zd(e,t,n,r){return!Rd(n)||Rs(qs(r,(r,i)=>Hf(e,t,n.contains,r)&&t.AddIndex(i)),n.minContains)}function Bd(e,t,n,r){return Rs(r,n.minimum)}function Vd(e,t,n,r){return Rs(r.length,n.minItems)}function Hd(e,t,n,r){return Us(r,n.minLength)}function Ud(e,t,n,r){return Rs(H(r).length,n.minProperties)}function Wd(e,t,n,r){return zs(r,n.multipleOf)}function Gd(e,t,n,r){let i=new ul;return!Hf(e,i,n.not,r)&&t.Merge([i])}function Kd(e,t,n,r){let i=n.oneOf.reduce((t,n)=>{let i=new ul;return Hf(e,i,n,r)?[...t,i]:t},[]);return z(i.length,1)&&t.Merge(i)}function qd(e,t,n,r){return(Ms(n.pattern)?ml(n.pattern):n.pattern).test(r)}function Jd(e,t,n,r){return Ws(Ys(n.patternProperties),0,([n,i])=>{let a=ml(n);return Ws(Ys(r),0,([n,r])=>!a.test(n)||Vf(e,t,i,r)&&t.AddKey(n))})}function Yd(e,t,n,r){return z(r.length,0)||Ws(n.prefixItems,0,(n,i)=>Ls(r.length,i)||Vf(e,t,n,r[i])&&t.AddIndex(i))}function Xd(e,t){return e.includes(t)||uc().exactOptionalPropertyTypes}function Zd(e,t){return Ps(e[t])}function Qd(e,t,n,r){let i=il(n)?n.required:[];return Ws(Ys(n.properties),0,([n,a])=>{let o=!V(r,n)||Vf(e,t,a,r[n])&&t.AddKey(n);return Xd(i,n)?o:Zd(r,n)||o})}function $d(e,t,n,r){return Ws(H(r),0,(r,i)=>Hf(e,t,n.propertyNames,r))}function ef(e,t,n,r){let i=e.RecursiveRef(n)??!1;return mc(i)&&Hf(e,t,i,r)}function tf(e,t,n,r){let i=e.Ref(n)??!1,a=new ul,o=mc(i)&&Hf(e,a,i,r);return o&&t.Merge([a]),o}function nf(e,t,n,r){return Ws(n.required,0,e=>V(r,e))}function rf(e,t,n,r,i){return z(n,`object`)?As(i):z(n,`array`)?R(i):z(n,`boolean`)?ws(i):z(n,`integer`)?Ds(i):z(n,`number`)?ks(i):z(n,`null`)?Os(i):z(n,`string`)?Ms(i):z(n,`bigint`)?Cs(i):z(n,`constructor`)?Ts(i):z(n,`function`)?Es(i):z(n,`symbol`)?Ns(i):z(n,`undefined`)?Ps(i):!z(n,`void`)||Ps(i)}function af(e,t,n,r,i){return Gs(n,n=>rf(e,t,n,r,i))}function of(e,t,n,r){return R(n.type)?af(e,t,n.type,n,r):rf(e,t,n.type,n,r)}function sf(e,t,n,r){let i=t.GetIndices();return Ws(r,0,(r,a)=>(i.has(a)||Hf(e,t,n.unevaluatedItems,r))&&t.AddIndex(a))}function cf(e,t,n,r){let i=t.GetKeys();return Ws(Ys(r),0,([r,a])=>i.has(r)||Hf(e,t,n.unevaluatedProperties,a)&&t.AddKey(r))}function lf(){throw Error(`Unreachable`)}function uf(e){let t=new Set,n=e;for(;n&&n!==Object.prototype;){for(let e of Reflect.ownKeys(n))e!==`constructor`&&typeof e!=`symbol`&&t.add(e);n=Object.getPrototypeOf(n)}return[...t]}function df(e){return typeof e==`number`}var ff;(function(e){e[e.Array=0]=`Array`,e[e.BigInt=1]=`BigInt`,e[e.Boolean=2]=`Boolean`,e[e.Date=3]=`Date`,e[e.Constructor=4]=`Constructor`,e[e.Function=5]=`Function`,e[e.Null=6]=`Null`,e[e.Number=7]=`Number`,e[e.Object=8]=`Object`,e[e.RegExp=9]=`RegExp`,e[e.String=10]=`String`,e[e.Symbol=11]=`Symbol`,e[e.TypeArray=12]=`TypeArray`,e[e.Undefined=13]=`Undefined`})(ff||={});var pf=BigInt(`14695981039346656037`),[mf,hf]=[BigInt(`1099511628211`),BigInt(`18446744073709551616`)],gf=Array.from({length:256}).map((e,t)=>BigInt(t)),_f=new Float64Array(1),vf=new DataView(_f.buffer),yf=new Uint8Array(_f.buffer);function bf(e){pf^=gf[e],pf=pf*mf%hf}function xf(e){bf(ff.Array);for(let t of e)If(t)}function Sf(e){bf(ff.BigInt),vf.setBigInt64(0,e);for(let e of yf)bf(e)}function Cf(e){bf(ff.Boolean),bf(+!!e)}function wf(e){bf(ff.Constructor),If(e.toString())}function Tf(e){bf(ff.Date),If(e.getTime())}function Ef(e){bf(ff.Function),If(e.toString())}function Df(e){bf(ff.Null)}function Of(e){bf(ff.Number),vf.setFloat64(0,e,!0);for(let e of yf)bf(e)}function kf(e){bf(ff.Object);for(let t of uf(e).sort())If(t),If(e[t])}function Af(e){bf(ff.RegExp),Mf(e.toString())}var jf=new TextEncoder;function Mf(e){bf(ff.String);for(let t of jf.encode(e))bf(t)}function Nf(e){bf(ff.Symbol),If(e.toString())}function Pf(e){bf(ff.TypeArray);let t=new Uint8Array(e.buffer);for(let e=0;e<t.length;e++)bf(t[e])}function Ff(e){return bf(ff.Undefined)}function If(e){return ic(e)?Pf(e):oc(e)?Tf(e):ac(e)?Af(e):tc(e)?Cf(e.valueOf()):rc(e)?Mf(e.valueOf()):nc(e)?Of(e.valueOf()):df(e)?Of(e):R(e)?xf(e):ws(e)?Cf(e):Cs(e)?Sf(e):Ts(e)?wf(e):Os(e)?Df(e):js(e)?kf(e):Ms(e)?Mf(e):Ns(e)?Nf(e):Ps(e)?Ff(e):Es(e)?Ef(e):lf()}function Lf(e){return pf=BigInt(`14695981039346656037`),If(e),pf}function Rf(e){return Lf(e).toString(16).padStart(16,`0`)}function zf(e){return!z(e.uniqueItems,!1)}function Bf(e,t,n,r){if(!zf(n))return!0;let i=new Set(r.map(Rf)).size,a=r.length;return z(i,a)}function Vf(e,t,n,r){return t.Push()&&Hf(e,t,n,r)&&t.Pop()}function Hf(e,t,n,r){e.Push(n);let i=pc(n)?bl(e,t,n,r):(!ol(n)||of(e,t,n,r))&&(!(js(r)&&!R(r))||(!il(n)||nf(e,t,n,r))&&(!gc(n)||_l(e,t,n,r))&&(!Sc(n)||wl(e,t,n,r))&&(!Cc(n)||Tl(e,t,n,r))&&(!wc(n)||El(e,t,n,r))&&(!Xc(n)||Jd(e,t,n,r))&&(!Qc(n)||Qd(e,t,n,r))&&(!$c(n)||$d(e,t,n,r))&&(!Gc(n)||Ud(e,t,n,r))&&(!Bc(n)||Ld(e,t,n,r)))&&(!R(r)||(!hc(n)||pl(e,t,n,r))&&(!xc(n)||Cl(e,t,n,r))&&(!Pc(n)||jd(e,t,n,r))&&(!Lc(n)||Nd(e,t,n,r))&&(!Rc(n)||Fd(e,t,n,r))&&(!Hc(n)||zd(e,t,n,r))&&(!Uc(n)||Vd(e,t,n,r))&&(!Zc(n)||Yd(e,t,n,r))&&(!sl(n)||Bf(e,t,n,r)))&&(!Ms(r)||(!zc(n)||Id(e,t,n,r))&&(!Wc(n)||Hd(e,t,n,r))&&(!jc(n)||Dd(e,t,n,r))&&(!Yc(n)||qd(e,t,n,r)))&&(!(ks(r)||Cs(r))||(!kc(n)||kl(e,t,n,r))&&(!Ac(n)||Al(e,t,n,r))&&(!Ic(n)||Pd(e,t,n,r))&&(!Vc(n)||Bd(e,t,n,r))&&(!Kc(n)||Wd(e,t,n,r)))&&(!rl(n)||tf(e,t,n,r))&&(!nl(n)||ef(e,t,n,r))&&(!Ec(n)||Dl(e,t,n,r))&&(!bc(n)||xl(e,t,n,r))&&(!Oc(n)||Ol(e,t,n,r))&&(!Nc(n)||Od(e,t,n,r))&&(!qc(n)||Gd(e,t,n,r))&&(!_c(n)||vl(e,t,n,r))&&(!yc(n)||yl(e,t,n,r))&&(!Jc(n)||Kd(e,t,n,r))&&(!cl(n)||!R(r)||sf(e,t,n,r))&&(!ll(n)||!js(r)||cf(e,t,n,r))&&(!dc(n)||dl(e,t,n,r));return e.Pop(n),i}function Uf(e,t){return js(t)&&!Js(e)?t[e]:void 0}function Wf(e,t){return e.reduce((e,t)=>Uf(t,e),t)}function Gf(e){if(z(e.length,0))return[];let t=e.split(`/`).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`));return t.length>0&&t[0]===``?t.slice(1):t}function Kf(e,t){return Wf(Gf(t),e)}var qf=`https://json-schema.org`;function Jf(e,t){if(js(e)&&Tc(e)&&z(e.$dynamicAnchor,t))return e;if(js(e))for(let n of H(e)){let r=Jf(e[n],t);if(r)return r}}function Yf(e,t,n){if(z(e,n))return t.href;let r=fc(e)&&Mc(e)?new URL(e.$id,t.href):t;if(R(e))for(let t of e){let e=Yf(t,r,n);if(!Ps(e))return e}else if(js(e))for(let t of H(e)){let i=Yf(e[t],r,n);if(!Ps(i))return i}}function W(e,t,n){if(z(e.$id,n.hash))return e;let r=new URL(n.href,t.href);if(z(t.pathname,r.pathname))return n.hash.startsWith(`#`)?Qf(e,n):e}function Xf(e,t,n){let r=new URL(`#${e.$anchor}`,t.href),i=new URL(n.href,t.href);return z(r.href,i.href)?e:void 0}function Zf(e,t,n){let r=new URL(`#${e.$dynamicAnchor}`,t.href),i=new URL(n.href,t.href);return z(r.href,i.href)?e:void 0}function Qf(e,t){if(t.href.endsWith(`#`))return e;if(!t.hash.startsWith(`#`))return;let n=decodeURIComponent(t.hash.slice(1));if(n.startsWith(`/`))return Kf(e,n)}function $f(e,t,n){if(Mc(e)){let r=W(e,t,n);if(!Ps(r))return r}if(vc(e)){let r=Xf(e,t,n);if(!Ps(r))return r}if(Tc(e)){let r=Zf(e,t,n);if(!Ps(r))return r}return Qf(e,n)}function ep(e,t,n){return e.reduce((e,r)=>{let i=rp(r,t,n);return Ps(i)?e:i},void 0)}function tp(e){return z(e,`const`)||z(e,`enum`)}function np(e,t,n){return H(e).reduce((r,i)=>{if(tp(i))return r;let a=rp(e[i],t,n);return Ps(a)?r:a},void 0)}function rp(e,t,n){let r=fc(e)&&Mc(e)?new URL(e.$id,t.href):t;if(fc(e)){let t=$f(e,r,n);if(!Ps(t))return t}if(R(e))return ep(e,r,n);if(js(e))return np(e,r,n)}function ip(e,t,n){return Yf(e,new URL(t||`.`,qf),n)}function ap(e,t,n,r){let i=mp(e,t,n,r,!1);return fc(i)&&Mc(i)?i:void 0}function op(e){return e.href.split(`#`)[0]}function sp(e,t){return V(e,t)?e[t]:void 0}function cp(e,t,n){return rp(e,t,n)}function lp(e,t,n){let r=op(n);if(z(r,op(t))||!V(e,r))return;let i=e[r],a=fc(i)&&Mc(i)?new URL(i.$id,r):new URL(r);return z(n.hash,``)?i:rp(i,a,n)}function up(e,t,n,r,i){if(!r.$ref.startsWith(`#`)||V(e,`$schema`))return;let a=ip(t,n,i);if(!(Ps(a)||z(a,n)))return{target:i,base:a,root:t}}function dp(e,t,n){let r=e[t];if(fc(r))return{target:n,base:t,root:r}}function fp(e,t,n,r,i){let a=i?dp(e.context,r,n):void 0;return Ps(a)?up(e.root,e.lexicalSchema,e.referenceBase,t,n):a}function pp(e,t,n,r,i,a){if(Mc(i))return;let o=ap(e,t,n,r);if(o&&!a.includes(o))return{target:i,resource:o}}function mp(e,t,n,r,i=!0){let a=new URL(n||`.`,qf),o=i&&Mc(t)?new URL(t.$id,a):a,s=new URL(r,o.href);return sp(e,r)??cp(t,o,s)??lp(e,o,s)}function hp(e,t,n,r,i,a){let o=new URL(n||`.`,qf),s=mp(e,i.$dynamicRef.startsWith(`#`)?r:t,n,i.$dynamicRef,!1);if(Ps(s)){let e=new URL(i.$dynamicRef,o).hash;if(!e.startsWith(`#/`)&&e.startsWith(`#`)){let n=decodeURIComponent(e.slice(1));return a.find(e=>z(e.$dynamicAnchor,n))??Jf(t,n)}}else return!fc(s)||!Tc(s)||new URL(i.$dynamicRef,o).hash.startsWith(`#/`)?s:a.find(e=>z(e.$dynamicAnchor,s.$dynamicAnchor))??s}function gp(e,t){let n=e.inRetrievedFrame?e.lexicalSchema:e.root,r=t.$ref.startsWith(`#`)?e.lexicalSchema:n,i=mp(e.context,r,e.referenceBase,t.$ref,!1);if(!i||!fc(i))return{schema:i};let a=new URL(t.$ref,e.referenceBase).href.split(`#`)[0],o=!z(a,e.resourceBase);return{schema:i,retrievedResource:fp(e,t,i,a,o),resolvedResource:o?pp(e.context,e.root,e.referenceBase,a,i,e.ids):void 0}}function _p(e,t){let n=tl(e.lexicalSchema)?e.recursiveAnchors[0]:e.lexicalSchema;return mp(e.context,n,e.lexicalBase,t.$recursiveRef,!1)}function vp(e,t){return hp(e.context,e.root,e.lexicalBase,e.lexicalSchema,t,e.dynamicAnchors)}var yp=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},bp,xp,Sp,Cp,wp,Tp,Ep,Dp,Op,kp,Ap,jp,Mp,Np,Pp,Fp=class{constructor(e,t){bp.add(this),this.context=e,this.schema=t,this.ids=[],this.resourceIds=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[],this.retrievedResources=new Map,this.retrievedFrames=[],this.resolvedResources=new Map,this.pendingResource=!0}LexicalBaseURL(){return yp(this,bp,`m`,Cp).call(this,this.ids)}Push(e){if(!fc(e))return;Mc(e)&&yp(this,bp,`m`,jp).call(this,e),vc(e)&&this.anchors.push(e),tl(e)&&this.recursiveAnchors.push(e),Tc(e)&&this.dynamicAnchors.push(e);let t=this.retrievedResources.get(e);t&&this.retrievedFrames.push({schema:t.root,base:t.base,idDepth:this.ids.length,resourceDepth:this.resourceIds.length})}Pop(e){fc(e)&&(Mc(e)&&yp(this,bp,`m`,Mp).call(this,e),vc(e)&&this.anchors.pop(),tl(e)&&this.recursiveAnchors.pop(),Tc(e)&&this.dynamicAnchors.pop(),this.retrievedResources.has(e)&&this.retrievedFrames.pop(),yp(this,bp,`m`,Pp).call(this,e))}Ref(e){let t=gp(yp(this,bp,`m`,xp).call(this),e);return yp(this,bp,`m`,Sp).call(this,t),t.schema}RecursiveRef(e){let t=_p(yp(this,bp,`m`,xp).call(this),e);return t&&(this.pendingResource=!0),t}DynamicRef(e){let t=vp(yp(this,bp,`m`,xp).call(this),e);return t&&(this.pendingResource=!0),t}};bp=new WeakSet,xp=function(){return{context:this.context,root:this.schema,ids:this.ids,lexicalSchema:yp(this,bp,`m`,Ep).call(this),lexicalBase:this.LexicalBaseURL(),referenceBase:yp(this,bp,`m`,Tp).call(this),resourceBase:yp(this,bp,`m`,wp).call(this),recursiveAnchors:this.recursiveAnchors,dynamicAnchors:this.dynamicAnchors,inRetrievedFrame:this.retrievedFrames.length>0}},Sp=function(e){Ps(e.schema)||(this.pendingResource=!0),Ps(e.resolvedResource)||yp(this,bp,`m`,Np).call(this,e.resolvedResource.target,e.resolvedResource.resource),Ps(e.retrievedResource)||this.retrievedResources.set(e.retrievedResource.target,{base:e.retrievedResource.base,root:e.retrievedResource.root})},Cp=function(e){let t=this.retrievedFrames[this.retrievedFrames.length-1],n=t?new URL(t.base):new URL(qf);return(t?e.slice(t.idDepth):e).reduce((e,t)=>new URL(t.$id,e),n).href},wp=function(){let e=this.retrievedFrames[this.retrievedFrames.length-1];return e?this.resourceIds.slice(e.resourceDepth).reduce((e,t)=>new URL(t.$id,e),new URL(e.base)).href:yp(this,bp,`m`,Cp).call(this,this.resourceIds)},Tp=function(){if(this.retrievedFrames.length>0)return yp(this,bp,`m`,wp).call(this);let e=this.ids[this.ids.length-1];return e&&!/^[A-Za-z][A-Za-z0-9+.-]*:/.test(e.$id)?this.LexicalBaseURL():yp(this,bp,`m`,wp).call(this)},Ep=function(){let e=this.retrievedFrames[this.retrievedFrames.length-1];return e?this.ids.length>e.idDepth?this.ids[this.ids.length-1]:e.schema:this.ids.length>0?this.ids[this.ids.length-1]:this.schema},Dp=function(e){e.forEach(e=>yp(this,bp,`m`,kp).call(this,e,!1))},Op=function(e){e.forEach(e=>yp(this,bp,`m`,Ap).call(this,e,!1))},kp=function e(t,n=!0){if(pc(t))return;if(R(t))return yp(this,bp,`m`,Dp).call(this,t);if(!fc(t))return;let r=t;if(n||!Mc(r)){!n&&Tc(r)&&this.dynamicAnchors.push(r);for(let t of H(r))yp(this,bp,`m`,e).call(this,r[t],!1)}},Ap=function e(t,n=!0){if(pc(t))return;if(R(t))return yp(this,bp,`m`,Op).call(this,t);if(!fc(t))return;let r=t;if(n||!Mc(r)){!n&&Tc(r)&&this.dynamicAnchors.pop();for(let t of H(r))yp(this,bp,`m`,e).call(this,r[t],!1)}},jp=function(e){this.ids.push(e);let t=this.pendingResource;this.pendingResource=!1,t&&this.resourceIds.push(e),yp(this,bp,`m`,kp).call(this,e,!0)},Mp=function(e){this.ids.pop(),this.resourceIds.length>0&&z(this.resourceIds[this.resourceIds.length-1],e)&&this.resourceIds.pop(),yp(this,bp,`m`,Ap).call(this,e,!0)},Np=function(e,t){yp(this,bp,`m`,jp).call(this,t),this.resolvedResources.set(e,t)},Pp=function(e){if(!this.resolvedResources.has(e))return;let t=this.resolvedResources.get(e);yp(this,bp,`m`,Mp).call(this,t),this.resolvedResources.delete(e)};var Ip={assign:0,create:0,clone:0,discard:0,update:0};function Lp(e){return uc().immutableTypes?Object.freeze(e):e}function Rp(e,t){return Ip.assign+=1,Lp({...e,...t})}function zp(e){return e}function Bp(e){return V(e,`~kind`)||V(e,`~unsafe`)}function Vp(e){let t={};for(let n of H(e)){if(Js(n))continue;let r=Object.getOwnPropertyDescriptor(e,n);r.value=Yp(r.value),z(r.enumerable,!0)?t[n]=r.value:Object.defineProperty(t,n,r)}return t}function Hp(e){let t={};for(let n of H(e))Js(n)||(t[n]=Yp(e[n]));for(let n of Xs(e))t[n]=Yp(e[n]);return t}function Up(e){return Bs(e)?zp(e):Bp(e)?Vp(e):Hp(e)}function Wp(e){return e.map(e=>Yp(e))}function Gp(e){return e.slice()}function Kp(e){return new RegExp(e.source,e.flags)}function qp(e){return new Map(Yp([...e.entries()]))}function Jp(e){return new Set(Yp([...e.values()]))}function Yp(e){return ic(e)?Gp(e):ac(e)?Kp(e):cc(e)?qp(e):sc(e)?Jp(e):R(e)?Wp(e):js(e)?Up(e):e}function Xp(e){return Ip.clone+=1,Yp(e)}function Zp(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function Qp(e,t){return{...e,...t}}function G(e,t,n={}){Ip.create+=1;let r=Qp(t,n);return Lp(uc().enumerableKind?Qp(r,e):Zp(r,e))}function $p(e,t){Ip.discard+=1;let n={};for(let r of H(e)){if(t.includes(r))continue;let i=Object.getOwnPropertyDescriptor(e,r);i.value=Xp(i.value),Object.defineProperty(n,r,i)}return Lp(n)}function K(e,t,n){Ip.update+=1;let r=uc(),i=Xp(e);for(let e of Object.keys(t))Object.defineProperty(i,e,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[e]});for(let e of Object.keys(n))Object.defineProperty(i,e,{configurable:!0,enumerable:!0,writable:!0,value:n[e]});return Lp(i)}function em(...e){let[t,n,r]=cs(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]});return Hf(new Fp(t,n),new ul,n,r)}function tm(...e){let[t,n,r]=cs(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]});return em(t,n,r)}function nm(e,t){return js(e)&&V(e,`~kind`)&&z(e[`~kind`],t)}function rm(e){return js(e)}function im(e,t,n){return G({"~kind":`Deferred`},{type:`deferred`,action:e,parameters:t,options:n},{})}function am(e){return nm(e,`Deferred`)}function om(e){return K(e,{"~readonly":!0},{})}function sm(e,t){return K(om(e),{},t)}function cm(e,t,n,r){return sm(Q(e,t,n),r)}function lm(e){return K(e,{"~optional":!0},{})}function um(e,t){return K(lm(e),{},t)}function dm(e,t,n,r){return um(Q(e,t,n),r)}function fm(e,t){return G({"~kind":`Array`},{type:`array`,items:e},t)}function pm(e){return nm(e,`Array`)}function mm(e){return $p(e,[`~kind`,`type`,`items`])}function hm(e,t,n={}){return G({"~kind":`Constructor`},{type:`constructor`,parameters:e,instanceType:t},n)}function gm(e){return nm(e,`Constructor`)}function _m(e){return $p(e,[`~kind`,`type`,`parameters`,`instanceType`])}function vm(e,t,n={}){return G({"~kind":`Function`},{type:`function`,parameters:e,returnType:t},n)}function ym(e){return nm(e,`Function`)}function bm(e){return $p(e,[`~kind`,`type`,`parameters`,`returnType`])}function xm(e,t){return G({"~kind":`Ref`},{$ref:e},t)}function Sm(e){return nm(e,`Ref`)}function Cm(e,t){return G({"~kind":`Generic`},{type:`generic`,parameters:e,expression:t})}function wm(e){return nm(e,`Generic`)}function Tm(e){return G({"~kind":`Any`},{},e)}function Em(e){return nm(e,`Any`)}var Dm=`(?!)`;function Om(e){return G({"~kind":`Never`},{not:{}},e)}function km(e){return nm(e,`Never`)}function Am(e,t={}){return im(`AddOptional`,[e],t)}function jm(e,t={}){return um(e,t)}function Mm(e){return jm(e)}function Nm(e){return rm(e)&&V(e,`~optional`)}function Pm(e){return H(e).filter(t=>!Nm(e[t]))}function Fm(e){return H(e)}function Im(e){return Zs(e)}function Lm(e,t={}){let n=Pm(e);return G({"~kind":`Object`},{type:`object`,...n.length>0?{required:n}:{},properties:e},t)}function Rm(e){return nm(e,`Object`)}function zm(e){return $p(e,[`~kind`,`type`,`properties`,`required`])}function Bm(e){return G({"~kind":`Unknown`},{},e)}function Vm(e){return nm(e,`Unknown`)}function Hm(e,t,n){return G({"~kind":`Cyclic`},{$defs:H(e).reduce((t,n)=>({...t,[n]:K(e[n],{},{$id:n})}),{}),$ref:t},n)}function Um(e){return nm(e,`Cyclic`)}function Wm(e){return K(e,{"~unsafe":null},{})}function Gm(e){return As(e)&&V(e,`~unsafe`)&&Os(e[`~unsafe`])}function Km(...e){let[t,n]=cs(e,{2:(e,t)=>[e,t,t],1:e=>[e,Bm(),Bm()]});return G({"~kind":`Infer`},{type:`infer`,name:t,extends:n},{})}function qm(e){return nm(e,`Infer`)}function Jm(e,t,n,r={}){return G({"~kind":`Dependent`},{if:e,then:t,else:n},r)}function Ym(e){return nm(e,`Dependent`)}function Xm(e){return $p(e,[`~kind`,`if`,`then`,`else`])}function Zm(e){return As(e)}function Qm(e){return H(e).filter(e=>isNaN(e)).reduce((t,n)=>[...t,e[n]],[])}function $m(e){return Ms(e)||ks(e)}function eh(e,t){return G({"~kind":`Enum`},{enum:Zm(e)?Qm(e):e},t)}function th(e){return nm(e,`Enum`)}function nh(e,t={}){return G({"~kind":`Intersect`},{allOf:e},t)}function rh(e){return nm(e,`Intersect`)}function ih(e){return $p(e,[`~kind`,`allOf`])}var ah=class{constructor(e,t){this.type=e,this.decode=t}Encode(e){let t=this.type,n={decode:uh(t)?e=>this.decode(t[`~codec`].decode(e)):this.decode,encode:uh(t)?n=>t[`~codec`].encode(e(n)):e};return K(this.type,{"~codec":n},{})}},oh=class{constructor(e){this.type=e}Decode(e){return new ah(this.type,e)}};function sh(e){return new oh(e)}function ch(e,t){return sh(e).Decode(t).Encode(()=>{throw Error(`Encode not implemented`)})}function lh(e,t){return sh(e).Decode(()=>{throw Error(`Decode not implemented`)}).Encode(t)}function uh(e){return rm(e)&&V(e,`~codec`)&&js(e[`~codec`])&&V(e[`~codec`],`encode`)&&V(e[`~codec`],`decode`)}function dh(e){return WA(e)}function fh(e){return rm(e)&&V(e,`~immutable`)}function ph(e,t={}){return im(`AddReadonly`,[e],t)}function mh(e,t={}){return sm(e,t)}function hh(e){return mh(e)}function gh(e){return rm(e)&&V(e,`~readonly`)}function _h(e,t){return K(e,{"~refine":bh(e)?[...e[`~refine`],t]:[t]},{})}function vh(...e){let[t,n,r]=cs(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[e,t,()=>`Refine Error`]});return _h(t,{check:n,error:r})}function yh(e){return As(e)&&V(e,`check`)&&V(e,`error`)&&Es(e.check)&&Es(e.error)}function bh(e){return rm(e)&&V(e,`~refine`)&&R(e[`~refine`])&&Ws(e[`~refine`],0,e=>yh(e))}var xh=`-?(?:0|[1-9][0-9]*)n`;function Sh(e){return G({"~kind":`BigInt`},{type:`bigint`},e)}function Ch(e){return nm(e,`BigInt`)}function wh(e){return G({"~kind":`Boolean`},{type:`boolean`},e)}function Th(e){return nm(e,`Boolean`)}function Eh(e){return G({"~kind":`Identifier`},{name:e})}function Dh(e){return nm(e,`Identifier`)}var Oh=`-?(?:0|[1-9][0-9]*)`;function kh(e){return G({"~kind":`Integer`},{type:`integer`},e)}function Ah(e){return nm(e,`Integer`)}var jh=class extends Error{constructor(e){super(`Invalid Literal value`),Object.defineProperty(this,"cause",{value:{value:e},writable:!1,configurable:!1,enumerable:!1})}};function Mh(e){return Cs(e)?`bigint`:ws(e)?`boolean`:ks(e)?`number`:Ms(e)?`string`:(()=>{throw new jh(e)})()}function q(e,t){return G({"~kind":`Literal`},{type:Mh(e),const:e},t)}function Nh(e){return Cs(e)||ws(e)||ks(e)||Ms(e)}function Ph(e){return Ih(e)&&ks(e.const)}function Fh(e){return Ih(e)&&Ms(e.const)}function Ih(e){return nm(e,`Literal`)}function Lh(e){return G({"~kind":`Null`},{type:`null`},e)}function Rh(e){return nm(e,`Null`)}var zh=`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`;function Bh(e){return G({"~kind":`Number`},{type:`number`},e)}function Vh(e){return nm(e,`Number`)}function Hh(e){return G({"~kind":`Symbol`},{type:`symbol`},e)}function Uh(e){return nm(e,`Symbol`)}function Wh(...e){let[t,n,r]=cs(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[e,t,t],1:e=>[e,Bm(),Bm()]});return G({"~kind":`Parameter`},{name:t,extends:n,equals:r},{})}function Gh(e){return nm(e,`Parameter`)}function Kh(e){return G({"~kind":`String`},{type:`string`},e)}function qh(e){return nm(e,`String`)}function Jh(e,t={}){return G({"~kind":`Union`},{anyOf:e},t)}function Yh(e){return nm(e,`Union`)}function Xh(e){return $p(e,[`~kind`,`anyOf`])}function Zh(e){let t=fC(e);return z(t.length,2)?t[0]:[]}function Qh(e){return!0}function $h(e){return B(e,(e,t)=>tg(e)?$h(t):!1,()=>!0)}function eg(e){return!z(e.length,0)&&$h(e)}function tg(e){return Yh(e)?eg(e.anyOf):Ih(e)?Qh(e.const):!1}function ng(e){return eg(e)}function rg(e){return G({"~kind":`TemplateLiteral`},{type:`string`,pattern:e},{})}function ig(e,t,n=[]){return B(e,(e,r)=>ig(r,t,[...n,`${e}${t}`]),()=>n)}function ag(e,t){return z(e.length,0)?[`${t}`]:ig(e,t)}function og(e,t,n=[]){return B(t,(t,r)=>og(e,r,[...n,...sg(e,t)]),()=>n)}function sg(e,t){return Yh(t)?og(e,t.anyOf):Ih(t)?ag(e,t.const):lf()}function cg(e,t){return B(t,(t,n)=>cg(sg(e,t),n),()=>e)}function lg(e){return e.map(e=>q(e))}function ug(e){return Jh(lg(cg([],e)))}function dg(e){return z(e.length,0)?lf():z(e.length,1)&&Ih(e[0])?e[0]:ug(e)}function fg(e){let t=Zh(e);return z(t.length,0)?Kh():ng(t)?dg(t):rg(e)}function pg(e){let t=fg(e);return ZC(t)?Kh():t}function mg(e,t){return G({"~kind":`Record`},{type:`object`,patternProperties:{[e]:t}})}function hg(e){return mg(C_,e)}function gg(e){return Lm({true:e,false:e})}function _g(e,t={}){let[n,r,i]=[e,e.length,!1];return G({"~kind":`Tuple`},{type:`array`,additionalItems:i,items:n,minItems:r},t)}function vg(e){return nm(e,`Tuple`)}function yg(e){return $p(e,[`~kind`,`type`,`items`,`minItems`,`additionalItems`])}function bg(e){return $p(e,[`~readonly`])}function xg(e,t){return K(bg(e),{},t)}function Sg(e,t,n,r){return xg(Q(e,t,n),r)}function Cg(e,t={}){return im(`RemoveReadonly`,[e],t)}function wg(e,t={}){return xg(e,t)}function Tg(e){return $p(e,[`~optional`])}function Eg(e,t){return K(Tg(e),{},t)}function Dg(e,t,n,r){return Eg(Q(e,t,n),r)}function Og(e,t={}){return im(`RemoveOptional`,[e],t)}function kg(e,t={}){return Eg(e,t)}function Ag(e){return e.reduceRight((e,t,n)=>({[n]:t,...e}),{})}function jg(e){return Lm(Ag(e.items))}function Mg(e){return Rm(e)||vg(e)}function Ng(e,t){return gh(e)?!!gh(t):!1}function Pg(e,t){return Nm(e)?!!Nm(t):!1}function Fg(e,t){let n=Ng(e,t),r=Pg(e,t),i=wg(kg($g([e,t])));return n&&r?mh(jm(i)):n&&!r?mh(i):!n&&r?jm(i):i}function Ig(e,t,n){return n in e?n in t?Fg(e[n],t[n]):e[n]:n in t?t[n]:Om()}function Lg(e,t){return[...new Set([...H(e),...H(t)])].reduce((n,r)=>({...n,[r]:Ig(e,t,r)}),{})}function Rg(e){return Rm(e)?e.properties:vg(e)?Ag(e.items):{}}function zg(e,t){return Lm(Lg(Rg(e),Rg(t)))}function Bg(e,t){let n=nE(e,t);return z(n,2)?e:z(n,3)||z(n,0)?t:Om()}function Vg(e,t){let n=Mg(e),r=Mg(t);return n&&r?zg(e,t):n&&!r?e:!n&&r?t:Bg(e,t)}function Hg(e,t){return km(e)||Em(e)?e:Vm(e)||km(t)||Em(t)?t:Vm(t)?e:Vg(e,t)}function Ug(e,t){return Yh(e)||Yh(t)}function Wg(e,t){let n=n_(e),r=n_(t);return Ug(n,r)?$g([n,r]):Hg(n,r)}function Gg(e,t,n=[]){return B(t,(t,r)=>Gg(e,r,[...n,Wg(t,e)]),()=>z(n.length,0)?[e]:n)}function Kg(e,t,n=[]){return B(e,(e,r)=>Kg(r,t,[...n,...qg([e],t)]),()=>n)}function qg(e,t=[]){return B(e,(e,n)=>Yh(e)?qg(n,Kg(e.anyOf,t)):qg(n,Gg(e,t)),()=>t)}function Jg(e,t){return iw(tE({},e,t))?[]:[e]}function Yg(e,t,n=[]){return B(e,(e,r)=>Yg(r,t,[...n,...Jg(e,t)]),()=>n)}function Xg(e,t){let n=n_(e);return t_(Yg(Yh(n)?n.anyOf:[n],t))}function Zg(e,t,n){return t_([$g([e,t]),Xg(n,e)])}function Qg(e,t=[]){return B(e,(e,n)=>Qg(n,[...t,q(e)]),()=>t_(t))}function $g(e){return t_(oE(qg(e)))}function e_(e){return n_(pg(e))}function t_(e){return r_(oE(e))}function n_(e){return Ym(e)?Zg(e.if,e.then,e.else):th(e)?Qg(e.enum):rh(e)?$g(e.allOf):ZC(e)?e_(e.pattern):Yh(e)?t_(e.anyOf):e}function r_(e){return z(e.length,1)?e[0]:z(e.length,0)?Om():Jh(e)}function i_(e,t){return v_(Qg(e),t)}function a_(e,t){return mg(x_,t)}function o_(e,t){return v_($g(e),t)}function s_(e,t){return Ms(e)||ks(e)?Lm({[e]:t}):z(e,!1)?Lm({false:t}):z(e,!0)?Lm({true:t}):Lm({})}function c_(e,t){return mg(S_,t)}function l_(e,t){return V(e,`pattern`)&&(Ms(e.pattern)||e.pattern instanceof RegExp)?mg(e.pattern.toString(),t):mg(C_,t)}function u_(e,t){return ng(Zh(e))?v_(e_(e),t):mg(e,t)}function d_(e){return Yh(e)?f_(e.anyOf):[e]}function f_(e,t=[]){return B(e,(e,n)=>f_(n,[...t,...d_(e)]),()=>t)}function p_(e){return e.some(e=>qh(e)||Vh(e)||Ah(e))}function m_(e,t){return z(p_(e),!0)?mg(C_,t):void 0}function h_(e,t){return e.reduce((e,n)=>Ih(n)&&(Ms(n.const)||ks(n.const))?{...e,[n.const]:t}:e,{})}function g_(e,t){return Lm(h_(e,t))}function __(e,t){let n=f_(e),r=m_(n,t);return rm(r)?r:g_(n,t)}function v_(e,t){return Em(e)?hg(t):Th(e)?gg(t):th(e)?i_(e.enum,t):Ah(e)?a_(e,t):rh(e)?o_(e.allOf,t):Ih(e)?s_(e.const,t):Vh(e)?c_(e,t):Yh(e)?__(e.anyOf,t):qh(e)?l_(e,t):ZC(e)?u_(e.pattern,t):Lm({})}function y_(e,t,n){return MA([e])?K(v_(e,t),{},n):w_(e,t,n)}function b_(e,t,n,r,i){return y_(Q(e,t,n),Q(e,t,r),i)}var x_=`^${Oh}$`,S_=`^${zh}$`,C_=`^.*$`;function w_(e,t,n={}){return im(`Record`,[e,t],n)}function T_(e,t,n={}){return y_(e,t,n)}function E_(e,t){return mg(e,t)}function D_(e){return z(e,C_)?Kh():z(e,x_)?kh():z(e,S_)?Bh():fg(e)}function O_(e){return H(e.patternProperties)[0]}function k_(e){return D_(O_(e))}function A_(e){return e.patternProperties[O_(e)]}function j_(e){return nm(e,`Record`)}function M_(e){return G({"~kind":`Rest`},{type:`rest`,items:e},{})}function N_(e){return nm(e,`Rest`)}function P_(e){return G({"~kind":`This`},{$ref:`#`},e)}function F_(e){return nm(e,`This`)}function I_(e){return G({"~kind":`Undefined`},{type:`undefined`},e)}function L_(e){return nm(e,`Undefined`)}function R_(e){return G({"~kind":`Void`},{type:`void`},e)}function z_(e){return nm(e,`Void`)}function B_(e,t){return z(e,`Array`)?fm(t[0]):z(e,`Capitalize`)?ZE(t[0]):z(e,`ConstructorParameters`)?SD(t[0]):z(e,`Evaluate`)?GA(t[0]):z(e,`Exclude`)?DD(t[0],t[1]):z(e,`Extract`)?jD(t[0],t[1]):z(e,`Index`)?BD(t[0],t[1]):z(e,`InstanceType`)?FO(t[0]):z(e,`Lowercase`)?$E(t[0]):z(e,`NonNullable`)?_k(t[0]):z(e,`Omit`)?Sk(t[0],t[1]):z(e,`Parameters`)?kk(t[0]):z(e,`Partial`)?Pk(t[0]):z(e,`Pick`)?Wk(t[0],t[1]):z(e,`Readonly`)?Xk(t[0]):z(e,`KeyOf`)?BO(t[0]):z(e,`Record`)?w_(t[0],t[1]):z(e,`Required`)?gA(t[0]):z(e,`ReturnType`)?bA(t[0]):z(e,`Uncapitalize`)?tD(t[0]):z(e,`Uppercase`)?rD(t[0]):BE(xm(e),t)}function V_(){throw Error(`Unreachable`)}function H_(e,t=[]){return B(e,(e,n)=>H_(n,[...t,e[1]]),()=>t)}function U_(e){return z(e.length,3)?[e[0],...H_(e[1])]:[]}function W_(e){return Wh(e[0],e[2],e[4])}function G_(e){return Wh(e[0],e[2],e[2])}function K_(e){return Wh(e[0],Bm(),e[2])}function q_(e){return Wh(e,Bm(),Bm())}function J_(e){return e}function Y_(e){return U_(e)}function X_(e){return e[1]}function Z_(e){return U_(e)}function Q_(e){return e[1]}function $_(e){return B_(e[0],e[1])}function ev(e){return null}function tv(e){return Kh()}function nv(e){return Bh()}function rv(e){return wh()}function iv(e){return I_()}function av(e){return Lh()}function ov(e){return kh()}function sv(e){return Sh()}function cv(e){return Bm()}function lv(e){return Tm()}function uv(e){return Lm({})}function dv(e){return Om()}function fv(e){return Hh()}function pv(e){return R_()}function mv(e){return P_()}function hv(e){return q(BigInt(e))}function gv(e){return q(z(e,`true`))}function _v(e){return q(parseFloat(e))}function vv(e){return q(e)}function yv(e){return e[1]}function bv(e){return q(e)}function xv(e){return z(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function Sv(e){return e[1]}function Cv(e){return KC(e)}function wv(e){return z(e.length,6)?Jm(e[1],e[3],e[5]):Jm(e[1],e[3],Bm())}function Tv(e){return e.length>0}function Ev(e){return e.reduce((e,t)=>z(t.length,3)?[...e,[t[1]]]:[...e,[]],[])}function Dv(e){return z(e.length,6)?[e[1],e[3],e[5]]:[]}function Ov(e){return R(e)&&z(e.length,3)?e[1]:e}function kv(e){return z(e.length,2)?e[1]:[]}function Av(e,t){return t.reduce((e,t)=>{let n=t;return z(n.length,1)?BD(e,n[0]):z(n.length,0)?fm(e):V_()},e)}function jv(e,t){return z(t.length,3)?_D(e,t[0],t[1],t[2]):e}function Mv(e,t){return R(t)&&z(t.length,0)?e:TA(e,t)}function Nv(e){let[t,n,r,i,a]=e;return Mv(jv(t?BO(Av(n,r)):Av(n,r),i),a)}function Pv(e,t){return z(t.length,3)?(()=>{let[n,r,i]=t,a=Pv(r,i);if(z(n,`&`))return rh(a)?nh([e,...a.allOf]):nh([e,a]);if(z(n,`|`))return Yh(a)?Jh([e,...a.anyOf]):Jh([e,a]);V_()})():e}function Fv(e){return e}function Iv(e){let[t,n]=e;return Pv(t,n)}function Lv(e){return e}function Rv(e){let[t,n]=e;return Pv(t,n)}function zv(e){return UA(e[1])}function Bv(e){return e[1]}function Vv(e){return Cm(e[0],e[2])}function Hv(e){return z(e.length,4)?Km(e[1],e[3]):z(e.length,2)?Km(e[1],Bm()):V_()}function Uv(e){return e}function Wv(e){return`${e}`}function Gv(e){return e}function Kv(e){return e}function qv(e){return Ah(e[3])?x_:Vh(e[3])?S_:Uh(e[3])||qh(e[3])?C_:V_()}function Jv(e){return e}function Yv(e){return e.length>0}function Xv(e){return e.length>0}function Zv(e){let[t,n,r,i,a]=e;return{[n]:t&&r?ph(Am(a)):t&&!r?ph(a):!t&&r?Am(a):a}}function Qv(e){return e}function $v(e){return U_(e)}function ey(e){return e.reduce((e,t)=>V(t,x_)||V(t,S_)||V(t,C_)?[e[0],Rp(e[1],t)]:[Rp(e[0],t),e[1]],[{},{}])}function ty(e){return ey(e[1])}function ny(e){let[t,n]=e;return Lm(t,z(H(n).length,0)?{}:{patternProperties:n})}function ry(e){return z(e.length,5)?ph(Am(e[4])):z(e.length,3)?e[2]:z(e.length,4)?z(e[2],`readonly`)?ph(e[3]):Am(e[3]):V_()}function iy(e){if(!R(e)||!z(e.length,3))return e;let[t,n,r]=e;return t&&r?ph(Am(n)):t&&!r?ph(n):!t&&r?Am(n):n}function ay(e){return z(e.length,2)?M_(e[1]):z(e.length,1)?e[0]:V_()}function oy(e){return U_(e)}function sy(e){return _g(e[1])}function cy(e){return ph(Am(e[4]))}function ly(e){return ph(e[3])}function uy(e){return Am(e[3])}function dy(e){return e[2]}function fy(e){return e}function py(e){return z(e.length,2)?M_(e[1]):z(e.length,1)?e[0]:V_()}function my(e){return U_(e)}function hy(e){return vm(e[1],e[4])}function gy(e){return hm(e[2],e[5])}function _y(e,t){return z(e,`remove`)?Cg(t):z(e,`add`)?ph(t):t}function vy(e){return z(e.length,2)&&z(e[0],`-`)?`remove`:z(e.length,2)&&z(e[0],`+`)||z(e.length,1)?`add`:`none`}function yy(e,t){return z(e,`remove`)?Og(t):z(e,`add`)?Am(t):t}function by(e){return z(e.length,2)&&z(e[0],`-`)?`remove`:z(e.length,2)&&z(e[0],`+`)||z(e.length,1)?`add`:`none`}function xy(e){return z(e.length,2)?[e[1]]:[]}function Sy(e){return R(e[6])&&z(e[6].length,1)?QO(Eh(e[3]),e[5],e[6][0],_y(e[1],yy(e[8],e[10]))):QO(Eh(e[3]),e[5],xm(e[3]),_y(e[1],yy(e[8],e[10])))}function Cy(e){return xm(e)}function wy(e){return BigInt(e)}function Ty(e){return parseFloat(e)}function Ey(e){return z(e,`true`)}function Dy(e){return e}function Oy(e){return null}function ky(e){return{[e[0]]:e[2]}}function Ay(e){return U_(e)}function jy(e){return e.reduce((e,t)=>Rp(e,t),{})}function My(e){return jy(e[1])}function Ny(e){return U_(e)}function Py(e){return e[1]}function Fy(e){return e}function Iy(e){return Sh()}function Ly(e){return Kh()}function Ry(e){return Bh()}function zy(e){return kh()}function By(e){return Om()}function Vy(e){return q(e)}function Hy(e){return e}function Uy(e){return Jh(e[1])}function Wy(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function Gy(e){return[e[0],...e[1]]}function Ky(e){return e}function qy(e){return e[1]}function Jy(e){return U_(e)}function Yy(e){return z(e.length,2)?e[1]:[]}function Xy(e){let t=e[2],n=e[3],[r,i]=e[4],a=z(H(i).length,0)?{}:{patternProperties:i};return{[e[1]]:Cm(t,OT(n,r,a))}}function Zy(e){let t=e[2],[n,r]=e[3],i=z(H(r).length,0)?{}:{patternProperties:r};return{[e[1]]:OT(t,n,i)}}function Qy(e){return{[e[1]]:Cm(e[2],e[4])}}function $y(e){return{[e[1]]:e[3]}}function eb(e){return null}function tb(e){return e}function nb(e){return U_(e)}function rb(e){return e[1]}function ib(e){let[t,n]=[e[0],e[1]];return qA(Rp(t,ey(n)[0]))}function ab(e){return e}function ob(e){return z(e.length,2)}function sb(e,t,n){return ob(e)?t(e[0],e[1]):n()}function cb(e,t){return z(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function lb(e,t){for(let n=0;n<e.length;n++){let r=cb(e[n],t);if(ob(r))return r}return[]}function ub(e,t){return Array.from({length:t-e+1},(t,n)=>String.fromCharCode(e+n))}var db=[...ub(97,122),...ub(65,90)],fb=ub(49,57),pb=[`0`,...fb],mb=`//`,hb=`/*`,gb=`*/`;function _b(e){let t=e.indexOf(gb);return z(t,-1)?``:e.slice(t+2)}function vb(e){let t=e.indexOf(`
|
|
11
|
-
`);return z(t,-1)?``:e.slice(t)}function yb(e){return e.replace(/^[ \t\r\f\v]+/,``)}function bb(e){let t=yb(e);return t.startsWith(hb)?bb(_b(t.slice(2))):t.startsWith(mb)?bb(vb(t.slice(2))):t}function xb(e){let t=e.trimStart();return t.startsWith(hb)?xb(_b(t.slice(2))):t.startsWith(mb)?xb(vb(t.slice(2))):t}function Sb(e,t){return sb(lb([e],t),(e,t)=>[e,t],()=>[``,t])}function Cb(e,t){return e.includes(t)}function wb(e,t,n,r=``){return sb(lb(e,n),(n,i)=>Cb(t,n)?wb(e,t,i,r):wb(e,t,i,`${r}${n}`),()=>[r,n])}function Tb(e){return lb(fb,e)}var Eb=[...pb,`_`];function Db(e){return wb(Eb,[`_`],e)}function Ob(e){return sb(lb([`0`],e),(e,t)=>[e,t],()=>sb(Tb(e),(e,t)=>sb(Db(t),(t,n)=>[`${e}${t}`,n],()=>[]),()=>[]))}function kb(e){return Ob(xb(e))}function Ab(e){return Sb(`-`,e)}function jb(e){return sb(Ab(e),(e,t)=>sb(kb(t),(t,n)=>[`${e}${t}`,n],()=>[]),()=>[])}function Mb(e){return jb(xb(e))}function Nb(e){return sb(Mb(e),(e,t)=>sb(lb([`n`],t),(t,n)=>[`${e}`,n],()=>[]),()=>[])}function Pb(e){return Nb(e)}function Fb(e,t){return lb([e],t)}function J(e,t){return z(e,``)?[``,t]:e.startsWith(`
|
|
12
|
-
`)?Fb(e,bb(t)):e.startsWith(` `)?Fb(e,t):Fb(e,xb(t))}var Ib=[...db,`_`,`$`];function Lb(e){return lb(Ib,e)}var Rb=[...Ib,...pb];function zb(e,t=``){return sb(lb(Rb,e),(e,n)=>zb(n,`${t}${e}`),()=>[t,e])}function Bb(e){return sb(Lb(e),(e,t)=>sb(zb(t),(t,n)=>[`${e}${t}`,n],()=>[]),()=>[])}function Vb(e){return Bb(xb(e))}var Hb=[...pb,`_`];function Ub(e){return ob(lb([`.`],e))}function Wb(e){return sb(wb(Hb,[`_`],e),(e,t)=>z(e,``)?[]:[e,t],()=>[])}function Gb(e){return sb(lb([`.`],e),(e,t)=>sb(Wb(t),(t,n)=>[`0${e}${t}`,n],()=>[]),()=>[])}function Kb(e){return sb(kb(e),(e,t)=>sb(lb([`.`],t),(t,n)=>sb(Wb(n),(n,r)=>[`${e}${t}${n}`,r],()=>[`${e}`,n]),()=>[`${e}`,t]),()=>[])}function qb(e){return Ub(e)?Gb(e):Kb(e)}function Jb(e){return qb(xb(e))}function Yb(e){return Sb(`-`,e)}function Xb(e){return sb(Yb(e),(e,t)=>sb(Jb(t),(t,n)=>[`${e}${t}`,n],()=>[]),()=>[])}function Zb(e){return Xb(xb(e))}function Qb(e){return z(e,``)?[]:[e.slice(0,1),e.slice(1)]}function $b(e,t){return B(e,(e,n)=>t.startsWith(e)?!0:$b(n,t),()=>!1)}function ex(e,t,n=``){return sb(Qb(t),(r,i)=>$b(e,t)?[n,t]:ex(e,i,`${n}${r}`),()=>[])}function tx(e,t,n){return sb(lb([e],n),(e,n)=>sb(ex([t],n),(e,n)=>sb(lb([t],n),(t,n)=>[`${e}`,n],()=>[]),()=>[]),()=>[])}function nx(e,t,n){return sb(lb([e],n),(e,n)=>sb(ex([`
|
|
13
|
-
`,t],n),(e,n)=>sb(lb([t],n),(t,n)=>[`${e}`,n],()=>[]),()=>[]),()=>[])}function rx(e,t,n,r){return n?tx(e,t,xb(r)):nx(e,t,xb(r))}function ix(e,t){return lb(e,t)}function ax(e,t){return rx(e,e,!1,t)}function ox(e,t){return sb(ix(e,t),(e,t)=>ax(e,`${e}${t}`),()=>[])}function sx(e,t){return ox(e,xb(t))}function cx(e,t){return sb(ex(e,t),(e,t)=>z(e,``)?[]:[e,t],()=>[])}var Y=(e,t,n=()=>[])=>e.length===2?t(e):n(),lx=e=>Y(Y(Vb(e),([e,t])=>Y(J(`extends`,t),([t,n])=>Y(X(n),([n,r])=>Y(J(`=`,r),([r,i])=>Y(X(i),([i,a])=>[[e,t,n,r,i],a]))))),([e,t])=>[W_(e),t]),ux=e=>Y(Y(Vb(e),([e,t])=>Y(J(`extends`,t),([t,n])=>Y(X(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[G_(e),t]),dx=e=>Y(Y(Vb(e),([e,t])=>Y(J(`=`,t),([t,n])=>Y(X(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[K_(e),t]),fx=e=>Y(Vb(e),([e,t])=>[q_(e),t]),px=e=>Y(Y(lx(e),([e,t])=>[e,t],()=>Y(ux(e),([e,t])=>[e,t],()=>Y(dx(e),([e,t])=>[e,t],()=>Y(fx(e),([e,t])=>[e,t],()=>[])))),([e,t])=>[J_(e),t]),mx=(e,t=[])=>Y(Y(J(`,`,e),([e,t])=>Y(px(t),([t,n])=>[[e,t],n])),([e,n])=>mx(n,[...t,e]),()=>[t,e]),hx=e=>Y(Y(Y(px(e),([e,t])=>Y(mx(t),([t,n])=>Y(Y(J(`,`,n),([e,t])=>[[e],t],()=>[[],n]),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[Y_(e),t]),gx=e=>Y(Y(J(`<`,e),([e,t])=>Y(hx(t),([t,n])=>Y(J(`>`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[X_(e),t]),_x=(e,t=[])=>Y(Y(J(`,`,e),([e,t])=>Y(X(t),([t,n])=>[[e,t],n])),([e,n])=>_x(n,[...t,e]),()=>[t,e]),vx=e=>Y(Y(Y(X(e),([e,t])=>Y(_x(t),([t,n])=>Y(Y(J(`,`,n),([e,t])=>[[e],t],()=>[[],n]),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[Z_(e),t]),yx=e=>Y(Y(J(`<`,e),([e,t])=>Y(vx(t),([t,n])=>Y(J(`>`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[Q_(e),t]),bx=e=>Y(Y(Vb(e),([e,t])=>Y(yx(t),([t,n])=>[[e,t],n])),([e,t])=>[$_(e),t]),xx=e=>Y(Y(Y(J(`;`,e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[ev(e),t]),Sx=e=>Y(J(`string`,e),([e,t])=>[tv(e),t]),Cx=e=>Y(J(`number`,e),([e,t])=>[nv(e),t]),wx=e=>Y(J(`boolean`,e),([e,t])=>[rv(e),t]),Tx=e=>Y(J(`undefined`,e),([e,t])=>[iv(e),t]),Ex=e=>Y(J(`null`,e),([e,t])=>[av(e),t]),Dx=e=>Y(J(`integer`,e),([e,t])=>[ov(e),t]),Ox=e=>Y(J(`bigint`,e),([e,t])=>[sv(e),t]),kx=e=>Y(J(`unknown`,e),([e,t])=>[cv(e),t]),Ax=e=>Y(J(`any`,e),([e,t])=>[lv(e),t]),jx=e=>Y(J(`object`,e),([e,t])=>[uv(e),t]),Mx=e=>Y(J(`never`,e),([e,t])=>[dv(e),t]),Nx=e=>Y(J(`symbol`,e),([e,t])=>[fv(e),t]),Px=e=>Y(J(`void`,e),([e,t])=>[pv(e),t]),Fx=e=>Y(J(`this`,e),([e,t])=>[mv(e),t]),Ix=e=>Y(Y(J("${",e),([e,t])=>Y(X(t),([t,n])=>Y(J(`}`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[yv(e),t]),Lx=e=>Y(ex(["${","`"],e),([e,t])=>[bv(e),t]),Rx=e=>Y(Y(Y(Lx(e),([e,t])=>Y(Ix(t),([t,n])=>Y(Rx(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>Y(Y(Lx(e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>Y(Y(Lx(e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>[]))),([e,t])=>[xv(e),t]),zx=e=>Y(Y(J("`",e),([e,t])=>Y(Rx(t),([t,n])=>Y(J("`",n),([n,r])=>[[e,t,n],r]))),([e,t])=>[Sv(e),t]),Bx=e=>Y(zx(e),([e,t])=>[Cv(e),t]),Vx=e=>Y(Y(Y(J(`if`,e),([e,t])=>Y(X(t),([t,n])=>Y(J(`then`,n),([n,r])=>Y(X(r),([r,i])=>Y(J(`else`,i),([i,a])=>Y(X(a),([a,o])=>[[e,t,n,r,i,a],o])))))),([e,t])=>[e,t],()=>Y(Y(J(`if`,e),([e,t])=>Y(X(t),([t,n])=>Y(J(`then`,n),([n,r])=>Y(X(r),([r,i])=>[[e,t,n,r],i])))),([e,t])=>[e,t],()=>[])),([e,t])=>[wv(e),t]),Hx=e=>Y(Pb(e),([e,t])=>[hv(e),t]),Ux=e=>Y(Y(J(`true`,e),([e,t])=>[e,t],()=>Y(J(`false`,e),([e,t])=>[e,t],()=>[])),([e,t])=>[gv(e),t]),Wx=e=>Y(Zb(e),([e,t])=>[_v(e),t]),Gx=e=>Y(sx([`'`,`"`],e),([e,t])=>[vv(e),t]),Kx=e=>Y(Y(Y(J(`keyof`,e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[Tv(e),t]),qx=(e,t=[])=>Y(Y(Y(J(`[`,e),([e,t])=>Y(X(t),([t,n])=>Y(J(`]`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>Y(Y(J(`[`,e),([e,t])=>Y(J(`]`,t),([t,n])=>[[e,t],n])),([e,t])=>[e,t],()=>[])),([e,n])=>qx(n,[...t,e]),()=>[t,e]),Jx=e=>Y(qx(e),([e,t])=>[Ev(e),t]),Yx=e=>Y(Y(Y(J(`extends`,e),([e,t])=>Y(X(t),([t,n])=>Y(J(`?`,n),([n,r])=>Y(X(r),([r,i])=>Y(J(`:`,i),([i,a])=>Y(X(a),([a,o])=>[[e,t,n,r,i,a],o])))))),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[Dv(e),t]),Xx=e=>Y(Y(Y(J(`(`,e),([e,t])=>Y(X(t),([t,n])=>Y(J(`)`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>Y(Sx(e),([e,t])=>[e,t],()=>Y(Cx(e),([e,t])=>[e,t],()=>Y(wx(e),([e,t])=>[e,t],()=>Y(Tx(e),([e,t])=>[e,t],()=>Y(Ex(e),([e,t])=>[e,t],()=>Y(Dx(e),([e,t])=>[e,t],()=>Y(Ox(e),([e,t])=>[e,t],()=>Y(kx(e),([e,t])=>[e,t],()=>Y(Ax(e),([e,t])=>[e,t],()=>Y(jx(e),([e,t])=>[e,t],()=>Y(Mx(e),([e,t])=>[e,t],()=>Y(Nx(e),([e,t])=>[e,t],()=>Y(Px(e),([e,t])=>[e,t],()=>Y(Fx(e),([e,t])=>[e,t],()=>Y(Hx(e),([e,t])=>[e,t],()=>Y(Ux(e),([e,t])=>[e,t],()=>Y(Wx(e),([e,t])=>[e,t],()=>Y(Gx(e),([e,t])=>[e,t],()=>Y(Bx(e),([e,t])=>[e,t],()=>Y(Vx(e),([e,t])=>[e,t],()=>Y(yS(e),([e,t])=>[e,t],()=>Y(TS(e),([e,t])=>[e,t],()=>Y(FS(e),([e,t])=>[e,t],()=>Y(PS(e),([e,t])=>[e,t],()=>Y(zS(e),([e,t])=>[e,t],()=>Y(bx(e),([e,t])=>[e,t],()=>Y(BS(e),([e,t])=>[e,t],()=>[])))))))))))))))))))))))))))),([e,t])=>[Ov(e),t]),Zx=e=>Y(Y(Y(J(`with`,e),([e,t])=>Y(XS(t),([t,n])=>[[e,t],n])),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[kv(e),t]),Qx=e=>Y(Y(Kx(e),([e,t])=>Y(Xx(t),([t,n])=>Y(Jx(n),([n,r])=>Y(Yx(r),([r,i])=>Y(Zx(i),([i,a])=>[[e,t,n,r,i],a]))))),([e,t])=>[Nv(e),t]),$x=e=>Y(Y(Y(J(`&`,e),([e,t])=>Y(Qx(t),([t,n])=>Y($x(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[Fv(e),t]),eS=e=>Y(Y(Qx(e),([e,t])=>Y($x(t),([t,n])=>[[e,t],n])),([e,t])=>[Iv(e),t]),tS=e=>Y(Y(Y(J(`|`,e),([e,t])=>Y(eS(t),([t,n])=>Y(tS(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[Lv(e),t]),nS=e=>Y(Y(eS(e),([e,t])=>Y(tS(t),([t,n])=>[[e,t],n])),([e,t])=>[Rv(e),t]),rS=e=>Y(Y(J(`readonly`,e),([e,t])=>Y(nS(t),([t,n])=>[[e,t],n])),([e,t])=>[zv(e),t]),iS=e=>Y(Y(J(`|`,e),([e,t])=>Y(nS(t),([t,n])=>[[e,t],n])),([e,t])=>[Bv(e),t]),aS=e=>Y(Y(gx(e),([e,t])=>Y(J(`=`,t),([t,n])=>Y(X(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[Vv(e),t]),oS=e=>Y(Y(Y(J(`infer`,e),([e,t])=>Y(Vb(t),([t,n])=>Y(J(`extends`,n),([n,r])=>Y(nS(r),([r,i])=>[[e,t,n,r],i])))),([e,t])=>[e,t],()=>Y(Y(J(`infer`,e),([e,t])=>Y(Vb(t),([t,n])=>[[e,t],n])),([e,t])=>[e,t],()=>[])),([e,t])=>[Hv(e),t]),X=e=>Y(Y(oS(e),([e,t])=>[e,t],()=>Y(iS(e),([e,t])=>[e,t],()=>Y(rS(e),([e,t])=>[e,t],()=>Y(nS(e),([e,t])=>[e,t],()=>[])))),([e,t])=>[Uv(e),t]),sS=e=>Y(Zb(e),([e,t])=>[Wv(e),t]),cS=e=>Y(Vb(e),([e,t])=>[Gv(e),t]),lS=e=>Y(sx([`'`,`"`],e),([e,t])=>[Kv(e),t]),uS=e=>Y(Y(J(`[`,e),([e,t])=>Y(Vb(t),([t,n])=>Y(J(`:`,n),([n,r])=>Y(Y(Dx(r),([e,t])=>[e,t],()=>Y(Cx(r),([e,t])=>[e,t],()=>Y(Sx(r),([e,t])=>[e,t],()=>Y(Nx(r),([e,t])=>[e,t],()=>[])))),([r,i])=>Y(J(`]`,i),([i,a])=>[[e,t,n,r,i],a]))))),([e,t])=>[qv(e),t]),dS=e=>Y(Y(sS(e),([e,t])=>[e,t],()=>Y(cS(e),([e,t])=>[e,t],()=>Y(lS(e),([e,t])=>[e,t],()=>Y(uS(e),([e,t])=>[e,t],()=>[])))),([e,t])=>[Jv(e),t]),fS=e=>Y(Y(Y(J(`readonly`,e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[Yv(e),t]),pS=e=>Y(Y(Y(J(`?`,e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[Xv(e),t]),mS=e=>Y(Y(fS(e),([e,t])=>Y(dS(t),([t,n])=>Y(pS(n),([n,r])=>Y(J(`:`,r),([r,i])=>Y(X(i),([i,a])=>[[e,t,n,r,i],a]))))),([e,t])=>[Zv(e),t]),hS=e=>Y(Y(Y(J(`,`,e),([e,t])=>Y(J(`
|
|
14
|
-
`,t),([t,n])=>[[e,t],n])),([e,t])=>[e,t],()=>Y(Y(J(`;`,e),([e,t])=>Y(J(`
|
|
15
|
-
`,t),([t,n])=>[[e,t],n])),([e,t])=>[e,t],()=>Y(Y(J(`,`,e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>Y(Y(J(`;`,e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>Y(Y(J(`
|
|
16
|
-
`,e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>[]))))),([e,t])=>[Qv(e),t]),gS=(e,t=[])=>Y(Y(hS(e),([e,t])=>Y(mS(t),([t,n])=>[[e,t],n])),([e,n])=>gS(n,[...t,e]),()=>[t,e]),_S=e=>Y(Y(Y(mS(e),([e,t])=>Y(gS(t),([t,n])=>Y(Y(hS(n),([e,t])=>[[e],t],()=>[[],n]),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[$v(e),t]),vS=e=>Y(Y(J(`{`,e),([e,t])=>Y(_S(t),([t,n])=>Y(J(`}`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[ty(e),t]),yS=e=>Y(vS(e),([e,t])=>[ny(e),t]),bS=e=>Y(Y(Y(Vb(e),([e,t])=>Y(J(`?`,t),([t,n])=>Y(J(`:`,n),([n,r])=>Y(J(`readonly`,r),([r,i])=>Y(X(i),([i,a])=>[[e,t,n,r,i],a]))))),([e,t])=>[e,t],()=>Y(Y(Vb(e),([e,t])=>Y(J(`:`,t),([t,n])=>Y(J(`readonly`,n),([n,r])=>Y(X(r),([r,i])=>[[e,t,n,r],i])))),([e,t])=>[e,t],()=>Y(Y(Vb(e),([e,t])=>Y(J(`?`,t),([t,n])=>Y(J(`:`,n),([n,r])=>Y(X(r),([r,i])=>[[e,t,n,r],i])))),([e,t])=>[e,t],()=>Y(Y(Vb(e),([e,t])=>Y(J(`:`,t),([t,n])=>Y(X(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>[])))),([e,t])=>[ry(e),t]),xS=e=>Y(Y(bS(e),([e,t])=>[e,t],()=>Y(Y(fS(e),([e,t])=>Y(X(t),([t,n])=>Y(pS(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>[])),([e,t])=>[iy(e),t]),SS=e=>Y(Y(Y(J(`...`,e),([e,t])=>Y(xS(t),([t,n])=>[[e,t],n])),([e,t])=>[e,t],()=>Y(Y(xS(e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>[])),([e,t])=>[ay(e),t]),CS=(e,t=[])=>Y(Y(J(`,`,e),([e,t])=>Y(SS(t),([t,n])=>[[e,t],n])),([e,n])=>CS(n,[...t,e]),()=>[t,e]),wS=e=>Y(Y(Y(SS(e),([e,t])=>Y(CS(t),([t,n])=>Y(Y(J(`,`,n),([e,t])=>[[e],t],()=>[[],n]),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[oy(e),t]),TS=e=>Y(Y(J(`[`,e),([e,t])=>Y(wS(t),([t,n])=>Y(J(`]`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[sy(e),t]),ES=e=>Y(Y(Vb(e),([e,t])=>Y(J(`?`,t),([t,n])=>Y(J(`:`,n),([n,r])=>Y(J(`readonly`,r),([r,i])=>Y(X(i),([i,a])=>[[e,t,n,r,i],a]))))),([e,t])=>[cy(e),t]),DS=e=>Y(Y(Vb(e),([e,t])=>Y(J(`:`,t),([t,n])=>Y(J(`readonly`,n),([n,r])=>Y(X(r),([r,i])=>[[e,t,n,r],i])))),([e,t])=>[ly(e),t]),OS=e=>Y(Y(Vb(e),([e,t])=>Y(J(`?`,t),([t,n])=>Y(J(`:`,n),([n,r])=>Y(X(r),([r,i])=>[[e,t,n,r],i])))),([e,t])=>[uy(e),t]),kS=e=>Y(Y(Vb(e),([e,t])=>Y(J(`:`,t),([t,n])=>Y(X(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[dy(e),t]),AS=e=>Y(Y(ES(e),([e,t])=>[e,t],()=>Y(DS(e),([e,t])=>[e,t],()=>Y(OS(e),([e,t])=>[e,t],()=>Y(kS(e),([e,t])=>[e,t],()=>[])))),([e,t])=>[fy(e),t]),jS=e=>Y(Y(Y(J(`...`,e),([e,t])=>Y(AS(t),([t,n])=>[[e,t],n])),([e,t])=>[e,t],()=>Y(Y(AS(e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>[])),([e,t])=>[py(e),t]),MS=(e,t=[])=>Y(Y(J(`,`,e),([e,t])=>Y(jS(t),([t,n])=>[[e,t],n])),([e,n])=>MS(n,[...t,e]),()=>[t,e]),NS=e=>Y(Y(Y(jS(e),([e,t])=>Y(MS(t),([t,n])=>Y(Y(J(`,`,n),([e,t])=>[[e],t],()=>[[],n]),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[my(e),t]),PS=e=>Y(Y(J(`(`,e),([e,t])=>Y(NS(t),([t,n])=>Y(J(`)`,n),([n,r])=>Y(J(`=>`,r),([r,i])=>Y(X(i),([i,a])=>[[e,t,n,r,i],a]))))),([e,t])=>[hy(e),t]),FS=e=>Y(Y(J(`new`,e),([e,t])=>Y(J(`(`,t),([t,n])=>Y(NS(n),([n,r])=>Y(J(`)`,r),([r,i])=>Y(J(`=>`,i),([i,a])=>Y(X(a),([a,o])=>[[e,t,n,r,i,a],o])))))),([e,t])=>[gy(e),t]),IS=e=>Y(Y(Y(J(`+`,e),([e,t])=>Y(J(`readonly`,t),([t,n])=>[[e,t],n])),([e,t])=>[e,t],()=>Y(Y(J(`-`,e),([e,t])=>Y(J(`readonly`,t),([t,n])=>[[e,t],n])),([e,t])=>[e,t],()=>Y(Y(J(`readonly`,e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])))),([e,t])=>[vy(e),t]),LS=e=>Y(Y(Y(J(`+`,e),([e,t])=>Y(J(`?`,t),([t,n])=>[[e,t],n])),([e,t])=>[e,t],()=>Y(Y(J(`-`,e),([e,t])=>Y(J(`?`,t),([t,n])=>[[e,t],n])),([e,t])=>[e,t],()=>Y(Y(J(`?`,e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])))),([e,t])=>[by(e),t]),RS=e=>Y(Y(Y(J(`as`,e),([e,t])=>Y(X(t),([t,n])=>[[e,t],n])),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[xy(e),t]),zS=e=>Y(Y(J(`{`,e),([e,t])=>Y(IS(t),([t,n])=>Y(J(`[`,n),([n,r])=>Y(Vb(r),([r,i])=>Y(J(`in`,i),([i,a])=>Y(X(a),([a,o])=>Y(RS(o),([o,s])=>Y(J(`]`,s),([s,c])=>Y(LS(c),([c,l])=>Y(J(`:`,l),([l,u])=>Y(X(u),([u,d])=>Y(xx(d),([d,f])=>Y(J(`}`,f),([f,p])=>[[e,t,n,r,i,a,o,s,c,l,u,d,f],p]))))))))))))),([e,t])=>[Sy(e),t]),BS=e=>Y(Vb(e),([e,t])=>[Cy(e),t]),VS=e=>Y(Pb(e),([e,t])=>[wy(e),t]),HS=e=>Y(Zb(e),([e,t])=>[Ty(e),t]),US=e=>Y(Y(J(`true`,e),([e,t])=>[e,t],()=>Y(J(`false`,e),([e,t])=>[e,t],()=>[])),([e,t])=>[Ey(e),t]),WS=e=>Y(sx([`"`,`'`],e),([e,t])=>[Dy(e),t]),GS=e=>Y(J(`null`,e),([e,t])=>[Oy(e),t]),KS=e=>Y(J(`undefined`,e),([e,t])=>[void 0,t]),qS=e=>Y(Y(dS(e),([e,t])=>Y(J(`:`,t),([t,n])=>Y(eC(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[ky(e),t]),JS=(e,t=[])=>Y(Y(hS(e),([e,t])=>Y(qS(t),([t,n])=>[[e,t],n])),([e,n])=>JS(n,[...t,e]),()=>[t,e]),YS=e=>Y(Y(Y(qS(e),([e,t])=>Y(JS(t),([t,n])=>Y(Y(hS(n),([e,t])=>[[e],t],()=>[[],n]),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[Ay(e),t]),XS=e=>Y(Y(J(`{`,e),([e,t])=>Y(YS(t),([t,n])=>Y(J(`}`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[My(e),t]),ZS=(e,t=[])=>Y(Y(J(`,`,e),([e,t])=>Y(eC(t),([t,n])=>[[e,t],n])),([e,n])=>ZS(n,[...t,e]),()=>[t,e]),QS=e=>Y(Y(Y(eC(e),([e,t])=>Y(ZS(t),([t,n])=>Y(Y(J(`,`,n),([e,t])=>[[e],t],()=>[[],n]),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[Ny(e),t]),$S=e=>Y(Y(J(`[`,e),([e,t])=>Y(QS(t),([t,n])=>Y(J(`]`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[Py(e),t]),eC=e=>Y(Y(VS(e),([e,t])=>[e,t],()=>Y(HS(e),([e,t])=>[e,t],()=>Y(US(e),([e,t])=>[e,t],()=>Y(WS(e),([e,t])=>[e,t],()=>Y(GS(e),([e,t])=>[e,t],()=>Y(KS(e),([e,t])=>[e,t],()=>Y(XS(e),([e,t])=>[e,t],()=>Y($S(e),([e,t])=>[e,t],()=>[])))))))),([e,t])=>[Fy(e),t]),tC=e=>Y(J(`-?(?:0|[1-9][0-9]*)n`,e),([e,t])=>[Iy(e),t]),nC=e=>Y(J(`.*`,e),([e,t])=>[Ly(e),t]),rC=e=>Y(J(`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,e),([e,t])=>[Ry(e),t]),iC=e=>Y(J(`-?(?:0|[1-9][0-9]*)`,e),([e,t])=>[zy(e),t]),aC=e=>Y(J(`(?!)`,e),([e,t])=>[By(e),t]),oC=e=>Y(cx([`-?(?:0|[1-9][0-9]*)n`,`.*`,`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,`-?(?:0|[1-9][0-9]*)`,`(?!)`,`(`,`)`,`$`,`|`],e),([e,t])=>[Vy(e),t]),sC=e=>Y(Y(tC(e),([e,t])=>[e,t],()=>Y(nC(e),([e,t])=>[e,t],()=>Y(rC(e),([e,t])=>[e,t],()=>Y(iC(e),([e,t])=>[e,t],()=>Y(aC(e),([e,t])=>[e,t],()=>Y(cC(e),([e,t])=>[e,t],()=>Y(oC(e),([e,t])=>[e,t],()=>[]))))))),([e,t])=>[Hy(e),t]),cC=e=>Y(Y(J(`(`,e),([e,t])=>Y(dC(t),([t,n])=>Y(J(`)`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[Uy(e),t]),lC=e=>Y(Y(Y(uC(e),([e,t])=>Y(J(`|`,t),([t,n])=>Y(lC(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>Y(Y(uC(e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[]))),([e,t])=>[Wy(e),t]),uC=e=>Y(Y(sC(e),([e,t])=>Y(dC(t),([t,n])=>[[e,t],n])),([e,t])=>[Gy(e),t]),dC=e=>Y(Y(lC(e),([e,t])=>[e,t],()=>Y(uC(e),([e,t])=>[e,t],()=>[])),([e,t])=>[Ky(e),t]),fC=e=>Y(Y(J(`^`,e),([e,t])=>Y(dC(t),([t,n])=>Y(J(`$`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[qy(e),t]),pC=(e,t=[])=>Y(Y(J(`,`,e),([e,t])=>Y(X(t),([t,n])=>[[e,t],n])),([e,n])=>pC(n,[...t,e]),()=>[t,e]),mC=e=>Y(Y(Y(X(e),([e,t])=>Y(pC(t),([t,n])=>Y(Y(J(`,`,n),([e,t])=>[[e],t],()=>[[],n]),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[Jy(e),t]),hC=e=>Y(Y(Y(J(`extends`,e),([e,t])=>Y(mC(t),([t,n])=>[[e,t],n])),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[Yy(e),t]),gC=e=>Y(Y(J(`interface`,e),([e,t])=>Y(Vb(t),([t,n])=>Y(gx(n),([n,r])=>Y(hC(r),([r,i])=>Y(vS(i),([i,a])=>[[e,t,n,r,i],a]))))),([e,t])=>[Xy(e),t]),_C=e=>Y(Y(J(`interface`,e),([e,t])=>Y(Vb(t),([t,n])=>Y(hC(n),([n,r])=>Y(vS(r),([r,i])=>[[e,t,n,r],i])))),([e,t])=>[Zy(e),t]),vC=e=>Y(Y(J(`type`,e),([e,t])=>Y(Vb(t),([t,n])=>Y(gx(n),([n,r])=>Y(J(`=`,r),([r,i])=>Y(X(i),([i,a])=>[[e,t,n,r,i],a]))))),([e,t])=>[Qy(e),t]),yC=e=>Y(Y(J(`type`,e),([e,t])=>Y(Vb(t),([t,n])=>Y(J(`=`,n),([n,r])=>Y(X(r),([r,i])=>[[e,t,n,r],i])))),([e,t])=>[$y(e),t]),bC=e=>Y(Y(Y(J(`export`,e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[eb(e),t]),xC=e=>Y(Y(Y(J(`;`,e),([e,t])=>Y(J(`
|
|
17
|
-
`,t),([t,n])=>[[e,t],n])),([e,t])=>[e,t],()=>Y(Y(J(`;`,e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>Y(Y(J(`
|
|
18
|
-
`,e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>[]))),([e,t])=>[tb(e),t]),SC=(e,t=[])=>Y(Y(xC(e),([e,t])=>Y(wC(t),([t,n])=>[[e,t],n])),([e,n])=>SC(n,[...t,e]),()=>[t,e]),CC=e=>Y(Y(Y(wC(e),([e,t])=>Y(SC(t),([t,n])=>Y(Y(xC(n),([e,t])=>[[e],t],()=>[[],n]),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>Y([[],e],([e,t])=>[e,t],()=>[])),([e,t])=>[nb(e),t]),wC=e=>Y(Y(bC(e),([e,t])=>Y(Y(gC(t),([e,t])=>[e,t],()=>Y(_C(t),([e,t])=>[e,t],()=>Y(vC(t),([e,t])=>[e,t],()=>Y(yC(t),([e,t])=>[e,t],()=>[])))),([t,n])=>Y(xx(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[rb(e),t]),TC=e=>Y(Y(wC(e),([e,t])=>Y(CC(t),([t,n])=>[[e,t],n])),([e,t])=>[ib(e),t]),EC=e=>Y(Y(TC(e),([e,t])=>[e,t],()=>Y(aS(e),([e,t])=>[e,t],()=>Y(X(e),([e,t])=>[e,t],()=>[]))),([e,t])=>[ab(e),t]);function DC(e){let t=zx(`\`${e}\``);return z(t.length,2)?t[0]:lf()}function OC(e){return e.join(`|`)}function kC(e){return e.slice(1,e.length-1)}function AC(e,t,n){return VC(t,`${n}${e}`)}function jC(e,t){return VC(e,`${t}${xh}`)}function MC(e,t){return VC(e,`${t}${Oh}`)}function NC(e,t){return VC(e,`${t}${zh}`)}function PC(e,t){return BC(Jh([q(`false`),q(`true`)]),e,t)}function FC(e,t){return VC(e,`${t}.*`)}function IC(e,t,n){return VC(t,`${n}${kC(e)}`)}function LC(e,t,n){return BC(WC(e,{}),t,n)}function RC(e,t,n){return BC(Qg(e),t,n)}function zC(e,t,n,r=[]){return B(e,(e,i)=>zC(i,t,n,[...r,BC(e,[],``)]),()=>VC(t,`${n}(${OC(r)})`))}function BC(e,t,n){return th(e)?RC(e.enum,t,n):Ah(e)?MC(t,n):Ih(e)?AC(e.const,t,n):Ch(e)?jC(t,n):Th(e)?PC(t,n):Vh(e)?NC(t,n):qh(e)?FC(t,n):ZC(e)?IC(e.pattern,t,n):qC(e)?LC(e.parameters[0],t,n):Yh(e)?zC(e.anyOf,t,n):Dm}function VC(e,t){return B(e,(e,n)=>BC(e,n,t),()=>t)}function HC(e){return`^${VC(e,``)}$`}function UC(e){return rg(HC(e))}function WC(e,t){return MA(e)?K(UC(e),{},t):KC(e,t)}function GC(e,t,n,r){return WC(FA(e,t,n),r)}function KC(e,t={}){return im(`TemplateLiteral`,[e],t)}function qC(e){return rm(e)&&V(e,`action`)&&z(e.action,`TemplateLiteral`)}function JC(e){return WC(e,{})}function YC(e){return JC(DC(e))}function XC(e,t={}){return K(Ms(e)?YC(e):JC(e),{},t)}function ZC(e){return nm(e,`TemplateLiteral`)}var QC=s({ExtendsFalse:()=>nw,ExtendsTrue:()=>Z,ExtendsUnion:()=>$C,IsExtendsFalse:()=>rw,IsExtendsTrue:()=>tw,IsExtendsTrueLike:()=>iw,IsExtendsUnion:()=>ew,Match:()=>aw});function $C(e){return G({"~kind":`ExtendsUnion`},{inferred:e})}function ew(e){return js(e)&&V(e,`~kind`)&&V(e,`inferred`)&&z(e[`~kind`],`ExtendsUnion`)&&js(e.inferred)}function Z(e){return G({"~kind":`ExtendsTrue`},{inferred:e})}function tw(e){return js(e)&&V(e,`~kind`)&&V(e,`inferred`)&&z(e[`~kind`],`ExtendsTrue`)&&js(e.inferred)}function nw(){return G({"~kind":`ExtendsFalse`},{})}function rw(e){return js(e)&&V(e,`~kind`)&&z(e[`~kind`],`ExtendsFalse`)}function iw(e){return ew(e)||tw(e)}function aw(e,t,n){return iw(e)?t(e.inferred):n()}function ow(e,t,n,r){return aw(wT(e,n,r),r=>Z(Rp(Rp(e,r),{[t]:n})),()=>nw())}function sw(e,t){return Z(e)}function cw(e,t,n,r,i){return aw(wT(e,t,n),e=>aw(wT(e,t,r),e=>Z(e),()=>nw()),()=>aw(wT(e,t,i),e=>Z(e),()=>nw()))}function lw(e,t,n){return wT(e,t,Qg(n))}function uw(e,t,n){return B(n,(n,r)=>aw(wT(e,t,n),e=>uw(e,t,r),()=>nw()),()=>Z(e))}function dw(e,t,n){return wT(e,t,e_(n))}function fw(e,t,n){return B(n,(n,r)=>aw(wT(e,t,n),e=>Z(e),()=>fw(e,t,r)),()=>nw())}function pw(e,t,n){return Em(n)?sw(e,t):Ym(n)?cw(e,t,n.if,n.then,n.else):th(n)?lw(e,t,n.enum):qm(n)?ow(e,n.name,t,n.extends):rh(n)?uw(e,t,n.allOf):ZC(n)?dw(e,t,n.pattern):Yh(n)?fw(e,t,n.anyOf):Vm(n)?Z(e):nw()}function mw(e,t,n){return qm(n)?pw(e,t,n):Em(n)||Vm(n)?Z(e):$C(e)}function hw(e,t){let n=fh(e),r=fh(t);return n&&r||!n&&r?!0:!(n&&!r)}function gw(e,t,n,r){return pm(r)?hw(t,r)?wT(e,n,r.items):nw():pw(e,t,r)}function _w(e,t,n){return Ch(n)?Z(e):pw(e,t,n)}function vw(e,t,n){return Th(n)?Z(e):pw(e,t,n)}function yw(e,t,n,r,i){let a=qm(r)?t:r,o=qm(r)?r:t,s=Nm(t),c=Nm(r);return!s&&c?nw():aw(wT(e,a,o),e=>Sw(e,n,i),()=>nw())}function bw(e,t,n,r){return B(r,(r,i)=>yw(e,t,n,r,i),()=>Nm(t)?Z(e):nw())}function xw(e,t,n){return B(t,(t,r)=>bw(e,t,r,n),()=>Z(e))}function Sw(e,t,n){return xw(e,t,n)}function Cw(e,t,n){return z_(n)?Z(e):wT(e,t,n)}function ww(e,t,n,r){return Em(r)||Vm(r)?Z(e):gm(r)?aw(Sw(e,t,r.parameters),e=>Cw(e,n,r.instanceType),()=>nw()):nw()}function Tw(e,t,n,r,i){return aw(wT(e,t,i),()=>wT(e,n,i),()=>wT(e,r,i))}function Ew(e,t,n){return wT(e,Qg(t),n)}function Dw(e,t,n,r){return Em(r)||Vm(r)?Z(e):ym(r)?aw(Sw(e,t,r.parameters),e=>Cw(e,n,r.returnType),()=>nw()):nw()}function Ow(e,t,n){return Ah(n)||Vh(n)?Z(e):pw(e,t,n)}function kw(e,t,n){return wT(e,$g(t),n)}function Aw(e,t,n){return t===n?Z(e):nw()}function jw(e,t,n){return Ih(n)?Aw(e,t,n.const):Ch(n)?Z(e):pw(e,q(t),n)}function Mw(e,t,n){return Ih(n)?Aw(e,t,n.const):Th(n)?Z(e):pw(e,q(t),n)}function Nw(e,t,n){return Ih(n)?Aw(e,t,n.const):Vh(n)?Z(e):pw(e,q(t),n)}function Pw(e,t,n){return Ih(n)?Aw(e,t,n.const):qh(n)?Z(e):pw(e,q(t),n)}function Fw(e,t,n){return Cs(t.const)?jw(e,t.const,n):ws(t.const)?Mw(e,t.const,n):ks(t.const)?Nw(e,t.const,n):Ms(t.const)?Pw(e,t.const,n):lf()}function Iw(e,t,n){return qm(n)?pw(e,t,n):Z(e)}function Lw(e,t,n){return Rh(n)?Z(e):pw(e,t,n)}function Rw(e,t,n){return Vh(n)?Z(e):pw(e,t,n)}function zw(e,t,n){return Nm(t)?Nm(n)?Z(e):nw():Z(e)}function Bw(e,t,n){return qm(n)&&km(n.extends)?nw():aw(wT(e,t,n),e=>zw(e,t,n),()=>nw())}function Vw(e,t){return e.reduce((e,n)=>n in t&&iw(t[n])?{...e,...t[n].inferred}:lf(),{})}function Hw(e,t,n){let r={};for(let i of H(n))r[i]=i in t?Bw({},t[i],n[i]):Nm(n[i])?qm(n[i])?Z(Rp(e,{[n[i].name]:n[i].extends})):Z(e):nw();let i=Zs(r).every(e=>iw(e)),a=i?Vw(H(r),r):{};return i?Z(a):nw()}function Uw(e,t,n){let r=Hw(e,t,n);return iw(r)?Z(Rp(e,r.inferred)):nw()}function Ww(e,t,n){return Uw(e,t,n)}function Gw(e,t){return H(t).reduce((n,r)=>({...n,[r]:V(e,r)?Yh(n[r])?Jh([...n[r].anyOf,t[r]]):Jh([e[r],t[r]]):t[r]}),e)}function Kw(e,t,n,r){return B(t,(t,i)=>aw(wT({},e[t],n),t=>Kw(e,i,n,Gw(r,t)),()=>nw()),()=>Z(r))}function qw(e,t,n,r){return Kw(t,H(t),r,e)}function Jw(e,t,n){return j_(n)?qw(e,t,O_(n),A_(n)):Rm(n)?Ww(e,t,n.properties):pw(e,Lm(t),n)}function Yw(e,t){return z(H(t).length,0)?Z(e):nw()}function Xw(e,t,n,r,i){return wT(e,n,i)}function Zw(e,t,n,r){return j_(r)?Xw(e,D_(t),n,D_(O_(r)),A_(r)):Rm(r)?Yw(e,r.properties):Em(r)||Vm(r)?Z(e):nw()}function Qw(e,t,n){return qh(n)?Z(e):pw(e,t,n)}function $w(e,t,n){return Uh(n)?Z(e):pw(e,t,n)}function eT(e,t,n){return wT(e,e_(t),n)}function tT(e,t){return G({"~kind":`Inferrable`},{name:e,type:t},{})}function nT(e){return js(e)&&V(e,`~kind`)&&V(e,`name`)&&V(e,`type`)&&z(e[`~kind`],`Inferrable`)&&Ms(e.name)&&js(e.type)}function rT(e){return N_(e)?qm(e.items)?pm(e.items.extends)?tT(e.items.name,e.items.extends.items):Vm(e.items.extends)?tT(e.items.name,e.items.extends):void 0:lf():void 0}function iT(e){return qm(e)?tT(e.name,e.extends):void 0}function aT(e,t,n=[]){return B(e,(e,r)=>aw(wT({},e,t),()=>aT(r,t,[...n,e]),()=>void 0),()=>n)}function oT(e,t,n,r){let i=aT(n,r);return R(i)?Z(Rp(e,{[t]:_g(i)})):nw()}function sT(e,t,n,r){let i=aT(n,r);return R(i)?Z(Rp(e,{[t]:Jh(i)})):nw()}function cT(e){return[...e].reverse()}function lT(e,t){return t?cT(e):e}function uT(e){let t=e.length>0?e[0]:void 0;return rm(rm(t)?rT(t):void 0)}function dT(e,t,n,r,i,a){return aw(wT(e,n,i),e=>mT(e,t,r,a),()=>nw())}function fT(e,t,n,r,i){let a=rT(r);return nT(a)?oT(e,a.name,lT(n,t),a.type):B(n,(n,a)=>dT(e,t,n,a,r,i),()=>nw())}function pT(e,t,n,r){return B(r,(r,i)=>fT(e,t,n,r,i),()=>z(n.length,0)?Z(e):nw())}function mT(e,t,n,r){return pT(e,t,n,r)}function hT(e,t,n){let r=PA(e,jA([],[]),n),i=uT(r);return mT(e,i,lT(t,i),lT(r,i))}function gT(e,t,n){let r=iT(n);return nT(r)?sT(e,r.name,t,r.type):B(t,(t,r)=>aw(wT(e,t,n),e=>gT(e,r,n),()=>nw()),()=>Z(e))}function _T(e,t,n){let r=PA(e,jA([],[]),t);return vg(n)?hT(e,r,n.items):pm(n)?gT(e,r,n.items):pw(e,_g(r),n)}function vT(e,t,n){return z_(n)||L_(n)?Z(e):pw(e,t,n)}function yT(e,t,n){return B(n,(n,r)=>aw(wT(e,t,n),e=>Z(e),()=>yT(e,t,r)),()=>nw())}function bT(e,t,n){return B(t,(t,r)=>aw(yT(e,t,n),e=>bT(e,r,n),()=>nw()),()=>Z(e))}function xT(e,t,n){let r=iT(n);return nT(r)?sT(e,r.name,t,r.type):Yh(n)?bT(e,t,n.anyOf):bT(e,t,[n])}function ST(e,t,n){return qm(n)?pw(e,t,n):Em(n)||Vm(n)?Z(e):nw()}function CT(e,t,n){return z_(n)?Z(e):pw(e,t,n)}function wT(e,t,n){return Em(t)?mw(e,t,n):pm(t)?gw(e,t,t.items,n):Ch(t)?_w(e,t,n):Th(t)?vw(e,t,n):gm(t)?ww(e,t.parameters,t.instanceType,n):Ym(t)?Tw(e,t.if,t.then,t.else,n):th(t)?Ew(e,t.enum,n):ym(t)?Dw(e,t.parameters,t.returnType,n):Ah(t)?Ow(e,t,n):rh(t)?kw(e,t.allOf,n):Ih(t)?Fw(e,t,n):km(t)?Iw(e,t,n):Rh(t)?Lw(e,t,n):Vh(t)?Rw(e,t,n):Rm(t)?Jw(e,t.properties,n):j_(t)?Zw(e,O_(t),A_(t),n):qh(t)?Qw(e,t,n):Uh(t)?$w(e,t,n):ZC(t)?eT(e,t.pattern,n):vg(t)?_T(e,t.items,n):L_(t)?vT(e,t,n):Yh(t)?xT(e,t.anyOf,n):Vm(t)?ST(e,t,n):z_(t)?CT(e,t,n):nw()}function TT(e,t){return $g([...e,Lm(t)])}function ET(e,t,n){return MA(e)?K(TT(e,t),{},n):OT(e,t,n)}function DT(e,t,n,r,i){return ET(FA(e,t,n),NA(e,t,r),i)}function OT(e,t,n={}){return im(`Interface`,[e,t],n)}function kT(e){return rm(e)&&V(e,`action`)&&z(e.action,`Interface`)}function AT(e,t,n={}){return ET(e,t,n)}function jT(e,t,n){return e.includes(n)?!0:PT([...e,n],t,t[n])}function MT(e,t,n){return NT(e,t,Im(n))}function NT(e,t,n){return B(n,(n,r)=>PT(e,t,n)?!0:NT(e,t,r),()=>!1)}function PT(e,t,n){return Sm(n)?jT(e,t,n.$ref):pm(n)?PT(e,t,n.items):gm(n)?NT(e,t,[...n.parameters,n.instanceType]):ym(n)?NT(e,t,[...n.parameters,n.returnType]):kT(n)?MT(e,t,n.parameters[1]):rh(n)?NT(e,t,n.allOf):Rm(n)?MT(e,t,n.properties):Yh(n)?NT(e,t,n.anyOf):vg(n)?NT(e,t,n.items):j_(n)?PT(e,t,A_(n)):!1}function FT(e,t,n){return PT(e,t,n)}function IT(e,t){return t.reduce((t,n)=>FT([n],e,e[n])?[...t,n]:t,[])}function LT(e){return IT(e,Fm(e))}function RT(e,t,n){return n.includes(t)?n:t in e?VT(e,e[t],[...n,t]):lf()}function zT(e,t,n){return BT(e,Im(t),n)}function BT(e,t,n){return t.reduce((t,n)=>VT(e,n,t),n)}function VT(e,t,n){return Sm(t)?RT(e,t.$ref,n):pm(t)?VT(e,t.items,n):gm(t)?BT(e,[...t.parameters,t.instanceType],n):ym(t)?BT(e,[...t.parameters,t.returnType],n):kT(t)?zT(e,t.parameters[1],n):rh(t)?BT(e,t.allOf,n):Rm(t)?zT(e,t.properties,n):Yh(t)?BT(e,t.anyOf,n):vg(t)?BT(e,t.items,n):j_(t)?VT(e,A_(t),n):n}function HT(e,t,n){return VT(e,n,[t])}function UT(e){return Tm()}function WT(e){return H(e).reduce((t,n)=>({...t,[n]:KT(e[n])}),{})}function GT(e){return e.reduce((e,t)=>[...e,KT(t)],[])}function KT(e){return Sm(e)?UT(e.$ref):pm(e)?fm(KT(e.items),mm(e)):gm(e)?hm(GT(e.parameters),KT(e.instanceType)):ym(e)?vm(GT(e.parameters),KT(e.returnType)):rh(e)?nh(GT(e.allOf)):Rm(e)?Lm(WT(e.properties)):j_(e)?T_(k_(e),KT(A_(e))):Yh(e)?Jh(GT(e.anyOf)):vg(e)?_g(GT(e.items)):e}function qT(e,t){return t in e?KT(e[t]):Bm()}function JT(e){return qT(e.$defs,e.$ref)}function YT(e,t,n){let r=FA(e,jA([],[]),t),i=NA({},jA([],[]),n);return $g([...r,Lm(i)])}function XT(e,t){return H(e).filter(e=>t.includes(e)).reduce((t,n)=>{let r=e[n],i=kT(r)?YT(e,r.parameters[0],r.parameters[1]):r;return{...t,[n]:i}},{})}function ZT(e,t,n){return Hm(XT(e,HT(e,t,n)),t)}function QT(e,t){return t in e?Sm(e[t])?QT(e,e[t].$ref):e[t]:Om()}function $T(e,t){return QT(e,t)}function eE(e){return Um(e)?JT(e):Gm(e)?Bm():e}function tE(e,t,n){return wT(e,eE(t),eE(n))}function nE(e,t){let n=[tE({},e,t),tE({},t,e)];return iw(n[0])&&iw(n[1])?0:iw(n[0])&&rw(n[1])?2:rw(n[0])&&iw(n[1])?3:1}function rE(e,t,n=[],r=t){return B(t,(t,i)=>{let a=nE(e,t);return z(a,2)||z(a,0)?r:z(a,1)?rE(e,i,[...n,t],r):rE(e,i,n,r)},()=>[...n,e])}function iE(e,t,n){let r=n_(e);return Em(r)||Vm(r)?[r]:km(r)?aE(t,n):Rm(r)?aE(t,[...n,r]):aE(t,rE(r,n))}function aE(e,t=[]){return B(e,(e,n)=>iE(e,n,t),()=>t)}function oE(e){return f_(aE(e))}function sE(e,t){return K(n_(e),{},t)}function cE(e,t,n,r){return sE(Q(e,t,n),r)}function lE(e,t=[]){return am(e)&&z(e.action,`Conditional`)?Sm(e.parameters[0])?lE(e.parameters[2],lE(e.parameters[3],[...t,e.parameters[0].$ref])):lE(e.parameters[2],lE(e.parameters[3],t)):am(e)&&z(e.action,`Mapped`)&&am(e.parameters[1])&&z(e.parameters[1].action,`KeyOf`)&&Sm(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function uE(e,t){return e.reduce((e,n)=>[...e,t.includes(n.name)],[])}function dE(e,t,n=[]){return B(e,(e,r)=>B(t,(t,i)=>dE(r,i,[...n,[t,e]]),()=>n),()=>n)}function fE(e){return ZC(e)?e_(e.pattern):th(e)?Qg(e.enum):e}function pE(e){let t=fE(e);return Yh(t)?[...t.anyOf]:[t]}function mE(e,t){return e.reduce((e,n)=>[...e,[...n,t]],[])}function hE(e,t){return t.reduce((t,n)=>[...t,...mE(e,n)],[])}function gE(e){return e.reduce((e,t)=>z(t[0],!0)?hE(e,pE(t[1])):hE(e,[t[1]]),[[]])}function _E(e,t,n){let r=dE(t,uE(e,lE(n)));return am(n)&&z(n.action,`Conditional`)||am(n)&&z(n.action,`Mapped`)?gE(r):[t]}function vE(){return[`(not-resolvable)`,Om()]}function yE(){return[`(not-generic)`,Om()]}function bE(e,t,n){return[e,Cm(t,n)]}function xE(e,t,n){return t in e?SE(e,t,e[t],n):vE()}function SE(e,t,n,r){return wm(n)?bE(t,n.parameters,n.expression):Sm(n)?xE(e,n.$ref,r):yE()}function CE(e,t,n){return SE(e,`(anonymous)`,t,n)}function wE(e,t,n){if(qm(t)||HE(t)||iw(tE({},t,n)))return;let r={parameter:e,expect:n,actual:t};throw Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:r})}function TE(e,t,n,r,i){let a=Q(e,t,i);return wE(n,a,r),Rp(e,{[n]:a})}function EE(e,t,n,r,i){let a=Q(e,t,n.extends),o=Q(e,t,n.equals);return B(i,(i,o)=>DE(TE(e,t,n.name,a,i),t,r,o),()=>DE(TE(e,t,n.name,a,o),t,r,[]))}function DE(e,t,n,r){return B(n,(n,i)=>EE(e,t,n,i,r),()=>e)}function OE(e,t,n,r){return DE(e,t,n,r)}var kE=0,AE=0;function jE(){if(!Is(AE,uc().maxInstantiationCount))throw Error(`Type instantiation is excessively deep and possibly infinite`)}function ME(){jE(),AE++,kE++}function NE(){kE--,z(kE,0)&&(AE=0)}function PE(e){return Fs(e.callstack.length,0)?e.callstack[e.callstack.length-1]:``}function FE(e,t){return z(PE(e),t)}function IE(e,t,n,r,i,a){ME();try{let o=OE(e,t,r,a),s=Q(o,jA([...t.callstack,n.$ref],t.visited),i);return Q(o,jA([],[]),s)}finally{NE()}}function LE(e,t,n,r,i,a){return a.reduce((a,o)=>{let s=IE(e,t,n,r,i,o);return[...a,s]},[])}function RE(e,t,n,r,i,a){let o=LE(e,t,n,r,i,_E(r,a,i));return z(o.length,1)?o[0]:t_(o)}function zE(e,t,n,r){let i=FA(e,t,r),a=CE(e,n,r),o=a[0],s=a[1];return wm(s)?FE(t,o)?BE(xm(o),i):RE(e,t,xm(o),s.parameters,s.expression,i):BE(n,i)}function BE(e,t){return G({"~kind":`Call`},{type:`call`,target:e,arguments:t},{})}function VE(e,t){return zE({},jA([],[]),e,t)}function HE(e){return nm(e,`Call`)}function UE(e){return $p(e,[`~immutable`])}function WE(e,t){return K(UE(e),{},t)}function GE(e,t,n,r){return WE(Q(e,t,n),r)}function KE(e,t){return e(t)}function qE(e,t){return Ms(t)?q(KE(e,t)):q(t)}function JE(e,t){return XE(e,e_(t))}function YE(e,t){return Jh(t.map(t=>XE(e,t)))}function XE(e,t){return Ih(t)?qE(e,t.const):ZC(t)?JE(e,t.pattern):Yh(t)?YE(e,t.anyOf):t}function ZE(e,t={}){return im(`Capitalize`,[e],t)}function QE(e,t={}){return lD(e,t)}function $E(e,t={}){return im(`Lowercase`,[e],t)}function eD(e,t={}){return uD(e,t)}function tD(e,t={}){return im(`Uncapitalize`,[e],t)}function nD(e,t={}){return dD(e,t)}function rD(e,t={}){return im(`Uppercase`,[e],t)}function iD(e,t={}){return fD(e,t)}var aD=e=>e[0].toUpperCase()+e.slice(1),oD=e=>e.toLowerCase(),sD=e=>e[0].toLowerCase()+e.slice(1),cD=e=>e.toUpperCase();function lD(e,t){return MA([e])?K(XE(aD,e),{},t):ZE(e,t)}function uD(e,t){return MA([e])?K(XE(oD,e),{},t):$E(e,t)}function dD(e,t){return MA([e])?K(XE(sD,e),{},t):tD(e,t)}function fD(e,t){return MA([e])?K(XE(cD,e),{},t):rD(e,t)}function pD(e,t,n,r){return lD(Q(e,t,n),r)}function mD(e,t,n,r){return uD(Q(e,t,n),r)}function hD(e,t,n,r){return dD(Q(e,t,n),r)}function gD(e,t,n,r){return fD(Q(e,t,n),r)}function _D(e,t,n,r,i={}){return im(`Conditional`,[e,t,n,r],i)}function vD(e,t,n,r,i={}){return bD({},jA([],[]),e,t,n,r,i)}function yD(e,t,n,r,i,a){let o=tE(e,n,r);return ew(o)?Jh([Q(o.inferred,t,i),Q(e,t,a)]):tw(o)?Q(o.inferred,t,i):Q(e,t,a)}function bD(e,t,n,r,i,a,o){return MA([n,r])?K(yD(e,t,n,r,i,a),{},o):_D(n,r,i,a,o)}function xD(e,t,n,r,i,a,o){return bD(e,t,Q(e,t,n),Q(e,t,r),i,a,o)}function SD(e,t={}){return im(`ConstructorParameters`,[e],t)}function CD(e,t={}){return TD(e,t)}function wD(e){let t=gm(e)?e.parameters:[];return _g(PA({},jA([],[]),t))}function TD(e,t){return MA([e])?K(wD(e),{},t):SD(e,t)}function ED(e,t,n,r){return TD(Q(e,t,n),r)}function DD(e,t,n={}){return im(`Exclude`,[e,t],n)}function OD(e,t,n={}){return kD(e,t,n)}function kD(e,t,n){return MA([e,t])?K(Xg(e,t),{},n):DD(e,t,n)}function AD(e,t,n,r,i){return kD(Q(e,t,n),Q(e,t,r),i)}function jD(e,t,n={}){return im(`Extract`,[e,t],n)}function MD(e,t,n={}){return ID(e,t,n)}function ND(e,t){return iw(tE({},e,t))?[e]:[]}function PD(e,t,n=[]){return B(e,(e,r)=>PD(r,t,[...n,...ND(e,t)]),()=>n)}function FD(e,t){let n=n_(e);return t_(PD(Yh(n)?n.anyOf:[n],t))}function ID(e,t,n){return MA([e,t])?K(FD(e,t),{},n):jD(e,t,n)}function LD(e,t,n,r,i){return ID(Q(e,t,n),Q(e,t,r),i)}function RD(e){return e.reduce((e,t)=>Nh(t)?[...e,q(t)]:e,[])}function zD(e){return Jh(RD(e))}function BD(e,t,n={}){return im(`Index`,[e,t],n)}function VD(e,t,n={}){return NO(e,R(t)?zD(t):t,n)}function HD(e,t){return ZD($T(e,t))}function UD(e,t,n){return ZD(Zg(e,t,n))}function WD(e,t){let n=H(e).filter(e=>!V(t,e)),r=H(t).filter(t=>!V(e,t)),i=H(e).filter(e=>V(t,e)),a=n.reduce((t,n)=>({...t,[n]:e[n]}),{}),o=r.reduce((e,n)=>({...e,[n]:t[n]}),{}),s=i.reduce((n,r)=>({...n,[r]:$g([e[r],t[r]])}),{});return Rp(Rp(a,o),s)}function GD(e){return e.reduce((e,t)=>WD(e,ZD(t)),{})}function KD(e){return e}function qD(e){return ZD(jg(_g(e)))}function JD(e,t){return H(e).filter(e=>e in t).reduce((n,r)=>({...n,[r]:t_([e[r],t[r]])}),{})}function YD(e,t){return B(e,(e,n)=>YD(n,JD(t,ZD(e))),()=>t)}function XD(e){return B(e,(e,t)=>YD(t,ZD(e)),()=>lf())}function ZD(e){return Um(e)?HD(e.$defs,e.$ref):Ym(e)?UD(e.if,e.then,e.else):rh(e)?GD(e.allOf):Yh(e)?XD(e.anyOf):vg(e)?qD(e.items):Rm(e)?KD(e.properties):{}}function QD(e){return Lm(ZD(e))}var $D=RegExp(`^(?:0|[1-9][0-9]*)$`);function eO(e){let t=`${e}`;return $D.test(t)?parseInt(t):e}function tO(e){return q(eO(e))}function nO(e){return e.map(e=>rO(e))}function rO(e){return rh(e)?nh(nO(e.allOf)):Yh(e)?Jh(nO(e.anyOf)):Ih(e)?tO(e.const):e}function iO(e,t){return iw(tE({},rO(t),Bh()))?e:Ih(t)&&z(t.const,`length`)?Bh():Om()}function aO(e,t){return fO($T(e,t))}function oO(e,t,n){return fO(Zg(e,t,n))}function sO(e){return fO(Qg(e))}function cO(e){return fO($g(e))}function lO(e){return[`${e}`]}function uO(e){return fO(e_(e))}function dO(e){return e.reduce((e,t)=>[...e,...fO(t)],[])}function fO(e){return Um(e)?aO(e.$defs,e.$ref):Ym(e)?oO(e.if,e.then,e.else):th(e)?sO(e.enum):rh(e)?cO(e.allOf):Ih(e)?lO(e.const):ZC(e)?uO(e.pattern):Yh(e)?dO(e.anyOf):[]}function pO(e){return fO(e)}function mO(e,t){return t.map(t=>hO(e,t))}function hO(e,t){return pm(t)?fm(hO(e,t.items)):gm(t)?hm(mO(e,t.parameters),hO(e,t.instanceType)):ym(t)?vm(mO(e,t.parameters),hO(e,t.returnType)):vg(t)?_g(mO(e,t.items)):Yh(t)?Jh(mO(e,t.anyOf)):rh(t)?nh(mO(e,t.allOf)):F_(t)?Lm(e):t}function gO(e,t){return hO(e,t)}function _O(e,t){return gO(e,t in e?e[t]:Om())}function vO(e,t){return t.reduce((t,n)=>[...t,_O(e,n)],[])}function yO(e,t){return t_(vO(e,pO(t)))}var bO=new RegExp(x_);function xO(e){return e.filter(e=>bO.test(e))}function SO(e){return t_(vO(e,xO(Fm(e))))}function CO(e,t){return Vh(t)?SO(e):yO(e,t)}function wO(e){return q(eO(e))}function TO(e){return e.map(e=>EO(e))}function EO(e){return rh(e)?nh(TO(e.allOf)):Yh(e)?Jh(TO(e.anyOf)):Ih(e)?wO(e.const):e}function DO(e,t){return e.reduceRight((e,n,r)=>iw(tE({},q(r),t))?[n,...e]:e,[])}function OO(e,t){return r_(DO(e,EO(t)))}function kO(e){return r_(e)}function AO(e,t){return Ih(t)&&z(t.const,`length`)?q(e.length):Vh(t)||Ah(t)?kO(e):OO(e,t)}function jO(e,t){return pm(e)?iO(e.items,t):Rm(e)?CO(e.properties,t):vg(e)?AO(e.items,t):Om()}function MO(e){return Um(e)||Ym(e)||rh(e)||Yh(e)?QD(e):e}function NO(e,t,n){return MA([e,t])?K(jO(MO(e),t),{},n):BD(e,t,n)}function PO(e,t,n,r,i){return NO(Q(e,t,n),Q(e,t,r),i)}function FO(e,t={}){return im(`InstanceType`,[e],t)}function IO(e,t={}){return RO(e,t)}function LO(e){return gm(e)?e.instanceType:Om()}function RO(e,t){return MA([e])?K(LO(e),{},t):FO(e,t)}function zO(e,t,n,r={}){return RO(Q(e,t,n),r)}function BO(e,t={}){return im(`KeyOf`,[e],t)}function VO(e,t={}){return XO(e,t)}function HO(){return Jh([Bh(),Kh(),Hh()])}function UO(e){return Bh()}function WO(e){return e.reduce((e,t)=>Nh(t)?[...e,q(eO(t))]:lf(),[])}function GO(e){return r_(WO(H(e)))}function KO(e){return k_(e)}function qO(e){return r_(e.map((e,t)=>q(t)))}function JO(e){return Em(e)?HO():pm(e)?UO(e.items):Rm(e)?GO(e.properties):j_(e)?KO(e):vg(e)?qO(e.items):Om()}function YO(e){return Um(e)||Ym(e)||rh(e)||Yh(e)?QD(e):e}function XO(e,t){return MA([e])?K(JO(YO(e)),{},t):BO(e,t)}function ZO(e,t,n,r){return XO(Q(e,t,n),r)}function QO(e,t,n,r,i={}){return im(`Mapped`,[e,t,n,r],i)}function $O(e,t,n,r,i={}){return dk({},jA([],[]),e,t,n,r,i)}function ek(e){return ik(e_(e))}function tk(e){return e.reduce((e,t)=>[...e,...ik(t)],[])}function nk(e){return ik(Qg(e))}function rk(e){return ks(e)?[q(`${e}`)]:[q(e)]}function ik(e){return th(e)?nk(e.enum):Ih(e)?rk(e.const):ZC(e)?ek(e.pattern):Yh(e)?tk(e.anyOf):[e]}function ak(e){return ik(e)}function ok(e){return ZC(e)?e_(e.pattern):e}function sk(e,t,n,r,i,a){let o=Rp(e,{[n.name]:r}),s=ok(Q(o,t,i)),c=Q(o,t,a);return Ph(s)||Fh(s)?{[s.const]:c}:{}}function ck(e,t,n,r,i,a){return r.reduce((r,o)=>[...r,sk(e,t,n,o,i,a)],[])}function lk(e){return e.reduce((e,t)=>[...e,Lm(t)],[])}function uk(e,t,n,r,i,a){return $g(lk(ck(e,t,n,ak(r),i,a)))}function dk(e,t,n,r,i,a,o){return MA([r])?K(uk(e,t,n,r,i,a),{},o):QO(n,r,i,a,o)}function fk(e,t,n,r,i,a,o){return dk(e,t,n,Q(e,t,r),i,a,o)}function pk(e,t,n){let r=Rp(e,t);return H(t).filter(e=>n.includes(e)).reduce((e,n)=>({...e,[n]:ZT(r,n,t[n])}),{})}function mk(e,t,n){let r=Rp(e,t);return H(t).filter(e=>!n.includes(e)).reduce((e,n)=>({...e,[n]:Q(r,jA([],[]),t[n])}),{})}function hk(e,t,n){let r=LT(t),i=pk(e,t,r),a=mk(e,t,r);return K({...i,...a},{},n)}function gk(e,t,n,r){return hk(e,n,r)}function _k(e,t={}){return im(`NonNullable`,[e],t)}function vk(e,t={}){return bk(e,t)}function yk(e){return kD(e,Jh([Lh(),I_()]),{})}function bk(e,t){return MA([e])?K(yk(e),{},t):_k(e,t)}function xk(e,t,n,r){return bk(Q(e,t,n),r)}function Sk(e,t,n={}){return im(`Omit`,[e,t],n)}function Ck(e,t,n={}){return Dk(e,R(t)?zD(t):t,n)}function wk(e){let t=QD(e);return Rm(t)?t.properties:lf()}function Tk(e,t){return H(e).reduce((n,r)=>t.includes(r)?n:{...n,[r]:e[r]},{})}function Ek(e,t){return Lm(Tk(wk(e),pO(t)))}function Dk(e,t,n){return MA([e,t])?K(Ek(e,t),{},n):Sk(e,t,n)}function Ok(e,t,n,r,i){return Dk(Q(e,t,n),Q(e,t,r),i)}function kk(e,t={}){return im(`Parameters`,[e],t)}function Ak(e,t={}){return Mk(e,t)}function jk(e){let t=ym(e)?e.parameters:[];return _g(PA({},jA([],[]),t))}function Mk(e,t){return MA([e])?K(jk(e),{},t):kk(e,t)}function Nk(e,t,n,r){return Mk(Q(e,t,n),r)}function Pk(e,t={}){return im(`Partial`,[e],t)}function Fk(e,t={}){return Hk(e,t)}function Ik(e,t){let n=Vk($T(e,t));return Hm(Rp(e,{[t]:n}),t)}function Lk(e,t,n){return Vk(Zg(e,t,n))}function Rk(e){return Vk($g(e))}function zk(e){return Jh(e.map(e=>Vk(e)))}function Bk(e){return Lm(H(e).reduce((t,n)=>({...t,[n]:jm(e[n])}),{}))}function Vk(e){return Um(e)?Ik(e.$defs,e.$ref):Ym(e)?Lk(e.if,e.then,e.else):rh(e)?Rk(e.allOf):Yh(e)?zk(e.anyOf):Rm(e)?Bk(e.properties):Lm({})}function Hk(e,t){return MA([e])?K(Vk(e),{},t):Pk(e,t)}function Uk(e,t,n,r){return Hk(Q(e,t,n),r)}function Wk(e,t,n={}){return im(`Pick`,[e,t],n)}function Gk(e,t,n={}){return Jk(e,R(t)?zD(t):t,n)}function Kk(e,t){return H(e).reduce((n,r)=>t.includes(r)?Rp(n,{[r]:e[r]}):n,{})}function qk(e,t){return Lm(Kk(wk(e),pO(t)))}function Jk(e,t,n){return MA([e,t])?K(qk(e,t),{},n):Wk(e,t,n)}function Yk(e,t,n,r,i){return Jk(Q(e,t,n),Q(e,t,r),i)}function Xk(e,t={}){return im(`ReadonlyObject`,[e],t)}function Zk(e,t={}){return sA(e,t)}var Qk=Zk;function $k(e){return WA(fm(e))}function eA(e,t){let n=oA($T(e,t));return Hm(Rp(e,{[t]:n}),t)}function tA(e,t,n){return oA(Zg(e,t,n))}function nA(e){return oA($g(e))}function rA(e){return Lm(H(e).reduce((t,n)=>({...t,[n]:mh(e[n])}),{}))}function iA(e){return WA(_g(e))}function aA(e){return Jh(e.map(e=>oA(e)))}function oA(e){return pm(e)?$k(e.items):Um(e)?eA(e.$defs,e.$ref):Ym(e)?tA(e.if,e.then,e.else):rh(e)?nA(e.allOf):Rm(e)?rA(e.properties):vg(e)?iA(e.items):Yh(e)?aA(e.anyOf):e}function sA(e,t){return MA([e])?K(oA(e),{},t):Xk(e)}function cA(e,t,n,r){return sA(Q(e,t,n),r)}function lA(e,t,n,r){return t.visited.includes(r)?n:r in e?Q(e,jA(t.callstack,[...t.visited,r]),e[r]):n}function uA(e,t){let n=hA($T(e,t));return Hm(Rp(e,{[t]:n}),t)}function dA(e,t,n){return hA(Zg(e,t,n))}function fA(e){return hA($g(e))}function pA(e){return Jh(e.map(e=>hA(e)))}function mA(e){return Lm(H(e).reduce((t,n)=>({...t,[n]:kg(e[n])}),{}))}function hA(e){return Um(e)?uA(e.$defs,e.$ref):Ym(e)?dA(e.if,e.then,e.else):rh(e)?fA(e.allOf):Yh(e)?pA(e.anyOf):Rm(e)?mA(e.properties):Lm({})}function gA(e,t={}){return im(`Required`,[e],t)}function _A(e,t={}){return vA(e,t)}function vA(e,t){return MA([e])?K(hA(e),{},t):gA(e,t)}function yA(e,t,n,r){return vA(Q(e,t,n),r)}function bA(e,t={}){return im(`ReturnType`,[e],t)}function xA(e,t={}){return CA(e,t)}function SA(e){return ym(e)?e.returnType:Om()}function CA(e,t){return MA([e])?K(SA(e),{},t):bA(e,t)}function wA(e,t,n,r={}){return CA(Q(e,t,n),r)}function TA(e,t){return im(`With`,[e,t],{})}function EA(e,t){return DA(e,t)}function DA(e,t){return MA([e])?K(e,{},t):TA(e,t)}function OA(e,t,n,r){return DA(Q(e,t,n),r)}function kA(e){return N_(e)?vg(e.items)?AA(e.items.items):qm(e.items)||Sm(e.items)?[e]:[Om()]:[e]}function AA(e){return e.reduce((e,t)=>[...e,...kA(t)],[])}function jA(e,t){return{callstack:e,visited:t}}function MA(e){return B(e,(e,t)=>!Sm(e)&&MA(t),()=>!0)}function NA(e,t,n){return H(n).reduce((r,i)=>({...r,[i]:Q(e,t,n[i])}),{})}function PA(e,t,n){return AA(FA(e,t,n))}function FA(e,t,n){return n.map(n=>Q(e,t,n))}function IA(e,t){let n=Nm(e)?um(t,{}):t,r=gh(e)?sm(n,{}):n;return fh(e)?VA(r,{}):r}function LA(e,t,n,r,i){return z(n,`AddImmutable`)?HA(e,t,r[0],i):z(n,`RemoveImmutable`)?GE(e,t,r[0],i):z(n,`AddReadonly`)?cm(e,t,r[0],i):z(n,`RemoveReadonly`)?Sg(e,t,r[0],i):z(n,`AddOptional`)?dm(e,t,r[0],i):z(n,`RemoveOptional`)?Dg(e,t,r[0],i):z(n,`Capitalize`)?pD(e,t,r[0],i):z(n,`Conditional`)?xD(e,t,r[0],r[1],r[2],r[3],i):z(n,`ConstructorParameters`)?ED(e,t,r[0],i):z(n,`Evaluate`)?cE(e,t,r[0],i):z(n,`Exclude`)?AD(e,t,r[0],r[1],i):z(n,`Extract`)?LD(e,t,r[0],r[1],i):z(n,`Index`)?PO(e,t,r[0],r[1],i):z(n,`InstanceType`)?zO(e,t,r[0],i):z(n,`Interface`)?DT(e,t,r[0],r[1],i):z(n,`KeyOf`)?ZO(e,t,r[0],i):z(n,`Lowercase`)?mD(e,t,r[0],i):z(n,`Mapped`)?fk(e,t,r[0],r[1],r[2],r[3],i):z(n,`Module`)?gk(e,t,r[0],i):z(n,`NonNullable`)?xk(e,t,r[0],i):z(n,`Pick`)?Yk(e,t,r[0],r[1],i):z(n,`Parameters`)?Nk(e,t,r[0],i):z(n,`Partial`)?Uk(e,t,r[0],i):z(n,`Omit`)?Ok(e,t,r[0],r[1],i):z(n,`ReadonlyObject`)?cA(e,t,r[0],i):z(n,`Record`)?b_(e,t,r[0],r[1],i):z(n,`Required`)?yA(e,t,r[0],i):z(n,`ReturnType`)?wA(e,t,r[0],i):z(n,`TemplateLiteral`)?GC(e,t,r[0],i):z(n,`Uncapitalize`)?hD(e,t,r[0],i):z(n,`Uppercase`)?gD(e,t,r[0],i):z(n,`With`)?OA(e,t,r[0],r[1]):im(n,r,i)}function RA(e,t,n){return IA(n,Sm(n)?lA(e,t,n,n.$ref):pm(n)?fm(Q(e,t,n.items),mm(n)):HE(n)?zE(e,t,n.target,n.arguments):gm(n)?hm(FA(e,t,n.parameters),Q(e,t,n.instanceType),_m(n)):ym(n)?vm(FA(e,t,n.parameters),Q(e,t,n.returnType),bm(n)):Ym(n)?Jm(Q(e,t,n.if),Q(e,t,n.then),Q(e,t,n.else),Xm(n)):rh(n)?nh(FA(e,t,n.allOf),ih(n)):Rm(n)?Lm(NA(e,t,n.properties),zm(n)):j_(n)?E_(O_(n),Q(e,t,A_(n))):N_(n)?M_(Q(e,t,n.items)):vg(n)?_g(PA(e,t,n.items),yg(n)):Yh(n)?Jh(FA(e,t,n.anyOf),Xh(n)):n)}function Q(e,t,n){return am(n)?LA(e,t,n.action,n.parameters,n.options):RA(e,t,n)}function zA(e,t){return Q(e,jA([],[]),t)}function BA(e){return K(e,{"~immutable":!0},{})}function VA(e,t){return K(BA(e),{},t)}function HA(e,t,n,r){return VA(Q(e,t,n),r)}function UA(e,t={}){return im(`AddImmutable`,[e],t)}function WA(e,t={}){return VA(e,t)}function GA(e,t={}){return im(`Evaluate`,[e],t)}function KA(e,t={}){return sE(e,t)}function qA(e,t={}){return im(`Module`,[e],t)}function JA(e,t={}){return gk({},jA([],[]),e,t)}function YA(...e){let[t,n,r]=cs(e,{2:(e,t)=>Ms(e)?[{},e,t]:[e,t,{}],3:(e,t,n)=>[e,t,n],1:e=>[{},e,{}]}),i=EC(n);return K(R(i)&&z(i.length,2)?Q(t,jA([],[]),i[0]):Om(),{},r)}BigInt(2**53-1),BigInt(-(2**53-1)),Jh([Lm({type:q(`insert`),path:Kh(),value:Bm()}),Object({type:q(`update`),path:Kh(),value:Bm()}),Lm({type:q(`delete`),path:Kh()})]);var XA=4,ZA=4294967295,QA=65536,$A=class extends Error{constructor(e){super(e),this.name=`FrameError`}};function ej(e){let t=e?.maxFrameLength??16777216;if(!Number.isSafeInteger(t)||t<0||t>ZA)throw RangeError(`maxFrameLength must be an integer between 0 and ${ZA}`);return t}function tj(e){if(!(e instanceof Uint8Array))throw TypeError(`Frame payload must be a Uint8Array`);if(e.byteLength>ZA)throw RangeError(`Frame payload exceeds the unsigned 32-bit length limit`);let t=new Uint8Array(XA+e.byteLength),n=e.byteLength;return t[0]=n>>>24,t[1]=n>>>16,t[2]=n>>>8,t[3]=n,t.set(e,XA),t}var nj=class{header=new Uint8Array(XA);headerLength=0;maxFrameLength;payloadBlocks=[];currentPayloadBlock;currentPayloadBlockLength=0;expectedPayloadLength;payloadLength=0;state=`open`;constructor(e){this.maxFrameLength=ej(e)}push(e){if(this.state===`ended`)throw new $A(`Frame decoder has ended`);if(this.state===`failed`)throw new $A(`Frame decoder has failed`);if(!(e instanceof Uint8Array))throw TypeError(`Frame chunk must be a Uint8Array`);let t=[],n=0;for(;n<e.byteLength;){if(this.expectedPayloadLength===void 0){let r=Math.min(XA-this.headerLength,e.byteLength-n);if(this.header.set(e.subarray(n,n+r),this.headerLength),this.headerLength+=r,n+=r,this.headerLength<XA)continue;let i=this.header[0]*16777216+this.header[1]*65536+this.header[2]*256+this.header[3];if(this.headerLength=0,i>this.maxFrameLength&&this.fail(`Frame length ${i} exceeds configured limit of ${this.maxFrameLength}`),i===0){t.push(new Uint8Array);continue}this.expectedPayloadLength=i,this.payloadBlocks=[],this.currentPayloadBlock=void 0,this.currentPayloadBlockLength=0,this.payloadLength=0}let r=this.expectedPayloadLength;if(r!==void 0){for(;n<e.byteLength&&this.payloadLength<r;){let t=this.currentPayloadBlock;(!t||this.currentPayloadBlockLength===t.byteLength)&&(t=new Uint8Array(Math.min(QA,r-this.payloadLength)),this.payloadBlocks.push(t),this.currentPayloadBlock=t,this.currentPayloadBlockLength=0);let i=Math.min(t.byteLength-this.currentPayloadBlockLength,e.byteLength-n);t.set(e.subarray(n,n+i),this.currentPayloadBlockLength),this.currentPayloadBlockLength+=i,this.payloadLength+=i,n+=i}if(this.payloadLength===r){if(this.payloadBlocks.length===1)t.push(this.payloadBlocks[0]);else{let e=new Uint8Array(r),n=0;for(let t of this.payloadBlocks)e.set(t,n),n+=t.byteLength;t.push(e)}this.payloadBlocks=[],this.currentPayloadBlock=void 0,this.currentPayloadBlockLength=0,this.expectedPayloadLength=void 0,this.payloadLength=0}}}return t}end(){if(this.state===`ended`)throw new $A(`Frame decoder has ended`);if(this.state===`failed`)throw new $A(`Frame decoder has failed`);(this.headerLength!==0||this.expectedPayloadLength!==void 0)&&this.fail(`Truncated frame at end of stream`),this.state=`ended`}fail(e){throw this.state=`failed`,this.headerLength=0,this.payloadBlocks=[],this.currentPayloadBlock=void 0,this.currentPayloadBlockLength=0,this.expectedPayloadLength=void 0,this.payloadLength=0,new $A(e)}},rj=s({Any:()=>Tm,Array:()=>fm,BigInt:()=>Sh,Boolean:()=>wh,Call:()=>VE,Capitalize:()=>QE,Codec:()=>sh,Conditional:()=>vD,Constructor:()=>hm,ConstructorParameters:()=>CD,Cyclic:()=>Hm,Decode:()=>ch,DecodeBuilder:()=>oh,Dependent:()=>Jm,Encode:()=>lh,EncodeBuilder:()=>ah,Enum:()=>eh,Evaluate:()=>KA,Exclude:()=>OD,Extends:()=>tE,ExtendsResult:()=>QC,Extract:()=>MD,Function:()=>vm,Generic:()=>Cm,Identifier:()=>Eh,Immutable:()=>dh,Index:()=>VD,Infer:()=>Km,InstanceType:()=>IO,Instantiate:()=>zA,Integer:()=>kh,Interface:()=>AT,Intersect:()=>nh,IsAny:()=>Em,IsArray:()=>pm,IsBigInt:()=>Ch,IsBoolean:()=>Th,IsCall:()=>HE,IsCodec:()=>uh,IsConstructor:()=>gm,IsCyclic:()=>Um,IsDependent:()=>Ym,IsEnum:()=>th,IsEnumValue:()=>$m,IsFunction:()=>ym,IsGeneric:()=>wm,IsIdentifier:()=>Dh,IsImmutable:()=>fh,IsInfer:()=>qm,IsInteger:()=>Ah,IsIntersect:()=>rh,IsKind:()=>nm,IsLiteral:()=>Ih,IsNever:()=>km,IsNull:()=>Rh,IsNumber:()=>Vh,IsObject:()=>Rm,IsOptional:()=>Nm,IsParameter:()=>Gh,IsReadonly:()=>gh,IsRecord:()=>j_,IsRef:()=>Sm,IsRefine:()=>bh,IsRest:()=>N_,IsSchema:()=>rm,IsString:()=>qh,IsSymbol:()=>Uh,IsTemplateLiteral:()=>ZC,IsThis:()=>F_,IsTuple:()=>vg,IsUndefined:()=>L_,IsUnion:()=>Yh,IsUnknown:()=>Vm,IsUnsafe:()=>Gm,IsVoid:()=>z_,KeyOf:()=>VO,Literal:()=>q,Lowercase:()=>eD,Mapped:()=>$O,Module:()=>JA,Never:()=>Om,NonNullable:()=>vk,Null:()=>Lh,Number:()=>Bh,Object:()=>Lm,Omit:()=>Ck,Optional:()=>Mm,Parameter:()=>Wh,Parameters:()=>Ak,Partial:()=>Fk,Pick:()=>Gk,Readonly:()=>hh,ReadonlyObject:()=>Zk,ReadonlyType:()=>Qk,Record:()=>T_,RecordKey:()=>k_,RecordPattern:()=>O_,RecordValue:()=>A_,Ref:()=>xm,Refine:()=>vh,Required:()=>_A,Rest:()=>M_,ReturnType:()=>xA,Script:()=>YA,String:()=>Kh,Symbol:()=>Hh,TemplateLiteral:()=>XC,This:()=>P_,Tuple:()=>_g,Uncapitalize:()=>nD,Undefined:()=>I_,Union:()=>Jh,Unknown:()=>Bm,Unsafe:()=>Wm,Uppercase:()=>iD,Void:()=>R_,With:()=>EA}),ij=rj.String({minLength:1}),aj=rj.Unsafe(rj.Unknown()),oj=e=>rj.Object(e,{additionalProperties:!1}),sj=rj.String({pattern:`^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$`});function cj(e){return tm(sj,e)}var lj=oj({code:ij,message:rj.String()}),uj=oj({type:rj.Literal(`hello`),version:rj.Integer({minimum:0})}),dj=oj({serverId:sj}),fj=oj({serverId:sj,sessionId:ij,attachmentId:ij}),pj=rj.Union([dj,fj]),mj=oj({type:rj.Literal(`request`),id:ij,target:pj,call:aj}),hj=oj({type:rj.Literal(`cancel`),id:ij,target:pj}),gj=rj.Union([uj,mj,hj]),_j=oj({type:rj.Literal(`hello`),version:rj.Literal(8),serverId:sj}),vj=oj({type:rj.Literal(`hello_error`),error:lj}),yj=rj.Union([oj({type:rj.Literal(`response`),id:ij,ok:rj.Literal(!0),result:rj.Optional(aj)}),oj({type:rj.Literal(`response`),id:ij,ok:rj.Literal(!1),error:lj})]),bj=oj({type:rj.Literal(`service_update`),subscriptionId:ij,update:aj}),xj=oj({type:rj.Literal(`attachment`),attachment:rj.Union([fj,rj.Null()])}),Sj=rj.Union([_j,vj,yj,bj,xj]),Cj=class extends Error{constructor(e){super(e),this.name=`ProtocolValidationError`}};function wj(e){if(!tm(gj,e)||!Na(e))throw new Cj(`Invalid client protocol message`);return e}function Tj(e){if(!tm(Sj,e)||!Na(e))throw new Cj(`Invalid server protocol message`);return e}function Ej(e){return e instanceof Error?e.message.length<=500?e.message:`${e.message.slice(0,497)}...`:`Unknown codec error`}function Dj(e,t,n,r){let i=t(e);try{return tj(ss(i,{maxByteLength:r?.maxFrameLength??16777216}))}catch(e){throw e instanceof Cj?e:new Cj(`Unable to encode ${n} protocol message: ${Ej(e)}`)}}function Oj(e,t){return Dj(e,wj,`client`,t)}var kj=class{failed=!1;frames;kind;maxFrameLength;parse;constructor(e,t,n){this.frames=new nj(n),this.kind=e,this.maxFrameLength=n?.maxFrameLength??16777216,this.parse=t}push(e){if(this.failed)throw new Cj(`${this.kind} message decoder has failed`);try{let t=[];for(let n of this.frames.push(e))t.push(this.parse(ts(n,{maxByteLength:this.maxFrameLength})));return t}catch(e){throw this.failed=!0,e instanceof Cj?e:new Cj(`Invalid ${this.kind} protocol frame: ${Ej(e)}`)}}end(){if(this.failed)throw new Cj(`${this.kind} message decoder has failed`);try{this.frames.end()}catch(e){throw this.failed=!0,new Cj(`Invalid ${this.kind} protocol framing: ${Ej(e)}`)}}},Aj=class{decoder;constructor(e){this.decoder=new kj(`server`,Tj,e)}push(e){return this.decoder.push(e)}end(){this.decoder.end()}},jj=class extends Error{code;constructor(e){super(e.message),this.name=`ServerError`,this.code=e.code}},Mj=class extends Error{constructor(e=`Client is disconnected`,t){super(e,t===void 0?void 0:{cause:t}),this.name=`DisconnectedError`}},Nj=class extends Error{constructor(){super(`Client is disposed`),this.name=`ClientDisposedError`}};function Pj(e){return e instanceof Error?e:Error(String(e))}function Fj(e){let t=Pj(e);return t instanceof Mj?t:new Mj(t.message,t)}function Ij(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var Lj=4294967295,Rj=class{#e;#t;#n={state:`disconnected`};#r=0;constructor(e){if(this.#e=e,this.#t=e.maxFrameLength??16777216,!Number.isSafeInteger(this.#t)||this.#t<=0||this.#t>Lj)throw TypeError(`Client maxFrameLength must be an integer between 1 and ${Lj}`)}get state(){return this.#n.state}get maxFrameLength(){return this.#t}connect(){if(this.#n.state!==`disconnected`)return Promise.reject(new Mj(`Client is already ${this.#n.state}`));let e=++this.#r,t=Ij();return this.#n={state:`connecting`,id:e,decoder:new Aj({maxFrameLength:this.#t}),handshake:t},this.#e.onStateChange({state:`connecting`}),this.#i(e,{onData:t=>this.#a(e,t),onClose:()=>{this.#u(e)&&this.#s()},onError:t=>{this.#u(e)&&this.#c(Fj(t))}}),t.promise}disconnect(e=`Client disconnected`){this.#n.state!==`disconnected`&&this.#c(typeof e==`string`?new Mj(e):e)}fail(e){this.#c(e)}send(e){let t=this.#n;if(t.state!==`connected`)throw new Mj;let n;try{n=t.transport.send(e)}catch(e){this.#c(Fj(e));return}n.catch(e=>{let n=this.#n;n.state!==`disconnected`&&n.transport===t.transport&&this.#c(Fj(e))})}async#i(e,t){let n;try{n=await this.#e.transportFactory(t)}catch(t){this.#u(e)&&this.#l(Fj(t));return}let r=this.#n;if(r.state!==`connecting`||r.id!==e)n.close();else{this.#n={...r,transport:n};try{await n.send(Oj({type:`hello`,version:8},{maxFrameLength:this.#t}))}catch(t){this.#u(e)&&this.#c(Fj(t))}}}#a(e,t){let n=this.#n;if(n.state===`disconnected`||n.id!==e)return;if(n.state===`connecting`&&!n.transport){this.#c(new Cj(`Received server data before the client hello was sent`));return}let r;try{r=n.decoder.push(t)}catch(e){this.#c(Pj(e));return}for(let e of r){if(this.#n.state===`disconnected`)return;this.#o(e)}}#o(e){let t=this.#n;if(t.state===`connecting`){if(e.type===`hello_error`){this.#c(new jj(e.error));return}if(e.type!==`hello`){this.#c(new Cj(`Expected server hello as first message`));return}if(e.serverId!==this.#e.serverId){this.#c(new Cj(`Connected server ${JSON.stringify(e.serverId)} does not match ${JSON.stringify(this.#e.serverId)}`));return}if(!t.transport){this.#c(new Cj(`Received server hello before the client hello was sent`));return}let n={state:`connected`,id:t.id,decoder:t.decoder,transport:t.transport,handshake:t.handshake};this.#n=n;try{this.#e.onHandshake(e)}catch(e){this.#n===n&&this.#c(Pj(e));return}if(this.#n!==n||(this.#e.onStateChange({state:`connected`}),this.#n!==n))return;this.#n={...n,handshake:void 0},t.handshake.resolve(e)}else t.state===`connected`&&(e.type===`hello`||e.type===`hello_error`?this.#c(new Cj(`Unexpected handshake message`)):this.#e.onMessage(e))}#s(){let e=this.#n;if(e.state===`disconnected`)return;let t=new Mj(`Byte transport closed`);try{e.decoder.end()}catch(e){t=Pj(e)}this.#l(t)}#c(e){let t=this.#n,n=t.state===`disconnected`?void 0:t.transport;this.#l(e),n?.close()}#l(e){let t=this.#n;t.state!==`disconnected`&&(this.#n={state:`disconnected`},t.handshake?.reject(e),this.#e.onStateChange({state:`disconnected`,error:e}))}#u(e){return this.#n.state!==`disconnected`&&this.#n.id===e}},zj=class e{#e;#t;#n=new Map;#r=new Set;#i=new Set;#a=new Map;#o=0;#s=0;#c;#l;#u=!1;#d;constructor(e){if(!cj(e.serverId))throw TypeError(`serverId must be a canonical lowercase UUIDv4`);this.#e=e,this.#t=new Rj({transportFactory:e.transportFactory,serverId:e.serverId,maxFrameLength:e.maxFrameLength,onHandshake:e=>{this.#c=e},onMessage:e=>this.#p(e),onStateChange:e=>this.#m(e)})}get disposed(){return this.#u}get connectionState(){return this.#t.state}get connected(){return this.#t.state===`connected`}get serverId(){return this.#e.serverId}get hello(){return this.#c}get attachment(){return this.#l}static async connect(t){let n=new e(t);try{return await n.connect(),n}catch(e){throw await n.dispose(),e}}connect(){return this.#u?Promise.reject(new Nj):(this.#c=void 0,this.#t.connect())}reconnect(){return this.connect()}disconnect(e=`Client disconnected`){this.#t.disconnect(e)}onConnectionStateChange(e){return this.#b(),this.#r.add(e),()=>this.#r.delete(e)}onAttachmentChange(e){return this.#b(),this.#i.add(e),()=>this.#i.delete(e)}request(e,t,n){return this.#f(e,t,n)}async serviceCatalogue(e,t){let n=await this.#f(e,wo(),t);try{return Oo(n)}catch(e){let t=new Cj(e instanceof Error?e.message:`Invalid service catalogue`);throw this.#t.fail(t),t}}async subscribeService(e,t,n,r,i){let a=`service-${++this.#s}`,o={target:e,listener:r,decoder:Uo(),queuedWireUpdates:[],queued:[],deliveryTail:Promise.resolve(),hydrated:!1,ready:!1};this.#a.set(a,o);let s;try{s=await this.#f(e,To(a,t,n),i,e=>{let t=o.decoder.decodeSnapshot(ko(e));o.hydrated=!0;for(let e of o.queuedWireUpdates.splice(0))o.queued.push(o.decoder.decodeUpdate(Ao(e)));return t})}catch(e){throw this.#a.get(a)===o&&this.#a.delete(a),e}if(this.#a.get(a)!==o)throw new Mj;let c=!1;return{id:a,target:e,snapshot:s,start:()=>{if(!(c||o.ready)){o.ready=!0;for(let e of o.queued.splice(0))this.#v(o,e)}},dispose:async()=>{if(!c){c=!0,this.#a.get(a)===o&&this.#a.delete(a);try{this.connected&&this.#y(e)&&await this.#f(e,Eo(a)),await o.deliveryTail}finally{o.queuedWireUpdates.length=0,o.queued.length=0}}}}}#f(e,t,n,r){if(this.#u)return Promise.reject(new Nj);if(!this.connected)return Promise.reject(new Mj);if(n?.aborted)return Promise.reject(Vj(n));let i=`request-${++this.#o}`,{promise:a,resolve:o,reject:s}=Ij(),c=!1,l=!1,u,d=()=>{if(c&&this.connected)try{this.#t.send(Oj({type:`cancel`,id:i,target:e},{maxFrameLength:this.#t.maxFrameLength}))}catch(e){this.#t.fail(Pj(e))}};n!==void 0&&(u=()=>{l||(l=!0,s(Vj(n)),d())},n.addEventListener(`abort`,u,{once:!0})),this.#n.set(i,{resolve:e=>{try{o(r===void 0?e:r(e))}catch(e){let t=new Cj(e instanceof Error?e.message:`Invalid service operation stream`);this.#t.fail(t),s(t)}},reject:s,cleanup:()=>{n!==void 0&&u!==void 0&&n.removeEventListener(`abort`,u)}});let f;try{f=Oj({type:`request`,id:i,target:e,call:Do(t)},{maxFrameLength:this.#t.maxFrameLength})}catch(e){return this.#h(i)?.reject(Pj(e)),a}return this.#t.send(f),c=!0,l&&d(),a}#p(e){if(e.type===`attachment`){if(e.attachment!==null&&e.attachment.serverId!==this.#e.serverId){this.#t.fail(new Cj(`Attachment update belongs to another server`));return}this.#_(e.attachment??void 0);return}if(e.type===`service_update`){let t=this.#a.get(e.subscriptionId);if(t===void 0)return;if(!t.hydrated){t.queuedWireUpdates.push(e.update);return}let n;try{n=t.decoder.decodeUpdate(Ao(e.update))}catch(e){this.#t.fail(new Cj(e instanceof Error?e.message:`Invalid service operation stream`));return}t.ready?this.#v(t,n):t.queued.push(n);return}let t=this.#h(e.id);t?e.ok?t.resolve(e.result):t.reject(new jj(e.error)):this.#t.fail(new Cj(`Response has no matching request`))}#m(e){e.state===`disconnected`&&(this.#c=void 0,this.#_(void 0),this.#g(e.error??new Mj),this.#a.clear());for(let t of this.#r)try{t(e)}catch(e){this.#x(e)}}#h(e){let t=this.#n.get(e);return t&&(this.#n.delete(e),t.cleanup()),t}#g(e){let t=[...this.#n.values()];this.#n.clear();for(let n of t)n.cleanup(),n.reject(e)}dispose(){if(this.#d)return this.#d;this.#u=!0,this.#d=Promise.resolve();let e=new Nj;return this.#g(e),this.#t.disconnect(e),this.#c=void 0,this.#_(void 0),this.#r.clear(),this.#i.clear(),this.#a.clear(),this.#d}[Symbol.asyncDispose](){return this.dispose()}#_(e){let t=this.#l;if(t?.serverId!==e?.serverId||t?.sessionId!==e?.sessionId||t?.attachmentId!==e?.attachmentId){this.#l=e;for(let t of this.#i)try{t(e)}catch(e){this.#x(e)}}}#v(e,t){e.deliveryTail=e.deliveryTail.then(()=>e.listener(t)).catch(e=>this.#x(e))}#y(e){if(!(`sessionId`in e))return this.#c?.serverId===e.serverId;let t=this.#l;return t?.serverId===e.serverId&&t.sessionId===e.sessionId&&t.attachmentId===e.attachmentId}#b(){if(this.#u)throw new Nj}#x(e){if(this.#e.onListenerError)try{this.#e.onListenerError(Pj(e))}catch{}}};function Bj(e,t){let n=()=>{let e=t();if(e===void 0)throw Error(`Remote service target is unavailable`);return e};return{invoke:async(t,r)=>e.request(n(),t,r.abortSignal),async subscribe(t,r,i,a){let o=await e.subscribeService(n(),t,r,e=>i(e,ya),a.abortSignal);return{snapshot:o.snapshot,activate:()=>o.start(),close:()=>o.dispose()}}}}function Vj(e){let t=e.reason;return t instanceof Error?t:new DOMException(`The operation was aborted`,`AbortError`)}function Hj(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t)}function Uj(e){return Uint8Array.from(atob(e),e=>e.charCodeAt(0))}async function Wj(e,t){let n=await t.begin({name:e.name,mimeType:e.mimeType,size:e.bytes.length});try{for(let r=0;r<e.bytes.length;r+=262144)await t.append({id:n,offset:r,data:Hj(e.bytes.subarray(r,r+262144))});return await t.finish(n),n}catch(e){throw await t.release(n).catch(()=>{}),e}}async function Gj(e){let t=[],n=0,r=0,i=``;do{let a=await e(n);if(!Number.isSafeInteger(a.total)||a.total<=0||a.total>20971520||n>0&&(a.total!==r||a.mimeType!==i))throw Error(`Invalid image size or format`);if(r=a.total,i=a.mimeType,a.data.length>349528)throw Error(`Image chunk is too large`);let o=Uj(a.data);if(o.length>262144||n+o.length>r||!o.length&&n<r)throw Error(`Incomplete image`);t.push(o),n+=o.length}while(n<r);let a=new Uint8Array(n),o=0;for(let e of t)a.set(e,o),o+=e.length;return{name:`Image`,mimeType:i,bytes:a}}function Kj(e){let t=/^\/compact(?:\s+([\s\S]*))?$/.exec(e.trim());return t?t[1]?.trim()??``:null}var qj=(e,t=`New session`)=>e.title||e.firstPromptPreview||t,Jj=e=>e.lastMessageAt??e.createdAt,Yj=(e,t)=>Jj(t)-Jj(e)||Number(t.id)-Number(e.id),Xj=(e,t)=>t.lastUsedAt-e.lastUsedAt||Number(t.id)-Number(e.id),Zj=(e,t)=>`${e.title} ${e.firstPromptPreview} ${e.id}`.toLocaleLowerCase().includes(t.trim().toLocaleLowerCase());function Qj(e,t,n=`en`){let r=Math.floor(Math.max(0,t-e)/6e4);if(r<1)return n===`zh`?`刚刚`:`now`;let i=Math.floor(r/60),a=Math.floor(i/24);if(a>=30)return new Date(e).toLocaleDateString(n===`zh`?`zh-CN`:`en-GB`);let o=a||i||r,s=a?[`天`,`d`]:i?[`小时`,`h`]:[`分钟`,`m`];return n===`zh`?`${o} ${s[0]}前`:`${o}${s[1]}`}var $j=Bo(`neko.session-directory`),eM=Bo(`neko.session-management`),tM=Bo(`neko.models`),nM=Bo(`neko.chat`),rM=Bo(`neko.workspaces`),iM=Bo(`neko.credentials`),aM=Bo(`neko.workspace-files`);function oM(e){return t=>{let n=new WebSocket(e);n.binaryType=`arraybuffer`;let r=!1,i=[];return n.onopen=()=>{r=!0;for(let e of i.splice(0))n.send(e.slice())},n.onmessage=e=>{e.data instanceof ArrayBuffer?t.onData(new Uint8Array(e.data)):e.data instanceof Blob&&e.data.arrayBuffer().then(e=>t.onData(new Uint8Array(e)))},n.onclose=()=>t.onClose(),n.onerror=()=>t.onError(Error(`WebSocket transport error`)),{send(e){return n.readyState===WebSocket.CLOSING||n.readyState===WebSocket.CLOSED?Promise.reject(Error(`WebSocket transport is not open`)):(r?n.send(e.slice()):i.push(e),Promise.resolve())},close(){n.close()}}}}var sM=ya;function cM(e,t){return e.filter(e=>e.workspaceRoot===t).sort(Yj)}var lM=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u=[];#d;#f;#p=[];#m;#h;#g=0;#_=0;#v=0;#y=!1;#b=!1;#x=!1;#S=!1;constructor(e){this.#e=e,this.#d=e.workspaceRoot}get currentSessionId(){return this.#f}get workspaceRoot(){return this.#d}get ready(){return this.#b&&!this.#x&&this.#l!==void 0}get managementReady(){return this.#b&&!this.#x}async saveCredential(e,t){if(!this.#b||!this.#c)throw Error(`网关未连接`);await this.#c.save({provider:e,key:t},sM)}async removeCredential(e){if(!this.#b||!this.#c)throw Error(`网关未连接`);await this.#c.remove({provider:e},sM)}async start(){this.#e.events.onPhase(`connecting`),this.#e.events.onWorkspace(this.#d);try{await this.#A()}catch(e){this.#C(e),this.#j()}}#C(e){this.#e.events.onError(e instanceof Error?e.message:String(e))}#w(e){if(this.#y||e!==this.#_)throw Error(`连接已变化,请重试`)}async#T(e){if(!this.managementReady)throw Error(`操作进行中或网关未连接,请稍后重试`);this.#x=!0,this.#e.events.onOperation(!0);let t=this.#_;try{await e(t)}finally{this.#x=!1,this.#e.events.onOperation(!1),t===this.#_&&this.#k()}}async selectWorkspace(e){await this.#T(async t=>{if(!this.#a?.state.value?.workspaces.some(t=>t.path===e))throw Error(`工作区不存在`);await this.#E(e,void 0,t)})}async addWorkspace(e){await this.#T(async t=>{let n=await this.#a.add({path:e},sM);this.#w(t),await this.#E(n.path,void 0,t)})}async browse(e){if(!this.#b||!this.#a)throw Error(`网关未连接`);return this.#a.browse(e,sM)}async attachTo(e){await this.#T(async t=>{if(!this.#u.find(t=>t.id===e&&t.workspaceRoot===this.#d))throw Error(`会话不属于当前工作区或已归档`);await this.#D(e,t)})}async createSession(){await this.#T(async e=>{let t=await this.#i.create({cwd:this.#d},sM);this.#w(e),await this.#D(t.id,e)})}async archiveSession(e){await this.#T(async t=>{await this.#i.archive(e,sM),this.#w(t),this.#u=this.#u.filter(t=>t.id!==e),this.#f===e&&await this.#E(this.#d,void 0,t)})}async#E(e,t,n){let r=cM(this.#u,e).sort(Xj),i=r.find(e=>e.id===t)??r[0];try{i?await this.#D(i.id,n):await this.#O(n),this.#w(n),this.#d=e,this.#e.events.onWorkspace(e)}catch(e){throw n===this.#_&&(this.#M(),this.#f=void 0,this.#e.events.onSessionChange(null)),e}}async#D(e,t){if(this.#f===e&&this.#l)return;let n=this.#t;this.#M();let r=this.#v;this.#f=void 0,this.#e.events.onSessionChange(null);let i=this.#u.find(t=>t.id===e)?.lastUsedAt??-1,a=n.attachment?.sessionId!==e;if(await this.#i.attach(e,sM),this.#w(t),await uM(n,e),a){let n=Date.now();for(;(this.#u.find(t=>t.id===e)?.lastUsedAt??-1)<=i;){if(Date.now()-n>5e3)throw Error(`等待会话目录更新超时`);await new Promise(e=>setTimeout(e,5)),this.#w(t)}}this.#w(t);let o=Vo({services:[nM],transport:Bj(n,(e=>()=>e)(n.attachment))});this.#r=o,await o.ready(sM),this.#w(t);let s=o.use(nM);this.#l=s,this.#f=e,this.#e.events.onSessionChange(e);let c=e=>{t===this.#_&&r===this.#v&&this.#e.events.onView(e)};s.view.value&&c(s.view.value),this.#m=s.view.subscribe(c)}async#O(e){this.#M(),this.#f=void 0,this.#e.events.onSessionChange(null),await this.#i.detach(sM),this.#w(e)}#k(){this.managementReady&&this.#f&&!this.#u.some(e=>e.id===this.#f)&&this.#T(e=>this.#E(this.#d,void 0,e)).catch(e=>this.#C(e))}async configure(e){if(!this.ready)throw Error(`会话未就绪`);await this.#l.configure(e,sM)}async submit(e,t=[],n=crypto.randomUUID(),r){if(r!==void 0&&r!==this.#f)throw Error(`会话已切换,草稿已保留`);if(!this.ready)throw Error(`会话未就绪`);let i=this.#l,a=[];try{for(let e of t)a.push(await Wj(e,{begin:e=>i.beginImage(e,sM),append:e=>i.appendImage(e,sM),finish:e=>i.finishImage(e,sM),release:e=>i.releaseImage(e,sM)}));await i.submit({content:e,requestId:n,images:a},sM)}finally{for(let e of a)await i.releaseImage(e,sM).catch(()=>{})}}async searchFiles(e,t,n){if(!this.managementReady||!this.#o||t!==this.#d)throw Error(`工作区未就绪`);return this.#o.search({workspaceRoot:t,query:e},xa(n,sM))}async workspaceImage(e,t,n){if(!this.ready||t!==this.#f)throw Error(`会话已切换,草稿已保留`);let r=this.#l,i=xa(n,sM),a=await r.importImage(e,i);try{return{...await Gj(e=>r.draftImage({id:a.id,offset:e},i)),name:a.name}}finally{await r.releaseImage(a.id,sM).catch(()=>{})}}async compact(e,t){if(t!==void 0&&t!==this.#f)throw Error(`会话已切换,草稿已保留`);if(!this.ready)throw Error(`会话未就绪`);await this.#l.compact({instructions:e},sM)}async image(e,t,n){if(n!==void 0&&n!==this.#f)throw Error(`会话已切换,草稿已保留`);if(!this.ready)throw Error(`会话未就绪`);let r=this.#l;return Gj(n=>r.getImage({entryId:e,contentIndex:t,offset:n},sM))}abort(){this.ready&&this.#l.abort(sM).catch(e=>this.#C(e))}async listSkills(e,t){if(!this.ready||e!==this.#f)throw Error(`会话未就绪`);return this.#l.skills(xa(t,sM))}async listModels(){return this.#s?.list(sM)??[]}async#A(){let e=++this.#_,t=await zj.connect({serverId:this.#e.serverId,transportFactory:oM(this.#e.url),onListenerError:e=>this.#C(e)});if(this.#y||e!==this.#_){await t.dispose();return}this.#t=t,t.onConnectionStateChange(e=>{e.state===`disconnected`&&t===this.#t&&this.#j()});let n=Vo({services:[$j,eM,tM,rM,iM,aM],transport:Bj(t,()=>({serverId:this.#e.serverId}))});this.#n=n,await n.ready(sM),this.#w(e),this.#i=n.use(eM),this.#a=n.use(rM),this.#o=n.use(aM),this.#s=n.use(tM),this.#c=n.use(iM),this.#p.push(this.#c.state.subscribe(t=>{e===this.#_&&this.#e.events.onCredentials?.(t)})),this.#c.state.value&&this.#e.events.onCredentials?.(this.#c.state.value);let r=n.use($j),i=t=>{e===this.#_&&(this.#u=t.sessions,this.#e.events.onDirectory(t),this.#k())};this.#p.push(r.state.subscribe(i)),this.#p.push(this.#a.state.subscribe(t=>{e===this.#_&&this.#e.events.onWorkspaces(t)})),this.#S||=(await this.#a.add({path:this.#d},sM),this.#w(e),!0);let a=Date.now();for(;!r.state.value||!this.#a.state.value;){if(Date.now()-a>5e3)throw Error(`等待工作区目录超时`);await new Promise(e=>setTimeout(e,10)),this.#w(e)}i(r.state.value),this.#e.events.onWorkspaces(this.#a.state.value),await this.#E(this.#d,this.#f,e),this.#w(e),this.#b=!0,this.#g=0,this.#e.events.onPhase(`ready`),this.#s.list(sM).then(t=>{e===this.#_&&this.#e.events.onModels(t)}).catch(()=>{})}#j(){if(this.#y||this.#h)return;++this.#_,this.#b=!1,this.#M(),this.#e.events.onPhase(`reconnecting`);let e=Math.min((this.#e.retryBaseMs??800)*++this.#g,this.#e.retryMaxMs??8e3);this.#h=setTimeout(()=>{this.#h=void 0,this.#N().then(()=>{if(!this.#y)return this.#A()}).catch(e=>{this.#C(e),this.#j()})},e)}#M(){++this.#v,this.#m?.(),this.#m=void 0,this.#l=void 0,this.#r?.dispose(sM).catch(()=>{}),this.#r=void 0,this.#e.events.onView(null)}async#N(){for(let e of this.#p.splice(0))e();this.#M(),this.#i=void 0,this.#a=void 0,this.#o=void 0,this.#c=void 0,this.#e.events.onCredentials?.(null),this.#s=void 0,await this.#n?.dispose(sM).catch(()=>{}),this.#n=void 0;let e=this.#t;this.#t=void 0,await e?.dispose().catch(()=>{})}dispose(){this.#y=!0,++this.#_,this.#b=!1,clearTimeout(this.#h),this.#N()}};function uM(e,t){return e.attachment?.sessionId===t?Promise.resolve():new Promise((n,r)=>{let i=setTimeout(()=>{a(),r(Error(`等待会话连接超时`))},5e3),a=e.onAttachmentChange(e=>{e?.sessionId===t&&(clearTimeout(i),a(),n())})})}var dM={phase:`connecting`,credentials:null,workspaceRoot:``,workspaces:[],operating:!1,sessions:[],models:[],currentSessionId:null,view:null,notice:null},fM=new Set;function pM(e){dM=e;for(let e of fM)e()}function mM(e){return fM.add(e),()=>{fM.delete(e)}}function hM(){return(0,m.useSyncExternalStore)(mM,()=>dM)}function gM(){return dM}var _M={setCredentials(e){e&&dM.credentials&&e.revision<dM.credentials.revision||pM({...dM,credentials:e})},setWorkspace(e){pM({...dM,workspaceRoot:e})},setWorkspaces(e){pM({...dM,workspaces:e})},setOperation(e){pM({...dM,operating:e})},setPhase(e){pM({...dM,phase:e})},setDirectory(e){pM({...dM,sessions:e})},setModels(e){pM({...dM,models:e})},setSession(e){pM({...dM,currentSessionId:e})},setView(e){pM({...dM,view:e})},notice(e){pM({...dM,notice:e})},clearNotice(){dM.notice!==null&&pM({...dM,notice:null})}};async function vM(){let e=await fetch(`/api/info`);if(!e.ok)throw Error(`GET /api/info 失败(${e.status})`);return await e.json()}var yM;function bM(){(async()=>{let e;try{e=await vM()}catch(e){_M.setPhase(`error`),_M.notice({level:`error`,text:`获取网关信息失败:${e instanceof Error?e.message:String(e)}`});return}yM=new lM({url:e.gatewayWs,serverId:e.serverId,workspaceRoot:e.workspaceRoot,events:{onPhase:_M.setPhase,onCredentials:_M.setCredentials,onWorkspaces:e=>_M.setWorkspaces(e.workspaces),onWorkspace:_M.setWorkspace,onOperation:_M.setOperation,onError:e=>_M.notice({level:`error`,text:e}),onDirectory:e=>_M.setDirectory(e.sessions),onModels:_M.setModels,onSessionChange:_M.setSession,onView:_M.setView}}),await yM.start()})()}function xM(){_M.notice({level:`error`,text:`网关连接未就绪,请稍候或刷新页面。`})}var SM={saveCredential(e,t){return CM().saveCredential(e,t)},removeCredential(e){return CM().removeCredential(e)},configure(e,t){let n=CM();return n.currentSessionId!==t||!n.ready?Promise.reject(Error(`会话已变化,请重试`)):n.configure(e)},submit(e,t=[],n,r){return CM().submit(e,t,n,r)},searchFiles(e,t,n){return CM().searchFiles(e,t,n)},workspaceImage(e,t,n){return CM().workspaceImage(e,t,n)},compact(e,t){return CM().compact(e,t)},listSkills(e,t){return CM().listSkills(e,t)},image(e,t,n){return CM().image(e,t,n)},abort(){yM?.ready===!0?yM.abort():xM()},selectSession(e){return CM().attachTo(e)},selectWorkspace(e){return CM().selectWorkspace(e)},addWorkspace(e){return CM().addWorkspace(e)},browse(e){return CM().browse(e)},createSession(){return CM().createSession()},configureModel(e){yM===void 0?xM():yM.configure({model:e}).catch(e=>{_M.notice({level:`error`,text:e instanceof Error?e.message:String(e)})})},archiveSession(e){return CM().archiveSession(e)}};function CM(){if(!yM)throw Error(`网关尚未连接`);return yM}function wM(e){_M.notice({level:`error`,text:e instanceof Error?e.message:String(e)})}function TM(e,t){let n=e.slice(0,t),r=/(?:^|\s|[([{])(@(?:"[^"\n]*"?|[^\s"@]*))$/.exec(n);if(!r?.[1])return null;let i=r[1];return{start:t-i.length,end:t,query:i.slice(1).replace(/^"|"$/g,``)}}function EM(e,t=!1){let n=t&&!e.endsWith(`/`)?`${e}/`:e;return`@${/\s/.test(n)?`"${n}"`:n}`}function DM(e,t,n,r){let i=EM(n,r),a=r?``:` `;return{text:e.slice(0,t.start)+i+a+e.slice(t.end),cursor:t.start+i.length+a.length-(r&&i.endsWith(`"`)?1:0)}}var OM=e=>/^\/[^\s]*$/.test(e);function kM(e,t){let n=OM(e)?e:`/`;return[{key:`compact`,label:`/compact`,description:`压缩上下文(可附加要求)`},...t.map(e=>({key:`skill:${e.name}`,label:`/skill:${e.name}`,description:e.description}))].filter(e=>e.label.startsWith(n))}function AM(){return typeof window<`u`}function jM(e){return PM(e)?(e.nodeName||``).toLowerCase():`#document`}function MM(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function NM(e){return((PM(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function PM(e){return AM()?e instanceof Node||e instanceof MM(e).Node:!1}function FM(e){return AM()?e instanceof Element||e instanceof MM(e).Element:!1}function IM(e){return AM()?e instanceof HTMLElement||e instanceof MM(e).HTMLElement:!1}function LM(e){return!AM()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof MM(e).ShadowRoot}function RM(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=YM(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function zM(e){return/^(table|td|th)$/.test(jM(e))}function BM(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var VM=/transform|translate|scale|rotate|perspective|filter/,HM=/paint|layout|strict|content/,UM=e=>!!e&&e!==`none`,WM;function GM(e){let t=FM(e)?YM(e):e;return UM(t.transform)||UM(t.translate)||UM(t.scale)||UM(t.rotate)||UM(t.perspective)||!qM()&&(UM(t.backdropFilter)||UM(t.filter))||VM.test(t.willChange||``)||HM.test(t.contain||``)}function KM(e){let t=ZM(e);for(;IM(t)&&!JM(t);){if(GM(t))return t;if(BM(t))return null;t=ZM(t)}return null}function qM(){return WM??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),WM}function JM(e){return/^(html|body|#document)$/.test(jM(e))}function YM(e){return MM(e).getComputedStyle(e)}function XM(e){return FM(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ZM(e){if(jM(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||LM(e)&&e.host||NM(e);return LM(t)?t.host:t}function QM(e){let t=ZM(e);return JM(t)?(e.ownerDocument||e).body:IM(t)&&RM(t)?t:QM(t)}function $M(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=QM(e),i=r===e.ownerDocument?.body,a=MM(r);if(i){let e=eN(a);return t.concat(a,a.visualViewport||[],RM(r)?r:[],e&&n?$M(e):[])}return t.concat(r,$M(r,[],n))}function eN(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var tN=Math.min,nN=Math.max,rN=Math.round,iN=Math.floor,aN=e=>({x:e,y:e}),oN={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function sN(e,t,n){return nN(e,tN(t,n))}function cN(e,t){return typeof e==`function`?e(t):e}function lN(e){return e.split(`-`)[0]}function uN(e){return e.split(`-`)[1]}function dN(e){return e===`x`?`y`:`x`}function fN(e){return e===`y`?`height`:`width`}function pN(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function mN(e){return dN(pN(e))}function hN(e,t,n){n===void 0&&(n=!1);let r=uN(e),i=mN(e),a=fN(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=wN(o)),[o,wN(o)]}function gN(e){let t=wN(e);return[_N(e),t,_N(t)]}function _N(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var vN=[`left`,`right`],yN=[`right`,`left`],bN=[`top`,`bottom`],xN=[`bottom`,`top`];function SN(e,t,n){switch(e){case`top`:case`bottom`:return n?t?yN:vN:t?vN:yN;case`left`:case`right`:return t?bN:xN;default:return[]}}function CN(e,t,n,r){let i=uN(e),a=SN(lN(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(_N)))),a}function wN(e){let t=lN(e);return oN[t]+e.slice(t.length)}function TN(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function EN(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:TN(e)}function DN(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var ON=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`area[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`].join(`,`),kN=typeof Element>`u`,AN=kN?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,jN=!kN&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},MN=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):MN(e.parentNode))},NN=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},PN=function(e,t,n){if(MN(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ON));return t&&AN.call(e,ON)&&r.unshift(e),r=r.filter(n),r},FN=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!MN(a,!1)){if(a.tagName===`SLOT`){var o=a.assignedElements(),s=FN(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{AN.call(a,ON)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!MN(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=FN(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}}return r},IN=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},LN=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||NN(e))&&!IN(e)?0:e.tabIndex},RN=function(e,t){var n=LN(e);return n<0&&t&&!IN(e)?0:n},zN=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},BN=function(e){return e.tagName===`INPUT`},VN=function(e){return BN(e)&&e.type===`hidden`},HN=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},UN=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},WN=function(e){if(!e.name)return!0;var t=e.form||jN(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){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`,e.message),!1}var i=UN(r,e.form);return!i||i===e},GN=function(e){return BN(e)&&e.type===`radio`},KN=function(e){return GN(e)&&!WN(e)},qN=function(e){var t=e&&jN(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=jN(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},JN=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},YN=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var i=getComputedStyle(e).visibility;if(i===`hidden`||i===`collapse`)return!0;var a=AN.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(AN.call(a,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var o=e;e;){var s=e.parentElement,c=jN(e);if(s&&!s.shadowRoot&&r(s)===!0)return JN(e);e=e.assignedSlot?e.assignedSlot:!s&&c!==e.ownerDocument?c.host:s}e=o}if(qN(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return JN(e);return!1},XN=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return AN.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},ZN=function(e,t){return!(t.disabled||VN(t)||YN(t,e)||HN(t)||XN(t))},QN=function(e,t){return!(KN(t)||LN(t)<0||!ZN(e,t))},$N=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},eP=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=RN(a,i),s=i?eP(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(zN).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},tP=function(e,t){return t||={},eP(t.getShadowRoot?FN([e],t.includeContainer,{filter:QN.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:$N}):PN(e,t.includeContainer,QN.bind(null,t)))};function nP(){return/apple/i.test(navigator.vendor)}function rP(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function iP(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&LM(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function aP(e){return e?.ownerDocument||document}var oP=typeof document<`u`?m.useLayoutEffect:function(){},sP={...m}.useInsertionEffect||(e=>e());function cP(e){let t=m.useRef(()=>{});return sP(()=>{t.current=e}),m.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}var lP=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function uP(e,t){let n=tP(e,lP()),r=n.length;if(r===0)return;let i=rP(aP(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function dP(e){return uP(aP(e).body,1)||e}function fP(e){return uP(aP(e).body,-1)||e}function pP(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!iP(n,r)}function mP(e){tP(e,lP()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function hP(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var gP=l(fa(),1);function _P(e,t,n){let{reference:r,floating:i}=e,a=pN(t),o=mN(t),s=fN(o),c=lN(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=uN(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function vP(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=cN(t,e),p=EN(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=DN(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=DN(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var yP=50,bP=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:vP},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=_P(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<yP&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=_P(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},xP=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=cN(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=lN(r),_=pN(o),v=lN(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[wN(o)]:gN(o)),x=p!==`none`;!d&&x&&b.push(...CN(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=hN(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===pN(t)||T.every(e=>pN(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=pN(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},SP=new Set([`left`,`top`]);async function CP(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=lN(n),s=uN(n),c=pN(n)===`y`,l=SP.has(o)?-1:1,u=a&&c?-1:1,d=cN(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var wP=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await CP(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},TP=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=cN(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=pN(i),p=dN(f),m=u[p],h=u[f],g=(e,t)=>sN(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},EP=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=cN(e,t),c=await i.detectOverflow(t,s),l=lN(n),u=uN(n),d=pN(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=tN(p-c[m],g),y=tN(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*nN(c.left,c.right):S=p-2*nN(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function DP(e){let t=YM(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=IM(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=rN(n)!==a||rN(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function OP(e){return FM(e)?e:e.contextElement}function kP(e){let t=OP(e);if(!IM(t))return aN(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=DP(t),o=(a?rN(n.width):n.width)/r,s=(a?rN(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var AP=aN(0);function jP(e){let t=MM(e);return!qM()||!t.visualViewport?AP:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function MP(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===MM(e)}function NP(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=OP(e),o=aN(1);t&&(r?FM(r)&&(o=kP(r)):o=kP(e));let s=MP(a,n,r)?jP(a):aN(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=MM(a),t=FM(r)?MM(r):r,n=e,i=eN(n);for(;i&&t!==n;){let e=kP(i),t=i.getBoundingClientRect(),r=YM(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=MM(i),i=eN(n)}}return DN({width:u,height:d,x:c,y:l})}function PP(e,t){let n=XM(e).scrollLeft;return t?t.left+n:NP(NM(e)).left+n}function FP(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-PP(e,n),y:n.top+t.scrollTop}}function IP(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=NM(r),s=t?BM(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=aN(1),u=aN(0),d=IM(r);if((d||!a)&&((jM(r)!==`body`||RM(o))&&(c=XM(r)),d)){let e=NP(r);l=kP(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?FP(o,c):aN(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function LP(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function RP(e){let t=XM(e),n=e.ownerDocument.body,r=nN(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=nN(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+PP(e),o=-t.scrollTop;return YM(n).direction===`rtl`&&(a+=nN(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var zP=25;function BP(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=MM(e),a=NM(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!qM()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(PP(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=zP&&(s-=o)}return{width:s,height:c,x:l,y:u}}function VP(e,t){let n=NP(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=kP(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function HP(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=BP(e,n,t);else if(t===`document`)r=RP(NM(e));else if(FM(t))r=VP(t,n);else{let n=jP(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return DN(r)}function UP(e,t){let n=t.get(e);if(n)return n;let r=$M(e,[],!1).filter(e=>FM(e)&&jM(e)!==`body`),i=null,a=YM(e).position===`fixed`,o=a?ZM(e):e;for(;FM(o)&&!JM(o);){let e=YM(o),t=GM(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=ZM(o)}return t.set(e,r),r}function WP(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?BM(t)?[]:UP(t,this._c):[].concat(n),r],o=HP(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=HP(t,a[e],i);s=nN(n.top,s),c=tN(n.right,c),l=tN(n.bottom,l),u=nN(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function GP(e){let{width:t,height:n}=DP(e);return{width:t,height:n}}function KP(e,t,n){let r=IM(t),i=NM(t),a=n===`fixed`,o=NP(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=aN(0);if((r||!a)&&((jM(t)!==`body`||RM(i))&&(s=XM(t)),r)){let e=NP(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=PP(i));let l=i&&!r&&!a?FP(i,s):aN(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function qP(e){return YM(e).position===`static`}function JP(e,t){if(!IM(e)||YM(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return NM(e)===n&&(n=n.ownerDocument.body),n}function YP(e,t){let n=MM(e);if(BM(e))return n;if(!IM(e)){let t=ZM(e);for(;t&&!JM(t);){if(FM(t)&&!qP(t))return t;t=ZM(t)}return n}let r=JP(e,t);for(;r&&zM(r)&&qP(r);)r=JP(r,t);return r&&JM(r)&&qP(r)&&!GM(r)?n:r||KM(e)||n}var XP=async function(e){let t=this.getOffsetParent||YP,n=this.getDimensions,r=await n(e.floating);return{reference:KP(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ZP(e){return YM(e).direction===`rtl`}var QP={convertOffsetParentRelativeRectToViewportRelativeRect:IP,getDocumentElement:NM,getClippingRect:WP,getOffsetParent:YP,getElementRects:XP,getClientRects:LP,getDimensions:GP,getScale:kP,isElement:FM,isRTL:ZP};function $P(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function eF(e,t,n){let r=null,i,a=NM(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=iN(d),h=iN(a.clientWidth-(u+f)),g=iN(a.clientHeight-(d+p)),_=iN(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:nN(0,tN(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!$P(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=MM(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function tF(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=OP(e),u=i||a?[...l?$M(l):[],...t?$M(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?eF(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?NP(e):null;c&&g();function g(){let t=NP(e);h&&!$P(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var nF=wP,rF=TP,iF=xP,aF=EP,oF=(e,t,n)=>{let r=new Map,i=n??{},a={...QP,...i.platform,_c:r};return bP(e,t,{...i,platform:a})},sF=typeof document<`u`?m.useLayoutEffect:function(){};function cF(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!cF(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!cF(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function lF(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function uF(e,t){let n=lF(e);return Math.round(t*n)/n}function dF(e){let t=m.useRef(e);return sF(()=>{t.current=e}),t}function fF(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(r);cF(f,r)||p(r);let[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=m.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=m.useRef(null),w=m.useRef(null),T=m.useRef(u),ee=c!=null,E=dF(c),D=dF(i),O=dF(l),k=m.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),oF(C.current,w.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!cF(T.current,t)&&(T.current=t,gP.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);sF(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=m.useRef(!1);sF(()=>(A.current=!0,()=>{A.current=!1}),[]),sF(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(E.current)return E.current(x,S,k);k()}},[x,S,k,E,ee]);let j=m.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),te=m.useMemo(()=>({reference:x,floating:S}),[x,S]),M=m.useMemo(()=>{let e={position:n,left:0,top:0};if(!te.floating)return e;let t=uF(te.floating,u.x),r=uF(te.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...lF(te.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,te.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:k,refs:j,elements:te,floatingStyles:M}),[u,k,j,te,M])}var pF=(e,t)=>{let n=nF(e);return{name:n.name,fn:n.fn,options:[e,t]}},mF=(e,t)=>{let n=rF(e);return{name:n.name,fn:n.fn,options:[e,t]}},hF=(e,t)=>{let n=iF(e);return{name:n.name,fn:n.fn,options:[e,t]}},gF=(e,t)=>{let n=aF(e);return{name:n.name,fn:n.fn,options:[e,t]}},_F=`ArrowLeft`,vF=`ArrowRight`,yF=`ArrowUp`,bF=`ArrowDown`,xF=[_F,vF],SF=[yF,bF];[...xF,...SF];var CF={...m},wF=!1,TF=0,EF=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+TF++;function DF(){let[e,t]=m.useState(()=>wF?EF():void 0);return oP(()=>{e??t(EF())},[]),m.useEffect(()=>{wF=!0},[]),e}var OF=CF.useId||DF;function kF(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var AF=m.createContext(null),jF=m.createContext(null),MF=()=>m.useContext(AF)?.id||null,NF=()=>m.useContext(jF);function PF(e){return`data-floating-ui-`+e}var FF={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`fixed`,whiteSpace:`nowrap`,width:`1px`,top:0,left:0},IF=m.forwardRef(function(e,t){let[n,r]=m.useState();oP(()=>{nP()&&r(`button`)},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[PF(`focus-guard`)]:``,style:FF};return(0,h.jsx)(`span`,{...e,...i})}),LF={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},RF=m.createContext(null),zF=PF(`portal`);function BF(e){e===void 0&&(e={});let{id:t,root:n}=e,r=OF(),i=HF(),[a,o]=m.useState(null),s=m.useRef(null);return oP(()=>()=>{a?.remove(),queueMicrotask(()=>{s.current=null})},[a]),oP(()=>{if(!r||s.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement(`div`);n.id=r,n.setAttribute(zF,``),e.appendChild(n),s.current=n,o(n)},[t,r]),oP(()=>{if(n===null||!r||s.current)return;let e=n||i?.portalNode;e&&!PM(e)&&(e=e.current),e||=document.body;let a=null;t&&(a=document.createElement(`div`),a.id=t,e.appendChild(a));let c=document.createElement(`div`);c.id=r,c.setAttribute(zF,``),e=a||e,e.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function VF(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,a=BF({id:n,root:r}),[o,s]=m.useState(null),c=m.useRef(null),l=m.useRef(null),u=m.useRef(null),d=m.useRef(null),f=o?.modal,p=o?.open,g=!!o&&!o.modal&&o.open&&i&&!!(r||a);return m.useEffect(()=>{if(!a||!i||f)return;function e(e){a&&pP(e)&&(e.type===`focusin`?hP:mP)(a)}return a.addEventListener(`focusin`,e,!0),a.addEventListener(`focusout`,e,!0),()=>{a.removeEventListener(`focusin`,e,!0),a.removeEventListener(`focusout`,e,!0)}},[a,i,f]),m.useEffect(()=>{a&&(p||hP(a))},[p,a]),(0,h.jsxs)(RF.Provider,{value:m.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:d,portalNode:a,setFocusManagerState:s}),[i,a]),children:[g&&a&&(0,h.jsx)(IF,{"data-type":`outside`,ref:c,onFocus:e=>{if(pP(e,a)){var t;(t=u.current)==null||t.focus()}else fP(o?o.domReference:null)?.focus()}}),g&&a&&(0,h.jsx)(`span`,{"aria-owns":a.id,style:LF}),a&&gP.createPortal(t,a),g&&a&&(0,h.jsx)(IF,{"data-type":`outside`,ref:l,onFocus:e=>{if(pP(e,a)){var t;(t=d.current)==null||t.focus()}else dP(o?o.domReference:null)?.focus(),o!=null&&o.closeOnFocusOut&&o?.onOpenChange(!1,e.nativeEvent,`focus-out`)}})]})}var HF=()=>m.useContext(RF);function UF(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=OF(),a=m.useRef({}),[o]=m.useState(()=>kF()),s=MF()!=null,[c,l]=m.useState(r.reference),u=cP((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=m.useMemo(()=>({setPositionReference:l}),[]),f=m.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return m.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function WF(e){let{elements:t,...n}=e===void 0?{}:e,{nodeId:r}=n,i=UF({...n,elements:{reference:t?.reference??null,floating:t?.floating??null}}),a=n.rootContext||i,o=a.elements,[s,c]=m.useState(null),[l,u]=m.useState(null),d=o?.domReference||s,f=m.useRef(null),p=NF();oP(()=>{d&&(f.current=d)},[d]);let h=fF({...n,elements:{...o,...l&&{reference:l}}}),g=m.useCallback(e=>{let t=FM(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),h.refs.setReference(t)},[h.refs]),_=m.useCallback(e=>{(FM(e)||e===null)&&(f.current=e,c(e)),(FM(h.refs.reference.current)||h.refs.reference.current===null||e!==null&&!FM(e))&&h.refs.setReference(e)},[h.refs]),v=m.useMemo(()=>({...h.refs,setReference:_,setPositionReference:g,domReference:f}),[h.refs,_,g]),y=m.useMemo(()=>({...h.elements,domReference:d}),[h.elements,d]),b=m.useMemo(()=>({...h,...a,refs:v,elements:y,nodeId:r}),[h,v,y,r,a]);return oP(()=>{a.dataRef.current.floatingContext=b;let e=p?.nodesRef.current.find(e=>e.id===r);e&&(e.context=b)}),m.useMemo(()=>({...h,context:b,refs:v,elements:y}),[h,v,y,b])}function GF({anchor:e,id:t,title:n,items:r,selected:i,onSelect:a,onAccept:o,message:s}){let{refs:c,floatingStyles:l,isPositioned:u}=WF({elements:{reference:e.current},placement:`top-start`,whileElementsMounted:tF,middleware:[pF(8),hF(),mF({padding:12}),gF({padding:12,apply({availableHeight:e,availableWidth:t,rects:n,elements:r}){Object.assign(r.floating.style,{maxHeight:`${Math.max(0,Math.min(320,e))}px`,width:`${Math.min(n.reference.width,t)}px`})}})]});return(0,m.useEffect)(()=>{document.getElementById(`${t}-${i}`)?.scrollIntoView({block:`nearest`})},[t,i]),(0,h.jsx)(VF,{children:(0,h.jsxs)(`div`,{ref:c.setFloating,style:{...l,visibility:u?`visible`:`hidden`},className:`z-50 overflow-y-auto rounded-xl border border-sakura-200 bg-base p-1.5 shadow-soft`,children:[(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-3 gap-y-1 px-3 py-2 text-xs text-ink-500`,children:[(0,h.jsx)(`span`,{children:n}),(0,h.jsx)(`span`,{children:`↑↓ 选择 · Enter / Tab 确认 · Esc 关闭`})]}),(0,h.jsx)(`div`,{id:t,role:`listbox`,tabIndex:-1,"aria-label":n,children:r.map((e,n)=>(0,h.jsxs)(`button`,{type:`button`,role:`option`,id:`${t}-${n}`,"aria-selected":n===i,tabIndex:-1,title:e.description,onMouseDown:e=>e.preventDefault(),onPointerMove:e=>{e.pointerType===`mouse`&&(e.movementX!==0||e.movementY!==0)&&a(n)},onClick:()=>o(n),className:`block w-full rounded-lg px-3 py-2 text-left ${n===i?`bg-sakura-100`:``}`,children:[(0,h.jsx)(`span`,{className:`block truncate text-sm text-ink-900`,children:e.label}),(0,h.jsx)(`span`,{className:`block truncate text-xs text-ink-500`,children:e.description})]},e.key))}),s&&(0,h.jsx)(`output`,{className:`block break-words px-3 py-2 text-sm text-ink-500`,children:s})]})})}function KF(e,t,n,r){let[i,a]=(0,m.useState)(null),[o,s]=(0,m.useState)({entries:[],limited:!1}),[c,l]=(0,m.useState)(``),[u,d]=(0,m.useState)(0),f=(0,m.useRef)(0),p=(0,m.useId)(),g=()=>{f.current++,a(null),s({entries:[],limited:!1}),d(0)},_=()=>{let t=e.current;if(!t||!n)return g();let r=TM(t.value,t.selectionStart);if(!r)return g();i&&r.start===i.start&&r.end===i.end&&r.query===i.query||(f.current++,s({entries:[],limited:!1}),l(`正在查找文件…`),a(r),d(0))};(0,m.useEffect)(()=>{if(!i||!n){a(null);return}let e=new AbortController,r=++f.current,o=setTimeout(()=>{SM.searchFiles(i.query,t,e.signal).then(t=>{e.signal.aborted||r!==f.current||(s(t),l(t.entries.length?t.limited?`结果较多,请继续输入路径缩小范围`:``:`没有匹配的文件或目录`))}).catch(t=>{!e.signal.aborted&&r===f.current&&l(t instanceof Error?t.message:`查询失败,请重试`)})},120);return()=>{clearTimeout(o),e.abort()}},[i,t,n]);let v=e=>{i&&(r(e,i),g())};return{refresh:_,close:g,keyDown:e=>{if(!i||e.nativeEvent.isComposing)return!1;if(e.key===`Escape`||e.key===`Tab`&&(e.shiftKey||!o.entries.length))return g(),e.key===`Escape`&&e.preventDefault(),e.key===`Escape`;if(e.key===`ArrowDown`||e.key===`ArrowUp`)return e.preventDefault(),d(t=>Math.max(0,Math.min(o.entries.length-1,t+(e.key===`ArrowDown`?1:-1)))),!0;if((e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey){e.preventDefault();let t=o.entries[u];return t&&v(t),!0}return!1},panel:i&&n?(0,h.jsx)(GF,{anchor:e,id:p,title:`工作区文件`,selected:u,onSelect:d,onAccept:e=>{let t=o.entries[e];t&&v(t)},items:o.entries.map(e=>({key:e.path,label:`${e.kind===`directory`?`▸`:`▤`} ${e.name}${e.kind===`directory`?`/`:``}`,description:e.path})),message:c}):null,open:!!i,controls:i?p:void 0,active:i&&o.entries[u]?`${p}-${u}`:void 0}}var qF=new Map,JF=new Set,YF=e=>(JF.add(e),()=>{JF.delete(e)});function XF(e){let{currentSessionId:t,workspaceRoot:n}=hM();return(0,h.jsx)(QF,{sessionId:t??`none:${n}`,...e},t??`none:${n}`)}function ZF({file:e}){let[t,n]=(0,m.useState)(``);return(0,m.useEffect)(()=>{let t=URL.createObjectURL(e);return n(t),()=>URL.revokeObjectURL(t)},[e]),(0,h.jsx)(`img`,{src:t||void 0,alt:e.name,className:`h-16 w-20 rounded-lg object-cover`})}function QF(e){let{credentials:t,view:n,models:r,workspaceRoot:i,phase:a,operating:o}=hM(),s=n?.compaction?.active??[];qF.has(e.sessionId)||qF.set(e.sessionId,{text:``,files:[],requestId:crypto.randomUUID()});let c=(0,m.useSyncExternalStore)(YF,()=>qF.get(e.sessionId)),[l,u]=(0,m.useState)(!1),[d,f]=(0,m.useState)(``),[p,g]=(0,m.useState)(!1),[_,v]=(0,m.useState)([]),[y,b]=(0,m.useState)(0),[x,S]=(0,m.useState)(``),C=(0,m.useId)(),[w,T]=(0,m.useState)(!1),ee=(0,m.useRef)(null),E=(0,m.useRef)(null),D=(0,m.useRef)(c);D.current=c;let O=(0,m.useRef)(!1),k=t=>{D.current=t,qF.set(e.sessionId,t);for(let e of JF)e()},A=e=>k({...D.current,...e,requestId:crypto.randomUUID()}),j=n?.agent.model?.provider===`deepseek`&&t?.statuses.deepseek.source===`none`,te=r.find(e=>e.provider===n?.agent.model?.provider&&e.modelId===n?.agent.model?.modelId),M=c.files.length>0&&te!==void 0&&!te.input.includes(`image`),ne=e=>{let t=e.map(e=>({id:crypto.randomUUID(),file:e,processing:!0,error:[`image/png`,`image/jpeg`,`image/webp`].includes(e.type)?e.size>20971520?`单图不能超过 20 MiB`:void 0:`仅支持 PNG、JPEG、WebP`}));A({files:[...D.current.files,...t]});for(let e of t)re(e)},re=async t=>{let n=t.error;if(!n)try{(await createImageBitmap(t.file)).close()}catch{n=`无法解码图片,请重新选择`}let r=qF.get(e.sessionId);if(!r?.files.some(e=>e.id===t.id))return;let i={...r,files:r.files.map(e=>e.id===t.id?{...e,error:n,processing:!1}:e)};k(i)},ie=(0,m.useRef)(null),ae=(0,m.useRef)(!1);(0,m.useEffect)(()=>()=>{ae.current||ie.current?.abort()},[]),(0,m.useEffect)(()=>{if(v([]),b(0),!p)return;if(e.sessionId.startsWith(`none:`)){S(`新建会话后可选择工作区技能`);return}if(a!==`ready`||o){S(`等待会话连接…`);return}let t=new AbortController;return S(`正在加载技能…`),SM.listSkills(e.sessionId,t.signal).then(e=>{t.signal.aborted||(v(e),S(e.length?``:`当前工作区暂无可用技能`))}).catch(()=>{t.signal.aborted||S(`技能加载失败,请关闭菜单后重试`)}),()=>t.abort()},[e.sessionId,a,o,p]);let oe=KF(ee,i,a===`ready`&&!o,(t,n)=>{let r=D.current;if(t.kind===`file`&&/\.(png|jpe?g|webp)$/i.test(t.path)){if(ie.current)return;let a=new AbortController;ie.current=a,f(`正在读取图片…`),(async()=>{let o=e.sessionId;if(o.startsWith(`none:`)){ae.current=!0,await SM.createSession();let e=gM();if(e.workspaceRoot!==i||!e.currentSessionId)throw Error(`工作区已切换`);o=e.currentSessionId,qF.set(o,r);for(let e of JF)e()}let s=await SM.workspaceImage(t.path,o,a.signal);if(a.signal.aborted||gM().currentSessionId!==o||gM().workspaceRoot!==i)return;let c=qF.get(o)??r,l={id:crypto.randomUUID(),file:new File([new Uint8Array(s.bytes)],s.name,{type:s.mimeType})},u=c.text===r.text?r.text.slice(0,n.start)+r.text.slice(n.end):c.text;qF.set(o,{...c,text:u,files:[...c.files,l],requestId:crypto.randomUUID()});for(let e of JF)e();f(``)})().catch(e=>{if(!a.signal.aborted){let t=e instanceof Error?e.message:`图片读取失败,请重试`;f(t),ae.current&&_M.notice({level:`error`,text:t})}}).finally(()=>{ie.current===a&&(ie.current=null)});return}let a=DM(r.text,n,t.path,t.kind===`directory`),o=ee.current;if(o){o.focus(),o.setSelectionRange(n.start,n.end);let e=a.text.slice(n.start,a.text.length-(r.text.length-n.end));document.execCommand(`insertText`,!1,e)?A({text:o.value}):A({text:a.text}),requestAnimationFrame(()=>{o.setSelectionRange(a.cursor,a.cursor),t.kind===`directory`&&oe.refresh()})}}),se=async t=>{if(O.current||e.disabled)return;O.current=!0,u(!0),f(``);let n=D.current;qF.set(e.sessionId,n);try{await SM.compact(t,e.sessionId),D.current===n&&qF.get(e.sessionId)===n&&Kj(n.text)!==null&&k({...n,text:``,requestId:crypto.randomUUID()}),g(!1)}catch(e){f(e instanceof Error?e.message:`压缩失败,请重试`)}finally{O.current=!1,u(!1)}},ce=async()=>{let t=Kj(D.current.text);if(t!==null){await se(t);return}let n=D.current;if(qF.set(e.sessionId,n),!(O.current||e.disabled||e.busy||j||M||!n.text.trim()&&!n.files.length)){if(n.files.length>4||n.files.reduce((e,t)=>e+t.file.size,0)>41943040)f(`每条消息最多 4 张图片,总大小不超过 40 MiB`);else if(!n.files.some(e=>e.processing)){if(n.files.some(e=>e.error))f(`请先移除不支持的附件`);else{O.current=!0,u(!0),f(``);try{let t=[];for(let e of n.files)t.push({name:e.file.name,mimeType:e.file.type,bytes:new Uint8Array(await e.file.arrayBuffer())});let r=e.sessionId;if(r.startsWith(`none:`)){await SM.createSession();let e=gM();if(e.workspaceRoot!==i||!e.currentSessionId)throw Error(`工作区已切换,草稿已保留`);r=e.currentSessionId,qF.set(r,n);for(let e of JF)e()}if(await SM.submit(n.text.trim(),t,n.requestId,r),r!==e.sessionId){qF.set(r,{text:``,files:[],requestId:crypto.randomUUID()});for(let e of JF)e()}let a=qF.get(e.sessionId);a&&k({text:a.text===n.text?``:a.text,files:a.files.filter(e=>!n.files.some(t=>t.id===e.id)),requestId:crypto.randomUUID()})}catch(t){let n=t instanceof Error?t.message:`发送失败,请重试`;f(n),gM().currentSessionId!==e.sessionId&&_M.notice({level:`error`,text:n})}finally{O.current=!1,u(!1)}}}}},le=kM(c.text,_),ue=Math.min(y,Math.max(0,le.length-1)),de=(e=ue)=>{let t=le[e];t&&(A({text:`${t.label} `}),g(!1),ee.current?.focus())};return(0,h.jsx)(`section`,{"aria-label":`消息输入`,className:`relative border-t border-sakura-200/70 bg-surface/80 px-4 py-3 ${w?`ring-2 ring-sakura-300`:``}`,onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),T(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||T(!1)},onDrop:e=>{e.preventDefault(),T(!1),ne(Array.from(e.dataTransfer.files))},children:(0,h.jsxs)(`div`,{className:`mx-auto max-w-3xl`,children:[w&&(0,h.jsx)(`p`,{className:`text-sm text-sakura-700`,children:`松开以添加图片,不会自动发送`}),j&&(0,h.jsxs)(`p`,{className:`text-sm text-sakura-700`,children:[`尚未配置 DeepSeek Key。`,(0,h.jsx)(zi,{to:`/settings`,className:`focus-neko underline`,children:`前往设置`})]}),M&&(0,h.jsx)(`p`,{className:`text-sm text-sakura-700`,children:`当前模型不支持图片,请切换模型或移除附件。`}),!te?.input.includes(`image`)&&n?.items.some(e=>e.type===`user`&&e.images?.length)&&(0,h.jsx)(`p`,{className:`text-xs text-ink-500`,children:`当前模型无法查看历史原图,仍可使用已有文字分析。`}),d&&(0,h.jsx)(`p`,{role:`alert`,className:`my-1 break-words text-sm text-sakura-700`,children:d}),!!c.files.length&&(0,h.jsx)(`ul`,{className:`mb-2 flex max-h-40 flex-wrap gap-2 overflow-y-auto`,children:c.files.map(e=>(0,h.jsxs)(`li`,{className:`relative w-28 rounded-xl border border-sakura-200 bg-base p-2`,children:[(0,h.jsx)(ZF,{file:e.file}),(0,h.jsx)(`span`,{className:`block truncate text-xs`,title:e.file.name,children:e.file.name}),e.processing&&(0,h.jsx)(`span`,{className:`text-xs text-ink-500`,children:`检查图片…`}),e.error&&(0,h.jsx)(`span`,{className:`text-xs text-sakura-700`,children:e.error}),(0,h.jsx)(`button`,{type:`button`,"aria-label":`移除 ${e.file.name}`,className:`focus-neko absolute right-0 top-0 rounded-full bg-base px-1`,onClick:()=>A({files:D.current.files.filter(t=>t.id!==e.id)}),children:`×`})]},e.id))}),oe.panel,p&&!oe.open&&(0,h.jsx)(GF,{anchor:ee,id:C,title:`输入命令`,items:le,selected:ue,onSelect:b,message:x||(le.length?void 0:`没有匹配的命令或技能`),onAccept:de}),(0,h.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,h.jsx)(`input`,{ref:E,type:`file`,accept:`image/png,image/jpeg,image/webp`,multiple:!0,hidden:!0,onChange:e=>{ne(Array.from(e.target.files??[])),e.target.value=``}}),(0,h.jsx)(`button`,{type:`button`,"aria-label":`添加图片`,title:`添加图片(最多 4 张)`,disabled:e.disabled,onClick:()=>E.current?.click(),className:`focus-neko h-10 rounded-full border border-sakura-200 px-3 text-xl`,children:`+`}),(0,h.jsx)(`textarea`,{ref:ee,disabled:e.disabled,value:c.text,rows:1,placeholder:`输入消息,@ 引用文件,/ 命令`,"aria-autocomplete":`list`,"aria-controls":oe.controls??(p?C:void 0),"aria-activedescendant":oe.active??(p&&le.length?`${C}-${ue}`:void 0),onClick:e=>{oe.refresh(),g(OM(e.currentTarget.value))},onBlur:()=>{oe.close(),g(!1)},onCompositionStart:()=>{oe.close(),g(!1)},onCompositionEnd:e=>{oe.refresh(),g(OM(e.currentTarget.value))},className:`focus-neko max-h-40 min-h-10 min-w-0 flex-1 resize-none rounded-2xl border border-sakura-300 bg-base px-3.5 py-2 text-[15px] text-ink-900`,onChange:e=>{A({text:e.target.value}),b(0),g(!e.nativeEvent.isComposing&&OM(e.target.value)),e.nativeEvent.isComposing||oe.refresh(),e.target.style.height=`auto`,e.target.style.height=`${Math.min(e.target.scrollHeight,160)}px`},onPaste:e=>{let t=Array.from(e.clipboardData.files);t.length&&(e.preventDefault(),ne(t))},onKeyDown:e=>{e.nativeEvent.isComposing||oe.keyDown(e)||(e.key===`Escape`&&p?(e.preventDefault(),g(!1)):p&&(e.key===`ArrowDown`||e.key===`ArrowUp`)?(e.preventDefault(),b(Math.max(0,Math.min(le.length-1,ue+(e.key===`ArrowDown`?1:-1))))):p&&e.key===`Tab`?!e.shiftKey&&le.length?(e.preventDefault(),de()):g(!1):e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),p&&le.length?de():(g(!1),ce())))}}),(0,h.jsx)(`button`,{type:`button`,"aria-label":`输入操作菜单`,"aria-expanded":p,className:`focus-neko h-10 px-2`,onClick:()=>{oe.close(),g(!p),ee.current?.focus()},children:`⋯`}),(0,h.jsx)(`button`,{type:`button`,disabled:l||e.disabled||!c.text.trim()&&!c.files.length||Kj(c.text)===null&&(e.busy||j||M||c.files.some(e=>!!e.error||e.processing)),onClick:()=>void ce(),className:`btn-primary focus-neko h-10 shrink-0 rounded-full px-3 text-sm disabled:opacity-50`,children:l?`处理中`:`发送`}),(e.busy||s.some(e=>e.reason===`manual`||e.blocking))&&(0,h.jsx)(`button`,{type:`button`,onClick:()=>SM.abort(),className:`btn-stop focus-neko h-10 rounded-full px-2 text-sm`,title:`中止当前会话运行及可中止任务`,children:`停止`})]})]})})}function $F({name:e}){return(0,h.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:e===`more`?3:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,h.jsx)(`path`,{d:{folder:`M3 6h6l2 2h10v11H3z`,plus:`M12 5v14M5 12h14`,chevron:`m8 10 4 4 4-4`,panel:`M3 4h18v16H3zM9 4v16`,search:`M20 20l-5-5M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0`,more:`M5 12h.01M12 12h.01M19 12h.01`,chat:`M4 4h16v12H9l-5 4z`,close:`m6 6 12 12M6 18 18 6`,settings:`M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M5.6 18.4l2.1-2.1M16.3 7.7l2.1-2.1M17 12a5 5 0 1 1-10 0 5 5 0 0 1 10 0`,archive:`M3 4h18v4H3zM5 8v12h14V8M10 12h4`,up:`m5 12 7-7 7 7M12 5v14`}[e]})})}function eI(){let[e,t]=(0,m.useState)(()=>window.matchMedia(`(max-width: 767px)`).matches);return(0,m.useEffect)(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var tI=0,nI=``;function rI(e){let t=(0,m.useRef)(null),n=(0,m.useId)();return(0,m.useEffect)(()=>{let e=document.activeElement,n=t.current;return tI===0&&(nI=document.body.style.overflow),tI+=1,document.body.style.overflow=`hidden`,n.showModal(),()=>{n.close(),--tI,tI===0&&(document.body.style.overflow=nI),e?.isConnected&&e.focus()}},[]),(0,gP.createPortal)((0,h.jsxs)(`dialog`,{ref:t,className:`nav-theme nav-dialog ${e.drawer?`nav-drawer`:``}`,"aria-labelledby":n,onCancel:t=>{t.preventDefault(),e.locked||e.onClose()},onKeyDown:e=>{if(e.key!==`Tab`)return;let t=[...e.currentTarget.querySelectorAll(`button:not(:disabled), input:not(:disabled), a[href], [tabindex='0']`)].filter(e=>e.getClientRects().length>0),n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())},children:[(0,h.jsxs)(`div`,{className:`nav-dialog-heading`,children:[(0,h.jsx)(`h2`,{id:n,children:e.title}),(0,h.jsx)(`button`,{type:`button`,className:`nav-icon`,"aria-label":`关闭`,title:`关闭`,disabled:e.locked,onClick:e.onClose,children:(0,h.jsx)($F,{name:`close`})})]}),e.children]}),document.body)}function iI(e){let t=(0,m.useRef)(null),n=(0,m.useRef)(e.onClose);n.current=e.onClose;let[r,i]=(0,m.useState)({left:8,top:8});return(0,m.useLayoutEffect)(()=>{let r=t.current,a=()=>{let t=e.anchor.getBoundingClientRect(),n=t.bottom+4+r.offsetHeight>window.innerHeight?Math.max(8,t.top-r.offsetHeight-4):t.bottom+4;i({left:Math.max(8,Math.min(t.left,window.innerWidth-r.offsetWidth-8)),top:n})};a(),r.querySelector(`button:not(:disabled), input, a`)?.focus();let o=t=>{!r.contains(t.target)&&!e.anchor.contains(t.target)&&n.current()};return document.addEventListener(`pointerdown`,o),window.addEventListener(`resize`,a),()=>{document.removeEventListener(`pointerdown`,o),window.removeEventListener(`resize`,a),e.anchor.isConnected&&e.anchor.focus()}},[e.anchor]),(0,gP.createPortal)((0,h.jsx)(`div`,{ref:t,className:`nav-theme nav-popover`,role:`dialog`,"aria-label":e.label,style:r,onKeyDown:t=>{if(t.key===`Escape`&&(t.preventDefault(),t.stopPropagation(),e.onClose()),t.key===`Tab`){e.onClose();return}if(t.key!==`ArrowDown`&&t.key!==`ArrowUp`)return;t.preventDefault();let n=[...t.currentTarget.querySelectorAll(`button:not(:disabled), a`)];n[(n.indexOf(document.activeElement)+(t.key===`ArrowDown`?1:-1)+n.length)%n.length]?.focus()},children:e.children}),e.anchor.closest(`dialog`)??document.body)}var aI=e=>e.split(/[\\/]/).filter(Boolean).at(-1)??e;function oI({image:e}){let{currentSessionId:t,phase:n}=hM(),[r,i]=(0,m.useState)(``),[a,o]=(0,m.useState)(``),[s,c]=(0,m.useState)(!1),[l,u]=(0,m.useState)(0),d=(0,m.useRef)(null);return(0,m.useEffect)(()=>{if(!t)return;i(``);let r=!1,a=``,s=!1,c=new IntersectionObserver(c=>{!s&&c.some(e=>e.isIntersecting)&&n===`ready`&&(s=!0,SM.image(e.entryId,e.contentIndex,t).then(e=>{r||(a=URL.createObjectURL(new Blob([e.bytes],{type:e.mimeType})),i(a),o(``))}).catch(()=>{r||o(`图片加载失败,点击重试`)}))});return d.current&&c.observe(d.current),()=>{r=!0,c.disconnect(),a&&URL.revokeObjectURL(a)}},[t,n,e.entryId,e.contentIndex,l]),(0,h.jsxs)(`div`,{ref:d,className:`max-w-full`,children:[(0,h.jsx)(`button`,{type:`button`,"aria-label":`查看图片 ${e.name}`,className:`focus-neko max-w-full rounded-xl border border-sakura-200 p-1`,onClick:()=>{a?(o(``),u(l+1)):r&&c(!0)},children:r?(0,h.jsx)(`img`,{src:r,alt:e.name,className:`max-h-40 max-w-full rounded-lg object-contain`}):(0,h.jsx)(`span`,{className:`text-sm`,children:a||`加载图片…`})}),s&&r&&(0,h.jsxs)(rI,{title:e.name,onClose:()=>c(!1),children:[(0,h.jsx)(`div`,{className:`min-h-0 overflow-auto bg-surface p-3 sm:p-4`,children:(0,h.jsx)(`img`,{src:r,alt:e.name,className:`max-h-[65dvh] w-full rounded-lg object-contain`})}),(0,h.jsx)(`div`,{className:`flex shrink-0 justify-end border-t border-sakura-200 bg-surface px-4 py-3`,children:(0,h.jsxs)(`a`,{href:r,download:e.name,className:`btn-primary focus-neko inline-flex min-h-10 items-center gap-2 rounded-full px-5 py-2 text-sm font-medium no-underline`,children:[(0,h.jsx)(`svg`,{"aria-hidden":`true`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,children:(0,h.jsx)(`path`,{d:`M12 3v12m-5-5 5 5 5-5M4 16v4h16v-4`})}),`保存图片`]})})]})]})}function sI({images:e}){return(0,h.jsx)(`div`,{className:`my-2 flex flex-wrap gap-2`,children:e.map(e=>(0,h.jsx)(oI,{image:e},`${e.entryId}:${e.contentIndex}`))})}function cI(e,t){this.v=e,this.k=t}function lI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function uI(e){if(Array.isArray(e))return e}function dI(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function fI(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
19
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pI(e,t){return uI(e)||dI(e,t)||mI(e,t)||fI()}function mI(e,t){if(e){if(typeof e==`string`)return lI(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lI(e,t):void 0}}function hI(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof cI;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}hI.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},hI.prototype.next=function(e){return this._invoke(`next`,e)},hI.prototype.throw=function(e){return this._invoke(`throw`,e)},hI.prototype.return=function(e){return this._invoke(`return`,e)};var gI=Object.entries,_I=Object.setPrototypeOf,vI=Object.isFrozen,yI=Object.getPrototypeOf,bI=Object.getOwnPropertyDescriptor,xI=Object.freeze,SI=Object.seal,CI=Object.create,wI=typeof Reflect<`u`&&Reflect,TI=wI.apply,EI=wI.construct;xI||=function(e){return e},SI||=function(e){return e},TI||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},EI||=function(e){return new e(...[...arguments].slice(1))};var DI=qI(Array.prototype.forEach);Array.prototype.indexOf;var OI=qI(Array.prototype.lastIndexOf),kI=qI(Array.prototype.pop),AI=qI(Array.prototype.push);Array.prototype.slice;var jI=qI(Array.prototype.splice),MI=Array.isArray,NI=qI(String.prototype.toLowerCase),PI=qI(String.prototype.toString),FI=qI(String.prototype.match),II=qI(String.prototype.replace),LI=qI(String.prototype.indexOf),RI=qI(String.prototype.trim),zI=qI(Number.prototype.toString),BI=qI(Boolean.prototype.toString),VI=typeof BigInt>`u`?null:qI(BigInt.prototype.toString),HI=typeof Symbol>`u`?null:qI(Symbol.prototype.toString),UI=qI(Object.prototype.hasOwnProperty),WI=qI(Object.prototype.toString),GI=qI(RegExp.prototype.test),KI=JI(TypeError);function qI(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return TI(e,t,n)}}function JI(e){return function(){return EI(e,[...arguments])}}function YI(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NI;if(_I&&_I(e,null),!MI(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(vI(t)||(t[r]=e),i=e)}e[i]=!0}return e}function XI(e){for(let t=0;t<e.length;t++)UI(e,t)||(e[t]=null);return e}function ZI(e){let t=CI(null);for(let r of gI(e)){var n=pI(r,2);let i=n[0],a=n[1];UI(e,i)&&(t[i]=MI(a)?XI(a):a&&typeof a==`object`&&a.constructor===Object?ZI(a):a)}return t}function QI(e){switch(typeof e){case`string`:return e;case`number`:return zI(e);case`boolean`:return BI(e);case`bigint`:return VI?VI(e):`0`;case`symbol`:return HI?HI(e):`Symbol()`;case`undefined`:return WI(e);case`function`:case`object`:{if(e===null)return WI(e);let t=e,n=$I(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:WI(e)}return WI(e)}default:return WI(e)}}function $I(e,t){for(;e!==null;){let n=bI(e,t);if(n){if(n.get)return qI(n.get);if(typeof n.value==`function`)return qI(n.value)}e=yI(e)}function n(){return null}return n}function eL(e){try{return GI(e,``),!0}catch{return!1}}var tL=xI(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),nL=xI(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),rL=xI([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),iL=xI([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),aL=xI(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),oL=xI([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),sL=xI([`#text`]),cL=xI(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),lL=xI(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),uL=xI(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),dL=xI([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),fL=SI(/{{[\w\W]*|^[\w\W]*}}/g),pL=SI(/<%[\w\W]*|^[\w\W]*%>/g),mL=SI(/\${[\w\W]*/g),hL=SI(/^data-[\-\w.\u00B7-\uFFFF]+$/),gL=SI(/^aria-[\-\w]+$/),_L=SI(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vL=SI(/^(?:\w+script|data):/i),yL=SI(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),bL=SI(/^html$/i),xL=SI(/^[a-z][.\w]*(-[.\w]+)+$/i),SL=SI(/<[/\w!]/g),CL=SI(/<[/\w]/g),wL=SI(/<\/no(script|embed|frames)/i),TL=SI(/\/>/i),EL={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},DL=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],OL=xI(YI({},DL)),kL=function(){let e={};return DI(DL,t=>{e[t]=SI(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),xI(e)}(),AL=function(){return typeof window>`u`?null:window},jL=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},ML=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},NL=function(e,t,n,r){return UI(e,t)&&MI(e[t])?YI(r.base?ZI(r.base):{},e[t],r.transform):n},PL=function(e,t,n){let r=UI(e,t)?e[t]:void 0;return r&&typeof r==`object`?ZI(r):n()};function FL(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:AL(),t=e=>FL(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==EL.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=$I(d,`cloneNode`),p=$I(d,`remove`),m=$I(d,`removeAttributeNode`),h=$I(d,`nextSibling`),g=$I(d,`childNodes`),_=$I(d,`parentNode`),v=$I(d,`shadowRoot`),y=$I(d,`attributes`),b=o&&o.prototype?$I(o.prototype,`nodeType`):null,x=o&&o.prototype?$I(o.prototype,`nodeName`):null,S=o&&o.prototype?$I(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,ee=``,E,D=!1,O=0,k=function(){if(O>0)throw KI(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},A=function(e){k(),O++;try{return T.createHTML(e)}finally{O--}},j=function(e){k(),O++;try{return T.createScriptURL(e)}finally{O--}},te=function(){return D||=(E=jL(u,i),!0),E},M=n,ne=M.implementation,re=M.createNodeIterator,ie=M.createDocumentFragment,ae=M.getElementsByTagName,oe=r.importNode,se=ML();t.isSupported=typeof gI==`function`&&typeof _==`function`&&ne&&ne.createHTMLDocument!==void 0;let ce=fL,le=pL,ue=mL,de=hL,fe=gL,pe=vL,me=yL,he=xL,N=_L,P=null,ge=YI({},[...tL,...nL,...rL,...aL,...sL]),_e=null,ve=YI({},[...cL,...lL,...uL,...dL]),ye=Object.seal(CI(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),be=null,xe=null,Se=Object.seal(CI(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ce=!0,we=!0,Te=!1,Ee=!0,De=!1,Oe=!0,ke=!1,Ae=!1,je=null,Me=null,Ne=!1,Pe=!1,Fe=!1,Ie=!1,Le=!0,Re=!1,ze=`user-content-`,Be=!0,Ve=!1,He={},Ue=null,We=YI({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ge=null,Ke=YI({},[`audio`,`video`,`img`,`source`,`image`,`track`]),qe=null,Je=YI({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ye=`http://www.w3.org/1998/Math/MathML`,Xe=`http://www.w3.org/2000/svg`,Ze=`http://www.w3.org/1999/xhtml`,Qe=Ze,$e=!1,et=null,tt=YI({},[Ye,Xe,Ze],PI),nt=xI([`mi`,`mo`,`mn`,`ms`,`mtext`]),rt=YI({},nt),it=xI([`annotation-xml`]),at=YI({},it),ot=YI({},[`title`,`style`,`font`,`a`,`script`]),st=null,ct=[`application/xhtml+xml`,`text/html`],lt=null,ut=null,dt=n.createElement(`form`),ft=function(e){return e instanceof RegExp||e instanceof Function},pt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ut&&ut===e)return;(!e||typeof e!=`object`)&&(e={}),e=ZI(e),st=ct.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,lt=st===`application/xhtml+xml`?PI:NI,P=NL(e,`ALLOWED_TAGS`,ge,{transform:lt}),_e=NL(e,`ALLOWED_ATTR`,ve,{transform:lt}),et=NL(e,`ALLOWED_NAMESPACES`,tt,{transform:PI}),qe=NL(e,`ADD_URI_SAFE_ATTR`,Je,{transform:lt,base:Je}),Ge=NL(e,`ADD_DATA_URI_TAGS`,Ke,{transform:lt,base:Ke}),Ue=NL(e,`FORBID_CONTENTS`,We,{transform:lt}),be=NL(e,`FORBID_TAGS`,ZI({}),{transform:lt}),xe=NL(e,`FORBID_ATTR`,ZI({}),{transform:lt}),He=UI(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?ZI(e.USE_PROFILES):e.USE_PROFILES:!1,Ce=e.ALLOW_ARIA_ATTR!==!1,we=e.ALLOW_DATA_ATTR!==!1,Te=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ee=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,De=e.SAFE_FOR_TEMPLATES||!1,Oe=e.SAFE_FOR_XML!==!1,ke=e.WHOLE_DOCUMENT||!1,Pe=e.RETURN_DOM||!1,Fe=e.RETURN_DOM_FRAGMENT||!1,Ie=e.RETURN_TRUSTED_TYPE||!1,Ne=e.FORCE_BODY||!1,Le=e.SANITIZE_DOM!==!1,Re=e.SANITIZE_NAMED_PROPS||!1,Be=e.KEEP_CONTENT!==!1,Ve=e.IN_PLACE||!1,N=eL(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:_L,Qe=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ze,rt=PL(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>YI({},nt)),at=PL(e,`HTML_INTEGRATION_POINTS`,()=>YI({},it));let t=PL(e,`CUSTOM_ELEMENT_HANDLING`,()=>CI(null));if(ye=CI(null),UI(t,`tagNameCheck`)&&ft(t.tagNameCheck)&&(ye.tagNameCheck=t.tagNameCheck),UI(t,`attributeNameCheck`)&&ft(t.attributeNameCheck)&&(ye.attributeNameCheck=t.attributeNameCheck),UI(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(ye.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),SI(ye),De&&(we=!1),Fe&&(Pe=!0),He&&(P=YI({},sL),_e=CI(null),He.html===!0&&(YI(P,tL),YI(_e,cL)),He.svg===!0&&(YI(P,nL),YI(_e,lL),YI(_e,dL)),He.svgFilters===!0&&(YI(P,rL),YI(_e,lL),YI(_e,dL)),He.mathMl===!0&&(YI(P,aL),YI(_e,uL),YI(_e,dL))),Se.tagCheck=null,Se.attributeCheck=null,UI(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Se.tagCheck=e.ADD_TAGS:MI(e.ADD_TAGS)&&(P===ge&&(P=ZI(P)),YI(P,e.ADD_TAGS,lt))),UI(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Se.attributeCheck=e.ADD_ATTR:MI(e.ADD_ATTR)&&(_e===ve&&(_e=ZI(_e)),YI(_e,e.ADD_ATTR,lt))),UI(e,`ADD_FORBID_CONTENTS`)&&MI(e.ADD_FORBID_CONTENTS)&&(Ue===We&&(Ue=ZI(Ue)),YI(Ue,e.ADD_FORBID_CONTENTS,lt)),Be&&(P[`#text`]=!0),ke&&YI(P,[`html`,`head`,`body`]),P.table&&(YI(P,[`tbody`]),delete be.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw KI(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw KI(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{ee=A(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,ee=``):(T===void 0&&(T=te()),T&&typeof ee==`string`&&(ee=A(``)));xI&&xI(e),ut=e},mt=YI({},[...nL,...rL,...iL]),ht=YI({},[...aL,...oL]),gt=function(e,t,n){return t.namespaceURI===Ze?e===`svg`:t.namespaceURI===Ye?e===`svg`&&(n===`annotation-xml`||rt[n]):!!mt[e]},_t=function(e,t,n){return t.namespaceURI===Ze?e===`math`:t.namespaceURI===Xe?e===`math`&&at[n]:!!ht[e]},vt=function(e,t,n){return t.namespaceURI===Xe&&!at[n]||t.namespaceURI===Ye&&!rt[n]?!1:!ht[e]&&(ot[e]||!mt[e])},yt=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:Qe,tagName:`template`});let n=NI(e.tagName),r=NI(t.tagName);return et[e.namespaceURI]?e.namespaceURI===Xe?gt(n,t,r):e.namespaceURI===Ye?_t(n,t,r):e.namespaceURI===Ze?vt(n,t,r):!!(st===`application/xhtml+xml`&&et[e.namespaceURI]):!1},bt=function(e){AI(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw KI(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},xt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},St=function(e){Tt(e);let t=g(e);if(t){let e=[];DI(t,t=>{AI(e,t)}),DI(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&xt(e,r,i)}},Ct=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}AI(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Pe||Fe)try{bt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},wt=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||_e[lt(i)]||xt(e,r,i)}},Tt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===EL.element&&wt(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},Et=function(e,t){return Oe?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Dt=function(e){if(!Oe)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===EL.processingInstruction||n===EL.comment&&GI(CL,e.data)){try{p(e)}catch{}continue}if(n===EL.element){let t=e,n=lt(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Et(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Ot=function(e){let t=null,r=null;if(Ne)e=`<remove></remove>`+e;else{let t=FI(e,/^[\r\n\t ]+/);r=t&&t[0]}st===`application/xhtml+xml`&&Qe===Ze&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?A(e):e;if(Qe===Ze)try{t=new l().parseFromString(i,st)}catch{}if(!t||!t.documentElement){t=ne.createDocument(Qe,`template`,null);try{t.documentElement.innerHTML=$e?ee:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Qe===Ze?ae.call(t,ke?`html`:`body`)[0]:ke?t.documentElement:a},kt=function(e){let t=S?S(e):e.ownerDocument;return re.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},At=function(e){return e=II(e,ce,` `),e=II(e,le,` `),e=II(e,ue,` `),e},jt=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=re.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=At(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&DI(i,e=>{Nt(e.content)&&jt(e.content)})},Mt=function(e){let t=x?x(e):null;return typeof t!=`string`||lt(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Nt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===EL.documentFragment}catch{return!1}},Pt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Ft(e,n,r){e.length!==0&&DI(e,e=>{e.call(t,n,r,ut)})}let It=function(e,t){return!!(Oe&&e.hasChildNodes()&&!Pt(e.firstElementChild)&&GI(SL,e.textContent)&&GI(SL,e.innerHTML)||Oe&&e.namespaceURI===Ze&&OL[t]&&(Pt(e.firstElementChild)||typeof e.textContent==`string`&&GI(kL[t],e.textContent))||e.nodeType===EL.processingInstruction||Oe&&e.nodeType===EL.comment&&GI(CL,e.data))},Lt=function(e,t){return e instanceof RegExp?GI(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Rt=function(e,t,n){if(!be[t]&&Wt(t)&&Lt(ye.tagNameCheck,t))return!1;if(Be&&!Ue[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return bt(e),!0},zt=function(e,t,n,r){return e.length===0?t:t===n||t===r?ZI(t):t},Bt=function(e,t){return e===t||_(e)!==null?!1:(Ve&&Tt(e),!0)},Vt=function(e,n){if(Ft(se.beforeSanitizeElements,e,null),Bt(e,n))return!0;if(Mt(e))return bt(e),!0;let r=lt(w(e));if(P=zt(se.uponSanitizeElement,P,ge,je),Ft(se.uponSanitizeElement,e,{tagName:r,allowedTags:P}),Bt(e,n))return!0;if(It(e,r))return bt(e),!0;if(be[r]||!(Se.tagCheck instanceof Function&&Se.tagCheck(r))&&!P[r]){let t=Rt(e,r,n);return t===!1&&(Ft(se.afterSanitizeElements,e,null),Bt(e,n))?!0:t}if(C(e)===EL.element&&!yt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&GI(wL,e.innerHTML))return bt(e),!0;if(De&&e.nodeType===EL.text){let n=At(e.textContent);e.textContent!==n&&(AI(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Ft(se.afterSanitizeElements,e,null),Bt(e,n)},Ht=function(e,t,r){if(xe[t]||Et(t,e)||Le&&(t===`id`||t===`name`)&&(r in n||r in dt))return!1;let i=_e[t]||Se.attributeCheck instanceof Function&&Se.attributeCheck(t,e);return we&&GI(de,t)||Ce&&GI(fe,t)?!0:i?qe[t]||GI(N,II(r,me,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&LI(r,`data:`)===0&&Ge[e]||Te&&!GI(pe,II(r,me,``))?!0:!r:Wt(e)&&Lt(ye.tagNameCheck,e)&&Lt(ye.attributeNameCheck,t,e)||t===`is`&&ye.allowCustomizedBuiltInElements&&Lt(ye.tagNameCheck,r)},Ut=YI({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Wt=function(e){return!Ut[NI(e)]&&GI(he,e)},Gt=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return A(r);case`TrustedScriptURL`:return j(r)}return r},Kt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Mt(e)||(bt(e),!1)}catch{return Ct(t,e),!1}},qt=function(e,n){if(Ft(se.beforeSanitizeAttributes,e,null),Bt(e,n))return;let r=e.attributes;if(!r||Mt(e))return;_e=zt(se.uponSanitizeAttribute,_e,ve,Me);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:_e,forceKeepAttr:void 0},a=r.length,o=lt(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=lt(s),d=l,f=s===`value`?d:RI(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Ft(se.uponSanitizeAttribute,e,i),f=i.attrValue,Re&&(u===`id`||u===`name`)&&LI(f,ze)!==0&&(Ct(s,e,n),f=ze+f,p=!0),Oe&&GI(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)||u===`attributename`&&FI(f,`href`)?Ct(s,e,n):i.forceKeepAttr||(i.keepAttr?!Ee&&GI(TL,f)?Ct(s,e,n):(De&&(f=At(f)),Ht(o,u,f)?(f=Gt(o,u,c,f),f!==d&&Kt(e,s,c,f)&&p&&kI(t.removed)):Ct(s,e,n)):Ct(s,e,n))}Ft(se.afterSanitizeAttributes,e,null),Bt(e,n)},Jt=function(e){let t=null,n=kt(e);for(Ft(se.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Ft(se.uponSanitizeShadowNode,t,null),Vt(t,e),qt(t,e),Nt(t.content)&&Jt(t.content),C(t)===EL.element){let e=v(t);Nt(e)&&(Yt(e),Jt(e))}Ft(se.afterSanitizeShadowDOM,e,null)},Yt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Jt(e.shadow);continue}let n=e.node,r=C(n)===EL.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&<(e)===`template`){let e=n.content;Nt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Nt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if($e=!e,$e&&(e=`<!-->`),typeof e!=`string`&&!Pt(e)&&(e=QI(e),typeof e!=`string`))throw KI(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ae?(P=je,_e=Me):pt(n),(se.uponSanitizeElement.length>0||se.uponSanitizeAttribute.length>0)&&(P=ZI(P)),se.uponSanitizeAttribute.length>0&&(_e=ZI(_e)),t.removed=[];let c=Ve&&typeof e!=`string`&&Pt(e);if(c){Dt(e);let t=w(e);if(typeof t==`string`){let n=lt(t);if(!P[n]||be[n])throw St(e),KI(`root node is forbidden and cannot be sanitized in-place`)}if(Mt(e))throw St(e),KI(`root node is clobbered and cannot be sanitized in-place`);try{Yt(e)}catch(t){throw St(e),t}}else if(Pt(e))i=Ot(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===EL.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Yt(i);else{if(!Pe&&!De&&!ke&&e.indexOf(`<`)===-1)return T&&Ie?A(e):e;if(i=Ot(e),!i)return Pe?null:Ie?ee:``}i&&Ne&&bt(i.firstChild);let l=c?e:i;try{let e=kt(l);for(;o=e.nextNode();)Vt(o,l),qt(o,l),Nt(o.content)&&Jt(o.content)}catch(n){throw c&&(St(e),DI(t.removed,e=>{e.element&&Tt(e.element)})),n}if(c){let n=!1;if(DI(t.removed,t=>{t.element&&(t.element===e&&(n=!0),Tt(t.element))}),n)throw KI(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return De&&jt(e),e}if(Pe){if(De&&jt(i),Fe)for(s=ie.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(_e.shadowroot||_e.shadowrootmode)&&(s=oe.call(r,s,!0)),s}let u=ke?i.outerHTML:i.innerHTML;return ke&&P[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&GI(bL,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
20
|
-
`+u),De&&(u=At(u)),T&&Ie?A(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};pt(e),Ae=!0,je=P,Me=_e},t.clearConfig=function(){ut=null,Ae=!1,je=null,Me=null,T=E,ee=``},t.isValidAttribute=function(e,t,n){ut||pt({});let r=lt(e),i=lt(t);return Ht(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&UI(se,e)&&AI(se[e],t)},t.removeHook=function(e,t){if(UI(se,e)){if(t!==void 0){let n=OI(se[e],t);return n===-1?void 0:jI(se[e],n,1)[0]}return kI(se[e])}},t.removeHooks=function(e){UI(se,e)&&(se[e]=[])},t.removeAllHooks=function(){se=ML()},t}var IL=FL();function LL(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var RL=LL();function zL(e){RL=e}var BL={exec:()=>null};function VL(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function $(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(UL.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var HL=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),UL={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:VL(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:VL(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:VL(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:VL(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:VL(e=>RegExp(`^ {0,${e}}(?:</?(?:${iR})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:VL(e=>RegExp(`^ {0,${e}}>`))},WL=/^(?:[ \t]*(?:\n|$))+/,GL=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,KL=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,qL=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,JL=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,YL=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,XL=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ZL=$(XL).replace(/bull/g,YL).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),QL=$(XL).replace(/bull/g,YL).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),$L=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,eR=/^[^\n]+/,tR=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,nR=$(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,tR).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),rR=$(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,YL).getRegex(),iR=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,aR=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,oR=$(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,aR).replace(`tag`,iR).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),sR=e=>$($L).replace(`hr`,qL).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,iR).getRegex(),cR=sR(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),lR=sR(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),uR={blockquote:$(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,lR).getRegex(),code:GL,def:nR,fences:KL,heading:JL,hr:qL,html:oR,lheading:ZL,list:rR,newline:WL,paragraph:cR,table:BL,text:eR},dR=$(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,qL).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,iR).getRegex(),fR={...uR,lheading:QL,table:dR,paragraph:$($L).replace(`hr`,qL).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,dR).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,iR).getRegex()},pR={...uR,html:$(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,aR).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:BL,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$($L).replace(`hr`,qL).replace(`heading`,` *#{1,6} *[^
|
|
21
|
-
]`).replace(`lheading`,ZL).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},mR=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hR=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,gR=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,_R=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,vR=/[\p{P}\p{S}]/u,yR=/[\s\p{P}\p{S}]/u,bR=/[^\s\p{P}\p{S}]/u,xR=$(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,yR).getRegex(),SR=/[\p{Pi}\p{Ps}"']/u,CR=/(?!~)[\p{P}\p{S}]/u,wR=/(?!~)[\s\p{P}\p{S}]/u,TR=/(?:[^\s\p{P}\p{S}]|~)/u,ER=$(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,HL?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),DR=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,OR=$(DR,`u`).replace(/punct/g,vR).getRegex(),kR=$(DR,`u`).replace(/punct/g,CR).getRegex(),AR=$(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,SR).replace(/punct/g,vR).getRegex(),jR=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,MR=$(jR,`gu`).replace(/notPunctSpace/g,bR).replace(/punctSpace/g,yR).replace(/punct/g,vR).getRegex(),NR=$(jR,`gu`).replace(/notPunctSpace/g,TR).replace(/punctSpace/g,wR).replace(/punct/g,CR).getRegex(),PR=$(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,bR).replace(/punctSpace/g,yR).replace(/punct/g,vR).getRegex(),FR=$(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,bR).replace(/punctSpace/g,yR).replace(/punct/g,vR).getRegex(),IR=$(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,bR).replace(/punctSpace/g,yR).replace(/punct/g,vR).getRegex(),LR=$(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,vR).getRegex(),RR=$(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,bR).replace(/punctSpace/g,yR).replace(/punct/g,vR).getRegex(),zR=$(/\\(punct)/,`gu`).replace(/punct/g,vR).getRegex(),BR=$(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),VR=$(aR).replace(`(?:-->|$)`,`-->`).getRegex(),HR=$(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,VR).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),UR=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,WR=$(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,UR).getRegex(),GR=$(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,WR).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),KR=$(/^!?\[(label)\]\[(ref)\]/).replace(`label`,WR).replace(`ref`,tR).getRegex(),qR=$(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,tR).getRegex(),JR=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,YR=$(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,UR).getRegex(),XR=$(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,$(/^!?\[(label)\]\[(ref)\]/).replace(`label`,YR).replace(`ref`,JR).getRegex()).replace(`nolink`,$(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,JR).getRegex()).getRegex(),ZR=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,QR=$(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),$R={_backpedal:BL,anyPunctuation:zR,autolink:BR,blockSkip:ER,br:gR,code:hR,del:BL,delLDelim:BL,delRDelim:BL,emStrongLDelim:OR,emStrongRDelimAst:MR,emStrongRDelimUnd:FR,escape:mR,link:GR,nolink:qR,punctuation:xR,reflink:KR,reflinkSearch:XR,tag:HR,text:_R,url:BL},ez={...$R,emStrongLDelim:AR,emStrongRDelimAst:PR,emStrongRDelimUnd:IR,link:$(/^!?\[(label)\]\((.*?)\)/).replace(`label`,WR).getRegex(),reflink:$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,WR).getRegex()},tz={...$R,emStrongRDelimAst:NR,emStrongLDelim:kR,delLDelim:LR,delRDelim:RR,url:$(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,QR).replace(`protocol`,ZR).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:$(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,ZR).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},nz={...tz,br:$(gR).replace(`{2,}`,`*`).getRegex(),text:$(tz.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},rz={normal:uR,gfm:fR,pedantic:pR},iz={normal:$R,gfm:tz,breaks:nz,pedantic:ez},az={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},oz=e=>az[e];function sz(e,t){if(t){if(UL.escapeTest.test(e))return e.replace(UL.escapeReplace,oz)}else if(UL.escapeTestNoEncode.test(e))return e.replace(UL.escapeReplaceNoEncode,oz);return e}function cz(e){return e.replace(UL.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function lz(e){try{e=encodeURI(e).replace(UL.percentDecode,`%`)}catch{return null}return e}function uz(e,t){let n=e.replace(UL.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(UL.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(UL.slashPipe,`|`);return n}function dz(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function fz(e){let t=e.split(`
|
|
22
|
-
`),n=t.length-1;for(;n>=0&&UL.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
23
|
-
`)}function pz(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function mz(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function hz(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function gz(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function _z(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
24
|
-
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
|
|
25
|
-
`)}function vz(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var yz=class{options;rules;lexer;constructor(e){this.options=e||RL}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:fz(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=_z(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=dz(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:dz(t[0],`
|
|
26
|
-
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:dz(t[0],`
|
|
27
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=dz(t[0],`
|
|
28
|
-
`).split(`
|
|
29
|
-
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
30
|
-
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
31
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
32
|
-
${s}`:s,r=r?`${r}
|
|
33
|
-
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
|
|
34
|
-
`),o=t.raw+`
|
|
35
|
-
`+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
|
|
36
|
-
`).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n}
|
|
37
|
-
${d.join(`
|
|
38
|
-
`)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
39
|
-
`+e.join(`
|
|
40
|
-
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
41
|
-
`)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
|
|
42
|
-
`,1)[0],l=t[1].length,u=this.options.pedantic?hz(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>hz(e,l)),d=e.split(`
|
|
43
|
-
`,1)[0],f=!u.trim(),p=0;if(this.options.pedantic?(p=2,s=u.trimStart()):f?p=l+1:(p=u.search(this.rules.other.nonSpaceChar),p=p>4?1:p,s=u.slice(p),p+=l),f&&this.rules.other.blankLine.test(d)&&(r+=d+`
|
|
44
|
-
`,e=e.substring(d.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),a=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p),c=this.rules.other.blockquoteBeginRegex(p);for(;e;){let l=e.split(`
|
|
45
|
-
`,1)[0],m;if(d=l,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting,` `),m=d):m=d.replace(this.rules.other.leadingSpaceTab,e=>e.replace(this.rules.other.tabCharGlobal,` `)),i.test(d)||a.test(d)||o.test(d)||c.test(d)||t.test(d)||n.test(d))break;if(m.search(this.rules.other.nonSpaceChar)>=p||!d.trim())s+=`
|
|
46
|
-
`+m.slice(p);else{if(f||u.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(u)||a.test(u)||n.test(u))break;s+=`
|
|
47
|
-
`+d}f=!d.trim(),r+=l+`
|
|
48
|
-
`,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=fz(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&mz(t[2],`()`)!==-1)return;let e=pz(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:dz(t[0],`
|
|
49
|
-
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=uz(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
50
|
-
`):[],a={type:`table`,raw:dz(t[0],`
|
|
51
|
-
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(uz(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:dz(t[0],`
|
|
52
|
-
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
53
|
-
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&vz(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=dz(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=mz(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),gz(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&vz(e,n[1],r,this.rules))return;let i=t[pz((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return gz(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:cz(t[0]),escaped:e}}}},bz=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||RL,this.options.tokenizer=this.options.tokenizer||new yz,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:UL,block:rz.normal,inline:iz.normal};this.options.pedantic?(t.block=rz.pedantic,t.inline=iz.pedantic):this.options.gfm&&(t.block=rz.gfm,t.inline=this.options.breaks?iz.breaks:iz.gfm),this.tokenizer.rules=t}static get rules(){return{block:rz,inline:iz}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(UL.carriageReturn,`
|
|
54
|
-
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(UL.tabCharGlobal,` `).replace(UL.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
|
|
55
|
-
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
56
|
-
`)?``:`
|
|
57
|
-
`)+i.raw,n.text+=`
|
|
58
|
-
`+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if((i=this.tokenizer.fences(e))||(i=this.tokenizer.heading(e))||(i=this.tokenizer.hr(e))||(i=this.tokenizer.blockquote(e))||(i=this.tokenizer.list(e))||(i=this.tokenizer.html(e))){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
59
|
-
`)?``:`
|
|
60
|
-
`)+i.raw,n.text+=`
|
|
61
|
-
`+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
|
|
62
|
-
`)?``:`
|
|
63
|
-
`)+i.raw,r.text+=`
|
|
64
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
65
|
-
`)?``:`
|
|
66
|
-
`)+i.raw,n.text+=`
|
|
67
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,pz(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,pz(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if((o=this.tokenizer.emStrong(e,n,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,n,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},xz=class{options;parser;constructor(e){this.options=e||RL}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(UL.notSpaceStart)?.[0],i=e?e.replace(UL.endingNewline,``)+`
|
|
68
|
-
`:``;return r?`<pre><code class="language-`+sz(r)+`">`+(n?i:sz(i,!0))+`</code></pre>
|
|
69
|
-
`:`<pre><code>`+(n?i:sz(i,!0))+`</code></pre>
|
|
70
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
71
|
-
${this.parser.parse(e)}</blockquote>
|
|
72
|
-
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
73
|
-
`}hr(e){return`<hr>
|
|
74
|
-
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
75
|
-
`+r+`</`+i+`>
|
|
76
|
-
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
77
|
-
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
78
|
-
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
79
|
-
<thead>
|
|
80
|
-
`+t+`</thead>
|
|
81
|
-
`+r+`</table>
|
|
82
|
-
`}tablerow({text:e}){return`<tr>
|
|
83
|
-
${e}</tr>
|
|
84
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
85
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${sz(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?sz(n,!0):this.parser.parseInline(r),o=lz(e);if(o===null)return a;e=sz(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+sz(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=lz(e);if(i===null)return sz(n);e=i;let a=`<img src="${sz(e)}" alt="${sz(n)}"`;return t&&(a+=` title="${sz(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:sz(e.text)}},Sz=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},Cz=class e{options;renderer;textRenderer;constructor(e){this.options=e||RL,this.options.renderer=this.options.renderer||new xz,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Sz}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},wz=class{options;block;constructor(e){this.options=e||RL}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?bz.lex:bz.lexInline}provideParser(e=this.block){return e?Cz.parse:Cz.parseInline}},Tz=new class{defaults=LL();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Cz;Renderer=xz;TextRenderer=Sz;Lexer=bz;Tokenizer=yz;Hooks=wz;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new xz(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new yz(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new wz;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=wz.passThroughHooks.has(n)?e=>{if(this.defaults.async&&wz.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return bz.lex(e,t??this.defaults)}parser(e,t){return Cz.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?bz.lex:bz.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?Cz.parse:Cz.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?bz.lex:bz.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?Cz.parse:Cz.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
86
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+sz(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Ez(e,t){return Tz.parse(e,t)}Ez.options=Ez.setOptions=function(e){return Tz.setOptions(e),Ez.defaults=Tz.defaults,zL(Ez.defaults),Ez},Ez.getDefaults=LL,Ez.defaults=RL;function Dz(...e){return Tz.use(...e),Ez.defaults=Tz.defaults,zL(Ez.defaults),Ez}Ez.use=Dz,Ez.walkTokens=function(e,t){return Tz.walkTokens(e,t)},Ez.parseInline=Tz.parseInline,Ez.Parser=Cz,Ez.parser=Cz.parse,Ez.Renderer=xz,Ez.TextRenderer=Sz,Ez.Lexer=bz,Ez.lexer=bz.lex,Ez.Tokenizer=yz,Ez.Hooks=wz,Ez.parse=Ez,Ez.options,Ez.setOptions,Ez.walkTokens,Ez.parseInline,Cz.parse,bz.lex;var Oz=l(o(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=new RegExp(y(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],(e[0]===`(`||/^\(\?[<']/.test(e[0]))&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,ee=`[a-zA-Z_]\\w*`,E=`\\b\\d+(\\.\\d+)?`,D=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,O=`\\b(0b[01]+)`,k=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,A=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},j={begin:`\\\\[\\s\\S]`,relevance:0},te={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[j]},M={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[j]},ne={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},re=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},ie=re(`//`,`$`),ae=re(`/\\*`,`\\*/`),oe=re(`#`,`$`),se=Object.freeze({__proto__:null,APOS_STRING_MODE:te,BACKSLASH_ESCAPE:j,BINARY_NUMBER_MODE:{scope:`number`,begin:O,relevance:0},BINARY_NUMBER_RE:O,COMMENT:re,C_BLOCK_COMMENT_MODE:ae,C_LINE_COMMENT_MODE:ie,C_NUMBER_MODE:{scope:`number`,begin:D,relevance:0},C_NUMBER_RE:D,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:oe,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:E,relevance:0},NUMBER_RE:E,PHRASAL_WORDS_MODE:ne,QUOTE_STRING_MODE:M,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[j,{begin:/\[/,end:/\]/,relevance:0,contains:[j]}]},RE_STARTERS_RE:k,SHEBANG:A,TITLE_MODE:{scope:`title`,begin:T,relevance:0},UNDERSCORE_IDENT_RE:ee,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:ee,relevance:0}});function ce(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function le(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ue(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=ce,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function de(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function fe(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function pe(e,t){e.relevance===void 0&&(e.relevance=1)}var me=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},he=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],N=`keyword`;function P(e,t,n=N){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,P(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,ge(n[0],n[1])]})}}function ge(e,t){return t?Number(t):+!_e(e)}function _e(e){return he.includes(e.toLowerCase())}var ve={},ye=e=>{console.error(e)},be=(e,...t)=>{console.log(`WARN: ${e}`,...t)},xe=(e,t)=>{ve[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),ve[`${e}/${t}`]=!0)},Se=Error();function Ce(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function we(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw ye(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),Se;if(typeof e.beginScope!=`object`||e.beginScope===null)throw ye(`beginScope must be object`),Se;Ce(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function Te(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw ye(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),Se;if(typeof e.endScope!=`object`||e.endScope===null)throw ye(`endScope must be object`),Se;Ce(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function Ee(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function De(e){Ee(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),we(e),Te(e)}function Oe(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[le,fe,De,me].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[ue,de,pe].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=P(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Ae(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function ke(e){return e?e.endsWithParent||ke(e.starts):!1}function Ae(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:ke(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var je=`11.12.0`,Me=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Ne=i,Pe=a,Fe=Symbol(`nomatch`),Ie=7,Le=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=te(n[1]);return t||(be(s.replace(`{}`,n[1])),be(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||te(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(xe(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),xe(`10.7.0`,`Please use highlight(code, options) instead.
|
|
87
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};oe(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,oe(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!k.keywords){j.addText(M);return}let e=0;k.keywordPatternRe.lastIndex=0;let t=k.keywordPatternRe.exec(M),n=``;for(;t;){n+=M.substring(e,t.index);let r=E.case_insensitive?t[0].toLowerCase():t[0],i=u(k,r);if(i){let[e,a]=i;if(j.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Ie&&(ne+=a),e.startsWith(`_`))n+=t[0];else{let n=E.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(M)}n+=M.substring(e),j.addText(n)}function f(){if(M===``)return;let e=null;if(typeof k.subLanguage==`string`){if(!t[k.subLanguage]){j.addText(M);return}e=v(k.subLanguage,M,!0,A[k.subLanguage]),A[k.subLanguage]=e._top}else e=S(M,k.subLanguage.length?k.subLanguage:null);k.relevance>0&&(ne+=e.relevance),j.__addSublanguage(e._emitter,e.language)}function p(){k.subLanguage==null?d():f(),M=``}function m(e,t){e!==``&&(j.startScope(t),j.addText(e),j.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=E.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(M=i,d(),M=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&j.openNode(E.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(M,E.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),M=``):e.beginScope._multi&&(h(e.beginScope,t),M=``)),k=Object.create(e,{parent:{value:k}}),k}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return k.matcher.regexIndex===0?(M+=e[0],1):(ae=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?M+=t:(n.excludeBegin&&(M+=t),p(),!n.returnBegin&&!n.excludeBegin&&(M=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(k,e,r);if(!i)return Fe;let a=k;k.endScope&&k.endScope._wrap?(p(),m(t,k.endScope._wrap)):k.endScope&&k.endScope._multi?(p(),h(k.endScope,e)):a.skip?M+=t:(a.returnEnd||a.excludeEnd||(M+=t),p(),a.excludeEnd&&(M=t));do k.scope&&j.closeNode(),!k.skip&&!k.subLanguage&&(ne+=k.relevance),k=k.parent;while(k!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=k;t!==E;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>j.openNode(e))}let T={};function ee(t,r){let a=r&&r[0];if(M+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(M+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(k.scope||`<unnamed>`)+`"`);throw e.mode=k,e}if(r.type===`end`){let e=C(r);if(e!==Fe)return e}if(r.type===`illegal`&&a===``)return r.index===n.length||(M+=`
|
|
88
|
-
`),1;if(ie>1e5&&ie>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return M+=a,a.length}let E=te(e);if(!E)throw ye(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let D=Oe(E),O=``,k=a||D,A={},j=new l.__emitter(l);w();let M=``,ne=0,re=0,ie=0,ae=!1;try{if(E.__emitTokens)E.__emitTokens(n,j);else{for(k.matcher.considerAll();;){ie++,ae?ae=!1:k.matcher.considerAll(),k.matcher.lastIndex=re;let e=k.matcher.exec(n);if(!e)break;let t=ee(n.substring(re,e.index),e);re=e.index+t}ee(n.substring(re))}return j.finalize(),O=j.toHTML(),{language:e,value:O,relevance:ne,illegal:!1,_emitter:j,_top:k}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Ne(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:re,context:n.slice(re-100,re+100),mode:t.mode,resultSoFar:O},_emitter:j};if(o)return{language:e,value:Ne(n),illegal:!1,relevance:0,errorRaised:t,_emitter:j,_top:k};throw t}}function b(e){let t={value:Ne(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(te).filter(ne).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(te(e.language).supersetOf===t.language)return 1;if(te(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(oe(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Me(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),oe(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Pe(l,e)}let ee=()=>{O(),xe(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function E(){O(),xe(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let D=!1;function O(){function e(){O()}document.readyState===`loading`?(D||window.addEventListener(`DOMContentLoaded`,e,!1),D=!0):document.querySelectorAll(l.cssSelector).forEach(w)}function k(n,r){let i=null;try{i=r(e)}catch(e){if(ye(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)ye(e);else throw e;i=c}i.name||(i.name=n),t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&M(i.aliases,{languageName:n})}function A(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function j(){return Object.keys(t)}function te(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function M(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function ne(e){let t=te(e);return t&&!t.disableAutodetect}function re(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function ie(e){re(e),a.push(e)}function ae(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function oe(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function ce(e){return xe(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),xe(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:O,highlightElement:w,highlightBlock:ce,configure:T,initHighlighting:ee,initHighlightingOnLoad:E,registerLanguage:k,unregisterLanguage:A,listLanguages:j,getLanguage:te,registerAliases:M,autoDetection:ne,inherit:Pe,addPlugin:ie,removePlugin:ae}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=je,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in se)typeof se[e]==`object`&&n(se[e]);return Object.assign(e,se),e},Re=Le({});Re.newInstance=()=>Le({}),t.exports=Re,Re.HighlightJS=Re,Re.default=Re}))()).default;function kz(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}function Az(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}var jz=`[A-Za-z$_][0-9A-Za-z$_]*`,Mz=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),Nz=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],Pz=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),Fz=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Iz=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],Lz=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`self`,`global`],Rz=[].concat(Iz,Pz,Fz);function zz(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=jz,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);((a=o.match(/^\s*=/))||(a=o.match(/^\s+extends\s+/))&&a.index===0)&&t.ignoreMatch()}},s={$pattern:jz,keyword:Mz,literal:Nz,built_in:Rz,"variable.language":Lz},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...Pz,...Fz]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},ee={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function E(e){return t.concat(`(?!`,e.join(`|`),`)`)}let D={match:t.concat(/\b/,E([...Iz,`super`,`import`,`await`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},O={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},A=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(A)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},j,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:A,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},O,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},D,ee,S,k,{match:/\$[(.]/}]}}var Bz={scope:`number`,match:`([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity`,relevance:0};function Vz(e){let t={className:`attr`,begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`,`json5`],keywords:{literal:r},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,Bz,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function Hz(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,r,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Uz(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.lazy.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.aiter.all.anext.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozendict.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.sentinel.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}var Wz=`[A-Za-z$_][0-9A-Za-z$_]*`,Gz=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),Kz=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],qz=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),Jz=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Yz=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],Xz=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`self`,`global`],Zz=[].concat(Yz,qz,Jz);function Qz(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=Wz,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);((a=o.match(/^\s*=/))||(a=o.match(/^\s+extends\s+/))&&a.index===0)&&t.ignoreMatch()}},s={$pattern:Wz,keyword:Gz,literal:Kz,built_in:Zz,"variable.language":Xz},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...qz,...Jz]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},ee={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function E(e){return t.concat(`(?!`,e.join(`|`),`)`)}let D={match:t.concat(/\b/,E([...Yz,`super`,`import`,`await`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},O={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},A=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(A)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},j,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:A,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},O,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},D,ee,S,k,{match:/\$[(.]/}]}}function $z(e){let t=e.regex,n=Qz(e),r=Wz,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:Wz,keyword:Gz.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:Kz,built_in:Zz.concat(i),"variable.language":Xz},l={className:`meta`,begin:`@`+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function eB(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}Oz.registerLanguage(`bash`,kz),Oz.registerLanguage(`diff`,Az),Oz.registerLanguage(`javascript`,zz),Oz.registerLanguage(`json`,Vz),Oz.registerLanguage(`markdown`,Hz),Oz.registerLanguage(`python`,Uz),Oz.registerLanguage(`typescript`,$z),Oz.registerLanguage(`yaml`,eB);var tB={shell:`bash`};function nB(e){if(e===void 0)return!1;let t=tB[e.trim().toLowerCase()]??e.trim().toLowerCase();return t!==``&&Oz.getLanguage(t)!==void 0}function rB(e,t){let n=t===void 0?``:tB[t.trim().toLowerCase()]??t.trim().toLowerCase();if(n!==``&&Oz.getLanguage(n)!==void 0)try{return Oz.highlight(e,{language:n}).value}catch{}return iB(e)}function iB(e){return e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`).replaceAll(`"`,`"`)}Ez.use({renderer:{code({text:e,lang:t}){return`<pre><code class="${nB(t)?`hljs language-${t??``}`:`hljs`}">${rB(e,t)}</code></pre>`}}});function aB({text:e}){let t=(0,m.useMemo)(()=>{let t=Ez.parse(e,{async:!1,gfm:!0,breaks:!0});return IL.sanitize(t,{USE_PROFILES:{html:!0}})},[e]);return(0,h.jsx)(`div`,{className:`md`,dangerouslySetInnerHTML:{__html:t}})}function oB({text:e}){let[t,n]=(0,m.useState)(!1);return e.trim()===``?null:(0,h.jsxs)(`div`,{className:`rounded-xl border border-dashed border-sakura-300 bg-sakura-50/70`,children:[(0,h.jsxs)(`button`,{type:`button`,onClick:()=>{n(!t)},className:`focus-neko flex w-full items-center gap-1.5 px-3 py-1.5 text-left text-xs text-ink-600 italic`,children:[(0,h.jsx)(`span`,{"aria-hidden":!0,children:t?`▾`:`▸`}),`思考过程…`]}),t&&(0,h.jsx)(`div`,{className:`px-3 pb-2 text-[13px] whitespace-pre-wrap text-ink-600 italic`,children:e})]})}var sB={pending:{label:`待执行`,className:`border-ink-200 bg-ink-100 text-ink-600`},running:{label:`运行中`,className:`border-tianyi-300 bg-tianyi-100 text-tianyi-900`},doneOk:{label:`完成`,className:`border-sakura-300 bg-sakura-100 text-sakura-900`},doneError:{label:`失败`,className:`border-sakura-400 bg-sakura-100 text-sakura-900`}};function cB(e){let[t,n]=(0,m.useState)(!1),r=e.phase===`done`?e.isError?sB.doneError:sB.doneOk:sB[e.phase],i=e.phase===`done`&&e.durationMs!==void 0&&e.durationMs!==null?` · ${(e.durationMs/1e3).toFixed(1)}s`:``,a=e.detail!==null||e.output!=null||e.result!=null||e.note!=null;return(0,h.jsxs)(`div`,{className:`overflow-hidden rounded-card border border-tianyi-200 bg-surface shadow-soft`,children:[(0,h.jsxs)(`button`,{type:`button`,onClick:()=>{a&&n(!t)},className:`focus-neko flex w-full items-center gap-2 px-3 py-2 text-left`,children:[(0,h.jsx)(`span`,{"aria-hidden":!0,className:`text-tianyi-500`,children:`⚡`}),(0,h.jsx)(`span`,{className:`font-mono text-[13px] font-semibold text-tianyi-800`,children:e.name}),(0,h.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-ink-600`,children:e.summary}),(0,h.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium ${r.className}`,children:[e.phase===`running`&&(0,h.jsx)(`span`,{className:`size-1.5 animate-pulse-soft rounded-full bg-tianyi-500`}),r.label,i]}),a&&(0,h.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-ink-400`,children:t?`▾`:`▸`})]}),t&&(0,h.jsxs)(`div`,{className:`space-y-2 border-t border-tianyi-100 px-3 py-2`,children:[e.detail!==null&&(0,h.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded-lg bg-ink-50 p-2 font-mono text-xs text-ink-700`,children:e.detail}),e.output!=null&&e.output!==``&&(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`div`,{className:`mb-1 text-xs font-medium text-tianyi-700`,children:`输出`}),(0,h.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded-lg bg-tianyi-50 p-2 font-mono text-xs text-ink-700`,children:e.output})]}),e.result!=null&&e.result!==``&&(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`div`,{className:`mb-1 text-xs font-medium ${e.isError?`text-sakura-800`:`text-ink-600`}`,children:e.isError?`错误输出`:`结果`}),(0,h.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded-lg p-2 font-mono text-xs ${e.isError?`bg-sakura-50 text-sakura-900`:`bg-ink-50 text-ink-700`}`,children:e.result})]}),e.note!=null&&(0,h.jsx)(`div`,{className:`text-xs italic text-ink-500`,children:e.note})]})]})}var lB=48;function uB(){return(0,h.jsxs)(`svg`,{width:`132`,height:`112`,viewBox:`0 0 132 112`,fill:`none`,"aria-hidden":`true`,children:[(0,h.jsx)(`title`,{children:`neko 小猫`}),(0,h.jsx)(`path`,{d:`M30 46 L24 14 L54 30 Z`,fill:`#ffd1da`,stroke:`#ffb7c5`,strokeWidth:`2.5`,strokeLinejoin:`round`}),(0,h.jsx)(`path`,{d:`M102 46 L108 14 L78 30 Z`,fill:`#ffd1da`,stroke:`#ffb7c5`,strokeWidth:`2.5`,strokeLinejoin:`round`}),(0,h.jsx)(`path`,{d:`M32 39 L29 23 L46 32 Z`,fill:`#ffb7c5`,opacity:`0.55`}),(0,h.jsx)(`path`,{d:`M100 39 L103 23 L86 32 Z`,fill:`#ffb7c5`,opacity:`0.55`}),(0,h.jsx)(`ellipse`,{cx:`66`,cy:`66`,rx:`44`,ry:`38`,fill:`#ffffff`,stroke:`#ffd1da`,strokeWidth:`2.5`}),(0,h.jsx)(`circle`,{cx:`50`,cy:`62`,r:`5`,fill:`#00598f`}),(0,h.jsx)(`circle`,{cx:`82`,cy:`62`,r:`5`,fill:`#00598f`}),(0,h.jsx)(`circle`,{cx:`51.8`,cy:`60`,r:`1.6`,fill:`#ffffff`}),(0,h.jsx)(`circle`,{cx:`83.8`,cy:`60`,r:`1.6`,fill:`#ffffff`}),(0,h.jsx)(`ellipse`,{cx:`40`,cy:`74`,rx:`6.5`,ry:`3.6`,fill:`#ffb7c5`,opacity:`0.65`}),(0,h.jsx)(`ellipse`,{cx:`92`,cy:`74`,rx:`6.5`,ry:`3.6`,fill:`#ffb7c5`,opacity:`0.65`}),(0,h.jsx)(`path`,{d:`M62 71 q4 4.5 4 1 q0 -3.5 4 -1`,stroke:`#8b314a`,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`}),(0,h.jsx)(`path`,{d:`M18 64 L32 66 M19 72 L32 70`,stroke:`#ffd1da`,strokeWidth:`2`,strokeLinecap:`round`}),(0,h.jsx)(`path`,{d:`M114 64 L100 66 M113 72 L100 70`,stroke:`#ffd1da`,strokeWidth:`2`,strokeLinecap:`round`})]})}function dB({text:e,images:t}){return(0,h.jsx)(`div`,{className:`chat-row anim-user flex justify-end`,children:(0,h.jsxs)(`div`,{className:`bubble-user max-w-[85%] px-4 py-2.5 text-[15px] whitespace-pre-wrap sm:max-w-[75%]`,children:[e,t&&(0,h.jsx)(sI,{images:t})]})})}function fB({thinking:e,text:t}){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(oB,{text:e}),t.trim()!==``&&(0,h.jsx)(aB,{text:t})]})}function pB({item:e}){return e.text.trim()===``&&e.thinking.trim()===``&&e.note===null?null:(0,h.jsx)(`div`,{className:`chat-row anim-other flex justify-start`,children:(0,h.jsxs)(`div`,{className:`bubble-assistant max-w-[85%] space-y-1.5 px-4 py-2.5 sm:max-w-[75%]`,children:[(0,h.jsx)(fB,{thinking:e.thinking,text:e.text}),e.note!==null&&(0,h.jsxs)(`div`,{className:`text-xs text-sakura-800 italic`,children:[`⚠ `,e.note]})]})})}function mB({text:e}){return(0,h.jsx)(`div`,{className:`chat-row anim-other flex justify-center`,children:(0,h.jsx)(`span`,{className:`rounded-full bg-ink-100 px-3 py-1 text-xs text-ink-600`,children:e})})}function hB({item:e}){return(0,h.jsx)(`div`,{className:`chat-row anim-other flex justify-start`,children:(0,h.jsxs)(`div`,{className:`w-full max-w-[85%] sm:max-w-[75%]`,children:[(0,h.jsx)(cB,{name:e.name,summary:e.summary,detail:e.detail,phase:e.phase,isError:e.isError,output:e.output,result:e.result,durationMs:e.durationMs,note:e.note}),e.images&&(0,h.jsx)(sI,{images:e.images})]})})}function gB({streaming:e,busy:t}){let n=e.text.trim()!==``||e.thinking.trim()!==``;return(0,h.jsxs)(h.Fragment,{children:[n&&(0,h.jsx)(`div`,{className:`chat-row stream-block flex justify-start`,children:(0,h.jsxs)(`div`,{className:`bubble-assistant max-w-[85%] space-y-1.5 px-4 py-2.5 sm:max-w-[75%]`,children:[(0,h.jsx)(fB,{thinking:e.thinking,text:e.text}),t&&(0,h.jsx)(`span`,{className:`stream-caret`,"aria-hidden":!0})]})}),e.toolCalls.map(e=>(0,h.jsx)(`div`,{className:`chat-row anim-other flex justify-start`,children:(0,h.jsx)(`div`,{className:`w-full max-w-[85%] sm:max-w-[75%]`,children:(0,h.jsx)(cB,{name:e.name,summary:e.summary,detail:e.detail,phase:e.phase,output:e.output})})},`st${e.callId}`))]})}function _B({view:e,busy:t}){let n=(0,m.useRef)(null),r=(0,m.useRef)(!0),[i,a]=(0,m.useState)(!1),o=e?.items??[],s=e?.streaming??null,c=e=>{let t=n.current;t!==null&&t.scrollTo({top:t.scrollHeight,behavior:e?`smooth`:`auto`})};return(0,m.useEffect)(()=>{if(!r.current)return;let e=n.current;e!==null&&e.scrollTo({top:e.scrollHeight})}),(0,h.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,h.jsx)(`div`,{ref:n,onScroll:()=>{let e=n.current;if(e===null)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<lB;r.current=t,a(!t)},className:`h-full overflow-y-auto`,children:(0,h.jsxs)(`div`,{className:`mx-auto flex max-w-3xl flex-col gap-3 px-4 py-5`,children:[o.length===0&&s===null&&(0,h.jsxs)(`div`,{className:`mt-[14vh] flex flex-col items-center gap-4 text-center`,children:[(0,h.jsx)(`div`,{className:`welcome-cat`,children:(0,h.jsx)(uB,{})}),(0,h.jsxs)(`div`,{className:`text-4xl font-extrabold tracking-tight`,children:[(0,h.jsx)(`span`,{className:`logo-gradient`,children:`neko`}),(0,h.jsx)(`span`,{className:`text-tianyi-600`,children:`.`}),(0,h.jsx)(`span`,{className:`logo-gradient`,children:`harness`})]}),(0,h.jsx)(`p`,{className:`max-w-sm text-sm text-ink-600`,children:`输入消息开始吧 ✦`})]}),o.map(e=>{switch(e.type){case`user`:return(0,h.jsx)(dB,{text:e.text,images:e.images},e.key);case`assistant`:return(0,h.jsx)(pB,{item:e},e.key);case`tool`:return(0,h.jsx)(hB,{item:e},e.key);case`system`:return(0,h.jsx)(mB,{text:e.text},e.key);default:return null}}),s!==null&&(0,h.jsx)(gB,{streaming:s,busy:t})]})}),i&&(0,h.jsx)(`button`,{type:`button`,onClick:()=>{r.current=!0,a(!1),c(!0)},className:`discrete-in focus-neko absolute bottom-3 left-1/2 -translate-x-1/2 rounded-full border border-sakura-300 bg-surface px-3.5 py-1.5 text-xs font-medium text-sakura-800 shadow-lift hover:bg-sakura-50`,children:`回到底部 ↓`})]})}var vB=Date.now(),yB=new Set,bB,xB=()=>{vB=Date.now();for(let e of yB)e()},SB=e=>(yB.add(e),yB.size===1&&(xB(),bB=setInterval(xB,6e4),window.addEventListener(`focus`,xB)),()=>{yB.delete(e),yB.size||(clearInterval(bB),window.removeEventListener(`focus`,xB))}),CB=()=>(0,m.useSyncExternalStore)(SB,()=>vB);function wB({initialPath:e,onClose:t}){let[n,r]=(0,m.useState)(e),[i,a]=(0,m.useState)(e),[o,s]=(0,m.useState)(``),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(null),[f,p]=(0,m.useState)(!0),[g,_]=(0,m.useState)(!1),[v,y]=(0,m.useState)(``),[b,x]=(0,m.useState)(0),S=(0,m.useRef)(0),C=(0,m.useRef)(null),w=(0,m.useRef)(!1);(0,m.useEffect)(()=>{let e=++S.current;return p(!0),y(``),d(null),SM.browse({path:n,query:o,showHidden:c}).then(t=>{e===S.current&&(d(t),a(e=>e===n?t.path:e),p(!1))},t=>{e===S.current&&(y(String(t)),p(!1))}),()=>{++S.current}},[n,o,c,b]);let T=e=>{C.current?.focus(),r(e),a(e),s(``),x(e=>e+1)},ee=async()=>{if(!u?.next||f)return;let e=++S.current;p(!0),y(``);try{let t=await SM.browse({path:n,query:o,showHidden:c,cursor:u.next});e===S.current&&d({...t,entries:[...u.entries,...t.entries]})}catch(t){e===S.current&&y(String(t))}finally{e===S.current&&p(!1)}},E=async()=>{if(!(!u||f||w.current)){w.current=!0,_(!0),y(``);try{await SM.addWorkspace(u.path),t()}catch(e){y(String(e))}finally{w.current=!1,_(!1)}}},D=(u?.path??n).split(`/`).filter(Boolean);return(0,h.jsxs)(rI,{title:`添加工作区`,onClose:t,locked:g,children:[(0,h.jsxs)(`div`,{className:`nav-picker-controls`,children:[(0,h.jsx)(`p`,{className:`nav-muted`,children:`选择 Harness 所在电脑上的文件夹`}),(0,h.jsxs)(`nav`,{className:`nav-breadcrumbs`,"aria-label":`目录路径`,children:[(0,h.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>T(`/`),children:`/`}),D.map((e,t)=>(0,h.jsxs)(`button`,{type:`button`,disabled:g,onClick:()=>T(`/${D.slice(0,t+1).join(`/`)}`),children:[e,` /`]},D.slice(0,t+1).join(`/`)))]}),(0,h.jsxs)(`form`,{className:`nav-path-form`,onSubmit:e=>{e.preventDefault(),T(i)},children:[(0,h.jsx)(`input`,{ref:C,"aria-label":`完整目录路径`,value:i,disabled:g,onChange:e=>a(e.target.value)}),(0,h.jsx)(`button`,{className:`nav-button`,type:`submit`,disabled:g,children:`前往`})]}),(0,h.jsxs)(`div`,{className:`nav-filter-row`,children:[(0,h.jsx)(`input`,{"aria-label":`筛选文件夹`,placeholder:`筛选文件夹…`,value:o,disabled:g,onChange:e=>s(e.target.value)}),(0,h.jsxs)(`label`,{children:[(0,h.jsx)(`input`,{type:`checkbox`,checked:c,disabled:g,onChange:e=>l(e.target.checked)}),`隐藏目录`]})]})]}),(0,h.jsxs)(`fieldset`,{className:`nav-folder-list`,"aria-label":`文件夹列表`,"aria-busy":f,onKeyDown:e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let t=[...e.currentTarget.querySelectorAll(`button:not(:disabled)`)];t[(t.indexOf(document.activeElement)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()},children:[v&&(0,h.jsxs)(`div`,{role:`alert`,className:`nav-error`,children:[v,(0,h.jsx)(`button`,{type:`button`,className:`nav-button`,disabled:g,onClick:()=>x(e=>e+1),children:`重试`})]}),u?.parent&&(0,h.jsxs)(`button`,{type:`button`,className:`nav-row`,disabled:g||f,onClick:()=>T(u.parent),children:[(0,h.jsx)($F,{name:`up`}),`上级目录`]}),u?.entries.map(e=>(0,h.jsxs)(`button`,{type:`button`,className:`nav-row`,disabled:g||f||!!e.error,title:e.error??e.path,onClick:()=>T(e.path),children:[(0,h.jsx)($F,{name:`folder`}),(0,h.jsx)(`span`,{className:`nav-truncate`,children:e.name}),e.error&&(0,h.jsx)(`span`,{className:`nav-muted`,children:`不可访问`})]},e.path)),f&&(0,h.jsx)(`output`,{className:`nav-empty`,children:`正在读取目录…`}),!f&&u?.entries.length===0&&(0,h.jsx)(`p`,{className:`nav-empty`,children:`没有匹配的子文件夹,可选择当前目录`}),u?.next&&(0,h.jsx)(`button`,{type:`button`,className:`nav-button`,disabled:f||g,onClick:()=>void ee(),children:`加载更多`})]}),(0,h.jsxs)(`div`,{className:`nav-picker-footer`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`strong`,{children:aI(u?.path??n)}),(0,h.jsx)(`p`,{className:`nav-path`,children:u?.path??n})]}),(0,h.jsxs)(`div`,{className:`nav-actions`,children:[(0,h.jsx)(`button`,{type:`button`,className:`nav-button`,disabled:g,onClick:t,children:`取消`}),(0,h.jsx)(`button`,{type:`button`,className:`nav-button nav-primary`,disabled:!u||f||g||!!v,onClick:()=>void E(),children:g?`正在添加…`:`选择文件夹`})]})]})]})}function TB({open:e,onClose:t}){let n=hM(),r=CB(),i=eI(),[a,o]=(0,m.useState)(null),s=n.sessions.find(e=>e.id===a?.id),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(null),[f,p]=(0,m.useState)(``),[g,_]=(0,m.useState)(``),v=n.phase!==`ready`||n.operating,y=cM(n.sessions,n.workspaceRoot).filter(e=>Zj(e,g)),b=e=>{e.then(()=>{i&&t()}).catch(wM)};if(!e)return null;let x=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`div`,{className:`nav-sidebar-top`,children:[(0,h.jsxs)(`div`,{className:`nav-workspace-heading`,children:[(0,h.jsxs)(`button`,{type:`button`,className:`nav-workspace-trigger`,"aria-label":`切换工作区`,"aria-expanded":a!==null&&!a.id,disabled:v,onClick:e=>o({anchor:e.currentTarget}),children:[(0,h.jsx)(`span`,{className:`nav-workspace-mark`,children:(0,h.jsx)($F,{name:`folder`})}),(0,h.jsx)(`span`,{className:`nav-truncate`,children:aI(n.workspaceRoot)||`工作区`}),(0,h.jsx)($F,{name:`chevron`})]}),!i&&(0,h.jsx)(`button`,{type:`button`,className:`nav-icon`,"aria-label":`收起侧栏`,title:`收起侧栏`,onClick:t,children:(0,h.jsx)($F,{name:`panel`})})]}),(0,h.jsxs)(`button`,{type:`button`,className:`nav-row nav-new`,disabled:v,onClick:()=>b(SM.createSession()),children:[(0,h.jsx)($F,{name:`plus`}),`新建会话`]}),(0,h.jsxs)(`div`,{className:`nav-search`,children:[(0,h.jsx)($F,{name:`search`}),(0,h.jsx)(`input`,{"aria-label":`搜索当前工作区会话`,placeholder:`搜索会话…`,value:g,onChange:e=>_(e.target.value)})]})]}),(0,h.jsxs)(`div`,{className:`nav-section-label`,children:[`会话 `,(0,h.jsx)(`span`,{children:y.length})]}),(0,h.jsxs)(`div`,{className:`nav-session-scroll`,children:[(0,h.jsx)(`ul`,{className:`nav-session-list`,children:y.map(e=>(0,h.jsxs)(`li`,{className:`nav-session-row ${e.id===n.currentSessionId?`is-active`:``}`,children:[(0,h.jsxs)(`button`,{type:`button`,className:`nav-row nav-session-select`,disabled:v,"aria-current":e.id===n.currentSessionId?`page`:void 0,"aria-label":`${qj(e,`新会话`)} · ${new Date(Jj(e)).toLocaleString(`zh-CN`)}`,onClick:()=>b(SM.selectSession(e.id)),children:[(0,h.jsx)($F,{name:`chat`}),(0,h.jsxs)(`span`,{className:`nav-session-copy`,children:[(0,h.jsx)(`span`,{className:`nav-truncate`,children:qj(e,`新会话`)}),(0,h.jsxs)(`span`,{className:`nav-session-meta`,children:[(0,h.jsx)(`time`,{dateTime:new Date(Jj(e)).toISOString(),children:Qj(Jj(e),r,`zh`)}),e.status===`running`?` · 运行中`:e.status===`error`?` · 出错`:``]}),(0,h.jsxs)(`span`,{className:`nav-session-tooltip`,role:`tooltip`,children:[qj(e,`新会话`),(0,h.jsx)(`br`,{}),new Date(Jj(e)).toLocaleString(`zh-CN`)]})]})]}),(0,h.jsx)(`button`,{type:`button`,className:`nav-icon nav-row-more`,disabled:v,"aria-label":`${qj(e,`新会话`)}的操作`,title:`会话操作`,onClick:t=>o({anchor:t.currentTarget,id:e.id}),children:(0,h.jsx)($F,{name:`more`})})]},e.id))}),y.length===0&&(0,h.jsx)(`div`,{className:`nav-empty`,children:n.phase===`ready`?g?`没有匹配的会话`:`此工作区暂无会话`:`等待网关连接…`})]}),(0,h.jsxs)(`div`,{className:`nav-sidebar-bottom`,children:[(0,h.jsx)(`span`,{className:`nav-path`,title:n.workspaceRoot,children:n.workspaceRoot}),(0,h.jsxs)(zi,{to:`/settings`,className:`nav-row`,children:[(0,h.jsx)($F,{name:`settings`}),`设置`]})]})]});return(0,h.jsxs)(h.Fragment,{children:[i?(0,h.jsx)(rI,{title:`工作区与会话`,drawer:!0,onClose:t,children:x}):(0,h.jsx)(`aside`,{className:`nav-theme nav-sidebar`,"aria-label":`工作区与会话`,children:x}),a&&(0,h.jsx)(iI,{anchor:a.anchor,label:a.id?`会话操作`:`选择工作区`,onClose:()=>o(null),children:a.id?(0,h.jsxs)(h.Fragment,{children:[s&&(0,h.jsxs)(`div`,{className:`nav-session-details`,children:[(0,h.jsx)(`strong`,{children:qj(s,`新会话`)}),(0,h.jsx)(`small`,{children:new Date(Jj(s)).toLocaleString(`zh-CN`)})]}),(0,h.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{d(a.id),p(``),o(null)},children:[(0,h.jsx)($F,{name:`archive`}),`归档会话`]})]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`div`,{className:`nav-section-label`,children:`工作区`}),(0,h.jsx)(`div`,{className:`nav-workspace-options`,children:n.workspaces.map(e=>(0,h.jsxs)(`button`,{type:`button`,className:`nav-workspace-option ${e.path===n.workspaceRoot?`is-active`:``}`,title:e.path,onClick:()=>{o(null),_(``),b(SM.selectWorkspace(e.path))},children:[(0,h.jsx)($F,{name:`folder`}),(0,h.jsxs)(`span`,{children:[(0,h.jsx)(`strong`,{children:aI(e.path)}),(0,h.jsx)(`small`,{children:e.path})]}),e.path===n.workspaceRoot&&(0,h.jsx)(`span`,{role:`img`,"aria-label":`当前工作区`,children:`✓`})]},e.path))}),(0,h.jsxs)(`button`,{type:`button`,className:`nav-row nav-add-workspace`,onClick:()=>{o(null),l(!0)},children:[(0,h.jsx)($F,{name:`plus`}),`添加工作区`]})]})}),c&&(0,h.jsx)(wB,{initialPath:n.workspaceRoot,onClose:()=>l(!1)}),u&&(0,h.jsx)(rI,{title:`归档会话`,locked:n.operating,onClose:()=>d(null),children:(0,h.jsxs)(`div`,{className:`nav-confirm`,children:[(0,h.jsxs)(`p`,{children:[`归档“`,qj(n.sessions.find(e=>e.id===u)??{title:``,firstPromptPreview:``},`新会话`),`”?会话将从列表中隐藏,工作区和文件仍会保留。`]}),f&&(0,h.jsx)(`p`,{role:`alert`,className:`nav-error`,children:f}),(0,h.jsxs)(`div`,{className:`nav-actions`,children:[(0,h.jsx)(`button`,{type:`button`,className:`nav-button`,disabled:n.operating,onClick:()=>d(null),children:`取消`}),(0,h.jsx)(`button`,{type:`button`,className:`nav-button nav-primary`,disabled:n.operating,onClick:()=>{SM.archiveSession(u).then(()=>d(null)).catch(e=>p(String(e)))},children:`确认归档`})]})]})})]})}function EB(e){let{models:t,currentSessionId:n,view:r,phase:i,operating:a}=hM(),[o,s]=(0,m.useState)(null),c=t.find(t=>t.provider===e.current?.provider&&t.modelId===e.current?.modelId);o&&o.id!==n&&s(null);let l=c?.name??e.fallbackLabel;return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`button`,{type:`button`,disabled:!c||i!==`ready`||a,onClick:()=>n&&s({id:n}),className:`focus-neko min-w-0 truncate rounded-full px-2 py-1 text-left text-xs text-ink-500 hover:bg-sakura-50`,"aria-label":`模型与思考强度:${l} ${r?.agent.thinkingLevel??``}`,children:[l,` · `,r?.agent.thinkingLevel??`off`,` ▾`]}),o&&o.id===n&&c&&(0,h.jsx)(DB,{session:o.id,current:c,level:r?.agent.thinkingLevel??`off`,onClose:()=>s(e=>e===o?null:e)},o.id)]})}function DB(e){let{models:t}=hM(),[n,r]=(0,m.useState)(e.current),[i,a]=(0,m.useState)(e.level),[o,s]=(0,m.useState)(!1),c=(0,m.useRef)(!1),[l,u]=(0,m.useState)(``);async function d(){if(!c.current){c.current=!0,s(!0),u(``);try{await SM.configure({model:{provider:n.provider,modelId:n.modelId},thinkingLevel:i},e.session),e.onClose()}catch{u(`配置失败,请重试。`)}finally{c.current=!1,s(!1)}}}return(0,h.jsx)(rI,{title:`模型与思考强度`,onClose:e.onClose,children:(0,h.jsxs)(`div`,{className:`model-settings space-y-5 p-5`,children:[(0,h.jsx)(`fieldset`,{className:`space-y-2`,"aria-label":`模型`,children:t.map(e=>(0,h.jsxs)(`button`,{type:`button`,disabled:o,"aria-pressed":e===n,onClick:()=>{r(e),a(e.thinkingLevelAdjustments[i])},className:`focus-neko block w-full rounded-xl border px-4 py-3 text-left text-sm ${e===n?`border-sakura-300 bg-sakura-50 text-sakura-800`:`border-sakura-200 bg-surface text-ink-700`}`,children:[e.name,e===n?` ✓`:``,(0,h.jsx)(`span`,{className:`mt-1 block text-xs text-ink-500`,children:e.input.includes(`image`)?`支持图片`:`仅文本`})]},`${e.provider}/${e.modelId}`))}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`p`,{className:`mb-2 text-sm text-ink-600`,children:`思考强度`}),(0,h.jsx)(`fieldset`,{className:`flex flex-wrap gap-2`,"aria-label":`思考强度`,children:n.supportedThinkingLevels.map(e=>(0,h.jsx)(`button`,{type:`button`,disabled:o,"aria-pressed":i===e,onClick:()=>a(e),className:`focus-neko rounded-full border px-4 py-2 text-sm ${e===i?`border-tianyi-300 bg-tianyi-50 text-tianyi-800`:`border-sakura-200`}`,children:e},e))})]}),(0,h.jsx)(`p`,{className:`text-xs text-ink-500`,children:`仅当前会话,从下一次请求生效。`}),l&&(0,h.jsx)(`p`,{role:`alert`,className:`text-sm text-sakura-800`,children:l}),(0,h.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,h.jsx)(`button`,{type:`button`,onClick:e.onClose,className:`focus-neko rounded-full px-4 py-2 text-sm`,children:`取消`}),(0,h.jsx)(`button`,{type:`button`,disabled:o,onClick:()=>void d(),className:`focus-neko rounded-full bg-sakura-100 px-5 py-2 text-sm text-sakura-800`,children:o?`应用中…`:`应用`})]})]})})}function OB(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function kB(e){return`$${e.toFixed(e>=1?2:4)}`}function AB(e){let{view:t}=hM(),n=t?.contextUsage,r=t?.compaction?.latest,i=t?.compaction?.active??[],[,a]=(0,m.useState)(0),o=r&&![`summarizing`,`waiting-to-apply`].includes(r.phase)?r.at+(r.phase===`failed`?1e4:5e3):null;(0,m.useEffect)(()=>{if(o===null||o<=Date.now())return;let e=setTimeout(()=>a(e=>e+1),o-Date.now());return()=>clearTimeout(e)},[o]);let s=i.length?i.some(e=>e.retry)?`压缩重试中`:i.some(e=>e.blocking)?`等待上下文压缩`:`正在压缩上下文`:r&&(o===null||Date.now()<o)?{applied:`上下文已压缩`,nothing:`当前无需压缩`,skipped:`已跳过过期摘要`,cancelled:`压缩已取消`,failed:`压缩失败,可重试`,summarizing:`正在压缩上下文`,"waiting-to-apply":`等待应用压缩摘要`}[r.phase]:null,c=!i.length&&r?.phase===`failed`;return(0,h.jsxs)(`div`,{className:`mx-auto flex w-full max-w-3xl shrink-0 flex-wrap items-center gap-x-2 gap-y-1 px-4 py-2 text-xs text-ink-500`,children:[(0,h.jsx)(`div`,{className:`min-w-0 max-w-48 [&>button]:max-w-full`,children:(0,h.jsx)(EB,{current:e.agentModel,fallbackLabel:e.model})}),(0,h.jsxs)(`div`,{className:`flex min-h-7 min-w-max flex-1 items-center gap-2`,children:[n&&n.window>0&&(0,h.jsxs)(`span`,{className:`shrink-0 rounded-full bg-tianyi-50 px-2 py-1 font-mono ${n.percent!==null&&n.percent>90?`text-sakura-700 font-semibold`:`text-ink-600`}`,title:n.tokens===null?`暂无有效用量;首次回答或压缩后的新回答完成后更新`:`最近一次成功回答的上下文用量:${n.tokens} / ${n.window} tokens;非会话累计用量`,children:[`Ctx `,n.percent===null?`?`:`${n.percent.toFixed(1)}%`,`/`,OB(n.window)]}),(0,h.jsx)(`output`,{"aria-live":`polite`,"aria-atomic":`true`,className:`contents`,children:s&&(0,h.jsx)(`span`,{className:`max-w-full whitespace-nowrap rounded-full border px-2 py-1 ${c?`border-sakura-300 bg-sakura-50 text-sakura-700`:`border-tianyi-200 bg-tianyi-50 text-ink-600`}`,title:r?.phase===`nothing`&&!i.length?`保留近期上下文,暂无可压缩的旧内容;默认保留最近约 20,000 tokens`:void 0,children:s})})]}),(0,h.jsxs)(`div`,{className:`ml-auto flex max-w-full shrink-0 items-center justify-end gap-2`,children:[e.busy&&e.status!==null&&(0,h.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-64 items-center gap-1.5 font-medium text-sakura-700`,title:e.status,children:[(0,h.jsxs)(`span`,{className:`dots shrink-0`,"aria-hidden":!0,children:[(0,h.jsx)(`span`,{}),(0,h.jsx)(`span`,{}),(0,h.jsx)(`span`,{})]}),(0,h.jsx)(`span`,{className:`truncate`,children:e.status.replace(/\.\.\.$/,``)})]}),e.usage!==null&&(0,h.jsxs)(`span`,{className:`min-w-0 truncate font-mono`,title:`输入 ${e.usage.input} · 输出 ${e.usage.output} · 缓存读 ${e.usage.cacheRead}`,children:[`↑`,OB(e.usage.input),` ↓`,OB(e.usage.output),` · `,kB(e.usage.cost)]})]})]})}var jB={ready:`已连接`,connecting:`连接中…`,reconnecting:`重连中…`,error:`连接失败`};function MB(e){let{workspaceRoot:t,currentSessionId:n,operating:r,sessions:i}=hM(),a=i.find(e=>e.id===n);return(0,h.jsxs)(`header`,{className:`nav-theme nav-topbar`,children:[(0,h.jsx)(`button`,{type:`button`,className:`nav-icon`,"aria-label":`切换侧栏`,title:`切换侧栏`,"aria-expanded":e.sidebarOpen,onClick:e.onToggleSessions,children:(0,h.jsx)($F,{name:`panel`})}),(0,h.jsxs)(`span`,{className:`nav-top-path`,title:t,children:[(0,h.jsx)($F,{name:`folder`}),(0,h.jsx)(`span`,{className:`nav-truncate`,children:aI(t)||`工作区`})]}),(0,h.jsx)(`span`,{className:`nav-muted`,children:`/`}),(0,h.jsx)(`span`,{className:`nav-truncate`,title:a?qj(a,`新会话`):void 0,children:a?qj(a,`新会话`):`新会话`}),(0,h.jsx)(`output`,{className:`nav-connection ${e.conn===`ready`?`is-connected`:``}`,children:r?`切换中…`:jB[e.conn]})]})}function NB(){let{view:e,phase:t,notice:n,operating:r,workspaceRoot:i,currentSessionId:a}=hM(),o=eI(),[s,c]=(0,m.useState)(()=>!window.matchMedia(`(max-width: 767px)`).matches);(0,m.useEffect)(()=>{c(!o)},[o]);let l=e?.busy??!1,u=e?.status??null;return(0,h.jsxs)(`div`,{className:`flex h-dvh`,children:[(0,h.jsx)(TB,{open:s,onClose:()=>c(!1)}),(0,h.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,h.jsx)(MB,{sidebarOpen:s,conn:t,onToggleSessions:()=>c(!s)}),n!==null&&(0,h.jsx)(`div`,{className:`discrete-in border-b px-4 py-1.5 text-center text-xs ${n.level===`error`?`border-sakura-300 bg-sakura-100 text-sakura-900`:`border-tianyi-200 bg-tianyi-50 text-tianyi-900`}`,role:`alert`,children:n.text}),!a&&t===`ready`&&!r?(0,h.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 px-6 text-center`,children:[(0,h.jsx)(`h1`,{className:`text-xl font-semibold text-ink-900`,children:aI(i)}),(0,h.jsx)(`p`,{className:`text-sm text-ink-600`,children:`在这个工作区开始新的会话`}),(0,h.jsx)(`button`,{type:`button`,className:`btn-primary focus-neko rounded-xl px-4 py-2`,onClick:()=>{SM.createSession().catch(wM)},children:`新建会话`})]}):(0,h.jsx)(_B,{view:e,busy:l}),(0,h.jsx)(AB,{model:e?.model??`…`,agentModel:e?.agent.model??null,usage:e?.usage??null,busy:l,status:u}),(0,h.jsx)(XF,{disabled:t!==`ready`||r,busy:l,status:u})]})]})}var PB=[{id:`deepseek`,envVar:`DEEPSEEK_API_KEY`,signupUrl:`https://platform.deepseek.com/api_keys`,keyless:!1},{id:`tavily`,envVar:`TAVILY_API_KEY`,signupUrl:`https://app.tavily.com`,keyless:!0}],FB={saved:`使用已保存密钥`,environment:`使用环境变量`,runtime:`使用运行时配置`,keyless:`keyless(限流)`,none:`尚未配置`},IB={deepseek:`DeepSeek`,tavily:`Tavily`};function LB(e){let{spec:t,status:n,ready:r}=e,i=IB[t.id]??t.id,[a,o]=(0,m.useState)(``),[s,c]=(0,m.useState)(!1),l=(0,m.useRef)(!1),[u,d]=(0,m.useState)(``);async function f(e){if(!l.current){l.current=!0,c(!0),d(``);try{e?await SM.removeCredential(t.id):await SM.saveCredential(t.id,a),o(``),d(e?`已移除保存的密钥`:`已保存,下次请求生效`)}catch{d(`操作失败,请检查连接后重试。`)}finally{l.current=!1,c(!1)}}}let p=s||!r||!n;return(0,h.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,h.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,h.jsx)(`h2`,{className:`text-base font-bold text-ink-900`,children:i}),(0,h.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-3 py-1 text-xs text-tianyi-800`,children:n?FB[n.source]:`读取中…`})]}),(0,h.jsxs)(`p`,{className:`mb-3 text-xs text-ink-500`,children:[`环境变量:`,n?n.environmentConfigured?`已配置`:`未配置`:`读取中…`,t.keyless?` · 未配置时以 keyless 限流模式运行`:``]}),(0,h.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),f(!1)},children:[(0,h.jsxs)(`label`,{className:`sr-only`,htmlFor:`${t.id}-key`,children:[i,` API Key`]}),(0,h.jsx)(`input`,{id:`${t.id}-key`,type:`password`,autoComplete:`off`,spellCheck:!1,value:a,maxLength:4096,disabled:p,onChange:e=>o(e.target.value),placeholder:n?.savedConfigured?`输入新密钥以替换`:`粘贴你的 API Key`,className:`focus-neko w-full min-w-0 rounded-xl border border-sakura-200 bg-base px-3 py-2.5 text-sm`}),(0,h.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3`,children:[(0,h.jsx)(`button`,{type:`submit`,disabled:p||!a.trim(),className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800 disabled:opacity-50`,children:s?`处理中…`:`保存密钥`}),n?.savedConfigured&&(0,h.jsx)(`button`,{type:`button`,disabled:p,onClick:()=>void f(!0),className:`focus-neko rounded-full px-3 py-1.5 text-sm text-ink-500 disabled:opacity-50`,children:`移除已保存密钥`}),(0,h.jsxs)(`a`,{href:t.signupUrl,target:`_blank`,rel:`noreferrer`,className:`focus-neko ml-auto inline-block rounded text-xs text-sakura-700`,children:[`获取 `,i,` API Key ↗`]})]})]}),(0,h.jsx)(`output`,{className:`mt-2 block min-h-4 text-xs text-tianyi-800`,children:u})]})}function RB(){let{credentials:e,phase:t}=hM(),n=t===`ready`&&e!==null;return(0,h.jsxs)(`div`,{className:`flex min-h-dvh flex-col bg-base`,children:[(0,h.jsxs)(`header`,{className:`flex items-center justify-between border-b border-sakura-200/70 bg-surface px-5 py-3`,children:[(0,h.jsx)(zi,{to:`/`,className:`focus-neko rounded-lg text-sakura-700`,children:`← 返回聊天`}),(0,h.jsx)(`span`,{className:`text-xs text-ink-500`,children:t===`ready`?`已连接`:`连接中…`})]}),(0,h.jsxs)(`main`,{className:`mx-auto w-full max-w-lg px-5 py-8 sm:py-12`,children:[(0,h.jsx)(`h1`,{className:`mb-1 text-xl font-bold text-ink-900`,children:`设置`}),(0,h.jsx)(`p`,{className:`mb-5 text-sm text-ink-500`,children:`管理 API Key,保存值优先于环境变量,所有工作区共用。`}),(0,h.jsx)(`div`,{className:`flex flex-col gap-4`,children:PB.map(t=>(0,h.jsx)(LB,{spec:t,status:e?.statuses[t.id],ready:n},t.id))})]})]})}var zB=Wi({component:()=>(0,h.jsx)(ea,{})}),BB=Hi({getParentRoute:()=>zB,path:`/`,component:NB}),VB=Hi({getParentRoute:()=>zB,path:`/settings`,component:RB}),HB=oa({routeTree:zB.addChildren([BB,VB])}),UB=new Pe;bM();var WB=document.getElementById(`root`);WB!==null&&(0,ma.createRoot)(WB).render((0,h.jsx)(m.StrictMode,{children:(0,h.jsx)(_,{client:UB,children:(0,h.jsx)(ca,{router:HB})})}));
|