@zonease/aiworker-cli 0.10.2 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +139 -60
- package/aiworker-bun.js +568 -669
- package/package.json +1 -1
- package/web/fleet/assets/index-bti7BCPc.js +1372 -0
- package/web/fleet/index.html +1 -1
- package/web/worker/assets/{index-K99vOXUf.js → index-DMK6sJoi.js} +193 -307
- package/web/worker/index.html +1 -1
- package/web/fleet/assets/index-RizR7tk6.js +0 -1486
|
@@ -1,1486 +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,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},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=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(){}},u=new class extends l{#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`}},d={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},f=new class{#e=d;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 p(e){setTimeout(e,0)}var m=typeof window>`u`||`Deno`in globalThis;function h(){}function g(e,t){return typeof e==`function`?e(t):e}function _(e){return typeof e==`number`&&e>=0&&e!==1/0}function v(e,t){return Math.max(e+(t||0)-Date.now(),0)}function y(e,t){return typeof e==`function`?e(t):e}function b(e,t){return typeof e==`function`?e(t):e}function x(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==C(o,t.options))return!1}else if(!T(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 S(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(w(t.options.mutationKey)!==w(a))return!1}else if(!T(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function C(e,t){return(t?.queryKeyHashFn||w)(e)}function w(e){return JSON.stringify(e,(e,t)=>A(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function T(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>T(e[n],t[n])):!1}var E=Object.prototype.hasOwnProperty;function D(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=k(e)&&k(t);if(!r&&!(A(e)&&A(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:E.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=D(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function O(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function k(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function A(e){if(!j(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!j(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function j(e){return Object.prototype.toString.call(e)===`[object Object]`}function M(e){return new Promise(t=>{f.setTimeout(t,e)})}function N(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:D(e,t)}function P(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ee(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var F=Symbol();function te(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===F?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ne(e,t){return typeof e==`function`?e(...t):!!e}function re(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var I=(()=>{let e=()=>m;return{isServer(){return e()},setIsServer(t){e=t}}})();function L(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ie=p;function ae(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ie,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 R=ae(),z=new class extends l{#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 oe(e){return Math.min(1e3*2**e,3e4)}function se(e){return(e??`online`)===`online`?z.isOnline():!0}var ce=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function le(e){let t=!1,n=0,r,i=L(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new ce(t);p(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>u.isFocused()&&(e.networkMode===`always`||z.isOnline())&&e.canRun(),d=()=>se(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())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(f).catch(r=>{if(a())return;let i=e.retry??(I.isServer()?0:3),o=e.retryDelay??oe,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),M(s).then(()=>l()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:d,start:()=>(d()?h():m().then(h),i)}}var ue=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_(this.gcTime)&&(this.#e=f.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(I.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(f.clearTimeout(this.#e),this.#e=void 0)}},de=class extends ue{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=me(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=me(this.options);e.data!==void 0&&(this.setState(pe(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=N(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(h).catch(h):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>b(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===F||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>y(e.options.staleTime,this)===`static`):!1}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:!v(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.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.#o=!0,n.signal)})},i=()=>{let e=te(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!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.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=le({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ce&&e.revert&&this.setState({...this.#t,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 this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ce){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{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,...fe(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...pe(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=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),R.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function fe(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:se(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function pe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function me(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 he=class extends l{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=L(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),_e(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ve(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ve(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof b(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!O(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&ye(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||b(this.options.enabled,this.#t)!==b(t.enabled,this.#t)||y(this.options.staleTime,this.#t)!==y(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||b(this.options.enabled,this.#t)!==b(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return xe(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(h)),t}#g(){this.#b();let e=y(this.options.staleTime,this.#t);if(I.isServer()||this.#r.isStale||!_(e))return;let t=v(this.#r.dataUpdatedAt,e)+1;this.#d=f.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(I.isServer()||b(this.options.enabled,this.#t)===!1||!_(this.#p)||this.#p===0)&&(this.#f=f.setInterval(()=>{(this.options.refetchIntervalInBackground||u.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(f.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(f.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&_e(e,t),o=i&&ye(e,n,t,r);(a||o)&&(l={...l,...fe(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=N(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=N(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,x=d!==void 0,S={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&x,isStale:be(e,t),refetch:this.refetch,promise:this.#o,isEnabled:b(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{i(this.#o=S.promise=L())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!O(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){R.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function ge(e,t){return b(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function _e(e,t){return ge(e,t)||e.state.data!==void 0&&ve(e,t,t.refetchOnMount)}function ve(e,t,n){if(b(t.enabled,e)!==!1&&y(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&be(e,t)}return!1}function ye(e,t,n,r){return(e!==t||b(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&be(e,n)}function be(e,t){return b(t.enabled,e)!==!1&&e.isStaleByTime(y(t.staleTime,e))}function xe(e,t){return!O(e.getCurrentResult(),t)}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=>{re(e,()=>t.signal,()=>n=!0)},u=te(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?ee:P;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};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.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=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 ue{#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||Ee(),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.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=le({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)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),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:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}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.#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),R.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ee(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var De=class extends l{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Te({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=Oe(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=Oe(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=Oe(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Oe(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){R.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=>S(t,e))}findAll(e={}){return this.getAll().filter(t=>S(e,t))}notify(e){R.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return R.batch(()=>Promise.all(e.map(e=>e.continue().catch(h))))}};function Oe(e){return e.options.scope?.id}var ke=class extends l{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),O(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&w(t.mutationKey)!==w(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Ee();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){R.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Ae=class extends l{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??C(r,t),a=this.get(i);return a||(a=new de({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){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){R.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=>x(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>x(e,t)):t}notify(e){R.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){R.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){R.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},je=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ae,this.#t=e.mutationCache||new De,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=u.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=z.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(y(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=g(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return R.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;R.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return R.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=R.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(h).catch(h)}invalidateQueries(e,t={}){return R.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=R.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(h)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(h)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(y(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(h).catch(h)}fetchInfiniteQuery(e){return e.behavior=Se(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(h).catch(h)}ensureInfiniteQueryData(e){return e.behavior=Se(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return z.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(w(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{T(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(w(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{T(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||=C(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===F&&(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()}},Me=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.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=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 M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(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 N(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,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(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(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(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 P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ee(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var F=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)},te={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(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=te,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},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=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.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)T.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:ee}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,F)}catch(e){F(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.5`})),Ne=o(((e,t)=>{t.exports=Me()})),Pe=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})),Fe=o(((e,t)=>{t.exports=Pe()})),B=c(Ne(),1),V=Fe(),Ie=B.createContext(void 0),Le=e=>{let t=B.useContext(Ie);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Re=({client:e,children:t})=>(B.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,V.jsx)(Ie.Provider,{value:e,children:t})),ze=B.createContext(!1),Be=()=>B.useContext(ze);ze.Provider;function Ve(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var He=B.createContext(Ve()),Ue=()=>B.useContext(He),We=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?ne(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ge=e=>{B.useEffect(()=>{e.clearReset()},[e])},Ke=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ne(n,[e.error,r])),qe=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Je=(e,t)=>e.isLoading&&e.isFetching&&!t,Ye=(e,t)=>e?.suspense&&t.isPending,Xe=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ze(e,t,n){let r=Be(),i=Ue(),a=Le(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,qe(o),We(o,i,s),Ge(i);let c=!a.getQueryCache().get(o.queryHash),[l]=B.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(B.useSyncExternalStore(B.useCallback(e=>{let t=d?l.subscribe(R.batchCalls(e)):h;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),B.useEffect(()=>{l.setOptions(o)},[o,l]),Ye(o,u))throw Xe(o,l,i);if(Ke({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!I.isServer()&&Je(u,r)&&(c?Xe(o,l,i):s?.promise)?.catch(h).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function Qe(e,t){return Ze(e,he,t)}function $e(e,t){let n=Le(t),[r]=B.useState(()=>new ke(n,e));B.useEffect(()=>{r.setOptions(e)},[r,e]);let i=B.useSyncExternalStore(B.useCallback(e=>r.subscribe(R.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=B.useCallback((e,t)=>{r.mutate(e,t).catch(h)},[r]);if(i.error&&ne(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var et=typeof window<`u`?B.useLayoutEffect:B.useEffect;function tt(e){let t=B.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function nt(e,t,n={},r={}){B.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function rt(e){let t=B.useRef(null);return B.useImperativeHandle(e,()=>t.current,[]),t}function it(e){return e[e.length-1]}function at(e){return typeof e==`function`}function ot(e,t){return at(e)?e(t):e}var st=Object.prototype.hasOwnProperty,ct=Object.prototype.propertyIsEnumerable,lt=()=>Object.create(null),ut=(e,t)=>dt(e,t,lt);function dt(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=ht(e)&&ht(i);if(!a&&!(pt(e)&&pt(i)))return i;let o=a?e:ft(e);if(!o)return i;let s=a?i:ft(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:st.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=dt(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function ft(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!ct.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!ct.call(e,t))return!1;r.push(t)}return r}function pt(e){if(!mt(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!mt(n)||!n.hasOwnProperty(`isPrototypeOf`))}function mt(e){return Object.prototype.toString.call(e)===`[object Object]`}function ht(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function gt(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!gt(e[r],t[r],n))return!1;return!0}if(pt(e)&&pt(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!gt(e[i],t[i],n))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++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!gt(e[o],t[o],n)))return!1;return i===a}return!1}function _t(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function vt(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function yt(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function bt(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 yt(t)}var xt=[`http:`,`https:`,`mailto:`,`tel:`];function St(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Ct(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=bt(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=bt(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function wt(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Tt(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 Et(){throw Error(`Invariant failed`)}function Dt(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var Ot=4,kt=5;function At(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function jt(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=At(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Mt(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;s<o;){let e=jt(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=Ft(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=Ft(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=It(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=It(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=It(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=Ft(n.fullPath??n.from);e.kind=kt,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=Ft(n.fullPath??n.from);e.kind=Ot,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=n.options?.params?.parse??null,i.skipOnParamError=l,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)Mt(e,t,r,s,i,a,o)}function Nt(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;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 Pt(e){if(e.pathless)for(let t of e.pathless)Pt(t);if(e.static)for(let t of e.static.values())Pt(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())Pt(t);if(e.dynamic?.length){e.dynamic.sort(Nt);for(let t of e.dynamic)Pt(t)}if(e.optional?.length){e.optional.sort(Nt);for(let t of e.optional)Pt(t)}if(e.wildcard?.length){e.wildcard.sort(Nt);for(let t of e.wildcard)Pt(t)}}function Ft(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function It(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function Lt(e,t){let n=Ft(`/`),r=new Uint16Array(6);for(let t of e)Mt(!1,r,t,1,n,0);Pt(n),t.masksTree=n,t.flatCache=Dt(1e3)}function Rt(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=Ut(e,t.masksTree);return t.flatCache.set(e,r),r}function zt(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Ft(`/`),Mt(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Ut(r,o,n)}function Bt(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=Ut(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Gt(a.route)),t.matchCache.set(r,a),a}function Vt(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Ht(e,t=!1,n){let r=Ft(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return Mt(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&Et(),a[e.id]=e,s!==0&&e.path){let t=Vt(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),Pt(r),{processedTree:{segmentTree:r,singleCache:Dt(1e3),matchCache:Dt(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Ut(e,t,n=!1){let r=e.split(`/`),i=qt(e,r,t,n);if(!i)return null;let[a]=Wt(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function Wt(e,t,n){let r=Kt(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===Ot)break;if(u.kind===kt){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function Gt(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Kt(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function qt(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!it(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}],c=null,l=null,u=null;for(;s.length;){let n=s.pop(),{node:i,index:d,skipped:f,depth:p,statics:m,dynamics:h,optionals:g}=n,{extract:_,rawParams:v,parsedParams:y}=n;if(i.skipOnParamError){if(!Jt(e,t,n))continue;v=n.rawParams,_=n.extract,y=n.parsedParams}r&&i.route&&i.kind!==Ot&&Yt(l,n)&&(l=n);let b=d===o;if(b&&(i.route&&!a&&Yt(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let x=b?void 0:t[d],S;if(b&&i.index){let n={node:i.index,index:d,skipped:f,depth:p+1,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y},r=!0;if(i.index.skipOnParamError&&(Jt(e,t,n)||(r=!1)),r){if(m===o&&!h&&!g&&!f)return n;Yt(u,n)&&(u=n)}}if(i.wildcard&&Yt(c,n))for(let n of i.wildcard){let{prefix:r,suffix:i}=n;if(r&&(b||!(n.caseSensitive?x:S??=x.toLowerCase()).startsWith(r)))continue;if(i){if(b)continue;let e=t.slice(d).join(`/`).slice(-i.length);if((n.caseSensitive?e:e.toLowerCase())!==i)continue}let a={node:n,index:o,skipped:f,depth:p,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y};if(!(n.skipOnParamError&&!Jt(e,t,a))){c=a;break}}if(i.optional){let e=f|1<<p,t=p+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:d,skipped:e,depth:t,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?x:S??=x.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:d+1,skipped:f,depth:t,statics:m,dynamics:h,optionals:g+1,extract:_,rawParams:v,parsedParams:y})}}if(!b&&i.dynamic&&x)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?x:S??=x.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:d+1,skipped:f,depth:p+1,statics:m,dynamics:h+1,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.staticInsensitive){let e=i.staticInsensitive.get(S??=x.toLowerCase());e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.static){let e=i.static.get(x);e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(i.pathless){let e=p+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:d,skipped:f,depth:e,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}}}if(u&&c)return Yt(c,u)?u:c;if(u)return u;if(c)return c;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??=Object.create(null),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function Jt(e,t,n){try{let[r,i]=Wt(e,t,n);n.rawParams=r,n.extract=i;let a=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,a),!0}catch{return null}}function Yt(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===Ot)>(e.node.kind===Ot)||t.node.kind===Ot==(e.node.kind===Ot)&&t.depth>e.depth))):!0}function Xt(e){return Zt(e.filter(e=>e!==void 0).join(`/`))}function Zt(e){return e.replace(/\/{2,}/g,`/`)}function Qt(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function $t(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function en(e){return $t(Qt(e))}function tn(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function nn(e,t,n){return tn(e,n)===tn(t,n)}function rn({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&it(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(it(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c,l=``;for(let e=0;e<s.length;e++){e>0&&(l+=`/`);let t=s[e];if(!t)continue;c=jt(t,0,c);let n=c[0];if(n===0){l+=t;continue}let r=c[5],i=t.substring(0,c[1]),a=t.substring(c[4],r),o=t.substring(c[2],c[3]);n===1?l+=i||a?`${i}{$${o}}${a}`:`$${o}`:n===2?l+=i||a?`${i}{$}${a}`:`$`:l+=`${i}{-$${o}}${a}`}l=Zt(l);let u=l||`/`;return o&&r&&r.set(o,u),u}function an(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function on(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>cn(e,n)).join(`/`):cn(r,n):r}function sn({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=jt(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=on(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=on(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=on(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function cn(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function ln(e){return e?.isNotFound===!0}function un(){try{return typeof window<`u`&&typeof window.sessionStorage==`object`?window.sessionStorage:void 0}catch{return}}var dn=`tsr-scroll-restoration-v1_3`;function fn(){let e=un();if(!e)return null;let t={};try{let n=JSON.parse(e.getItem(`tsr-scroll-restoration-v1_3`)||`{}`);pt(n)&&(t=n)}catch{}return{get state(){return t},set:e=>{t=ot(e,t)||t},persist:()=>{try{e.setItem(dn,JSON.stringify(t))}catch{}}}}var pn=fn(),mn=e=>e.state.__TSR_key||e.href;function hn(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var gn=!1,_n=`window`,vn=`data-scroll-restoration-id`;function yn(e,t){if(!pn)return;let n=pn;if((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,gn=!1;let r=e.options.getScrollRestorationKey||mn,i=new Map;window.history.scrollRestoration=`manual`;let a=t=>{if(!(gn||!e.isScrollRestoring))if(t.target===document||t.target===window)i.set(_n,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{let e=t.target;i.set(e,{scrollX:e.scrollLeft||0,scrollY:e.scrollTop||0})}},o=t=>{if(!e.isScrollRestoring||!t||i.size===0||!n)return;let r=n.state[t]||={};for(let[e,t]of i){let n;if(e===_n)n=_n;else if(e.isConnected){let t=e.getAttribute(vn);n=t?`[${vn}="${t}"]`:hn(e)}n&&(r[n]=t)}};document.addEventListener(`scroll`,a,!0),e.subscribe(`onBeforeLoad`,e=>{o(e.fromLocation?r(e.fromLocation):void 0),i.clear()}),window.addEventListener(`pagehide`,()=>{o(r(e.stores.resolvedLocation.get()??e.stores.location.get())),n.persist()}),e.subscribe(`onRendered`,t=>{let a=r(t.toLocation),o=e.options.scrollRestorationBehavior,s=e.options.scrollToTopSelectors;if(i.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))){gn=!0;try{let t=e.isScrollRestoring?n.state[a]:void 0,r=!1;if(t)for(let e in t){let n=t[e];if(!pt(n))continue;let{scrollX:i,scrollY:a}=n;if(!(!Number.isFinite(i)||!Number.isFinite(a))){if(e===_n)window.scrollTo({top:a,left:i,behavior:o}),r=!0;else if(e){let t;try{t=document.querySelector(e)}catch{continue}t&&(t.scrollLeft=i,t.scrollTop=a,r=!0)}}}if(!r){let t=e.history.location.hash.slice(1);if(t){let e=window.history.state?.__hashScrollIntoViewOptions??!0;if(e){let n=document.getElementById(t);n&&n.scrollIntoView(e)}}else{let e={top:0,left:0,behavior:o};if(window.scrollTo(e),s)for(let t of s){if(t===_n)continue;let n=typeof t==`function`?t():document.querySelector(t);n&&n.scrollTo(e)}}}}finally{gn=!1}e.isScrollRestoring&&n.set(e=>(e[a]||={},e))}})}function bn(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function xn(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Sn(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]=xn(r):Array.isArray(t)?t.push(xn(r)):n[e]=[t,xn(r)]}return n}var Cn=Tn(JSON.parse),wn=En(JSON.stringify,JSON.parse);function Tn(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Sn(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function En(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=bn(e,r);return t?`?${t}`:``}}var Dn=`__root__`;function On(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}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 kn(e){return e instanceof Response&&!!e.options}function An(e){return{input:({url:t})=>{for(let n of e)t=Mn(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Nn(e[n],t);return t}}}function jn(e){let t=en(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Xt([`/`,t,e.pathname]),e)}}function Mn(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 Nn(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 Pn(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>Fn(o,_.get())),x=r(()=>Fn(s,v.get())),S=r(()=>Fn(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),T=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),E=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=Dt(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let k={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:T,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:E,getRouteMatchStore:O,setMatches:A,setPending:j,setCached:M};A(e.matches),a?.(k);function A(e){In(e,o,_,n,i)}function j(e){In(e,s,v,n,i)}function M(e){In(e,c,y,n,i)}return k}function Fn(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function In(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}Tt(n.get(),a)||n.set(a)})}var Ln=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Rn=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),zn=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Bn=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},Vn=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},Hn=(e,t,n)=>{if(!(!kn(n)&&!ln(n)))throw kn(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:kn(n)?`redirected`:ln(n)?`notFound`:r.status===`pending`?`success`:r.status,context:Bn(e,t.index),isFetching:!1,error:n})),ln(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),kn(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},Un=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Wn=(e,t,n)=>{let r=Bn(e,n);e.updateMatch(t,e=>({...e,context:r}))},Gn=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Hn(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,Hn(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!kn(n)&&!ln(n)&&(e.serialError??=n)},Kn=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!zn(e,t)&&(n.options.loader||n.options.beforeLoad||rr(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{Ln(e)},i);r._nonReactive.pendingTimeout=t}},qn=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Kn(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&Hn(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},Jn=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=_t(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&Gn(e,n,o,`PARSE_PARAMS`),s&&Gn(e,n,s,`VALIDATE_SEARCH`),Kn(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=_t();let f={...Bn(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=zn(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(kn(r)||ln(r))&&(u(),Gn(e,n,r,`BEFORE_LOAD`)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),vt(y))return u(),y.catch(t=>{Gn(e,n,t,`BEFORE_LOAD`)}).then(v)}catch(t){u(),Gn(e,n,t,`BEFORE_LOAD`)}v(y)},Yn=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>Jn(e,n,t,i),s=()=>{if(Un(e,n))return;let t=qn(e,n,i);return vt(t)?t.then(o):o()};return a()},Xn=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},Zn=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=Bn(e,r),d=zn(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},Qn=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{nr(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(Zn(e,t,n,r,i)),l=!!s&&vt(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;Hn(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:Bn(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:Bn(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,ln(t)&&await i.options.notFoundComponent?.preload?.(),Hn(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,Hn(e,e.router.getMatch(n),t)}!kn(o)&&!ln(o)&&await nr(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:Bn(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),Hn(e,r,t)}},$n=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(Zn(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await Qn(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){kn(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await Qn(e,t,i,n,d):Wn(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(Un(e,i)){if(!e.router.getMatch(i))return e.matches[n];Wn(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=zn(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&Hn(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=_t(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function er(e){let t=e,n=[];Rn(t.router)&&Ln(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=Yn(t,e);vt(n)&&await n}catch(e){if(kn(e))throw e;if(ln(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?Vn(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push($n(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(kn(e))throw e;ln(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=Vn(t,l);e===void 0&&Et();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await nr(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await nr(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=Xn(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=Ln(t);if(vt(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function tr(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function nr(e,t=ir){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===ir?(()=>{if(e._componentsPromise===void 0){let t=tr(e,ir);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():tr(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function rr(e){for(let t of ir)if(e.options[t]?.preload)return!0;return!1}var ir=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],ar=`__TSR_index`,or=`popstate`,sr=`beforeunload`;function cr(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({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=fr(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};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[ar];i=lr(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[ar];i=lr(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),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[ar]!==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}}function lr(e,t){t||={};let n=pr();return{...t,key:n,__TSR_key:n,[ar]:e}}function ur(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=e?.createHref??(e=>e),c=e?.parseLocation??(()=>fr(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=pr();t.history.replaceState({[ar]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=fr(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[ar]-l.state[ar],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 n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=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){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=cr({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(sr,S,{capture:!0}),t.removeEventListener(or,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(sr,S,{capture:!0}),t.addEventListener(or,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function dr(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function fr(e,t){let n=dr(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=pr();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[ar]:0,key:a,__TSR_key:a}}}function pr(){return(Math.random()+1).toString(36).substring(7)}function mr(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var hr=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=an(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=ur()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=Dt(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Pn(vr(this.latestLocation),e),yn(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=en(o);t&&t!==`/`&&e.push(jn({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:An(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a)`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Ht(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&Lt(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state: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:Ct(e).path,external:!1,searchStr:o,search:ut(t?.search,i),hash:Ct(r.slice(1)).path,state:dt(t?.state,a)}}let o=new URL(i,this.origin),s=Mn(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:Ct(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:ut(t?.search,c),hash:Ct(s.hash.slice(1)).path,state:dt(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>rn({base:e,to:Zt(t),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>br({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=this.resolvePathWithBase(i,`.`),o=r.search,s=Object.assign(Object.create(null),r.params),c=t.to?this.resolvePathWithBase(a,`${t.to}`):this.resolvePathWithBase(a,`.`),l=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,ot(t.params,s)),u=this.getMatchedRoutes(c),d=u.matchedRoutes;if((!u.foundRoute||u.foundRoute.path!==`/`&&u.routeParams[`**`])&&this.options.notFoundRoute&&(d=[...d,this.options.notFoundRoute]),Object.keys(l).length>0)for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(l,t(l))}catch{}}let f=e.leaveParams?c:Ct(sn({path:c,params:l,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,p=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,yr(t.options.validateSearch,{...e,...p}))}catch{}}),p=e}p=xr({search:p,dest:t,destRoutes:d,_includeValidateSearch:e._includeValidateSearch}),p=ut(o,p);let m=this.options.stringifySearch(p),h=t.hash===!0?n.hash:t.hash?ot(t.hash,n.hash):void 0,g=h?`#${h}`:``,_=t.state===!0?n.state:t.state?ot(t.state,n.state):{};_=dt(n.state,_);let v=`${f}${m}${g}`,y,b,x=!1;if(this.rewrite){let e=new URL(v,this.origin),t=Nn(this.rewrite,e);y=e.href.replace(e.origin,``),t.origin===this.origin?b=t.pathname+t.search+t.hash:(b=t.href,x=!0)}else y=wt(v),b=y;return{publicHref:b,href:y,pathname:f,search:p,searchStr:m,state:_,hash:h??``,external:x,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=Rt(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,ot(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=gt(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=$t(this.latestLocation.href)===$t(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=_t(()=>{a?.resolve(),a=void 0}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=fr(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Mn(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(St(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t,n,r,i=this.stores.resolvedLocation.get()??this.stores.location.get();for(r=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=mr(t,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...n}),this.emit({type:`onBeforeLoad`,...n}),await er({router:this,sync:e?.sync,forceStaleReload:i.href===t.href,matches:this.stores.pendingMatches.get(),location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){kn(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):ln(e)&&(n=e);let r=t?t.status:n?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(r),this.stores.redirect.set(t)})}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.matches.get().some(e=>e.status===`error`)&&(a=500),a!==void 0&&this.stores.statusCode.set(a)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(mr(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&St(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=nr,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await er({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(kn(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});ln(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=zt(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!gt(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?gt(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??wn,parseSearch:e.parseSearch??Cn,protocolAllowlist:e.protocolAllowlist??xt}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n,{matchedRoutes:o}=n,s=!1;(r?r.path!==`/`&&i[`**`]:$t(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?Cr(this.options.notFoundMode,o):void 0,l=Array(o.length),u=new Map;for(let e of this.stores.matchStores.values())e.routeId&&u.set(e.routeId,e.get());for(let n=0;n<o.length;n++){let r=o[n],s=l[n-1],d,f,p;{let n=s?.search??e.search,i=s?._strictSearch??void 0;try{let e=yr(r.options.validateSearch,{...n})??void 0;d={...n,...e},f={...i,...e},p=void 0}catch(e){let r=e;if(e instanceof gr||(r=new gr(e.message,{cause:e})),t?.throwOnError)throw r;d=n,f={},p=r}}let m=r.options.loaderDeps?.({search:d})??``,h=m?JSON.stringify(m):``,{interpolatedPath:g,usedParams:_}=sn({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),v=r.id+g+h,y=this.getMatch(v),b=u.get(r.id),x=y?._strictParams??_,S;if(!y)try{wr(r,_,a,x)}catch(e){if(S=ln(e)||kn(e)?e:new _r(e.message,{cause:e}),t?.throwOnError)throw S}Object.assign(i,x);let C=b?`stay`:`enter`,w;if(y)w={...y,cause:C,params:b?.params??i,_strictParams:x,search:ut(b?b.search:y.search,d),_strictSearch:f};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||rr(r)?`pending`:`success`;w={id:v,ssr:r.options.ssr,index:n,routeId:r.id,params:b?.params??i,_strictParams:x,pathname:g,updatedAt:Date.now(),search:b?ut(b.search,d):d,_strictSearch:f,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:S,__routeContext:void 0,_nonReactive:{loadPromise:_t()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:b?dt(b.loaderDeps,m):m,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(w.globalNotFound=c===r.id),w.searchError=p;let T=this.getParentContext(s);w.context={...T,...w.__routeContext,...w.__beforeLoadContext},l[n]=w}for(let t=0;t<l.length;t++){let n=l[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=u.get(n.routeId);if(n.params=o?ut(o.params,i):i,!a){let i=l[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:l,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return l}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=it(t),a={...e.search};for(let e of t)try{Object.assign(a,yr(e.options.validateSearch,a))}catch{}let o=it(this.stores.matchesId.get()),s=o&&this.stores.matchStores.get(o)?.get(),c=s&&s.routeId===i.id&&s.pathname===e.pathname,l;if(c)l=s.params;else{let e=Object.assign(Object.create(null),n);for(let i of t)try{wr(i,n,r??{},e)}catch{}l=e}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:l}}},gr=class extends Error{},_r=class extends Error{};function vr(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function yr(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new gr(`Async validation not supported`);if(n.issues)throw new gr(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 br({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=$t(e),a,o,s=Bt(i,n,!0);return s&&(a=s.route,Object.assign(r,s.rawParams),o=Object.assign(Object.create(null),s.parsedParams)),{matchedRoutes:s?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function xr({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Sr(n)(e,t,r??!1)}function Sr(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...yr(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:ot(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function Cr(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return Dn}function wr(e,t,n,r){let i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(let e in t)e in n&&(r[e]=n[e]);else{let e=i(r);Object.assign(r,e)}}var Tr=`Error preloading route! ☝️`,Er=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.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Dn:this.parentRoute||Et();let r=n?Dn:t?.path;r&&r!==`/`&&(r=Qt(r));let i=t?.id||r,a=n?Dn:Xt([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Xt([`/`,a]));let o=a===`__root__`?`/`:Xt([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=$t(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=>On({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.`)}},Dr=class extends Er{constructor(e){super(e)}};function Or(e){if(typeof document<`u`&&document.querySelector){let t=e.stores.location.get(),n=t.state.__hashScrollIntoViewOptions??!0;if(n&&t.hash!==``){let e=document.getElementById(t.hash);e&&e.scrollIntoView(n)}}}function kr(e){let t=e.errorComponent??jr;return(0,V.jsx)(Ar,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?B.createElement(t,{error:n,reset:r}):e.children})}var Ar=class extends B.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function jr({error:e}){let[t,n]=B.useState(!1);return(0,V.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,V.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,V.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,V.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,V.jsx)(`div`,{children:(0,V.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,V.jsx)(`code`,{children:e.message}):null})}):null]})}function Mr({children:e,fallback:t=null}){return Nr()?(0,V.jsx)(B.Fragment,{children:e}):(0,V.jsx)(B.Fragment,{children:t})}function Nr(){return B.useSyncExternalStore(Pr,()=>!0,()=>!1)}function Pr(){return()=>{}}var Fr=B.createContext(null);function Ir(e){return B.useContext(Fr)}var Lr=B.createContext(void 0),Rr=B.createContext(void 0),zr=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(zr||{});function Br({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;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}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(!0)}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 Vr(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 Hr=[],Ur=0,{link:Wr,unlink:Gr,propagate:Kr,checkDirty:qr,shallowPropagate:Jr}=Br({update(e){return e._update()},notify(e){Hr[Xr++]=e,e.flags&=~zr.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=zr.Mutable|zr.Dirty,ei(e))}}),Yr=0,Xr=0,Zr,Qr=0;function $r(e){try{++Qr,e()}finally{--Qr||ti()}}function ei(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Gr(n,e)}function ti(){if(!(Qr>0)){for(;Yr<Xr;){let e=Hr[Yr];Hr[Yr++]=void 0,e.notify()}Yr=0,Xr=0}}function ni(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?zr.None:zr.Mutable,get(){return Zr!==void 0&&Wr(i,Zr,Ur),i._snapshot},subscribe(e){let t=Vr(e),n={current:!1},r=ri(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Zr,o=t?.compare??Object.is;if(n)Zr=i,++Ur,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=zr.Mutable|zr.RecursedCheck);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{Zr=a,n&&(i.flags&=~zr.RecursedCheck),ei(i)}}};return n?(i.flags=zr.Mutable|zr.Dirty,i.get=function(){let e=i.flags;if(e&zr.Dirty||e&zr.Pending&&qr(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Jr(e)}}else e&zr.Pending&&(i.flags=e&~zr.Pending);return Zr!==void 0&&Wr(i,Zr,Ur),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Kr(e),Jr(e),ti())}},i}function ri(e){let t=()=>{let t=Zr;Zr=n,++Ur,n.depsTail=void 0,n.flags=zr.Watching|zr.RecursedCheck;try{return e()}finally{Zr=t,n.flags&=~zr.RecursedCheck,ei(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:zr.Watching|zr.RecursedCheck,notify(){let e=this.flags;e&zr.Dirty||e&zr.Pending&&qr(this.deps,this)?t():this.flags=zr.Watching},stop(){this.flags=zr.None,this.depsTail=void 0,ei(this)}};return t(),n}var ii=o((e=>{var t=Ne();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 d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),ai=o(((e,t)=>{t.exports=ii()})),oi=o((e=>{var t=Ne(),n=ai();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}})),si=o(((e,t)=>{t.exports=oi()}))();function ci(e,t){return e===t}function li(e,t,n=ci){let r=(0,B.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,B.useCallback)(()=>e?.get(),[e]);return(0,si.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var ui={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function di(e){let t=Ir(),n=B.useContext(e.from?Rr:Lr),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=B.useRef(void 0);return li(i??ui,n=>{if((e.shouldThrow??!0)&&!n&&Et(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=dt(a.current,r);return a.current=e,e}return r})}function fi(e){return di({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function pi(e){let{select:t,...n}=e;return di({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function mi(e){return di({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 hi(e){return di({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function gi(e){let t=Ir();return B.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function _i(e){return di({...e,select:t=>e.select?e.select(t.context):t.context})}var vi=o((e=>{var t=Ne();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`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(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.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 o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.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=c(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=c(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})}}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=c(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=c(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})}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 s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.5`})),yi=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=vi()})),bi=c(yi(),1);function xi(e,t){let n=Ir(),r=rt(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:_,disabled:v,style:y,className:b,onClick:x,onBlur:S,onFocus:C,onMouseEnter:w,onMouseLeave:T,onTouchStart:E,ignoreBlocker:D,params:O,search:k,hash:A,state:j,mask:M,reloadDocument:N,unsafeRelative:P,from:ee,_fromLocation:F,...te}=e,ne=Nr(),re=B.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),I=li(n.stores.location,e=>e,(e,t)=>e.href===t.href),L=B.useMemo(()=>{let e={_fromLocation:I,...re};return n.buildLocation(e)},[n,I,re]),ie=L.maskedLocation?L.maskedLocation.publicHref:L.publicHref,ae=L.maskedLocation?L.maskedLocation.external:L.external,R=B.useMemo(()=>Ai(ie,ae,n.history,v),[v,ae,ie,n.history]),z=B.useMemo(()=>{if(R?.external)return St(R.href,n.protocolAllowlist)?void 0:R.href;if(!ji(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),St(s,n.protocolAllowlist)?void 0:s}catch{}},[s,R,n.protocolAllowlist]),oe=B.useMemo(()=>{if(z)return!1;if(o?.exact){if(!nn(I.pathname,L.pathname,n.basepath))return!1}else{let e=tn(I.pathname,n.basepath),t=tn(L.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!gt(I.search,L.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?ne&&I.hash===L.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,I,z,ne,L.hash,L.pathname,L.search,n.basepath]),se=oe?ot(i,{})??Ci:Si,ce=oe?Si:ot(a,{})??Si,le=[b,se.className,ce.className].filter(Boolean).join(` `),ue=(y||se.style||ce.style)&&{...y,...se.style,...ce.style},[de,fe]=B.useState(!1),pe=B.useRef(!1),me=e.reloadDocument||z?!1:c??n.options.defaultPreload,he=l??n.options.defaultPreloadDelay??0,ge=B.useCallback(()=>{n.preloadRoute({...re,_builtLocation:L}).catch(e=>{console.warn(e),console.warn(Tr)})},[n,re,L]);nt(r,B.useCallback(e=>{e?.isIntersecting&&ge()},[ge]),Oi,{disabled:!!v||me!==`viewport`}),B.useEffect(()=>{pe.current||!v&&me===`render`&&(ge(),pe.current=!0)},[v,ge,me]);let _e=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;if(!v&&!Ni(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,bi.flushSync)(()=>{fe(!0)});let t=n.subscribe(`onResolved`,()=>{t(),fe(!1)});n.navigate({...re,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:D})}};if(z)return{...te,ref:r,href:z,...g&&{children:g},..._&&{target:_},...v&&{disabled:v},...y&&{style:y},...b&&{className:b},...x&&{onClick:x},...S&&{onBlur:S},...C&&{onFocus:C},...w&&{onMouseEnter:w},...T&&{onMouseLeave:T},...E&&{onTouchStart:E}};let ve=e=>{if(v||me!==`intent`)return;if(!he){ge();return}let t=e.currentTarget;if(Di.has(t))return;let n=setTimeout(()=>{Di.delete(t),ge()},he);Di.set(t,n)},ye=e=>{v||me!==`intent`||ge()},be=e=>{if(v||!me||!he)return;let t=e.currentTarget,n=Di.get(t);n&&(clearTimeout(n),Di.delete(t))};return{...te,...se,...ce,href:R?.href,ref:r,onClick:ki([x,_e]),onBlur:ki([S,be]),onFocus:ki([C,ve]),onMouseEnter:ki([w,ve]),onMouseLeave:ki([T,be]),onTouchStart:ki([E,ye]),disabled:!!v,target:_,...ue&&{style:ue},...le&&{className:le},...v&&wi,...oe&&Ti,...ne&&de&&Ei}}var Si={},Ci={className:`active`},wi={role:`link`,"aria-disabled":!0},Ti={"data-status":`active`,"aria-current":`page`},Ei={"data-transitioning":`transitioning`},Di=new WeakMap,Oi={rootMargin:`100px`},ki=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Ai(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function ji(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Mi=B.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=xi(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return B.createElement(`a`,t,o)}return B.createElement(n,a,o)});function Ni(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Pi=class extends Er{constructor(e){super(e),this.useMatch=e=>di({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>_i({...e,from:this.id}),this.useSearch=e=>hi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>mi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>pi({...e,from:this.id}),this.useLoaderData=e=>fi({...e,from:this.id}),this.useNavigate=()=>gi({from:this.fullPath}),this.Link=B.forwardRef((e,t)=>(0,V.jsx)(Mi,{ref:t,from:this.fullPath,...e}))}};function Fi(e){return new Pi(e)}var Ii=class extends Dr{constructor(e){super(e),this.useMatch=e=>di({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>_i({...e,from:this.id}),this.useSearch=e=>hi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>mi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>pi({...e,from:this.id}),this.useLoaderData=e=>fi({...e,from:this.id}),this.useNavigate=()=>gi({from:this.fullPath}),this.Link=B.forwardRef((e,t)=>(0,V.jsx)(Mi,{ref:t,from:this.fullPath,...e}))}};function Li(e){return new Ii(e)}function Ri(e){return new zi(e,{silent:!0}).createRoute}var zi=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=Fi(e);return t.isRoot=!1,t},this.silent=t?.silent}};function Bi(e){let t=Ir(),n=`not-found-${li(t.stores.location,e=>e.pathname)}-${li(t.stores.status,e=>e)}`;return(0,V.jsx)(kr,{getResetKey:()=>n,onCatch:(t,n)=>{if(ln(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(ln(t))return e.fallback?.(t);throw t},children:e.children})}function Vi(){return(0,V.jsx)(`p`,{children:`Not Found`})}function Hi(e){return(0,V.jsx)(V.Fragment,{children:e.children})}function Ui(e,t,n){return t.options.notFoundComponent?(0,V.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,V.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,V.jsx)(Vi,{})}var Wi=B.memo(function({matchId:e}){let t=Ir(),n=t.stores.matchStores.get(e);n||Et();let r=li(t.stores.loadedAt,e=>e),i=li(n,e=>e);return(0,V.jsx)(Gi,{router:t,matchId:e,resetKey:r,matchState:B.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function Gi({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,V.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?B.Suspense:Hi,f=s?kr:Hi,p=l?Bi:Hi;return(0,V.jsxs)(i.isRoot?i.options.shellComponent??Hi:Hi,{children:[(0,V.jsx)(Lr.Provider,{value:t,children:(0,V.jsx)(d,{fallback:o,children:(0,V.jsx)(f,{getResetKey:()=>n,errorComponent:s||jr,onCatch:(e,t)=>{if(ln(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,V.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return B.createElement(l,e)},children:u||r._displayPending?(0,V.jsx)(Mr,{fallback:o,children:(0,V.jsx)(qi,{matchId:t})}):(0,V.jsx)(qi,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Ki,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function Ki({resetKey:e}){let t=Ir(),n=B.useRef(void 0);return et(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...mr(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var qi=B.memo(function({matchId:e}){let t=Ir(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||Et();let i=li(r,e=>e),a=i.routeId,o=t.routesById[a],s=B.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=B.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,V.jsx)(e,{},s):(0,V.jsx)(Ji,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=_t();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return ln(i.error)||Et(),Ui(t,o,i.error);if(i.status===`redirected`)throw kn(i.error)||Et(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),Ji=B.memo(function(){let e=Ir(),t=B.useContext(Lr),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=li(a,e=>[e?.routeId,e?.globalNotFound??!1]),i=li(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,V.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||Et(),Ui(e,a,void 0);if(!i)return null;let s=(0,V.jsx)(Wi,{matchId:i});return n===`__root__`?(0,V.jsx)(B.Suspense,{fallback:o,children:s}):s});function Yi(){let e=Ir(),t=B.useRef({router:e,mounted:!1}),[n,r]=B.useState(!1),i=li(e.stores.isLoading,e=>e),a=li(e.stores.hasPending,e=>e),o=tt(i),s=i||n||a,c=tt(s),l=i||a,u=tt(l);return e.startTransition=e=>{r(!0),B.startTransition(()=>{e(),r(!1)})},B.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return $t(e.latestLocation.publicHref)!==$t(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),et(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),et(()=>{o&&!i&&e.emit({type:`onLoad`,...mr(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),et(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...mr(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),et(()=>{if(c&&!s){let t=mr(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),$r(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())}),t.hrefChanged&&Or(e)}},[s,c,e]),null}function Xi(){let e=Ir(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,V.jsx)(t,{}):null,r=(0,V.jsxs)(typeof document<`u`&&e.ssr?Hi:B.Suspense,{fallback:n,children:[(0,V.jsx)(Yi,{}),(0,V.jsx)(Zi,{})]});return e.options.InnerWrap?(0,V.jsx)(e.options.InnerWrap,{children:r}):r}function Zi(){let e=Ir(),t=li(e.stores.firstId,e=>e),n=li(e.stores.loadedAt,e=>e),r=t?(0,V.jsx)(Wi,{matchId:t}):null;return(0,V.jsx)(Lr.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,V.jsx)(kr,{getResetKey:()=>n,errorComponent:jr,onCatch:void 0,children:r})})}var Qi=e=>({createMutableStore:ni,createReadonlyStore:ni,batch:$r}),$i=e=>new ea(e),ea=class extends hr{constructor(e){super(e,Qi)}};function ta({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,V.jsx)(Fr.Provider,{value:e,children:t});return e.options.Wrap?(0,V.jsx)(e.options.Wrap,{children:r}):r}function na({router:e,...t}){return(0,V.jsx)(ta,{router:e,...t,children:(0,V.jsx)(Xi,{})})}var ra=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,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){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&&E());){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&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(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,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ia=o(((e,t)=>{t.exports=ra()})),aa=o((e=>{var t=ia(),n=Ne(),r=yi();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){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n: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 d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),D=Symbol.for(`react.memo_cache_sentinel`),O=Symbol.iterator;function k(e){return typeof e!=`object`||!e?null:(e=O&&e[O]||e[`@@iterator`],typeof e==`function`?e:null)}var A=Symbol.for(`react.client.reference`);function j(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===A?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?j(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}var M=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,ee={pending:!1,data:null,method:null,action:null},F=[],te=-1;function ne(e){return{current:e}}function re(e){0>te||(e.current=F[te],F[te]=null,te--)}function I(e,t){te++,F[te]=e.current,e.current=t}var L=ne(null),ie=ne(null),ae=ne(null),R=ne(null);function z(e,t){switch(I(ae,t),I(ie,e),I(L,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ud(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ud(t),e=Wd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}re(L),I(L,e)}function oe(){re(L),re(ie),re(ae)}function se(e){e.memoizedState!==null&&I(R,e);var t=L.current,n=Wd(t,e.type);t!==n&&(I(ie,e),I(L,n))}function ce(e){ie.current===e&&(re(L),re(ie)),R.current===e&&(re(R),ep._currentValue=ee)}var le,ue;function de(e){if(le===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);le=t&&t[1]||``,ue=-1<e.stack.indexOf(`
|
|
2
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
-
`+le+e+ue}var fe=!1;function pe(e,t){if(!e||fe)return``;fe=!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}e.call(n.prototype)}}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(`
|
|
4
|
-
`),l=s.split(`
|
|
5
|
-
`);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=`
|
|
6
|
-
`+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{fe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?de(n):``}function me(e,t){switch(e.tag){case 26:case 27:case 5:return de(e.type);case 16:return de(`Lazy`);case 13:return e.child!==t&&t!==null?de(`Suspense Fallback`):de(`Suspense`);case 19:return de(`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 de(`Activity`);default:return``}}function he(e){try{var t=``,n=null;do t+=me(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
-
Error generating stack: `+e.message+`
|
|
8
|
-
`+e.stack}}var ge=Object.prototype.hasOwnProperty,_e=t.unstable_scheduleCallback,ve=t.unstable_cancelCallback,ye=t.unstable_shouldYield,be=t.unstable_requestPaint,xe=t.unstable_now,Se=t.unstable_getCurrentPriorityLevel,Ce=t.unstable_ImmediatePriority,we=t.unstable_UserBlockingPriority,Te=t.unstable_NormalPriority,Ee=t.unstable_LowPriority,De=t.unstable_IdlePriority,Oe=t.log,ke=t.unstable_setDisableYieldValue,Ae=null,je=null;function Me(e){if(typeof Oe==`function`&&ke(e),je&&typeof je.setStrictMode==`function`)try{je.setStrictMode(Ae,e)}catch{}}var Pe=Math.clz32?Math.clz32:V,Fe=Math.log,B=Math.LN2;function V(e){return e>>>=0,e===0?32:31-(Fe(e)/B|0)|0}var Ie=256,Le=262144,Re=4194304;function ze(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&261888;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 Be(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=ze(n))):i=ze(o):i=ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ze(n))):i=ze(o)):i=ze(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 Ve(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function He(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 Ue(){var e=Re;return Re<<=1,!(Re&62914560)&&(Re=4194304),e}function We(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ge(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ke(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-Pe(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&&qe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Pe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Je(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Pe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ye(e,t){var n=t&-t;return n=n&42?1:Xe(n),(n&(e.suspendedLanes|t))===0?n:0}function Xe(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 Ze(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Qe(){var e=P.p;return e===0?(e=window.event,e===void 0?32:gp(e.type)):e}function $e(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var et=Math.random().toString(36).slice(2),tt=`__reactFiber$`+et,nt=`__reactProps$`+et,rt=`__reactContainer$`+et,it=`__reactEvents$`+et,at=`__reactListeners$`+et,ot=`__reactHandles$`+et,st=`__reactResources$`+et,ct=`__reactMarker$`+et;function lt(e){delete e[tt],delete e[nt],delete e[it],delete e[at],delete e[ot]}function ut(e){var t=e[tt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[rt]||n[tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pf(e);e!==null;){if(n=e[tt])return n;e=pf(e)}return t}e=n,n=e.parentNode}return null}function dt(e){if(e=e[tt]||e[rt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ft(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function pt(e){var t=e[st];return t||=e[st]={hoistableStyles:new Map,hoistableScripts:new Map},t}function mt(e){e[ct]=!0}var ht=new Set,gt={};function _t(e,t){vt(e,t),vt(e+`Capture`,t)}function vt(e,t){for(gt[e]=t,e=0;e<t.length;e++)ht.add(t[e])}var yt=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]*$`),bt={},xt={};function St(e){return ge.call(xt,e)?!0:ge.call(bt,e)?!1:yt.test(e)?xt[e]=!0:(bt[e]=!0,!1)}function Ct(e,t,n){if(St(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 wt(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 Tt(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 Et(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Dt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ot(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 kt(e){if(!e._valueTracker){var t=Dt(e)?`checked`:`value`;e._valueTracker=Ot(e,t,``+e[t])}}function At(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Dt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function jt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Mt=/[\n"\\]/g;function Nt(e){return e.replace(Mt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Pt(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=``+Et(t)):e.value!==``+Et(t)&&(e.value=``+Et(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):It(e,o,Et(n)):It(e,o,Et(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=``+Et(s):e.removeAttribute(`name`)}function Ft(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)){kt(e);return}n=n==null?``:``+Et(n),t=t==null?n:``+Et(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),kt(e)}function It(e,t,n){t===`number`&&jt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Lt(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=``+Et(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 Rt(e,t,n){if(t!=null&&(t=``+Et(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Et(n)}function zt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(M(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Et(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),kt(e)}function Bt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Vt=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 Ht(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||Vt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Ut(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]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Ht(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Ht(e,o,t[o])}function Wt(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 Gt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Kt=/^[\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 qt(e){return Kt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Jt(){}var Yt=null;function Xt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zt=null,Qt=null;function $t(e){var t=dt(e);if(t&&(e=t.stateNode)){var n=e[nt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Pt(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="`+Nt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[nt]||null;if(!a)throw Error(i(90));Pt(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&&At(r)}break a;case`textarea`:Rt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Lt(e,!!n.multiple,t,!1)}}}var en=!1;function tn(e,t,n){if(en)return e(t,n);en=!0;try{return e(t)}finally{if(en=!1,(Zt!==null||Qt!==null)&&(yu(),Zt&&(t=Zt,e=Qt,Qt=Zt=null,$t(t),e)))for(t=0;t<e.length;t++)$t(e[t])}}function nn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[nt]||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 rn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),an=!1;if(rn)try{var on={};Object.defineProperty(on,`passive`,{get:function(){an=!0}}),window.addEventListener(`test`,on,on),window.removeEventListener(`test`,on,on)}catch{an=!1}var sn=null,cn=null,ln=null;function un(){if(ln)return ln;var e,t=cn,n=t.length,r,i=`value`in sn?sn.value:sn.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 ln=i.slice(e,1<r?1-r:void 0)}function dn(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 fn(){return!0}function pn(){return!1}function mn(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)?fn:pn,this.isPropagationStopped=pn,this}return f(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=fn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=fn)},persist:function(){},isPersistent:fn}),t}var hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gn=mn(hn),_n=f({},hn,{view:0,detail:0}),vn=mn(_n),yn,bn,xn,Sn=f({},_n,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nn,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!==xn&&(xn&&e.type===`mousemove`?(yn=e.screenX-xn.screenX,bn=e.screenY-xn.screenY):bn=yn=0,xn=e),yn)},movementY:function(e){return`movementY`in e?e.movementY:bn}}),Cn=mn(Sn),wn=mn(f({},Sn,{dataTransfer:0})),Tn=mn(f({},_n,{relatedTarget:0})),En=mn(f({},hn,{animationName:0,elapsedTime:0,pseudoElement:0})),Dn=mn(f({},hn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),On=mn(f({},hn,{data:0})),kn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},An={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`},jn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Mn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jn[e])?!!t[e]:!1}function Nn(){return Mn}var Pn=mn(f({},_n,{key:function(e){if(e.key){var t=kn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=dn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?An[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nn,charCode:function(e){return e.type===`keypress`?dn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?dn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Fn=mn(f({},Sn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),In=mn(f({},_n,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nn})),Ln=mn(f({},hn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Rn=mn(f({},Sn,{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})),zn=mn(f({},hn,{newState:0,oldState:0})),Bn=[9,13,27,32],Vn=rn&&`CompositionEvent`in window,Hn=null;rn&&`documentMode`in document&&(Hn=document.documentMode);var Un=rn&&`TextEvent`in window&&!Hn,Wn=rn&&(!Vn||Hn&&8<Hn&&11>=Hn),Gn=` `,Kn=!1;function qn(e,t){switch(e){case`keyup`:return Bn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Jn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Yn=!1;function Xn(e,t){switch(e){case`compositionend`:return Jn(t);case`keypress`:return t.which===32?(Kn=!0,Gn):null;case`textInput`:return e=t.data,e===Gn&&Kn?null:e;default:return null}}function Zn(e,t){if(Yn)return e===`compositionend`||!Vn&&qn(e,t)?(e=un(),ln=cn=sn=null,Yn=!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 Wn&&t.locale!==`ko`?null:t.data;default:return null}}var Qn={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 $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Qn[e.type]:t===`textarea`}function er(e,t,n,r){Zt?Qt?Qt.push(r):Qt=[r]:Zt=r,t=Dd(t,`onChange`),0<t.length&&(n=new gn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var tr=null,nr=null;function rr(e){yd(e,0)}function ir(e){if(At(ft(e)))return e}function ar(e,t){if(e===`change`)return t}var or=!1;if(rn){var sr;if(rn){var cr=`oninput`in document;if(!cr){var lr=document.createElement(`div`);lr.setAttribute(`oninput`,`return;`),cr=typeof lr.oninput==`function`}sr=cr}else sr=!1;or=sr&&(!document.documentMode||9<document.documentMode)}function ur(){tr&&(tr.detachEvent(`onpropertychange`,dr),nr=tr=null)}function dr(e){if(e.propertyName===`value`&&ir(nr)){var t=[];er(t,nr,e,Xt(e)),tn(rr,t)}}function fr(e,t,n){e===`focusin`?(ur(),tr=t,nr=n,tr.attachEvent(`onpropertychange`,dr)):e===`focusout`&&ur()}function pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ir(nr)}function mr(e,t){if(e===`click`)return ir(t)}function hr(e,t){if(e===`input`||e===`change`)return ir(t)}function gr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var _r=typeof Object.is==`function`?Object.is:gr;function vr(e,t){if(_r(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(!ge.call(t,i)||!_r(e[i],t[i]))return!1}return!0}function yr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function br(e,t){var n=yr(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=yr(n)}}function xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=jt(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=jt(e.document)}return t}function Cr(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 wr=rn&&`documentMode`in document&&11>=document.documentMode,Tr=null,Er=null,Dr=null,Or=!1;function kr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Or||Tr==null||Tr!==jt(r)||(r=Tr,`selectionStart`in r&&Cr(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}),Dr&&vr(Dr,r)||(Dr=r,r=Dd(Er,`onSelect`),0<r.length&&(t=new gn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Ar(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var jr={animationend:Ar(`Animation`,`AnimationEnd`),animationiteration:Ar(`Animation`,`AnimationIteration`),animationstart:Ar(`Animation`,`AnimationStart`),transitionrun:Ar(`Transition`,`TransitionRun`),transitionstart:Ar(`Transition`,`TransitionStart`),transitioncancel:Ar(`Transition`,`TransitionCancel`),transitionend:Ar(`Transition`,`TransitionEnd`)},Mr={},Nr={};rn&&(Nr=document.createElement(`div`).style,`AnimationEvent`in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),`TransitionEvent`in window||delete jr.transitionend.transition);function Pr(e){if(Mr[e])return Mr[e];if(!jr[e])return e;var t=jr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Nr)return Mr[e]=t[n];return e}var Fr=Pr(`animationend`),Ir=Pr(`animationiteration`),Lr=Pr(`animationstart`),Rr=Pr(`transitionrun`),zr=Pr(`transitionstart`),Br=Pr(`transitioncancel`),Vr=Pr(`transitionend`),Hr=new Map,Ur=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Ur.push(`scrollEnd`);function Wr(e,t){Hr.set(e,t),_t(t,[e])}var Gr=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)},Kr=[],qr=0,Jr=0;function Yr(){for(var e=qr,t=Jr=qr=0;t<e;){var n=Kr[t];Kr[t++]=null;var r=Kr[t];Kr[t++]=null;var i=Kr[t];Kr[t++]=null;var a=Kr[t];if(Kr[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&&$r(n,i,a)}}function Xr(e,t,n,r){Kr[qr++]=e,Kr[qr++]=t,Kr[qr++]=n,Kr[qr++]=r,Jr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Zr(e,t,n,r){return Xr(e,t,n,r),ei(e)}function Qr(e,t){return Xr(e,null,null,t),ei(e)}function $r(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-Pe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ei(e){if(50<uu)throw uu=0,du=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ti={};function ni(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 ri(e,t,n,r){return new ni(e,t,n,r)}function ii(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ai(e,t){var n=e.alternate;return n===null?(n=ri(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&65011712,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 oi(e,t){e.flags&=65011714;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 si(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ii(e)&&(s=1);else if(typeof e==`string`)s=Gf(e,n,L.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=ri(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return ci(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=ri(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=ri(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=ri(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ri(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ci(e,t,n,r){return e=ri(7,e,r,t),e.lanes=n,e}function li(e,t,n){return e=ri(6,e,null,t),e.lanes=n,e}function ui(e){var t=ri(18,null,null,0);return t.stateNode=e,t}function di(e,t,n){return t=ri(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var fi=new WeakMap;function pi(e,t){if(typeof e==`object`&&e){var n=fi.get(e);return n===void 0?(t={value:e,source:t,stack:he(t)},fi.set(e,t),t):n}return{value:e,source:t,stack:he(t)}}var mi=[],hi=0,gi=null,_i=0,vi=[],bi=0,xi=null,Si=1,Ci=``;function wi(e,t){mi[hi++]=_i,mi[hi++]=gi,gi=e,_i=t}function Ti(e,t,n){vi[bi++]=Si,vi[bi++]=Ci,vi[bi++]=xi,xi=e;var r=Si;e=Ci;var i=32-Pe(r)-1;r&=~(1<<i),n+=1;var a=32-Pe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Si=1<<32-Pe(t)+i|n<<i|r,Ci=a+e}else Si=1<<a|n<<i|r,Ci=e}function Ei(e){e.return!==null&&(wi(e,1),Ti(e,1,0))}function Di(e){for(;e===gi;)gi=mi[--hi],mi[hi]=null,_i=mi[--hi],mi[hi]=null;for(;e===xi;)xi=vi[--bi],vi[bi]=null,Ci=vi[--bi],vi[bi]=null,Si=vi[--bi],vi[bi]=null}function Oi(e,t){vi[bi++]=Si,vi[bi++]=Ci,vi[bi++]=xi,Si=t.id,Ci=t.overflow,xi=e}var ki=null,Ai=null,ji=!1,Mi=null,Ni=!1,Pi=Error(i(519));function Fi(e){throw Vi(pi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Pi}function Ii(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[tt]=e,t[nt]=r,n){case`dialog`:bd(`cancel`,t),bd(`close`,t);break;case`iframe`:case`object`:case`embed`:bd(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)bd(_d[n],t);break;case`source`:bd(`error`,t);break;case`img`:case`image`:case`link`:bd(`error`,t),bd(`load`,t);break;case`details`:bd(`toggle`,t);break;case`input`:bd(`invalid`,t),Ft(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:bd(`invalid`,t);break;case`textarea`:bd(`invalid`,t),zt(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||Nd(t.textContent,n)?(r.popover!=null&&(bd(`beforetoggle`,t),bd(`toggle`,t)),r.onScroll!=null&&bd(`scroll`,t),r.onScrollEnd!=null&&bd(`scrollend`,t),r.onClick!=null&&(t.onclick=Jt),t=!0):t=!1,t||Fi(e,!0)}function Li(e){for(ki=e.return;ki;)switch(ki.tag){case 5:case 31:case 13:Ni=!1;return;case 27:case 3:Ni=!0;return;default:ki=ki.return}}function Ri(e){if(e!==ki)return!1;if(!ji)return Li(e),ji=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Gd(e.type,e.memoizedProps)),n=!n),n&&Ai&&Fi(e),Li(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ai=ff(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ai=ff(e)}else t===27?(t=Ai,$d(e.type)?(e=df,df=null,Ai=e):Ai=t):Ai=ki?uf(e.stateNode.nextSibling):null;return!0}function zi(){Ai=ki=null,ji=!1}function Bi(){var e=Mi;return e!==null&&(Xl===null?Xl=e:Xl.push.apply(Xl,e),Mi=null),e}function Vi(e){Mi===null?Mi=[e]:Mi.push(e)}var Hi=ne(null),Ui=null,Wi=null;function Gi(e,t,n){I(Hi,t._currentValue),t._currentValue=n}function Ki(e){e._currentValue=Hi.current,re(Hi)}function qi(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 Ji(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),qi(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),qi(s,n,e),s=null}else 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 Yi(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;_r(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===R.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ep]:e.push(ep))}a=a.return}e!==null&&Ji(t,e,n,r),t.flags|=262144}function Xi(e){for(e=e.firstContext;e!==null;){if(!_r(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Zi(e){Ui=e,Wi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qi(e){return ea(Ui,e)}function $i(e,t){return Ui===null&&Zi(e),ea(e,t)}function ea(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Wi===null){if(e===null)throw Error(i(308));Wi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Wi=Wi.next=t;return n}var ta=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()})}},na=t.unstable_scheduleCallback,ra=t.unstable_NormalPriority,aa={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oa(){return{controller:new ta,data:new Map,refCount:0}}function sa(e){e.refCount--,e.refCount===0&&na(ra,function(){e.controller.abort()})}var ca=null,la=0,ua=0,da=null;function fa(e,t){if(ca===null){var n=ca=[];la=0,ua=dd(),da={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return la++,t.then(pa,pa),t}function pa(){if(--la===0&&ca!==null){da!==null&&(da.status=`fulfilled`);var e=ca;ca=null,ua=0,da=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ma(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 ha=N.S;N.S=function(e,t){$l=xe(),typeof t==`object`&&t&&typeof t.then==`function`&&fa(e,t),ha!==null&&ha(e,t)};var ga=ne(null);function _a(){var e=ga.current;return e===null?Pl.pooledCache:e}function va(e,t){t===null?I(ga,ga.current):I(ga,t.pool)}function ya(){var e=_a();return e===null?null:{parent:aa._currentValue,pool:e}}var ba=Error(i(460)),xa=Error(i(474)),Sa=Error(i(542)),Ca={then:function(){}};function wa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ta(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Jt,Jt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e;default:if(typeof t.status==`string`)t.then(Jt,Jt);else{if(e=Pl,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,ka(e),e}throw Da=t,ba}}function Ea(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Da=e,ba):e}}var Da=null;function Oa(){if(Da===null)throw Error(i(459));var e=Da;return Da=null,e}function ka(e){if(e===ba||e===Sa)throw Error(i(483))}var Aa=null,ja=0;function Ma(e){var t=ja;return ja+=1,Aa===null&&(Aa=[]),Ta(Aa,e,t)}function Na(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Pa(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Fa(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=ai(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|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=li(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===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&Ea(i)===t.type)?(t=a(t,n.props),Na(t,n),t.return=e,t):(t=si(n.type,n.key,n.props,null,e.mode,r),Na(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=di(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=ci(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=li(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=si(t.type,t.key,t.props,null,e.mode,n),Na(n,t),n.return=e,n;case h:return t=di(t,e.mode,n),t.return=e,t;case T:return t=Ea(t),f(e,t,n)}if(M(t)||k(t))return t=ci(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ma(t),n);if(t.$$typeof===b)return f(e,$i(e,t),n);Pa(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 m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=Ea(n),p(e,t,n,r)}if(M(n)||k(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ma(n),r);if(n.$$typeof===b)return p(e,t,$i(e,n),r);Pa(e,n)}return null}function _(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 m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=Ea(r),_(e,t,n,r,i)}if(M(r)||k(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Ma(r),i);if(r.$$typeof===b)return _(e,t,n,$i(t,r),i);Pa(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),ji&&wi(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return ji&&wi(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),ji&&wi(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),ji&&wi(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return ji&&wi(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),ji&&wi(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&Ea(l)===r.type){n(e,r.sibling),c=a(r,o.props),Na(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===g?(c=ci(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=si(o.type,o.key,o.props,null,e.mode,c),Na(c,o),c.return=e,e=c)}return s(e);case h: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}else{n(e,r);break}else t(e,r);r=r.sibling}c=di(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Ea(o),x(e,r,o,c)}if(M(o))return v(e,r,o,c);if(k(o)){if(l=k(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,Ma(o),c);if(o.$$typeof===b)return x(e,r,$i(e,o),c);Pa(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=li(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ja=0;var i=x(e,t,n,r);return Aa=null,i}catch(t){if(t===ba||t===Sa)throw t;var a=ri(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ia=Fa(!0),La=Fa(!1),Ra=!1;function za(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ba(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 Va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ha(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Nl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ei(e),$r(e,null,n),t}return Xr(e,r,t,n),ei(e)}function Ua(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,Je(e,n)}}function Wa(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;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ga=!1;function Ka(){if(Ga){var e=da;if(e!==null)throw e}}function qa(e,t,n,r){Ga=!1;var i=e.updateQueue;Ra=!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 p=s.lane&-536870913,m=p!==s.lane;if(m?(Il&p)===p:(r&p)===p){p!==0&&p===ua&&(Ga=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Ra=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,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),Wl|=o,e.lanes=o,e.memoizedState=d}}function Ja(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ya(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ja(n[e],t)}var Xa=ne(null),Za=ne(0);function Qa(e,t){e=Hl,I(Za,e),I(Xa,t),Hl=e|t.baseLanes}function $a(){I(Za,Hl),I(Xa,Xa.current)}function eo(){Hl=Za.current,re(Xa),re(Za)}var to=ne(null),no=null;function H(e){var t=e.alternate;I(oo,oo.current&1),I(to,e),no===null&&(t===null||Xa.current!==null||t.memoizedState!==null)&&(no=e)}function ro(e){I(oo,oo.current),I(to,e),no===null&&(no=e)}function U(e){e.tag===22?(I(oo,oo.current),I(to,e),no===null&&(no=e)):io(e)}function io(){I(oo,oo.current),I(to,to.current)}function ao(e){re(to),no===e&&(no=null),re(oo)}var oo=ne(0);function so(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||sf(n)||cf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){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 co=0,W=null,lo=null,G=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,K=0;function _o(){throw Error(i(321))}function vo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_r(e[n],t[n]))return!1;return!0}function yo(e,t,n,r,i,a){return co=a,W=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Ps:Fs,po=!1,a=n(r,i),po=!1,fo&&(a=xo(t,n,r,i)),bo(e),a}function bo(e){N.H=J;var t=lo!==null&&lo.next!==null;if(co=0,G=lo=W=null,uo=!1,ho=0,go=null,t)throw Error(i(300));e===null||Xs||(e=e.dependencies,e!==null&&Xi(e)&&(Xs=!0))}function xo(e,t,n,r){W=e;var a=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=a)throw Error(i(301));if(a+=1,G=lo=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=Is,o=t(n,r)}while(fo);return o}function So(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?ko(t):t,e=e.useState()[0],(lo===null?null:lo.memoizedState)!==e&&(W.flags|=1024),t}function Co(){var e=mo!==0;return mo=0,e}function wo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function To(e){if(uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uo=!1}co=0,G=lo=W=null,fo=!1,ho=mo=0,go=null}function Eo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return G===null?W.memoizedState=G=e:G=G.next=e,G}function Do(){if(lo===null){var e=W.alternate;e=e===null?null:e.memoizedState}else e=lo.next;var t=G===null?W.memoizedState:G.next;if(t!==null)G=t,lo=e;else{if(e===null)throw W.alternate===null?Error(i(467)):Error(i(310));lo=e,e={memoizedState:lo.memoizedState,baseState:lo.baseState,baseQueue:lo.baseQueue,queue:lo.queue,next:null},G===null?W.memoizedState=G=e:G=G.next=e}return G}function Oo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(e){var t=ho;return ho+=1,go===null&&(go=[]),e=Ta(go,e,t),t=W,(G===null?t.memoizedState:G.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Ps:Fs),e}function Ao(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ko(e);if(e.$$typeof===b)return Qi(e)}throw Error(i(438,String(e)))}function jo(e){var t=null,n=W.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=W.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=Oo(),W.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]=D;return t.index++,n}function Mo(e,t){return typeof t==`function`?t(e):t}function No(e){return Po(Do(),lo,e)}function Po(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?(co&f)===f:(Il&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===ua&&(d=!0);else if((co&p)===p){u=u.next,p===ua&&(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,W.lanes|=p,Wl|=p;f=u.action,po&&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,W.lanes|=f,Wl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!_r(o,e.memoizedState)&&(Xs=!0,d&&(n=da,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 Fo(e){var t=Do(),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);_r(o,t.memoizedState)||(Xs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Io(e,t,n){var r=W,a=Do(),o=ji;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!_r((lo||a).memoizedState,n);if(s&&(a.memoizedState=n,Xs=!0),a=a.queue,ss(zo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||G!==null&&G.memoizedState.tag&1){if(r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,a,n,t),null),Pl===null)throw Error(i(349));o||co&127||Lo(r,t,n)}return n}function Lo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=W.updateQueue,t===null?(t=Oo(),W.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ro(e,t,n,r){t.value=n,t.getSnapshot=r,Bo(t)&&Vo(e)}function zo(e,t,n){return n(function(){Bo(t)&&Vo(e)})}function Bo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_r(e,n)}catch{return!0}}function Vo(e){var t=Qr(e,2);t!==null&&mu(t,e,2)}function Ho(e){var t=Eo();if(typeof e==`function`){var n=e;if(e=n(),po){Me(!0);try{n()}finally{Me(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:e},t}function Uo(e,t,n,r){return e.baseState=n,Po(e,lo,typeof r==`function`?r:Mo)}function Wo(e,t,n,r,a){if(Ms(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,Go(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Go(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),Ko(e,t,s)}catch(n){Jo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Ko(e,t,a)}catch(n){Jo(e,t,n)}}function Ko(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){qo(e,t,n)},function(n){return Jo(e,t,n)}):qo(e,t,n)}function qo(e,t,n){t.status=`fulfilled`,t.value=n,Yo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Go(e,n)))}function Jo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Yo(t),t=t.next;while(t!==r)}e.action=null}function Yo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xo(e,t){return t}function Zo(e,t){if(ji){var n=Pl.formState;if(n!==null){a:{var r=W;if(ji){if(Ai){b:{for(var i=Ai,a=Ni;i.nodeType!==8;){if(!a){i=null;break b}if(i=uf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ai=uf(i.nextSibling),r=i.data===`F!`;break a}}Fi(r)}r=!1}r&&(t=n[0])}}return n=Eo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:t},n.queue=r,n=ks.bind(null,W,r),r.dispatch=n,r=Ho(!1),a=js.bind(null,W,!1,r.queue),r=Eo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Wo.bind(null,W,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Qo(e){return $o(Do(),lo,e)}function $o(e,t,n){if(t=Po(e,t,Xo)[0],e=No(Mo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ko(t)}catch(e){throw e===ba?Sa:e}else r=t;t=Do();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(W.flags|=2048,ns(9,{destroy:void 0},es.bind(null,i,n),null)),[r,a,e]}function es(e,t){e.action=t}function ts(e){var t=Do(),n=lo;if(n!==null)return $o(t,n,e);Do(),t=t.memoizedState,n=Do();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=W.updateQueue,t===null&&(t=Oo(),W.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 rs(){return Do().memoizedState}function is(e,t,n,r){var i=Eo();W.flags|=e,i.memoizedState=ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function as(e,t,n,r){var i=Do();r=r===void 0?null:r;var a=i.memoizedState.inst;lo!==null&&r!==null&&vo(r,lo.memoizedState.deps)?i.memoizedState=ns(t,a,n,r):(W.flags|=e,i.memoizedState=ns(1|t,a,n,r))}function os(e,t){is(8390656,8,e,t)}function ss(e,t){as(2048,8,e,t)}function cs(e){W.flags|=4;var t=W.updateQueue;if(t===null)t=Oo(),W.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ls(e){var t=Do().memoizedState;return cs({ref:t,nextImpl:e}),function(){if(Nl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function us(e,t){return as(4,2,e,t)}function ds(e,t){return as(4,4,e,t)}function fs(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 ps(e,t,n){n=n==null?null:n.concat([e]),as(4,4,fs.bind(null,t,e),n)}function ms(){}function hs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&vo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&vo(t,r[1]))return r[0];if(r=e(),po){Me(!0);try{e()}finally{Me(!1)}}return n.memoizedState=[r,t],r}function _s(e,t,n){return n===void 0||co&1073741824&&!(Il&261930)?e.memoizedState=t:(e.memoizedState=n,e=pu(),W.lanes|=e,Wl|=e,n)}function vs(e,t,n,r){return _r(n,t)?n:Xa.current===null?!(co&42)||co&1073741824&&!(Il&261930)?(Xs=!0,e.memoizedState=n):(e=pu(),W.lanes|=e,Wl|=e,t):(e=_s(e,n,r),_r(e,t)||(Xs=!0),e)}function ys(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,js(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?As(e,t,ma(c,r),fu(e)):As(e,t,r,fu(e))}catch(n){As(e,t,{then:function(){},status:`rejected`,reason:n},fu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function bs(){}function xs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ss(e).queue;ys(e,a,t,ee,n===null?bs:function(){return Cs(e),n(r)})}function Ss(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:ee},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Cs(e){var t=Ss(e);t.next===null&&(t=e.alternate.memoizedState),As(e,t.next.queue,{},fu())}function ws(){return Qi(ep)}function Ts(){return Do().memoizedState}function Es(){return Do().memoizedState}function Ds(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fu();e=Va(n);var r=Ha(t,e,n);r!==null&&(mu(r,t,n),Ua(r,t,n)),t={cache:oa()},e.payload=t;return}t=t.return}}function Os(e,t,n){var r=fu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ms(e)?Ns(t,n):(n=Zr(e,t,n,r),n!==null&&(mu(n,e,r),q(n,t,r)))}function ks(e,t,n){As(e,t,n,fu())}function As(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ms(e))Ns(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,_r(s,o))return Xr(e,t,i,0),Pl===null&&Yr(),!1}catch{}if(n=Zr(e,t,i,r),n!==null)return mu(n,e,r),q(n,t,r),!0}return!1}function js(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ms(e)){if(t)throw Error(i(479))}else t=Zr(e,n,r,2),t!==null&&mu(t,e,2)}function Ms(e){var t=e.alternate;return e===W||t!==null&&t===W}function Ns(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function q(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Je(e,n)}}var J={readContext:Qi,use:Ao,useCallback:_o,useContext:_o,useEffect:_o,useImperativeHandle:_o,useLayoutEffect:_o,useInsertionEffect:_o,useMemo:_o,useReducer:_o,useRef:_o,useState:_o,useDebugValue:_o,useDeferredValue:_o,useTransition:_o,useSyncExternalStore:_o,useId:_o,useHostTransitionStatus:_o,useFormState:_o,useActionState:_o,useOptimistic:_o,useMemoCache:_o,useCacheRefresh:_o};J.useEffectEvent=_o;var Ps={readContext:Qi,use:Ao,useCallback:function(e,t){return Eo().memoizedState=[e,t===void 0?null:t],e},useContext:Qi,useEffect:os,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),is(4194308,4,fs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return is(4194308,4,e,t)},useInsertionEffect:function(e,t){is(4,2,e,t)},useMemo:function(e,t){var n=Eo();t=t===void 0?null:t;var r=e();if(po){Me(!0);try{e()}finally{Me(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Eo();if(n!==void 0){var i=n(t);if(po){Me(!0);try{n(t)}finally{Me(!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=Os.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=Eo();return e={current:e},t.memoizedState=e},useState:function(e){e=Ho(e);var t=e.queue,n=ks.bind(null,W,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ms,useDeferredValue:function(e,t){return _s(Eo(),e,t)},useTransition:function(){var e=Ho(!1);return e=ys.bind(null,W,e.queue,!0,!1),Eo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=W,a=Eo();if(ji){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Pl===null)throw Error(i(349));Il&127||Lo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,os(zo.bind(null,r,o,e),[e]),r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,o,n,t),null),n},useId:function(){var e=Eo(),t=Pl.identifierPrefix;if(ji){var n=Ci,r=Si;n=(r&~(1<<32-Pe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=K++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ws,useFormState:Zo,useActionState:Zo,useOptimistic:function(e){var t=Eo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=js.bind(null,W,!0,n),n.dispatch=t,[e,t]},useMemoCache:jo,useCacheRefresh:function(){return Eo().memoizedState=Ds.bind(null,W)},useEffectEvent:function(e){var t=Eo(),n={impl:e};return t.memoizedState=n,function(){if(Nl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Fs={readContext:Qi,use:Ao,useCallback:hs,useContext:Qi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:No,useRef:rs,useState:function(){return No(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){return vs(Do(),lo.memoizedState,e,t)},useTransition:function(){var e=No(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){return Uo(Do(),lo,e,t)},useMemoCache:jo,useCacheRefresh:Es};Fs.useEffectEvent=ls;var Is={readContext:Qi,use:Ao,useCallback:hs,useContext:Qi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:Fo,useRef:rs,useState:function(){return Fo(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){var n=Do();return lo===null?_s(n,e,t):vs(n,lo.memoizedState,e,t)},useTransition:function(){var e=Fo(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){var n=Do();return lo===null?(n.baseState=e,[e,n.queue.dispatch]):Uo(n,lo,e,t)},useMemoCache:jo,useCacheRefresh:Es};Is.useEffectEvent=ls;function Y(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var X={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=fu(),i=Va(r);i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(mu(t,e,r),Ua(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=fu(),i=Va(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(mu(t,e,r),Ua(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fu(),r=Va(n);r.tag=2,t!=null&&(r.callback=t),t=Ha(e,r,n),t!==null&&(mu(t,e,n),Ua(t,e,n))}};function Ls(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?!vr(n,r)||!vr(i,a):!0}function Rs(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&&X.enqueueReplaceState(t,t.state,null)}function zs(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=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Bs(e){Gr(e)}function Vs(e){console.error(e)}function Hs(e){Gr(e)}function Us(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ws(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 Gs(e,t,n){return n=Va(n),n.tag=3,n.payload={element:null},n.callback=function(){Us(e,t)},n}function Ks(e){return e=Va(e),e.tag=3,e}function qs(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(){Ws(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ws(t,n,r),typeof i!=`function`&&(nu===null?nu=new Set([this]):nu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Js(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Yi(t,n,a,!0),n=to.current,n!==null){switch(n.tag){case 31:case 13:return no===null?Eu():n.alternate===null&&Ul===0&&(Ul=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,a)),!1;case 22:return n.flags|=65536,r===Ca?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)),Gu(e,r,a)),!1}throw Error(i(435,n.tag))}return Gu(e,r,a),Eu(),!1}if(ji)return t=to.current,t===null?(r!==Pi&&(t=Error(i(423),{cause:r}),Vi(pi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=pi(r,n),a=Gs(e.stateNode,r,a),Wa(e,a),Ul!==4&&(Ul=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Pi&&(e=Error(i(422),{cause:r}),Vi(pi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=pi(o,n),Yl===null?Yl=[o]:Yl.push(o),Ul!==4&&(Ul=2),t===null)return!0;r=pi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Gs(n.stateNode,r,e),Wa(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`&&(nu===null||!nu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ks(a),qs(a,e,n,r),Wa(n,a),!1}n=n.return}while(n!==null);return!1}var Ys=Error(i(461)),Xs=!1;function Zs(e,t,n,r){t.child=e===null?La(t,null,n,r):Ia(t,e.child,n,r)}function Qs(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 Zi(t),r=yo(e,t,n,o,a,i),s=Co(),e!==null&&!Xs?(wo(e,t,i),Sc(e,t,i)):(ji&&s&&Ei(t),t.flags|=1,Zs(e,t,r,i),t.child)}function $s(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,ec(e,t,a,r,i)):(e=si(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Cc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?vr:n,n(o,r)&&e.ref===t.ref)return Sc(e,t,i)}return t.flags|=1,e=ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function ec(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(vr(a,r)&&e.ref===t.ref)if(Xs=!1,t.pendingProps=r=a,Cc(e,i))e.flags&131072&&(Xs=!0);else return t.lanes=e.lanes,Sc(e,t,i)}return cc(e,t,n,r,i)}function tc(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 rc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&va(t,a===null?null:a.cachePool),a===null?$a():Qa(t,a),U(t);else return r=t.lanes=536870912,rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&va(t,null),$a(),io(t)):(va(t,a.cachePool),Qa(t,a),io(t),t.memoizedState=null);return Zs(e,t,i,n),t.child}function nc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function rc(e,t,n,r,i){var a=_a();return a=a===null?null:{parent:aa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&va(t,null),$a(),U(t),e!==null&&Yi(e,t,r,!0),t.childLanes=i,null}function ic(e,t){return t=_c({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ac(e,t,n){return Ia(t,e.child,null,n),e=ic(t,t.pendingProps),e.flags|=2,ao(t),t.memoizedState=null,e}function oc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(ji){if(r.mode===`hidden`)return e=ic(t,r),t.lanes=536870912,nc(null,e);if(ro(t),(e=Ai)?(e=of(e,Ni),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xi===null?null:{id:Si,overflow:Ci},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,ki=t,Ai=null)):e=null,e===null)throw Fi(t);return t.lanes=536870912,null}return ic(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ro(t),a)if(t.flags&256)t.flags&=-257,t=ac(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Xs||Yi(e,t,n,!1),a=(n&e.childLanes)!==0,Xs||a){if(r=Pl,r!==null&&(s=Ye(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Qr(e,s),mu(r,e,s),Ys;Eu(),t=ac(e,t,n)}else e=o.treeContext,Ai=uf(s.nextSibling),ki=t,ji=!0,Mi=null,Ni=!1,e!==null&&Oi(t,e),t=ic(t,r),t.flags|=4096;return t}return e=ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function sc(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 cc(e,t,n,r,i){return Zi(t),n=yo(e,t,n,r,void 0,i),r=Co(),e!==null&&!Xs?(wo(e,t,i),Sc(e,t,i)):(ji&&r&&Ei(t),t.flags|=1,Zs(e,t,n,i),t.child)}function lc(e,t,n,r,i,a){return Zi(t),t.updateQueue=null,n=xo(t,r,n,i),bo(e),r=Co(),e!==null&&!Xs?(wo(e,t,a),Sc(e,t,a)):(ji&&r&&Ei(t),t.flags|=1,Zs(e,t,n,a),t.child)}function uc(e,t,n,r,i){if(Zi(t),t.stateNode===null){var a=ti,o=n.contextType;typeof o==`object`&&o&&(a=Qi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=X,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},za(t),o=n.contextType,a.context=typeof o==`object`&&o?Qi(o):ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Y(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&&X.enqueueReplaceState(a,a.state,null),qa(t,r,a,i),Ka(),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=zs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ti,typeof u==`object`&&u&&(o=Qi(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)&&Rs(t,a,r,o),Ra=!1;var f=t.memoizedState;a.state=f,qa(t,r,a,i),Ka(),l=t.memoizedState,s||f!==l||Ra?(typeof d==`function`&&(Y(t,n,d,r),l=t.memoizedState),(c=Ra||Ls(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,Ba(e,t),o=t.memoizedProps,u=zs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ti,typeof l==`object`&&l&&(c=Qi(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)&&Rs(t,a,r,c),Ra=!1,f=t.memoizedState,a.state=f,qa(t,r,a,i),Ka();var p=t.memoizedState;o!==d||f!==p||Ra||e!==null&&e.dependencies!==null&&Xi(e.dependencies)?(typeof s==`function`&&(Y(t,n,s,r),p=t.memoizedState),(u=Ra||Ls(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Xi(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,sc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ia(t,e.child,null,i),t.child=Ia(t,null,n,i)):Zs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Sc(e,t,i),e}function dc(e,t,n,r){return zi(),t.flags|=256,Zs(e,t,n,r),t.child}var fc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pc(e){return{baseLanes:e,cachePool:ya()}}function mc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ql),e}function hc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(oo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(ji){if(a?H(t):io(t),(e=Ai)?(e=of(e,Ni),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xi===null?null:{id:Si,overflow:Ci},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,ki=t,Ai=null)):e=null,e===null)throw Fi(t);return cf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(io(t),a=t.mode,c=_c({mode:`hidden`,children:c},a),r=ci(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(null,r)):(H(t),gc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(H(t),t.flags&=-257,t=vc(e,t,n)):t.memoizedState===null?(io(t),c=r.fallback,a=t.mode,r=_c({mode:`visible`,children:r.children},a),c=ci(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ia(t,e.child,null,n),r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,t=nc(null,r)):(io(t),t.child=e.child,t.flags|=128,t=null);else if(H(t),cf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Vi({value:r,source:null,stack:null}),t=vc(e,t,n)}else if(Xs||Yi(e,t,n,!1),s=(n&e.childLanes)!==0,Xs||s){if(s=Pl,s!==null&&(r=Ye(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Qr(e,r),mu(s,e,r),Ys;sf(c)||Eu(),t=vc(e,t,n)}else sf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ai=uf(c.nextSibling),ki=t,ji=!0,Mi=null,Ni=!1,e!==null&&Oi(t,e),t=gc(t,r.children),t.flags|=4096);return t}return a?(io(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ai(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ci(c,a,n,null),c.flags|=2):c=ai(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,nc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=pc(n):(a=c.cachePool,a===null?a=ya():(l=aa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(e.child,r)):(H(t),n=e.child,e=n.sibling,n=ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function gc(e,t){return t=_c({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function _c(e,t){return e=ri(22,e,null,t),e.lanes=0,e}function vc(e,t,n){return Ia(t,e.child,null,n),e=gc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),qi(e.return,t,n)}function bc(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 xc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=oo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,I(oo,o),Zs(e,t,r,n),r=ji?_i:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&yc(e,n,t);else if(e.tag===19)yc(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`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&so(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),bc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&so(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}bc(t,!0,n,null,a,r);break;case`together`:bc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Sc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Yi(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=ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Xi(e))):!0}function wc(e,t,n){switch(t.tag){case 3:z(t,t.stateNode.containerInfo),Gi(t,aa,e.memoizedState.cache),zi();break;case 27:case 5:se(t);break;case 4:z(t,t.stateNode.containerInfo);break;case 10:Gi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ro(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(H(t),e=Sc(e,t,n),e===null?null:e.sibling):hc(e,t,n):(H(t),t.flags|=128,null);H(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Yi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return xc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),I(oo,oo.current),r)break;return null;case 22:return t.lanes=0,tc(e,t,n,t.pendingProps);case 24:Gi(t,aa,e.memoizedState.cache)}return Sc(e,t,n)}function Tc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Xs=!0;else{if(!Cc(e,n)&&!(t.flags&128))return Xs=!1,wc(e,t,n);Xs=!!(e.flags&131072)}else Xs=!1,ji&&t.flags&1048576&&Ti(t,_i,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ea(t.elementType),t.type=e,typeof e==`function`)ii(e)?(r=zs(e,r),t.tag=1,t=uc(null,t,e,r,n)):(t.tag=0,t=cc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=Qs(null,t,e,r,n);break a}else if(a===w){t.tag=14,t=$s(null,t,e,r,n);break a}}throw t=j(e)||e,Error(i(306,t,``))}}return t;case 0:return cc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=zs(r,t.pendingProps),uc(e,t,r,a,n);case 3:a:{if(z(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ba(e,t),qa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Gi(t,aa,r),r!==o.cache&&Ji(t,[aa],n,!0),Ka(),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=dc(e,t,r,n);break a}else if(r!==a){a=pi(Error(i(424)),t),Vi(a),t=dc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ai=uf(e.firstChild),ki=t,ji=!0,Mi=null,Ni=!0,n=La(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(zi(),r===a){t=Sc(e,t,n);break a}Zs(e,t,r,n)}t=t.child}return t;case 26:return sc(e,t),e===null?(n=jf(t.type,null,t.pendingProps,null))?t.memoizedState=n:ji||(n=t.type,e=t.pendingProps,r=Hd(ae.current).createElement(n),r[tt]=t,r[nt]=e,Id(r,n,e),mt(r),t.stateNode=r):t.memoizedState=jf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return se(t),e===null&&ji&&(r=t.stateNode=mf(t.type,t.pendingProps,ae.current),ki=t,Ni=!0,a=Ai,$d(t.type)?(df=a,Ai=uf(r.firstChild)):Ai=a),Zs(e,t,t.pendingProps.children,n),sc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ji&&((a=r=Ai)&&(r=rf(r,t.type,t.pendingProps,Ni),r===null?a=!1:(t.stateNode=r,ki=t,Ai=uf(r.firstChild),Ni=!1,a=!0)),a||Fi(t)),se(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Gd(a,o)?r=null:s!==null&&Gd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=yo(e,t,So,null,null,n),ep._currentValue=a),sc(e,t),Zs(e,t,r,n),t.child;case 6:return e===null&&ji&&((e=n=Ai)&&(n=af(n,t.pendingProps,Ni),n===null?e=!1:(t.stateNode=n,ki=t,Ai=null,e=!0)),e||Fi(t)),null;case 13:return hc(e,t,n);case 4:return z(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ia(t,null,r,n):Zs(e,t,r,n),t.child;case 11:return Qs(e,t,t.type,t.pendingProps,n);case 7:return Zs(e,t,t.pendingProps,n),t.child;case 8:return Zs(e,t,t.pendingProps.children,n),t.child;case 12:return Zs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Gi(t,t.type,r.value),Zs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Zi(t),a=Qi(a),r=r(a),t.flags|=1,Zs(e,t,r,n),t.child;case 14:return $s(e,t,t.type,t.pendingProps,n);case 15:return ec(e,t,t.type,t.pendingProps,n);case 19:return xc(e,t,n);case 31:return oc(e,t,n);case 22:return tc(e,t,n,t.pendingProps);case 24:return Zi(t),r=Qi(aa),e===null?(a=_a(),a===null&&(a=Pl,o=oa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},za(t),Gi(t,aa,a)):((e.lanes&n)!==0&&(Ba(e,t),qa(t,null,null,n),Ka()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Gi(t,aa,r),r!==a.cache&&Ji(t,[aa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Gi(t,aa,r))),Zs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ec(e){e.flags|=4}function Dc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Cu())e.flags|=8192;else throw Da=Ca,xa}else e.flags&=-16777217}function Oc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Kf(t))if(Cu())e.flags|=8192;else throw Da=Ca,xa}function kc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ue(),e.lanes|=t,Jl|=t)}function Ac(e,t){if(!ji)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var 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}}function jc(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&65011712,r|=i.flags&65011712,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 Mc(e,t,n){var r=t.pendingProps;switch(Di(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jc(t),null;case 1:return jc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ki(aa),oe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ri(t)?Ec(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Bi())),jc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ec(t),o===null?(jc(t),Dc(t,a,null,r,n)):(jc(t),Oc(t,o))):o?o===e.memoizedState?(jc(t),t.flags&=-16777217):(Ec(t),jc(t),Oc(t,o)):(e=e.memoizedProps,e!==r&&Ec(t),jc(t),Dc(t,a,e,r,n)),null;case 27:if(ce(t),n=ae.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}e=L.current,Ri(t)?Ii(t,e):(e=mf(a,r,n),t.stateNode=e,Ec(t))}return jc(t),null;case 5:if(ce(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}if(o=L.current,Ri(t))Ii(t,o);else{var s=Hd(ae.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[tt]=t,o[nt]=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(Id(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&&Ec(t)}}return jc(t),Dc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ae.current,Ri(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ki,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[tt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Nd(e.nodeValue,n)),e||Fi(t,!0)}else e=Hd(e).createTextNode(r),e[tt]=t,t.stateNode=e}return jc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ri(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[tt]=t}else zi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),e=!1}else n=Bi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ao(t),t):(ao(t),null);if(t.flags&128)throw Error(i(558))}return jc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ri(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[tt]=t}else zi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),a=!1}else a=Bi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ao(t),t):(ao(t),null)}return ao(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),kc(t,t.updateQueue),jc(t),null);case 4:return oe(),e===null&&Cd(t.stateNode.containerInfo),jc(t),null;case 10:return Ki(t.type),jc(t),null;case 19:if(re(oo),r=t.memoizedState,r===null)return jc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Ac(r,!1);else{if(Ul!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=so(e),o!==null){for(t.flags|=128,Ac(r,!1),e=o.updateQueue,t.updateQueue=e,kc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)oi(n,e),n=n.sibling;return I(oo,oo.current&1|2),ji&&wi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&xe()>eu&&(t.flags|=128,a=!0,Ac(r,!1),t.lanes=4194304)}else{if(!a)if(e=so(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,kc(t,e),Ac(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!ji)return jc(t),null}else 2*xe()-r.renderingStartTime>eu&&n!==536870912&&(t.flags|=128,a=!0,Ac(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)}return r.tail===null?(jc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=xe(),e.sibling=null,n=oo.current,I(oo,a?n&1|2:n&1),ji&&wi(t,r.treeForkCount),e);case 22:case 23:return ao(t),eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(jc(t),t.subtreeFlags&6&&(t.flags|=8192)):jc(t),n=t.updateQueue,n!==null&&kc(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&&re(ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ki(aa),jc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Nc(e,t){switch(Di(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ki(aa),oe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ce(t),null;case 31:if(t.memoizedState!==null){if(ao(t),t.alternate===null)throw Error(i(340));zi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ao(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));zi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return re(oo),null;case 4:return oe(),null;case 10:return Ki(t.type),null;case 22:case 23:return ao(t),eo(),e!==null&&re(ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ki(aa),null;case 25:return null;default:return null}}function Pc(e,t){switch(Di(t),t.tag){case 3:Ki(aa),oe();break;case 26:case 27:case 5:ce(t);break;case 4:oe();break;case 31:t.memoizedState!==null&&ao(t);break;case 13:ao(t);break;case 19:re(oo);break;case 10:Ki(t.type);break;case 22:case 23:ao(t),eo(),e!==null&&re(ga);break;case 24:Ki(aa)}}function Fc(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){Wu(t,t.return,e)}}function Ic(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){Wu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Wu(t,t.return,e)}}function Lc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ya(t,n)}catch(t){Wu(e,e.return,t)}}}function Rc(e,t,n){n.props=zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Wu(e,t,n)}}function zc(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:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Wu(e,t,n)}}function Bc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Wu(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){Wu(e,t,n)}else n.current=null}function Vc(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){Wu(e,e.return,t)}}function Hc(e,t,n){try{var r=e.stateNode;Ld(r,e.type,n,t),r[nt]=t}catch(t){Wu(e,e.return,t)}}function Uc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&$d(e.type)||e.tag===4}function Wc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Uc(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&&$d(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 Gc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Jt));else if(r!==4&&(r===27&&$d(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Gc(e,t,n),e=e.sibling;e!==null;)Gc(e,t,n),e=e.sibling}function Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&$d(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Id(t,r,n),t[tt]=e,t[nt]=n}catch(t){Wu(e,e.return,t)}}var Z=!1,Jc=!1,Yc=!1,Xc=typeof WeakSet==`function`?WeakSet:Set,Zc=null;function Qc(e,t){if(e=e.containerInfo,Bd=lp,e=Sr(e),Cr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Vd={focusedElem:e,selectionRange:n},lp=!1,Zc=t;Zc!==null;)if(t=Zc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Zc=e;else for(;Zc!==null;){switch(t=Zc,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=zs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Wu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)nf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:nf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Zc=e;break}Zc=t.return}}function $c(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ml(e,n),r&4&&Fc(5,n);break;case 1:if(ml(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Wu(n,n.return,e)}else{var i=zs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Wu(n,n.return,e)}}r&64&&Lc(n),r&512&&zc(n,n.return);break;case 3:if(ml(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{Ya(e,t)}catch(e){Wu(n,n.return,e)}}break;case 27:t===null&&r&4&&qc(n);case 26:case 5:ml(e,n),t===null&&r&4&&Vc(n),r&512&&zc(n,n.return);break;case 12:ml(e,n);break;case 31:ml(e,n),r&4&&al(e,n);break;case 13:ml(e,n),r&4&&ol(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),lf(e,n))));break;case 22:if(r=n.memoizedState!==null||Z,!r){t=t!==null&&t.memoizedState!==null||Jc,i=Z;var a=Jc;Z=r,(Jc=t)&&!a?gl(e,n,(n.subtreeFlags&8772)!=0):ml(e,n),Z=i,Jc=a}break;case 30:break;default:ml(e,n)}}function el(e){var t=e.alternate;t!==null&&(e.alternate=null,el(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&<(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 tl=null,nl=!1;function rl(e,t,n){for(n=n.child;n!==null;)il(e,t,n),n=n.sibling}function il(e,t,n){if(je&&typeof je.onCommitFiberUnmount==`function`)try{je.onCommitFiberUnmount(Ae,n)}catch{}switch(n.tag){case 26:Jc||Bc(n,t),rl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Jc||Bc(n,t);var r=tl,i=nl;$d(n.type)&&(tl=n.stateNode,nl=!1),rl(e,t,n),hf(n.stateNode),tl=r,nl=i;break;case 5:Jc||Bc(n,t);case 6:if(r=tl,i=nl,tl=null,rl(e,t,n),tl=r,nl=i,tl!==null)if(nl)try{(tl.nodeType===9?tl.body:tl.nodeName===`HTML`?tl.ownerDocument.body:tl).removeChild(n.stateNode)}catch(e){Wu(n,t,e)}else try{tl.removeChild(n.stateNode)}catch(e){Wu(n,t,e)}break;case 18:tl!==null&&(nl?(e=tl,ef(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Fp(e)):ef(tl,n.stateNode));break;case 4:r=tl,i=nl,tl=n.stateNode.containerInfo,nl=!0,rl(e,t,n),tl=r,nl=i;break;case 0:case 11:case 14:case 15:Ic(2,n,t),Jc||Ic(4,n,t),rl(e,t,n);break;case 1:Jc||(Bc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Rc(n,t,r)),rl(e,t,n);break;case 21:rl(e,t,n);break;case 22:Jc=(r=Jc)||n.memoizedState!==null,rl(e,t,n),Jc=r;break;default:rl(e,t,n)}}function al(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Fp(e)}catch(e){Wu(t,t.return,e)}}}function ol(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Fp(e)}catch(e){Wu(t,t.return,e)}}function sl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Xc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Xc),t;default:throw Error(i(435,e.tag))}}function cl(e,t){var n=sl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function ll(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if($d(c.type)){tl=c.stateNode,nl=!1;break a}break;case 5:tl=c.stateNode,nl=!1;break a;case 3:case 4:tl=c.stateNode.containerInfo,nl=!0;break a}c=c.return}if(tl===null)throw Error(i(160));il(o,s,a),tl=null,nl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)dl(t,e),t=t.sibling}var ul=null;function dl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ll(t,e),fl(e),r&4&&(Ic(3,e,e.return),Fc(3,e),Ic(5,e,e.return));break;case 1:ll(t,e),fl(e),r&512&&(Jc||n===null||Bc(n,n.return)),r&64&&Z&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=ul;if(ll(t,e),fl(e),r&512&&(Jc||n===null||Bc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ct]||o[tt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Id(o,r,n),o[tt]=e,mt(o),r=o;break a;case`link`:var s=Uf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Id(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Uf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Id(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[tt]=e,mt(o),r=o}e.stateNode=r}else Wf(a,e.type,e.stateNode);else e.stateNode=Rf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Hc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Wf(a,e.type,e.stateNode):Rf(a,r,e.memoizedProps))}break;case 27:ll(t,e),fl(e),r&512&&(Jc||n===null||Bc(n,n.return)),n!==null&&r&4&&Hc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ll(t,e),fl(e),r&512&&(Jc||n===null||Bc(n,n.return)),e.flags&32){a=e.stateNode;try{Bt(a,``)}catch(t){Wu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Hc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Yc=!0);break;case 6:if(ll(t,e),fl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Wu(e,e.return,t)}}break;case 3:if(Hf=null,a=ul,ul=vf(t.containerInfo),ll(t,e),ul=a,fl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Fp(t.containerInfo)}catch(t){Wu(e,e.return,t)}Yc&&(Yc=!1,pl(e));break;case 4:r=ul,ul=vf(e.stateNode.containerInfo),ll(t,e),fl(e),ul=r;break;case 12:ll(t,e),fl(e);break;case 31:ll(t,e),fl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 13:ll(t,e),fl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ql=xe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Z,d=Jc;if(Z=u||a,Jc=d||l,ll(t,e),Jc=d,Z=u,fl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Z||Jc||hl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Wu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Wu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?tf(m,!0):tf(l.stateNode,!1)}catch(e){Wu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,cl(e,n))));break;case 19:ll(t,e),fl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 30:break;case 21:break;default:ll(t,e),fl(e)}}function fl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Uc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Kc(e,Wc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Bt(o,``),n.flags&=-33),Kc(e,Wc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Gc(e,Wc(e),s);break;default:throw Error(i(161))}}catch(t){Wu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function pl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;pl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ml(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)$c(e,t.alternate,t),t=t.sibling}function hl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ic(4,t,t.return),hl(t);break;case 1:Bc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Rc(t,t.return,n),hl(t);break;case 27:hf(t.stateNode);case 26:case 5:Bc(t,t.return),hl(t);break;case 22:t.memoizedState===null&&hl(t);break;case 30:hl(t);break;default:hl(t)}e=e.sibling}}function gl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:gl(i,a,n),Fc(4,a);break;case 1:if(gl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Wu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ja(c[i],s)}catch(e){Wu(r,r.return,e)}}n&&o&64&&Lc(a),zc(a,a.return);break;case 27:qc(a);case 26:case 5:gl(i,a,n),n&&r===null&&o&4&&Vc(a),zc(a,a.return);break;case 12:gl(i,a,n);break;case 31:gl(i,a,n),n&&o&4&&al(i,a);break;case 13:gl(i,a,n),n&&o&4&&ol(i,a);break;case 22:a.memoizedState===null&&gl(i,a,n),zc(a,a.return);break;case 30:break;default:gl(i,a,n)}t=t.sibling}}function _l(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&&sa(n))}function vl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e))}function yl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)bl(e,t,n,r),t=t.sibling}function bl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:yl(e,t,n,r),i&2048&&Fc(9,t);break;case 1:yl(e,t,n,r);break;case 3:yl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e)));break;case 12:if(i&2048){yl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Wu(t,t.return,e)}}else yl(e,t,n,r);break;case 31:yl(e,t,n,r);break;case 13:yl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?yl(e,t,n,r):(a._visibility|=2,xl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?yl(e,t,n,r):Sl(e,t),i&2048&&_l(o,t);break;case 24:yl(e,t,n,r),i&2048&&vl(t.alternate,t);break;default:yl(e,t,n,r)}}function xl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!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:xl(a,o,s,c,i),Fc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,xl(a,o,s,c,i)):u._visibility&2?xl(a,o,s,c,i):Sl(a,o),i&&l&2048&&_l(o.alternate,o);break;case 24:xl(a,o,s,c,i),i&&l&2048&&vl(o.alternate,o);break;default:xl(a,o,s,c,i)}t=t.sibling}}function Sl(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:Sl(n,r),i&2048&&_l(r.alternate,r);break;case 24:Sl(n,r),i&2048&&vl(r.alternate,r);break;default:Sl(n,r)}t=t.sibling}}var Cl=8192;function wl(e,t,n){if(e.subtreeFlags&Cl)for(e=e.child;e!==null;)Tl(e,t,n),e=e.sibling}function Tl(e,t,n){switch(e.tag){case 26:wl(e,t,n),e.flags&Cl&&e.memoizedState!==null&&qf(n,ul,e.memoizedState,e.memoizedProps);break;case 5:wl(e,t,n);break;case 3:case 4:var r=ul;ul=vf(e.stateNode.containerInfo),wl(e,t,n),ul=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Cl,Cl=16777216,wl(e,t,n),Cl=r):wl(e,t,n));break;default:wl(e,t,n)}}function El(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 Dl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Zc=r,Al(r,e)}El(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ol(e),e=e.sibling}function Ol(e){switch(e.tag){case 0:case 11:case 15:Dl(e),e.flags&2048&&Ic(9,e,e.return);break;case 3:Dl(e);break;case 12:Dl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,kl(e)):Dl(e);break;default:Dl(e)}}function kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Zc=r,Al(r,e)}El(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ic(8,t,t.return),kl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,kl(t));break;default:kl(t)}e=e.sibling}}function Al(e,t){for(;Zc!==null;){var n=Zc;switch(n.tag){case 0:case 11:case 15:Ic(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:sa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Zc=r;else a:for(n=e;Zc!==null;){r=Zc;var i=r.sibling,a=r.return;if(el(r),r===n){Zc=null;break a}if(i!==null){i.return=a,Zc=i;break a}Zc=a}}}var jl={getCacheForType:function(e){var t=Qi(aa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Qi(aa).controller.signal}},Ml=typeof WeakMap==`function`?WeakMap:Map,Nl=0,Pl=null,Fl=null,Il=0,Ll=0,Rl=null,zl=!1,Bl=!1,Vl=!1,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=null,Xl=null,Zl=!1,Ql=0,$l=0,eu=1/0,tu=null,nu=null,ru=0,iu=null,au=null,ou=0,su=0,cu=null,lu=null,uu=0,du=null;function fu(){return Nl&2&&Il!==0?Il&-Il:N.T===null?Qe():dd()}function pu(){if(ql===0)if(!(Il&536870912)||ji){var e=Le;Le<<=1,!(Le&3932160)&&(Le=262144),ql=e}else ql=536870912;return e=to.current,e!==null&&(e.flags|=32),ql}function mu(e,t,n){(e===Pl&&(Ll===2||Ll===9)||e.cancelPendingCommit!==null)&&(xu(e,0),vu(e,Il,ql,!1)),Ge(e,n),(!(Nl&2)||e!==Pl)&&(e===Pl&&(!(Nl&2)&&(Gl|=n),Ul===4&&vu(e,Il,ql,!1)),rd(e))}function hu(e,t,n){if(Nl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ve(e,t),a=r?ku(e,t):Du(e,t,!0),o=r;do{if(a===0){Bl&&!r&&vu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!_u(n)){a=Du(e,t,!1),o=!1;continue}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=Yl;var l=c.current.memoizedState.isDehydrated;if(l&&(xu(c,s).flags|=256),s=Du(c,s,!1),s!==2){if(Vl&&!l){c.errorRecoveryDisabledLanes|=o,Gl|=o,a=4;break a}o=Xl,Xl=a,o!==null&&(Xl===null?Xl=o:Xl.push.apply(Xl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){xu(e,0),vu(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)break;case 6:vu(r,t,ql,!zl);break a;case 2:Xl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Ql+300-xe(),10<a)){if(vu(r,t,ql,!zl),Be(r,0,!0)!==0)break a;ou=t,r.timeoutHandle=Jd(gu.bind(null,r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,o,`Throttled`,-0,0),a);break a}gu(r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,o,null,-0,0)}}break}while(1);rd(e)}function gu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jt},Tl(t,a,d);var m=(a&62914560)===a?Ql-xe():(a&4194048)===a?$l-xe():0;if(m=Yf(d,m),m!==null){ou=a,e.cancelPendingCommit=m(Iu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),vu(e,a,o,!l);return}}Iu(e,t,a,n,r,i,o,s,c)}function _u(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(!_r(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 vu(e,t,n,r){t&=~Kl,t&=~Gl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Pe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&qe(e,n,t)}function yu(){return Nl&6?!0:(id(0,!1),!1)}function bu(){if(Fl!==null){if(Ll===0)var e=Fl.return;else e=Fl,Wi=Ui=null,To(e),Aa=null,ja=0,e=Fl;for(;e!==null;)Pc(e.alternate,e),e=e.return;Fl=null}}function xu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Yd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ou=0,bu(),Pl=e,Fl=n=ai(e.current,null),Il=t,Ll=0,Rl=null,zl=!1,Bl=Ve(e,t),Vl=!1,Jl=ql=Kl=Gl=Wl=Ul=0,Xl=Yl=null,Zl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Pe(r),a=1<<i;t|=e[i],r&=~a}return Hl=t,Yr(),n}function Su(e,t){W=null,N.H=J,t===ba||t===Sa?(t=Oa(),Ll=3):t===xa?(t=Oa(),Ll=4):Ll=t===Ys?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Rl=t,Fl===null&&(Ul=1,Us(e,pi(t,e.current)))}function Cu(){var e=to.current;return e===null?!0:(Il&4194048)===Il?no===null:(Il&62914560)===Il||Il&536870912?e===no:!1}function wu(){var e=N.H;return N.H=J,e===null?J:e}function Tu(){var e=N.A;return N.A=jl,e}function Eu(){Ul=4,zl||(Il&4194048)!==Il&&to.current!==null||(Bl=!0),!(Wl&134217727)&&!(Gl&134217727)||Pl===null||vu(Pl,Il,ql,!1)}function Du(e,t,n){var r=Nl;Nl|=2;var i=wu(),a=Tu();(Pl!==e||Il!==t)&&(tu=null,xu(e,t)),t=!1;var o=Ul;a:do try{if(Ll!==0&&Fl!==null){var s=Fl,c=Rl;switch(Ll){case 8:bu(),o=6;break a;case 3:case 2:case 9:case 6:to.current===null&&(t=!0);var l=Ll;if(Ll=0,Rl=null,Nu(e,s,c,l),n&&Bl){o=0;break a}break;default:l=Ll,Ll=0,Rl=null,Nu(e,s,c,l)}}Ou(),o=Ul;break}catch(t){Su(e,t)}while(1);return t&&e.shellSuspendCounter++,Wi=Ui=null,Nl=r,N.H=i,N.A=a,Fl===null&&(Pl=null,Il=0,Yr()),o}function Ou(){for(;Fl!==null;)ju(Fl)}function ku(e,t){var n=Nl;Nl|=2;var r=wu(),a=Tu();Pl!==e||Il!==t?(tu=null,eu=xe()+500,xu(e,t)):Bl=Ve(e,t);a:do try{if(Ll!==0&&Fl!==null){t=Fl;var o=Rl;b:switch(Ll){case 1:Ll=0,Rl=null,Nu(e,t,o,1);break;case 2:case 9:if(wa(o)){Ll=0,Rl=null,Mu(t);break}t=function(){Ll!==2&&Ll!==9||Pl!==e||(Ll=7),rd(e)},o.then(t,t);break a;case 3:Ll=7;break a;case 4:Ll=5;break a;case 7:wa(o)?(Ll=0,Rl=null,Mu(t)):(Ll=0,Rl=null,Nu(e,t,o,7));break;case 5:var s=null;switch(Fl.tag){case 26:s=Fl.memoizedState;case 5:case 27:var c=Fl;if(s?Kf(s):c.stateNode.complete){Ll=0,Rl=null;var l=c.sibling;if(l!==null)Fl=l;else{var u=c.return;u===null?Fl=null:(Fl=u,Pu(u))}break b}}Ll=0,Rl=null,Nu(e,t,o,5);break;case 6:Ll=0,Rl=null,Nu(e,t,o,6);break;case 8:bu(),Ul=6;break a;default:throw Error(i(462))}}Au();break}catch(t){Su(e,t)}while(1);return Wi=Ui=null,N.H=r,N.A=a,Nl=n,Fl===null?(Pl=null,Il=0,Yr(),Ul):0}function Au(){for(;Fl!==null&&!ye();)ju(Fl)}function ju(e){var t=Tc(e.alternate,e,Hl);e.memoizedProps=e.pendingProps,t===null?Pu(e):Fl=t}function Mu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=lc(n,t,t.pendingProps,t.type,void 0,Il);break;case 11:t=lc(n,t,t.pendingProps,t.type.render,t.ref,Il);break;case 5:To(t);default:Pc(n,t),t=Fl=oi(t,Hl),t=Tc(n,t,Hl)}e.memoizedProps=e.pendingProps,t===null?Pu(e):Fl=t}function Nu(e,t,n,r){Wi=Ui=null,To(t),Aa=null,ja=0;var i=t.return;try{if(Js(e,i,t,n,Il)){Ul=1,Us(e,pi(n,e.current)),Fl=null;return}}catch(t){if(i!==null)throw Fl=i,t;Ul=1,Us(e,pi(n,e.current)),Fl=null;return}t.flags&32768?(ji||r===1?e=!0:Bl||Il&536870912?e=!1:(zl=e=!0,(r===2||r===9||r===3||r===6)&&(r=to.current,r!==null&&r.tag===13&&(r.flags|=16384))),Fu(t,e)):Pu(t)}function Pu(e){var t=e;do{if(t.flags&32768){Fu(t,zl);return}e=t.return;var n=Mc(t.alternate,t,Hl);if(n!==null){Fl=n;return}if(t=t.sibling,t!==null){Fl=t;return}Fl=t=e}while(t!==null);Ul===0&&(Ul=5)}function Fu(e,t){do{var n=Nc(e.alternate,e);if(n!==null){n.flags&=32767,Fl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Fl=e;return}Fl=e=n}while(e!==null);Ul=6,Fl=null}function Iu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Vu();while(ru!==0);if(Nl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Jr,Ke(e,n,o,s,c,l),e===Pl&&(Fl=Pl=null,Il=0),au=t,iu=e,ou=n,su=o,cu=a,lu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(Te,function(){return Hu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=Nl,Nl|=4;try{Qc(e,t,n)}finally{Nl=s,P.p=a,N.T=r}}ru=1,Lu(),Ru(),zu()}}function Lu(){if(ru===1){ru=0;var e=iu,t=au,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Nl;Nl|=4;try{dl(t,e);var a=Vd,o=Sr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&xr(s.ownerDocument.documentElement,s)){if(c!==null&&Cr(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 _=br(s,h),v=br(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}}lp=!!Bd,Vd=Bd=null}finally{Nl=i,P.p=r,N.T=n}}e.current=t,ru=2}}function Ru(){if(ru===2){ru=0;var e=iu,t=au,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Nl;Nl|=4;try{$c(e,t.alternate,t)}finally{Nl=i,P.p=r,N.T=n}}ru=3}}function zu(){if(ru===4||ru===3){ru=0,be();var e=iu,t=au,n=ou,r=lu;t.subtreeFlags&10256||t.flags&10256?ru=5:(ru=0,au=iu=null,Bu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(nu=null),Ze(n),t=t.stateNode,je&&typeof je.onCommitFiberRoot==`function`)try{je.onCommitFiberRoot(Ae,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,P.p=i}}ou&3&&Vu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===du?uu++:(uu=0,du=e):uu=0,id(0,!1)}}function Bu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,sa(t)))}function Vu(){return Lu(),Ru(),zu(),Hu()}function Hu(){if(ru!==5)return!1;var e=iu,t=su;su=0;var n=Ze(ou),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=cu,cu=null;var o=iu,s=ou;if(ru=0,au=iu=null,ou=0,Nl&6)throw Error(i(331));var c=Nl;if(Nl|=4,Ol(o.current),bl(o,o.current,s,n),Nl=c,id(0,!1),je&&typeof je.onPostCommitFiberRoot==`function`)try{je.onPostCommitFiberRoot(Ae,o)}catch{}return!0}finally{P.p=a,N.T=r,Bu(e,t)}}function Uu(e,t,n){t=pi(n,t),t=Gs(e.stateNode,t,2),e=Ha(e,t,2),e!==null&&(Ge(e,2),rd(e))}function Wu(e,t,n){if(e.tag===3)Uu(e,e,n);else for(;t!==null;){if(t.tag===3){Uu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(nu===null||!nu.has(r))){e=pi(n,e),n=Ks(2),r=Ha(t,n,2),r!==null&&(qs(n,r,t,e),Ge(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ml;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)||(Vl=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Pl===e&&(Il&n)===n&&(Ul===4||Ul===3&&(Il&62914560)===Il&&300>xe()-Ql?!(Nl&2)&&xu(e,0):Kl|=n,Jl===Il&&(Jl=0)),rd(e)}function qu(e,t){t===0&&(t=Ue()),e=Qr(e,t),e!==null&&(Ge(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(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),qu(e,n)}function Xu(e,t){return _e(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;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-Pe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=Il,a=Be(r,r===Pl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ve(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&qd()&&(e=nd);for(var t=xe(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}ru!==0&&ru!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Pe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=He(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Pl,n=Il,n=Be(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ll===2||Ll===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ve(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ve(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ve(r),Ze(n)){case 2:case 8:n=we;break;case 32:n=Te;break;case 268435456:n=De;break;default:n=Te}return r=cd.bind(null,e),n=_e(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ve(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(ru!==0&&ru!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Vu()&&e.callbackNode!==n)return null;var r=Il;return r=Be(e,e===Pl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(hu(e,r,t),sd(e,xe()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Vu())return null;hu(e,t,!0)}function ud(){Zd(function(){Nl&6?_e(Ce,ad):od()})}function dd(){if(nd===0){var e=ua;e===0&&(e=Ie,Ie<<=1,!(Ie&261888)&&(Ie=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:qt(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[nt]||null).action),o=r.submitter;o&&(t=(t=o[nt]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new gn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=o?pd(i,o):new FormData(i);xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<Ur.length;hd++){var gd=Ur[hd];Wr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Wr(Fr,`onAnimationEnd`),Wr(Ir,`onAnimationIteration`),Wr(Lr,`onAnimationStart`),Wr(`dblclick`,`onDoubleClick`),Wr(`focusin`,`onFocus`),Wr(`focusout`,`onBlur`),Wr(Rr,`onTransitionRun`),Wr(zr,`onTransitionStart`),Wr(Br,`onTransitionCancel`),Wr(Vr,`onTransitionEnd`),vt(`onMouseEnter`,[`mouseout`,`mouseover`]),vt(`onMouseLeave`,[`mouseout`,`mouseover`]),vt(`onPointerEnter`,[`pointerout`,`pointerover`]),vt(`onPointerLeave`,[`pointerout`,`pointerover`]),_t(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),_t(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),_t(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),_t(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),_t(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),_t(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`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(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(e,t){t=(t&4)!=0;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){Gr(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){Gr(e)}i.currentTarget=null,a=c}}}}function bd(e,t){var n=t[it];n===void 0&&(n=t[it]=new Set);var r=e+`__bubble`;n.has(r)||(wd(t,e,2,!1),n.add(r))}function xd(e,t,n){var r=0;t&&(r|=4),wd(n,e,r,t)}var Sd=`_reactListening`+Math.random().toString(36).slice(2);function Cd(e){if(!e[Sd]){e[Sd]=!0,ht.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||xd(t,!1,e),xd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Sd]||(t[Sd]=!0,xd(`selectionchange`,!1,t))}}function wd(e,t,n,r){switch(gp(t)){case 2:var i=up;break;case 8:i=dp;break;default:i=fp}n=i.bind(null,t,n,e),i=void 0,!an||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 Td(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=ut(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}tn(function(){var r=a,i=Xt(n),s=[];a:{var c=Hr.get(e);if(c!==void 0){var l=gn,u=e;switch(e){case`keypress`:if(dn(n)===0)break a;case`keydown`:case`keyup`:l=Pn;break;case`focusin`:u=`focus`,l=Tn;break;case`focusout`:u=`blur`,l=Tn;break;case`beforeblur`:case`afterblur`:l=Tn;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=Cn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=wn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=In;break;case Fr:case Ir:case Lr:l=En;break;case Vr:l=Ln;break;case`scroll`:case`scrollend`:l=vn;break;case`wheel`:l=Rn;break;case`copy`:case`cut`:case`paste`:l=Dn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Fn;break;case`toggle`:case`beforetoggle`:l=zn}var d=(t&4)!=0,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=nn(m,p),g!=null&&d.push(Ed(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(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Yt&&(u=n.relatedTarget||n.fromElement)&&(ut(u)||u[rt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ut(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Cn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Fn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:ft(l),h=u==null?c:ft(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ut(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Od,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&kd(s,c,l,d,!1),u!==null&&f!==null&&kd(s,f,u,d,!0)}}a:{if(c=r?ft(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ar;else if($n(c))if(or)v=hr;else{v=pr;var y=fr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Wt(r.elementType)&&(v=ar):v=mr;if(v&&=v(e,r)){er(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&It(c,`number`,c.value)}switch(y=r?ft(r):window,e){case`focusin`:($n(y)||y.contentEditable===`true`)&&(Tr=y,Er=r,Dr=null);break;case`focusout`:Dr=Er=Tr=null;break;case`mousedown`:Or=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Or=!1,kr(s,n,i);break;case`selectionchange`:if(wr)break;case`keydown`:case`keyup`:kr(s,n,i)}var b;if(Vn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Yn?qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Wn&&n.locale!==`ko`&&(Yn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Yn&&(b=un()):(sn=i,cn=`value`in sn?sn.value:sn.textContent,Yn=!0)),y=Dd(r,x),0<y.length&&(x=new On(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Jn(n),b!==null&&(x.data=b)))),(b=Un?Xn(e,n):Zn(e,n))&&(x=Dd(r,`onBeforeInput`),0<x.length&&(y=new On(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),md(s,e,r,n,i)}yd(s,t)})}function Ed(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Dd(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=nn(e,n),i!=null&&r.unshift(Ed(e,i,a)),i=nn(e,t),i!=null&&r.push(Ed(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Od(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function kd(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=nn(n,a),l!=null&&o.unshift(Ed(n,l,c))):i||(l=nn(n,a),l!=null&&o.push(Ed(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Ad=/\r\n?/g,jd=/\u0000|\uFFFD/g;function Md(e){return(typeof e==`string`?e:``+e).replace(Ad,`
|
|
9
|
-
`).replace(jd,``)}function Nd(e,t){return t=Md(t),Md(e)===t}function Pd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Bt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Bt(e,``+r);break;case`className`:wt(e,`class`,r);break;case`tabIndex`:wt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:wt(e,n,r);break;case`style`:Ut(e,r,o);break;case`data`:if(t!==`object`){wt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=qt(``+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}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Pd(e,t,`name`,a.name,a,null),Pd(e,t,`formEncType`,a.formEncType,a,null),Pd(e,t,`formMethod`,a.formMethod,a,null),Pd(e,t,`formTarget`,a.formTarget,a,null)):(Pd(e,t,`encType`,a.encType,a,null),Pd(e,t,`method`,a.method,a,null),Pd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=qt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Jt);break;case`onScroll`:r!=null&&bd(`scroll`,e);break;case`onScrollEnd`:r!=null&&bd(`scrollend`,e);break;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));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=qt(``+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`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`:bd(`beforetoggle`,e),bd(`toggle`,e),Ct(e,`popover`,r);break;case`xlinkActuate`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ct(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Gt.get(n)||n,Ct(e,n,r))}}function Fd(e,t,n,r,a,o){switch(n){case`style`:Ut(e,r,o);break;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));e.innerHTML=n}}break;case`children`:typeof r==`string`?Bt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Bt(e,``+r);break;case`onScroll`:r!=null&&bd(`scroll`,e);break;case`onScrollEnd`:r!=null&&bd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Jt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!gt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[nt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ct(e,n,r)}}}function Id(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:bd(`error`,e),bd(`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:Pd(e,t,o,s,n,null)}}a&&Pd(e,t,`srcSet`,n.srcSet,n,null),r&&Pd(e,t,`src`,n.src,n,null);return;case`input`:bd(`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:Pd(e,t,r,d,n,null)}}Ft(e,o,c,l,u,s,a,!1);return;case`select`:for(a in bd(`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:Pd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Lt(e,!!r,n,!0):Lt(e,!!r,t,!1);return;case`textarea`:for(s in bd(`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:Pd(e,t,s,c,n,null)}zt(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:Pd(e,t,l,r,n,null)}return;case`dialog`:bd(`beforetoggle`,e),bd(`toggle`,e),bd(`cancel`,e),bd(`close`,e);break;case`iframe`:case`object`:bd(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)bd(_d[r],e);break;case`image`:bd(`error`,e),bd(`load`,e);break;case`details`:bd(`toggle`,e);break;case`embed`:case`source`:case`link`:bd(`error`,e),bd(`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:Pd(e,t,u,r,n,null)}return;default:if(Wt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Fd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Pd(e,t,c,r,n,null))}function Ld(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)||Pd(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`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Pd(e,t,p,m,r,f)}}Pt(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)||Pd(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`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Pd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Lt(e,!!n,n?[]:``,!1):Lt(e,!!n,t,!0)):Lt(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:Pd(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`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Pd(e,t,s,a,r,o)}Rt(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:Pd(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`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Pd(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)&&Pd(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:Pd(e,t,u,p,r,m)}return;default:if(Wt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Fd(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||Fd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Pd(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||Pd(e,t,f,p,r,m)}function Rd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function zd(){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&&Rd(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&&Rd(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 Bd=null,Vd=null;function Hd(e){return e.nodeType===9?e:e.ownerDocument}function Ud(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 Wd(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 Gd(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 Kd=null;function qd(){var e=window.event;return e&&e.type===`popstate`?e===Kd?!1:(Kd=e,!0):(Kd=null,!1)}var Jd=typeof setTimeout==`function`?setTimeout:void 0,Yd=typeof clearTimeout==`function`?clearTimeout:void 0,Xd=typeof Promise==`function`?Promise:void 0,Zd=typeof queueMicrotask==`function`?queueMicrotask:Xd===void 0?Jd:function(e){return Xd.resolve(null).then(e).catch(Qd)};function Qd(e){setTimeout(function(){throw e})}function $d(e){return e===`head`}function ef(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),Fp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)hf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,hf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&hf(e.ownerDocument.body);n=i}while(n);Fp(t)}function tf(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 nf(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`:nf(n),lt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rf(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[ct])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=uf(e.nextSibling),e===null)break}return null}function af(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=uf(e.nextSibling),e===null))return null;return e}function of(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=uf(e.nextSibling),e===null))return null;return e}function sf(e){return e.data===`$?`||e.data===`$~`}function cf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lf(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 uf(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 df=null;function ff(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return uf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pf(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 mf(e,t,n){switch(t=Hd(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 hf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);lt(e)}var gf=new Map,_f=new Set;function vf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var yf=P.d;P.d={f:bf,r:xf,D:wf,C:Tf,L:Ef,m:Df,X:kf,S:Of,M:Af};function bf(){var e=yf.f(),t=yu();return e||t}function xf(e){var t=dt(e);t!==null&&t.tag===5&&t.type===`form`?Cs(t):yf.r(e)}var Sf=typeof document>`u`?null:document;function Cf(e,t,n){var r=Sf;if(r&&typeof t==`string`&&t){var i=Nt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),_f.has(i)||(_f.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Id(t,`link`,e),mt(t),r.head.appendChild(t)))}}function wf(e){yf.D(e),Cf(`dns-prefetch`,e,null)}function Tf(e,t){yf.C(e,t),Cf(`preconnect`,e,t)}function Ef(e,t,n){yf.L(e,t,n);var r=Sf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Nt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Nt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Nt(n.imageSizes)+`"]`)):i+=`[href="`+Nt(e)+`"]`;var a=i;switch(t){case`style`:a=Mf(e);break;case`script`:a=If(e)}gf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),gf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Nf(a))||t===`script`&&r.querySelector(Lf(a))||(t=r.createElement(`link`),Id(t,`link`,e),mt(t),r.head.appendChild(t)))}}function Df(e,t){yf.m(e,t);var n=Sf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Nt(r)+`"][href="`+Nt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=If(e)}if(!gf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),gf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Lf(a)))return}r=n.createElement(`link`),Id(r,`link`,e),mt(r),n.head.appendChild(r)}}}function Of(e,t,n){yf.S(e,t,n);var r=Sf;if(r&&e){var i=pt(r).hoistableStyles,a=Mf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Nf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=gf.get(a))&&Bf(e,n);var c=o=r.createElement(`link`);mt(c),Id(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,zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function kf(e,t){yf.X(e,t);var n=Sf;if(n&&e){var r=pt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=f({src:e,async:!0},t),(t=gf.get(i))&&Vf(e,t),a=n.createElement(`script`),mt(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t){yf.M(e,t);var n=Sf;if(n&&e){var r=pt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=gf.get(i))&&Vf(e,t),a=n.createElement(`script`),mt(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t,n,r){var a=(a=ae.current)?vf(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`?(t=Mf(n.href),n=pt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,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=Mf(n.href);var o=pt(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(Nf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),gf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},gf.set(e,n),o||Ff(a,e,n,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`?(t=If(n),n=pt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Mf(e){return`href="`+Nt(e)+`"`}function Nf(e){return`link[rel="stylesheet"][`+e+`]`}function Pf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Ff(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Id(t,`link`,n),mt(t),e.head.appendChild(t))}function If(e){return`[src="`+Nt(e)+`"]`}function Lf(e){return`script[async]`+e}function Rf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Nt(n.href)+`"]`);if(r)return t.instance=r,mt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),mt(r),Id(r,`style`,a),zf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Mf(n.href);var o=e.querySelector(Nf(a));if(o)return t.state.loading|=4,t.instance=o,mt(o),o;r=Pf(n),(a=gf.get(a))&&Bf(r,a),o=(e.ownerDocument||e).createElement(`link`),mt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Id(o,`link`,r),t.state.loading|=4,zf(o,n.precedence,e),t.instance=o;case`script`:return o=If(n.src),(a=e.querySelector(Lf(o)))?(t.instance=a,mt(a),a):(r=n,(a=gf.get(o))&&(r=f({},n),Vf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),mt(a),Id(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,zf(r,n.precedence,e));return t.instance}function zf(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 Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Hf=null;function Uf(e,t,n){if(Hf===null){var r=new Map,i=Hf=new Map;i.set(n,r)}else i=Hf,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[ct]||a[tt]||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 Wf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Gf(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 Kf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function qf(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=Mf(r.href),a=t.querySelector(Nf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Xf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,mt(a);return}a=t.ownerDocument||t,r=Pf(r),(i=gf.get(i))&&Bf(r,i),a=a.createElement(`link`),mt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Id(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=Xf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Jf=0;function Yf(e,t){return e.stylesheets&&e.count===0&&Qf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Jf===0&&(Jf=62500*zd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Jf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Xf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zf=null;function Qf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zf=new Map,t.forEach($f,e),Zf=null,Xf.call(e))}function $f(e,t){if(!(t.state.loading&4)){var n=Zf.get(e);if(n)var r=n.get(null);else{n=new Map,Zf.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=Xf.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 ep={$$typeof:b,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function tp(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=We(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=We(0),this.hiddenUpdates=We(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function np(e,t,n,r,i,a,o,s,c,l,u,d){return e=new tp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ri(3,null,null,t),e.current=a,a.stateNode=e,t=oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},za(a),e}function rp(e){return e?(e=ti,e):ti}function ip(e,t,n,r,i,a){i=rp(i),r.context===null?r.context=i:r.pendingContext=i,r=Va(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ha(e,r,t),n!==null&&(mu(n,e,t),Ua(n,e,t))}function ap(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function op(e,t){ap(e,t),(e=e.alternate)&&ap(e,t)}function sp(e){if(e.tag===13||e.tag===31){var t=Qr(e,67108864);t!==null&&mu(t,e,67108864),op(e,67108864)}}function cp(e){if(e.tag===13||e.tag===31){var t=fu();t=Xe(t);var n=Qr(e,t);n!==null&&mu(n,e,t),op(e,t)}}var lp=!0;function up(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,fp(e,t,n,r)}finally{P.p=a,N.T=i}}function dp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,fp(e,t,n,r)}finally{P.p=a,N.T=i}}function fp(e,t,n,r){if(lp){var i=pp(r);if(i===null)Td(e,t,r,mp,n),Tp(e,r);else if(Dp(i,e,t,n,r))r.stopPropagation();else if(Tp(e,r),t&4&&-1<wp.indexOf(e)){for(;i!==null;){var a=dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Pe(o);s.entanglements[1]|=c,o&=~c}rd(a),!(Nl&6)&&(eu=xe()+500,id(0,!1))}}break;case 31:case 13:s=Qr(a,2),s!==null&&mu(s,a,2),yu(),op(a,2)}if(a=pp(r),a===null&&Td(e,t,r,mp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Td(e,t,r,null,n)}}function pp(e){return e=Xt(e),hp(e)}var mp=null;function hp(e){if(mp=null,e=ut(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 mp=e,null}function gp(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`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Se()){case Ce:return 2;case we:return 8;case Te:case Ee:return 32;case De:return 268435456;default:return 32}default:return 32}}var _p=!1,vp=null,yp=null,bp=null,xp=new Map,Sp=new Map,Cp=[],wp=`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 Tp(e,t){switch(e){case`focusin`:case`focusout`:vp=null;break;case`dragenter`:case`dragleave`:yp=null;break;case`mouseover`:case`mouseout`:bp=null;break;case`pointerover`:case`pointerout`:xp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Sp.delete(t.pointerId)}}function Ep(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=dt(t),t!==null&&sp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Dp(e,t,n,r,i){switch(t){case`focusin`:return vp=Ep(vp,e,t,n,r,i),!0;case`dragenter`:return yp=Ep(yp,e,t,n,r,i),!0;case`mouseover`:return bp=Ep(bp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return xp.set(a,Ep(xp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Sp.set(a,Ep(Sp.get(a)||null,e,t,n,r,i)),!0}return!1}function Op(e){var t=ut(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,$e(e.priority,function(){cp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,$e(e.priority,function(){cp(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 kp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Yt=r,n.target.dispatchEvent(r),Yt=null}else return t=dt(n),t!==null&&sp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ap(e,t,n){kp(e)&&n.delete(t)}function jp(){_p=!1,vp!==null&&kp(vp)&&(vp=null),yp!==null&&kp(yp)&&(yp=null),bp!==null&&kp(bp)&&(bp=null),xp.forEach(Ap),Sp.forEach(Ap)}function Mp(e,n){e.blockedOn===n&&(e.blockedOn=null,_p||(_p=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jp)))}var Np=null;function Pp(e){Np!==e&&(Np=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Np===e&&(Np=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(hp(r||n)===null)continue;break}var a=dt(n);a!==null&&(e.splice(t,3),t-=3,xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Fp(e){function t(t){return Mp(t,e)}vp!==null&&Mp(vp,e),yp!==null&&Mp(yp,e),bp!==null&&Mp(bp,e),xp.forEach(t),Sp.forEach(t);for(var n=0;n<Cp.length;n++){var r=Cp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Cp.length&&(n=Cp[0],n.blockedOn===null);)Op(n),n.blockedOn===null&&Cp.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[nt]||null;if(typeof a==`function`)o||Pp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[nt]||null)s=o.formAction;else if(hp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Pp(n)}}}function Ip(){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 Lp(e){this._internalRoot=e}Rp.prototype.render=Lp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ip(n,fu(),e,t,null,null)},Rp.prototype.unmount=Lp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ip(e.current,2,null,e,null,null),yu(),t[rt]=null}};function Rp(e){this._internalRoot=e}Rp.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qe();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cp.length&&t!==0&&t<Cp[n].priority;n++);Cp.splice(n,0,e),n===0&&Op(e)}};var zp=n.version;if(zp!==`19.2.5`)throw Error(i(527,zp,`19.2.5`));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:d(e),e=e===null?null:e.stateNode,e};var Bp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Vp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vp.isDisabled&&Vp.supportsFiber)try{Ae=Vp.inject(Bp),je=Vp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Bs,s=Vs,c=Hs;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=np(e,1,!1,null,null,n,r,null,o,s,c,Ip),e[rt]=t.current,Cd(e),new Lp(t)}})),oa=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=aa()}))();function sa(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var ca=e=>{switch(e){case`success`:return da;case`info`:return pa;case`warning`:return fa;case`error`:return ma;default:return null}},la=Array(12).fill(0),ua=({visible:e,className:t})=>B.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},B.createElement(`div`,{className:`sonner-spinner`},la.map((e,t)=>B.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),da=B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},B.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),fa=B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},B.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),pa=B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},B.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),ma=B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},B.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),ha=B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},B.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),B.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),ga=()=>{let[e,t]=B.useState(document.hidden);return B.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},_a=1,va=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:_a++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],B.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(ba(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||_a++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ya=(e,t)=>{let n=t?.id||_a++;return va.addToast({title:e,...t,id:n}),n},ba=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`;Object.assign(ya,{success:va.success,info:va.info,warning:va.warning,error:va.error,custom:va.custom,message:va.message,promise:va.promise,dismiss:va.dismiss,loading:va.loading},{getHistory:()=>va.toasts,getToasts:()=>va.getActiveToasts()}),sa(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function xa(e){return e.label!==void 0}var Sa=3,Ca=`24px`,wa=`16px`,Ta=4e3,Ea=356,Da=14,Oa=45,ka=200;function Aa(...e){return e.filter(Boolean).join(` `)}function ja(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Ma=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=B.useState(null),[O,k]=B.useState(null),[A,j]=B.useState(!1),[M,N]=B.useState(!1),[P,ee]=B.useState(!1),[F,te]=B.useState(!1),[ne,re]=B.useState(!1),[I,L]=B.useState(0),[ie,ae]=B.useState(0),R=B.useRef(n.duration||y||Ta),z=B.useRef(null),oe=B.useRef(null),se=c===0,ce=c+1<=o,le=n.type,ue=n.dismissible!==!1,de=n.className||``,fe=n.descriptionClassName||``,pe=B.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),me=B.useMemo(()=>n.closeButton??p,[n.closeButton,p]),he=B.useMemo(()=>n.duration||y||Ta,[n.duration,y]),ge=B.useRef(0),_e=B.useRef(0),ve=B.useRef(0),ye=B.useRef(null),[be,xe]=b.split(`-`),Se=B.useMemo(()=>s.reduce((e,t,n)=>n>=pe?e:e+t.height,0),[s,pe]),Ce=ga(),we=n.invert||t,Te=le===`loading`;_e.current=B.useMemo(()=>pe*x+Se,[pe,Se]),B.useEffect(()=>{R.current=he},[he]),B.useEffect(()=>{j(!0)},[]),B.useEffect(()=>{let e=oe.current;if(e){let t=e.getBoundingClientRect().height;return ae(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),B.useLayoutEffect(()=>{if(!A)return;let e=oe.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ae(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ee=B.useCallback(()=>{N(!0),L(_e.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},ka)},[n,d,a,_e]);B.useEffect(()=>{if(n.promise&&le===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Ce?(()=>{if(ve.current<ge.current){let e=new Date().getTime()-ge.current;R.current-=e}ve.current=new Date().getTime()})():R.current!==1/0&&(ge.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ee()},R.current)),()=>clearTimeout(e)},[u,i,n,le,Ce,Ee]),B.useEffect(()=>{n.delete&&(Ee(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ee,n.delete]);function De(){return w?.loading?B.createElement(`div`,{className:Aa(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":le===`loading`},w.loading):B.createElement(ua,{className:Aa(C?.loader,n?.classNames?.loader),visible:le===`loading`})}let Oe=n.icon||w?.[le]||ca(le);return B.createElement(`li`,{tabIndex:0,ref:oe,className:Aa(_,de,C?.toast,n?.classNames?.toast,C?.default,C?.[le],n?.classNames?.[le]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":ne,"data-removed":M,"data-visible":ce,"data-y-position":be,"data-x-position":xe,"data-index":c,"data-front":se,"data-swiping":P,"data-dismissible":ue,"data-type":le,"data-invert":we,"data-swipe-out":F,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${M?I:_e.current}px`,"--initial-height":S?`auto`:`${ie}px`,...m,...n.style},onDragEnd:()=>{ee(!1),D(null),ye.current=null},onPointerDown:e=>{e.button!==2&&(Te||!ue||(z.current=new Date,L(_e.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(ee(!0),ye.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(F||!ue)return;ye.current=null;let e=Number(oe.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(oe.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-z.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=Oa||a>.11){L(_e.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ee(),te(!0);return}else{var o,s;(o=oe.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=oe.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}re(!1),ee(!1),D(null)},onPointerMove:t=>{var n,r;if(!ye.current||!ue||window.getSelection()?.toString().length>0)return;let i=t.clientY-ye.current.y,a=t.clientX-ye.current.x,o=e.swipeDirections??ja(b);!E&&(Math.abs(a)>1||Math.abs(i)>1)&&D(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(E===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&re(!0),(n=oe.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=oe.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},me&&!n.jsx&&le!==`loading`?B.createElement(`button`,{"aria-label":T,"data-disabled":Te,"data-close-button":!0,onClick:Te||!ue?()=>{}:()=>{Ee(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Aa(C?.closeButton,n?.classNames?.closeButton)},w?.close??ha):null,(le||n.icon||n.promise)&&n.icon!==null&&(w?.[le]!==null||n.icon)?B.createElement(`div`,{"data-icon":``,className:Aa(C?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||De():null,n.type===`loading`?null:Oe):null,B.createElement(`div`,{"data-content":``,className:Aa(C?.content,n?.classNames?.content)},B.createElement(`div`,{"data-title":``,className:Aa(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?B.createElement(`div`,{"data-description":``,className:Aa(v,fe,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),B.isValidElement(n.cancel)?n.cancel:n.cancel&&xa(n.cancel)?B.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{xa(n.cancel)&&ue&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ee())},className:Aa(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,B.isValidElement(n.action)?n.action:n.action&&xa(n.action)?B.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{xa(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ee())},className:Aa(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Na(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function Pa(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?wa:Ca;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Fa=B.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Sa,toastOptions:g,dir:_=Na(),gap:v=Da,icons:y,containerAriaLabel:b=`Notifications`}=e,[x,S]=B.useState([]),C=B.useMemo(()=>n?x.filter(e=>e.toasterId===n):x.filter(e=>!e.toasterId),[x,n]),w=B.useMemo(()=>Array.from(new Set([i].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,i]),[T,E]=B.useState([]),[D,O]=B.useState(!1),[k,A]=B.useState(!1),[j,M]=B.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),N=B.useRef(null),P=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),ee=B.useRef(null),F=B.useRef(!1),te=B.useCallback(e=>{S(t=>(t.find(t=>t.id===e.id)?.delete||va.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return B.useEffect(()=>va.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{S(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{bi.flushSync(()=>{S(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[x]),B.useEffect(()=>{if(d!==`system`){M(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?M(`dark`):M(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{M(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{M(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),B.useEffect(()=>{x.length<=1&&O(!1)},[x]),B.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;O(!0),(t=N.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===N.current||N.current?.contains(document.activeElement))&&O(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),B.useEffect(()=>{if(N.current)return()=>{ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null,F.current=!1)}},[N.current]),B.createElement(`section`,{ref:t,"aria-label":`${b} ${P}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},w.map((t,n)=>{let[i,a]=t.split(`-`);return C.length?B.createElement(`ol`,{key:t,dir:_===`auto`?Na():_,tabIndex:-1,ref:N,className:c,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${T[0]?.height||0}px`,"--width":`${Ea}px`,"--gap":`${v}px`,...m,...Pa(l,u)},onBlur:e=>{F.current&&!e.currentTarget.contains(e.relatedTarget)&&(F.current=!1,ee.current&&=(ee.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||F.current||(F.current=!0,ee.current=e.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{k||O(!1)},onDragEnd:()=>O(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||A(!0)},onPointerUp:()=>A(!1)},C.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>B.createElement(Ma,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:k,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:te,toasts:C.filter(e=>e.position==n.position),heights:T.filter(e=>e.position==n.position),setHeights:E,expandByDefault:o,gap:v,expanded:D,swipeDirections:e.swipeDirections}))):null}))}),Ia=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},La=(e=>e?Ia(e):Ia),Ra=e=>e;function za(e,t=Ra){let n=B.useSyncExternalStore(e.subscribe,B.useCallback(()=>t(e.getState()),[e,t]),B.useCallback(()=>t(e.getInitialState()),[e,t]));return B.useDebugValue(n),n}var Ba=e=>{let t=La(e),n=e=>za(t,e);return Object.assign(n,t),n},Va=(e=>e?Ba(e):Ba),Ha=`aiworker-theme`,Ua=new Set([`light`,`dark`,`system`]),Wa=Va()(e=>({theme:`system`,setTheme:t=>e({theme:t})}));function Ga(e){return`${Ha}:${e}`}function Ka(e){return e!==null&&Ua.has(e)}function qa(e){let t=window.localStorage.getItem(Ga(e));return Ka(t)?t:null}function Ja(){return typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches}function Ya(e){return e===`system`?Ja()?`dark`:`light`:e}function Xa(e){let t=document.documentElement,n=Ya(e);t.dataset.theme=n,t.dataset.themePreference=e}function Za(e){let t=qa(e)??`system`;Wa.setState({theme:t}),Xa(t)}function Qa({scope:e}){let t=Wa(e=>e.theme),n=Wa(e=>e.setTheme),r=(0,B.useRef)(!1),i=(0,B.useRef)(!0);return(0,B.useEffect)(()=>{let t=qa(e);t&&n(t),r.current=!0},[e,n]),(0,B.useEffect)(()=>{if(Xa(t),i.current?i.current=!1:r.current&&window.localStorage.setItem(Ga(e),t),t!==`system`||typeof window.matchMedia!=`function`)return;let n=window.matchMedia(`(prefers-color-scheme: dark)`),a=()=>Xa(`system`);return n.addEventListener(`change`,a),()=>n.removeEventListener(`change`,a)},[e,t]),null}function $a(e){return(0,V.jsx)(Fa,{theme:Wa(e=>e.theme),className:`toaster group`,toastOptions:{classNames:{toast:`group toast group-[.toaster]:rounded-sm group-[.toaster]:border-hairline group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:shadow-popover`,description:`group-[.toast]:text-muted-foreground`,actionButton:`group-[.toast]:rounded-pill group-[.toast]:border group-[.toast]:border-primary group-[.toast]:bg-primary group-[.toast]:font-medium group-[.toast]:text-primary-foreground`,cancelButton:`group-[.toast]:bg-soft-stone group-[.toast]:text-muted-foreground`}},...e})}var eo=new je({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1}}}),to;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(to||={});var no;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(no||={});var H=to.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),ro=e=>{switch(typeof e){case`undefined`:return H.undefined;case`string`:return H.string;case`number`:return Number.isNaN(e)?H.nan:H.number;case`boolean`:return H.boolean;case`function`:return H.function;case`bigint`:return H.bigint;case`symbol`:return H.symbol;case`object`:return Array.isArray(e)?H.array:e===null?H.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?H.promise:typeof Map<`u`&&e instanceof Map?H.map:typeof Set<`u`&&e instanceof Set?H.set:typeof Date<`u`&&e instanceof Date?H.date:H.object;default:return H.unknown}},U=to.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),io=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,to.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};io.create=e=>new io(e);var ao=(e,t)=>{let n;switch(e.code){case U.invalid_type:n=e.received===H.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case U.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,to.jsonStringifyReplacer)}`;break;case U.unrecognized_keys:n=`Unrecognized key(s) in object: ${to.joinValues(e.keys,`, `)}`;break;case U.invalid_union:n=`Invalid input`;break;case U.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${to.joinValues(e.options)}`;break;case U.invalid_enum_value:n=`Invalid enum value. Expected ${to.joinValues(e.options)}, received '${e.received}'`;break;case U.invalid_arguments:n=`Invalid function arguments`;break;case U.invalid_return_type:n=`Invalid function return type`;break;case U.invalid_date:n=`Invalid date`;break;case U.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:to.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case U.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case U.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case U.custom:n=`Invalid input`;break;case U.invalid_intersection_types:n=`Intersection results could not be merged`;break;case U.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case U.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,to.assertNever(e)}return{message:n}},oo=ao;function so(){return oo}var co=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function W(e,t){let n=so(),r=co({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===ao?void 0:ao].filter(e=>!!e)});e.common.issues.push(r)}var lo=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return G;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return G;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},G=Object.freeze({status:`aborted`}),uo=e=>({status:`dirty`,value:e}),fo=e=>({status:`valid`,value:e}),po=e=>e.status===`aborted`,mo=e=>e.status===`dirty`,ho=e=>e.status===`valid`,go=e=>typeof Promise<`u`&&e instanceof Promise,K;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(K||={});var _o=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},vo=(e,t)=>{if(ho(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new io(e.common.issues);return this._error=t,this._error}}};function yo(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var bo=class{get description(){return this._def.description}_getType(e){return ro(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ro(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new lo,ctx:{common:e.parent.common,data:e.data,parsedType:ro(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(go(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ro(e)};return vo(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ro(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return ho(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>ho(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ro(e)},r=this._parse({data:e,path:n.path,parent:n});return vo(n,await(go(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:U.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new Cs({schema:this,typeName:q.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return ws.create(this,this._def)}nullable(){return Ts.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return is.create(this)}promise(){return Ss.create(this,this._def)}or(e){return ss.create([this,e],this._def)}and(e){return ds.create(this,e,this._def)}transform(e){return new Cs({...yo(this._def),schema:this,typeName:q.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new Es({...yo(this._def),innerType:this,defaultValue:t,typeName:q.ZodDefault})}brand(){return new ks({typeName:q.ZodBranded,type:this,...yo(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new Ds({...yo(this._def),innerType:this,catchValue:t,typeName:q.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return As.create(this,e)}readonly(){return js.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},xo=/^c[^\s-]{8,}$/i,So=/^[0-9a-z]+$/,Co=/^[0-9A-HJKMNP-TV-Z]{26}$/i,wo=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,To=/^[a-z0-9_-]{21}$/i,Eo=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Do=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Oo=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ko=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,Ao,jo=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Mo=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,No=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Po=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Fo=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Io=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Lo=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,Ro=RegExp(`^${Lo}$`);function zo(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Bo(e){return RegExp(`^${zo(e)}$`)}function Vo(e){let t=`${Lo}T${zo(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Ho(e,t){return!!((t===`v4`||!t)&&jo.test(e)||(t===`v6`||!t)&&No.test(e))}function Uo(e,t){if(!Eo.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Wo(e,t){return!!((t===`v4`||!t)&&Mo.test(e)||(t===`v6`||!t)&&Po.test(e))}var Go=class e extends bo{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==H.string){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.string,received:t.parsedType}),G}let t=new lo,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?W(n,{code:U.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&W(n,{code:U.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)Oo.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`email`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)Ao||=new RegExp(ko,`u`),Ao.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`emoji`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)wo.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`uuid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)To.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`nanoid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)xo.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`cuid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)So.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`cuid2`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)Co.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`ulid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),W(n,{validation:`url`,code:U.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`regex`,code:U.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?Vo(r).test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?Ro.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?Bo(r).test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?Do.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`duration`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?Ho(e.data,r.version)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`ip`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?Uo(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`jwt`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?Wo(e.data,r.version)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`cidr`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?Fo.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`base64`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?Io.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`base64url`,code:U.invalid_string,message:r.message}),t.dirty()):to.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:U.invalid_string,...K.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...K.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...K.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...K.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...K.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...K.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...K.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...K.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...K.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...K.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...K.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...K.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...K.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...K.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...K.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...K.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...K.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...K.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...K.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...K.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...K.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...K.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...K.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...K.errToObj(t)})}nonempty(e){return this.min(1,K.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Go.create=e=>new Go({checks:[],typeName:q.ZodString,coerce:e?.coerce??!1,...yo(e)});function Ko(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var qo=class e extends bo{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==H.number){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.number,received:t.parsedType}),G}let t,n=new lo;for(let r of this._def.checks)r.kind===`int`?to.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),W(t,{code:U.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?Ko(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),W(t,{code:U.not_finite,message:r.message}),n.dirty()):to.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,K.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,K.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,K.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,K.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:K.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:K.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:K.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:K.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:K.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:K.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:K.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:K.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&to.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};qo.create=e=>new qo({checks:[],typeName:q.ZodNumber,coerce:e?.coerce||!1,...yo(e)});var Jo=class e extends bo{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==H.bigint)return this._getInvalidInput(e);let t,n=new lo;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):to.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.bigint,received:t.parsedType}),G}gte(e,t){return this.setLimit(`min`,e,!0,K.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,K.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,K.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,K.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:K.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:K.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:K.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:K.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Jo.create=e=>new Jo({checks:[],typeName:q.ZodBigInt,coerce:e?.coerce??!1,...yo(e)});var Yo=class extends bo{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==H.boolean){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.boolean,received:t.parsedType}),G}return fo(e.data)}};Yo.create=e=>new Yo({typeName:q.ZodBoolean,coerce:e?.coerce||!1,...yo(e)});var Xo=class e extends bo{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==H.date){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.date,received:t.parsedType}),G}if(Number.isNaN(e.data.getTime()))return W(this._getOrReturnCtx(e),{code:U.invalid_date}),G;let t=new lo,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):to.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:K.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:K.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};Xo.create=e=>new Xo({checks:[],coerce:e?.coerce||!1,typeName:q.ZodDate,...yo(e)});var Zo=class extends bo{_parse(e){if(this._getType(e)!==H.symbol){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.symbol,received:t.parsedType}),G}return fo(e.data)}};Zo.create=e=>new Zo({typeName:q.ZodSymbol,...yo(e)});var Qo=class extends bo{_parse(e){if(this._getType(e)!==H.undefined){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.undefined,received:t.parsedType}),G}return fo(e.data)}};Qo.create=e=>new Qo({typeName:q.ZodUndefined,...yo(e)});var $o=class extends bo{_parse(e){if(this._getType(e)!==H.null){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.null,received:t.parsedType}),G}return fo(e.data)}};$o.create=e=>new $o({typeName:q.ZodNull,...yo(e)});var es=class extends bo{constructor(){super(...arguments),this._any=!0}_parse(e){return fo(e.data)}};es.create=e=>new es({typeName:q.ZodAny,...yo(e)});var ts=class extends bo{constructor(){super(...arguments),this._unknown=!0}_parse(e){return fo(e.data)}};ts.create=e=>new ts({typeName:q.ZodUnknown,...yo(e)});var ns=class extends bo{_parse(e){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.never,received:t.parsedType}),G}};ns.create=e=>new ns({typeName:q.ZodNever,...yo(e)});var rs=class extends bo{_parse(e){if(this._getType(e)!==H.undefined){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.void,received:t.parsedType}),G}return fo(e.data)}};rs.create=e=>new rs({typeName:q.ZodVoid,...yo(e)});var is=class e extends bo{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==H.array)return W(t,{code:U.invalid_type,expected:H.array,received:t.parsedType}),G;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(W(t,{code:e?U.too_big:U.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(W(t,{code:U.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(W(t,{code:U.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new _o(t,e,t.path,n)))).then(e=>lo.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new _o(t,e,t.path,n)));return lo.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:K.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:K.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:K.toString(n)}})}nonempty(e){return this.min(1,e)}};is.create=(e,t)=>new is({type:e,minLength:null,maxLength:null,exactLength:null,typeName:q.ZodArray,...yo(t)});function as(e){if(e instanceof os){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=ws.create(as(r))}return new os({...e._def,shape:()=>t})}else if(e instanceof is)return new is({...e._def,type:as(e.element)});else if(e instanceof ws)return ws.create(as(e.unwrap()));else if(e instanceof Ts)return Ts.create(as(e.unwrap()));else if(e instanceof fs)return fs.create(e.items.map(e=>as(e)));else return e}var os=class e extends bo{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=to.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==H.object){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.object,received:t.parsedType}),G}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof ns&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new _o(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof ns){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(W(n,{code:U.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new _o(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>lo.mergeObjectSync(t,e)):lo.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return K.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:K.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:q.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of to.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of to.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return as(this)}partial(t){let n={};for(let e of to.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of to.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof ws;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return ys(to.objectKeys(this.shape))}};os.create=(e,t)=>new os({shape:()=>e,unknownKeys:`strip`,catchall:ns.create(),typeName:q.ZodObject,...yo(t)}),os.strictCreate=(e,t)=>new os({shape:()=>e,unknownKeys:`strict`,catchall:ns.create(),typeName:q.ZodObject,...yo(t)}),os.lazycreate=(e,t)=>new os({shape:e,unknownKeys:`strip`,catchall:ns.create(),typeName:q.ZodObject,...yo(t)});var ss=class extends bo{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new io(e.ctx.common.issues));return W(t,{code:U.invalid_union,unionErrors:n}),G}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new io(e));return W(t,{code:U.invalid_union,unionErrors:i}),G}}get options(){return this._def.options}};ss.create=(e,t)=>new ss({options:e,typeName:q.ZodUnion,...yo(t)});var cs=e=>e instanceof _s?cs(e.schema):e instanceof Cs?cs(e.innerType()):e instanceof vs?[e.value]:e instanceof bs?e.options:e instanceof xs?to.objectValues(e.enum):e instanceof Es?cs(e._def.innerType):e instanceof Qo?[void 0]:e instanceof $o?[null]:e instanceof ws?[void 0,...cs(e.unwrap())]:e instanceof Ts?[null,...cs(e.unwrap())]:e instanceof ks||e instanceof js?cs(e.unwrap()):e instanceof Ds?cs(e._def.innerType):[],ls=class e extends bo{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.object)return W(t,{code:U.invalid_type,expected:H.object,received:t.parsedType}),G;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(W(t,{code:U.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),G)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=cs(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:q.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...yo(r)})}};function us(e,t){let n=ro(e),r=ro(t);if(e===t)return{valid:!0,data:e};if(n===H.object&&r===H.object){let n=to.objectKeys(t),r=to.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=us(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===H.array&&r===H.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=us(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===H.date&&r===H.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var ds=class extends bo{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(po(e)||po(r))return G;let i=us(e.value,r.value);return i.valid?((mo(e)||mo(r))&&t.dirty(),{status:t.value,value:i.data}):(W(n,{code:U.invalid_intersection_types}),G)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ds.create=(e,t,n)=>new ds({left:e,right:t,typeName:q.ZodIntersection,...yo(n)});var fs=class e extends bo{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.array)return W(n,{code:U.invalid_type,expected:H.array,received:n.parsedType}),G;if(n.data.length<this._def.items.length)return W(n,{code:U.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),G;!this._def.rest&&n.data.length>this._def.items.length&&(W(n,{code:U.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new _o(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>lo.mergeArray(t,e)):lo.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};fs.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new fs({items:e,typeName:q.ZodTuple,rest:null,...yo(t)})};var ps=class e extends bo{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.object)return W(n,{code:U.invalid_type,expected:H.object,received:n.parsedType}),G;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new _o(n,e,n.path,e)),value:a._parse(new _o(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?lo.mergeObjectAsync(t,r):lo.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof bo?new e({keyType:t,valueType:n,typeName:q.ZodRecord,...yo(r)}):new e({keyType:Go.create(),valueType:t,typeName:q.ZodRecord,...yo(n)})}},ms=class extends bo{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.map)return W(n,{code:U.invalid_type,expected:H.map,received:n.parsedType}),G;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new _o(n,e,n.path,[a,`key`])),value:i._parse(new _o(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return G;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return G;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};ms.create=(e,t,n)=>new ms({valueType:t,keyType:e,typeName:q.ZodMap,...yo(n)});var hs=class e extends bo{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.set)return W(n,{code:U.invalid_type,expected:H.set,received:n.parsedType}),G;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(W(n,{code:U.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(W(n,{code:U.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return G;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new _o(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:K.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:K.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};hs.create=(e,t)=>new hs({valueType:e,minSize:null,maxSize:null,typeName:q.ZodSet,...yo(t)});var gs=class e extends bo{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.function)return W(t,{code:U.invalid_type,expected:H.function,received:t.parsedType}),G;function n(e,n){return co({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,so(),ao].filter(e=>!!e),issueData:{code:U.invalid_arguments,argumentsError:n}})}function r(e,n){return co({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,so(),ao].filter(e=>!!e),issueData:{code:U.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof Ss){let e=this;return fo(async function(...t){let o=new io([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return fo(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new io([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new io([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:fs.create(t).rest(ts.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||fs.create([]).rest(ts.create()),returns:n||ts.create(),typeName:q.ZodFunction,...yo(r)})}},_s=class extends bo{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};_s.create=(e,t)=>new _s({getter:e,typeName:q.ZodLazy,...yo(t)});var vs=class extends bo{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return W(t,{received:t.data,code:U.invalid_literal,expected:this._def.value}),G}return{status:`valid`,value:e.data}}get value(){return this._def.value}};vs.create=(e,t)=>new vs({value:e,typeName:q.ZodLiteral,...yo(t)});function ys(e,t){return new bs({values:e,typeName:q.ZodEnum,...yo(t)})}var bs=class e extends bo{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return W(t,{expected:to.joinValues(n),received:t.parsedType,code:U.invalid_type}),G}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return W(t,{received:t.data,code:U.invalid_enum_value,options:n}),G}return fo(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};bs.create=ys;var xs=class extends bo{_parse(e){let t=to.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==H.string&&n.parsedType!==H.number){let e=to.objectValues(t);return W(n,{expected:to.joinValues(e),received:n.parsedType,code:U.invalid_type}),G}if(this._cache||=new Set(to.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=to.objectValues(t);return W(n,{received:n.data,code:U.invalid_enum_value,options:e}),G}return fo(e.data)}get enum(){return this._def.values}};xs.create=(e,t)=>new xs({values:e,typeName:q.ZodNativeEnum,...yo(t)});var Ss=class extends bo{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==H.promise&&t.common.async===!1?(W(t,{code:U.invalid_type,expected:H.promise,received:t.parsedType}),G):fo((t.parsedType===H.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Ss.create=(e,t)=>new Ss({type:e,typeName:q.ZodPromise,...yo(t)});var Cs=class extends bo{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===q.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{W(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return G;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?G:r.status===`dirty`||t.value===`dirty`?uo(r.value):r});{if(t.value===`aborted`)return G;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?G:r.status===`dirty`||t.value===`dirty`?uo(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?G:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?G:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ho(e))return G;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>ho(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):G);to.assertNever(r)}};Cs.create=(e,t,n)=>new Cs({schema:e,typeName:q.ZodEffects,effect:t,...yo(n)}),Cs.createWithPreprocess=(e,t,n)=>new Cs({schema:t,effect:{type:`preprocess`,transform:e},typeName:q.ZodEffects,...yo(n)});var ws=class extends bo{_parse(e){return this._getType(e)===H.undefined?fo(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ws.create=(e,t)=>new ws({innerType:e,typeName:q.ZodOptional,...yo(t)});var Ts=class extends bo{_parse(e){return this._getType(e)===H.null?fo(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ts.create=(e,t)=>new Ts({innerType:e,typeName:q.ZodNullable,...yo(t)});var Es=class extends bo{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===H.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Es.create=(e,t)=>new Es({innerType:e,typeName:q.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...yo(t)});var Ds=class extends bo{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return go(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new io(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new io(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Ds.create=(e,t)=>new Ds({innerType:e,typeName:q.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...yo(t)});var Os=class extends bo{_parse(e){if(this._getType(e)!==H.nan){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.nan,received:t.parsedType}),G}return{status:`valid`,value:e.data}}};Os.create=e=>new Os({typeName:q.ZodNaN,...yo(e)});var ks=class extends bo{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},As=class e extends bo{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?G:e.status===`dirty`?(t.dirty(),uo(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?G:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:q.ZodPipeline})}},js=class extends bo{_parse(e){let t=this._def.innerType._parse(e),n=e=>(ho(e)&&(e.value=Object.freeze(e.value)),e);return go(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};js.create=(e,t)=>new js({innerType:e,typeName:q.ZodReadonly,...yo(t)});function Ms(e,t){let n=typeof e==`function`?e(t):typeof e==`string`?{message:e}:e;return typeof n==`string`?{message:n}:n}function Ns(e,t={},n){return e?es.create().superRefine((r,i)=>{let a=e(r);if(a instanceof Promise)return a.then(e=>{if(!e){let e=Ms(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}});if(!a){let e=Ms(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}}):es.create()}os.lazycreate;var q;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(q||={});var J=Go.create,Ps=qo.create;Os.create,Jo.create;var Fs=Yo.create;Xo.create,Zo.create,Qo.create,$o.create,es.create;var Is=ts.create;ns.create,rs.create;var Y=is.create,X=os.create;os.strictCreate;var Ls=ss.create,Rs=ls.create;ds.create,fs.create;var zs=ps.create;ms.create,hs.create,gs.create,_s.create;var Bs=vs.create,Vs=bs.create;xs.create,Ss.create,Cs.create,ws.create,Ts.create,Cs.createWithPreprocess,As.create;var Hs=/^[a-z0-9][a-z0-9._-]*$/,Us=/^[a-z][a-z0-9-]*$/,Ws=/^[a-z][a-z0-9-]*$/,Gs=J().min(1).regex(Hs,`admission id must be lowercase alphanumeric with . _ -`),Ks=J().min(1).regex(Us,`admission kind must be kebab-case`),qs=Vs([`low`,`medium`,`high`]),Js=Vs([`pending`,`approved`,`rejected`,`applied`,`failed`]),Ys=Vs([`approved`,`rejected`,`applied`,`failed`]),Xs=Vs([`conversation`,`message`,`tool-call`,`observation`,`artifact`,`memory`,`log`]),Zs=X({at:J().min(1),kind:Xs,summary:J().max(500).optional(),notes:J().max(2e3).optional(),ref:J().min(1)});X({confidence:Ps().min(0).max(1),createdAt:J().min(1),evidence:Y(Zs).readonly(),id:Gs,kind:Ks,payload:zs(J(),Is()).optional(),risk:qs,rollback:J().min(1),scopeId:J().min(1).optional(),soulId:J().min(1).regex(Ws),status:Js,summary:J().min(1).max(2e3),target:J().min(1),updatedAt:J().min(1)}),X({confidence:Ps().min(0).max(1),evidence:Y(Zs).readonly().optional(),id:Gs,kind:Ks,payload:zs(J(),Is()).optional(),risk:qs.default(`high`),rollback:J().min(1),scopeId:J().min(1).optional(),soulId:J().min(1).regex(Ws),summary:J().min(1).max(2e3),target:J().min(1)}),X({appliedAt:J().min(1).optional(),decidedAt:J().min(1),decidedBy:J().min(1),decision:Ys,failureReason:J().max(4e3).optional(),id:Ps().int().positive(),proposalId:Gs,reason:J().max(2e3).optional()}),X({body:J().min(1).max(2e4),topic:J().min(1).regex(/^[a-z0-9][a-z0-9._-]*$/).optional(),indexEntry:J().min(1).max(280).optional()}),X({body:J().min(1).max(2e4),skillId:J().min(1).regex(/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/),overwrite:Fs().optional()});var Qs=/^[a-z0-9][a-z0-9._-]*$/,$s=/^[a-z][a-z0-9-]*$/,ec=J().min(1).regex(Qs,`artifact id must be lowercase alphanumeric with . _ -`),tc=J().min(1).regex($s,`artifact type must be kebab-case`),nc=Vs([`public`,`internal`,`confidential`,`secret`]),rc=Vs([`active`,`archived`,`removed`]),ic=Vs([`operator`,`brain-runtime`,`executor`,`channel-import`]);X({createdAt:J().min(1),evidenceRefs:Y(J().min(1)).readonly(),hash:J().regex(/^[a-f0-9]{64}$/).optional(),id:ec,metadata:zs(J(),Is()).optional(),ref:J().min(1),retention:J().min(1).optional(),scopeId:J().min(1).optional(),sensitivity:nc,source:ic,status:rc,summary:J().max(2e3).optional(),type:tc,updatedAt:J().min(1)}),X({evidenceRefs:Y(J().min(1)).readonly().optional(),hash:J().regex(/^[a-f0-9]{64}$/).optional(),id:ec,metadata:zs(J(),Is()).optional(),ref:J().min(1),retention:J().min(1).optional(),scopeId:J().min(1).optional(),sensitivity:nc.default(`internal`),source:ic,status:rc.default(`active`),summary:J().max(2e3).optional(),type:tc});var ac=J().min(1).regex(/^[a-z][a-z0-9-]*$/,`brief section id must be kebab-case`),oc=Vs([`agent-doc`,`soul-doc`,`memory-doc`,`rollup-doc`,`risk-policy`,`admission-summary`,`artifact-summary`,`scope-manifest`,`soul-skeleton`]),sc=X({body:J().min(1),id:ac,protected:Fs(),source:oc,tokens:Ps().int().nonnegative()}),cc=X({estimatedTokens:Ps().int().nonnegative(),id:ac,reason:J().min(1)});X({artifactRefs:Y(Is()).transform(e=>e.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(e=>e.length>0)).pipe(Y(J().min(1)).readonly()).optional(),executor:J().min(1).optional(),risk:qs.optional(),scopeId:J().min(1).optional(),soulId:J().min(1).optional(),task:J().min(1).max(4e3),tokenBudget:Ps().int().min(200).max(5e4).optional()}),X({compiledAt:J().min(1),droppedSections:Y(cc).readonly(),executor:J().min(1).optional(),scopeId:J().min(1).optional(),sections:Y(sc).readonly(),soulId:J().min(1),task:J().min(1),tokensBudget:Ps().int().positive(),tokensUsed:Ps().int().nonnegative(),warnings:Y(J().min(1)).readonly()});var lc=Symbol.for(`yaml.alias`),uc=Symbol.for(`yaml.document`),dc=Symbol.for(`yaml.map`),fc=Symbol.for(`yaml.pair`),pc=Symbol.for(`yaml.scalar`),mc=Symbol.for(`yaml.seq`),hc=Symbol.for(`yaml.node.type`),gc=e=>!!e&&typeof e==`object`&&e[hc]===lc,_c=e=>!!e&&typeof e==`object`&&e[hc]===uc,vc=e=>!!e&&typeof e==`object`&&e[hc]===dc,yc=e=>!!e&&typeof e==`object`&&e[hc]===fc,bc=e=>!!e&&typeof e==`object`&&e[hc]===pc,xc=e=>!!e&&typeof e==`object`&&e[hc]===mc;function Sc(e){if(e&&typeof e==`object`)switch(e[hc]){case dc:case mc:return!0}return!1}function Cc(e){if(e&&typeof e==`object`)switch(e[hc]){case lc:case dc:case pc:case mc:return!0}return!1}var wc=e=>(bc(e)||Sc(e))&&!!e.anchor,Tc=Symbol(`break visit`),Ec=Symbol(`skip children`),Dc=Symbol(`remove node`);function Oc(e,t){let n=Mc(t);_c(e)?kc(null,e.contents,n,Object.freeze([e]))===Dc&&(e.contents=null):kc(null,e,n,Object.freeze([]))}Oc.BREAK=Tc,Oc.SKIP=Ec,Oc.REMOVE=Dc;function kc(e,t,n,r){let i=Nc(e,t,n,r);if(Cc(i)||yc(i))return Pc(e,r,i),kc(e,i,n,r);if(typeof i!=`symbol`){if(Sc(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=kc(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Tc)return Tc;else i===Dc&&(t.items.splice(e,1),--e)}}else if(yc(t)){r=Object.freeze(r.concat(t));let e=kc(`key`,t.key,n,r);if(e===Tc)return Tc;e===Dc&&(t.key=null);let i=kc(`value`,t.value,n,r);if(i===Tc)return Tc;i===Dc&&(t.value=null)}}return i}async function Ac(e,t){let n=Mc(t);_c(e)?await jc(null,e.contents,n,Object.freeze([e]))===Dc&&(e.contents=null):await jc(null,e,n,Object.freeze([]))}Ac.BREAK=Tc,Ac.SKIP=Ec,Ac.REMOVE=Dc;async function jc(e,t,n,r){let i=await Nc(e,t,n,r);if(Cc(i)||yc(i))return Pc(e,r,i),jc(e,i,n,r);if(typeof i!=`symbol`){if(Sc(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await jc(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Tc)return Tc;else i===Dc&&(t.items.splice(e,1),--e)}}else if(yc(t)){r=Object.freeze(r.concat(t));let e=await jc(`key`,t.key,n,r);if(e===Tc)return Tc;e===Dc&&(t.key=null);let i=await jc(`value`,t.value,n,r);if(i===Tc)return Tc;i===Dc&&(t.value=null)}}return i}function Mc(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Nc(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(vc(t))return n.Map?.(e,t,r);if(xc(t))return n.Seq?.(e,t,r);if(yc(t))return n.Pair?.(e,t,r);if(bc(t))return n.Scalar?.(e,t,r);if(gc(t))return n.Alias?.(e,t,r)}function Pc(e,t,n){let r=t[t.length-1];if(Sc(r))r.items[e]=n;else if(yc(r))e===`key`?r.key=n:r.value=n;else if(_c(r))r.contents=n;else{let e=gc(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var Fc={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},Ic=e=>e.replace(/[!,[\]{}]/g,e=>Fc[e]),Lc=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Ic(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&Cc(e.contents)){let t={};Oc(e.contents,(e,n)=>{Cc(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
10
|
-
`)}};Lc.defaultYaml={explicit:!1,version:`1.2`},Lc.defaultTags={"!!":`tag:yaml.org,2002:`};function Rc(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function zc(e){let t=new Set;return Oc(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function Bc(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function Vc(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=zc(e);let a=Bc(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(bc(t.node)||Sc(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function Hc(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=Hc(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=Hc(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=Hc(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=Hc(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function Uc(e,t,n){if(Array.isArray(e))return e.map((e,t)=>Uc(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!wc(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var Wc=class{constructor(e){Object.defineProperty(this,hc,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!_c(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=Uc(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?Hc(i,{"":o},``,o):o}},Gc=class extends Wc{constructor(e){super(lc),this.source=e,Object.defineProperty(this,`tag`,{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Oc(e,{Node:(e,t)=>{(gc(t)||wc(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(Uc(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=Kc(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(Rc(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function Kc(e,t,n){if(gc(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Sc(t)){let r=0;for(let i of t.items){let t=Kc(e,i,n);t>r&&(r=t)}return r}else if(yc(t)){let r=Kc(e,t.key,n),i=Kc(e,t.value,n);return Math.max(r,i)}return 1}var qc=e=>!e||typeof e!=`function`&&typeof e!=`object`,Z=class extends Wc{constructor(e){super(pc),this.value=e}toJSON(e,t){return t?.keep?this.value:Uc(this.value,e,t)}toString(){return String(this.value)}};Z.BLOCK_FOLDED=`BLOCK_FOLDED`,Z.BLOCK_LITERAL=`BLOCK_LITERAL`,Z.PLAIN=`PLAIN`,Z.QUOTE_DOUBLE=`QUOTE_DOUBLE`,Z.QUOTE_SINGLE=`QUOTE_SINGLE`;var Jc=`tag:yaml.org,2002:`;function Yc(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function Xc(e,t,n){if(_c(e)&&(e=e.contents),Cc(e))return e;if(yc(e)){let t=n.schema[dc].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??=i(e),new Gc(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=Jc+t.slice(2));let l=Yc(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new Z(e);return c&&(c.node=t),t}l=e instanceof Map?o[dc]:Symbol.iterator in Object(e)?o[mc]:o[dc]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new Z(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Zc(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return Xc(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var Qc=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,$c=class extends Wc{constructor(e,t){super(e),Object.defineProperty(this,`schema`,{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>Cc(t)||yc(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Qc(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(Sc(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Zc(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(Sc(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&bc(i)?i.value:i:Sc(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!yc(t))return!1;let n=t.value;return n==null||e&&bc(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return Sc(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(Sc(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,Zc(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},el=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function tl(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var nl=(e,t,n)=>e.endsWith(`
|
|
11
|
-
`)?tl(n,t):n.includes(`
|
|
12
|
-
`)?`
|
|
13
|
-
`+tl(n,t):(e.endsWith(` `)?``:` `)+n,rl=`flow`,il=`block`,al=`quoted`;function ol(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=sl(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
|
|
14
|
-
`)n===`block`&&(h=sl(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
|
|
15
|
-
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
|
|
16
|
-
`&&t!==` `&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function sl(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
|
17
|
-
`);r=t,i=t+1,a=e[i]}return r}var cl=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ll=e=>/^(%|---|\.\.\.)/m.test(e);function ul(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
|
|
18
|
-
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function dl(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(ll(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
|
|
19
|
-
|
|
20
|
-
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
|
|
21
|
-
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:ol(o,a,al,cl(t,!1))}function fl(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
22
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return dl(e,t);let n=t.indent||(ll(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:ol(r,n,rl,cl(t,!1))}function pl(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=dl;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?fl:i&&!t?dl:n?fl:dl}return r(e,t)}var ml;try{ml=RegExp(`(^|(?<!
|
|
23
|
-
))
|
|
24
|
-
+(?!
|
|
25
|
-
|$)`,`g`)}catch{ml=/\n+(?!\n|$)/g}function hl({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return pl(n,r);let l=r.indent||(r.forceBlockIndent||ll(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===Z.BLOCK_FOLDED?!1:t===Z.BLOCK_LITERAL?!0:!ul(n,c,l.length);if(!n)return u?`|
|
|
26
|
-
`:`>
|
|
27
|
-
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
|
|
28
|
-
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
|
|
29
|
-
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
|
|
30
|
-
`&&(p=p.slice(0,-1)),p.replace(ml,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
|
|
31
|
-
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
|
|
32
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=cl(r,!0);o!==`folded`&&t!==Z.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=ol(`${v}${e}${p}`,l,il,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function gl(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
|
|
33
|
-
`)||u&&/[[\]{},]/.test(a))return pl(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
|
34
|
-
`)?pl(a,t):hl(e,t,n,r);if(!s&&!u&&i!==Z.PLAIN&&a.includes(`
|
|
35
|
-
`))return hl(e,t,n,r);if(ll(a)){if(c===``)return t.forceBlockIndent=!0,hl(e,t,n,r);if(s&&c===l)return pl(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return pl(a,t)}return s?d:ol(d,c,rl,cl(t,!1))}function _l(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==Z.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=Z.QUOTE_DOUBLE);let c=e=>{switch(e){case Z.BLOCK_FOLDED:case Z.BLOCK_LITERAL:return i||a?pl(o.value,t):hl(o,t,n,r);case Z.QUOTE_DOUBLE:return dl(o.value,t);case Z.QUOTE_SINGLE:return fl(o.value,t);case Z.PLAIN:return gl(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function vl(e,t){let n=Object.assign({blockQuote:!0,commentString:el,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function yl(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(bc(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function bl(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(bc(e)||Sc(e))&&e.anchor;a&&Rc(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function xl(e,t,n,r){if(yc(e))return e.toString(t,n,r);if(gc(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=Cc(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=yl(t.doc.schema.tags,a);let o=bl(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):bc(a)?_l(a,t,n,r):a.toString(t,n,r);return o?bc(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function Sl({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=Cc(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(Sc(e)||!Cc(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||Sc(e)||(bc(e)?e.type===Z.BLOCK_FOLDED||e.type===Z.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=xl(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=nl(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=nl(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=nl(g,n.indent,l(f))));let _,v,y;Cc(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&bc(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&xc(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=xl(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
|
36
|
-
`:``,v){let e=l(v);S+=`\n${tl(e,n.indent)}`}x===``&&!n.inFlow?S===`
|
|
37
|
-
`&&y&&(S=`
|
|
38
|
-
|
|
39
|
-
`):S+=`\n${n.indent}`}else if(!p&&Sc(t)){let e=x[0],r=x.indexOf(`
|
|
40
|
-
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else (x===``||x[0]===`
|
|
41
|
-
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=nl(g,n.indent,l(y)):h&&i&&i(),g}function Cl(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var wl=`<<`,Tl={identify:e=>e===wl||typeof e==`symbol`&&e.description===wl,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new Z(Symbol(wl)),{addToJSMap:Dl}),stringify:()=>wl},El=(e,t)=>(Tl.identify(t)||bc(t)&&(!t.type||t.type===Z.PLAIN)&&Tl.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===Tl.tag&&e.default);function Dl(e,t,n){if(n=e&&gc(n)?n.resolve(e.doc):n,xc(n))for(let r of n.items)Ol(e,t,r);else if(Array.isArray(n))for(let r of n)Ol(e,t,r);else Ol(e,t,n)}function Ol(e,t,n){let r=e&&gc(n)?n.resolve(e.doc):n;if(!vc(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function kl(e,t,{key:n,value:r}){if(Cc(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(El(e,n))Dl(e,t,r);else{let i=Uc(n,``,e);if(t instanceof Map)t.set(i,Uc(r,i,e));else if(t instanceof Set)t.add(i);else{let a=Al(n,i,e),o=Uc(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function Al(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(Cc(e)&&n?.doc){let t=vl(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),Cl(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function jl(e,t,n){return new Ml(Xc(e,void 0,n),Xc(t,void 0,n))}var Ml=class e{constructor(e,t=null){Object.defineProperty(this,hc,{value:fc}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return Cc(n)&&(n=n.clone(t)),Cc(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return kl(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?Sl(this,e,t,n):JSON.stringify(this)}};function Nl(e,t,n){return(t.inFlow??e.flow?Fl:Pl)(e,t,n)}function Pl({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(Cc(i))!d&&i.spaceBefore&&f.push(``),Il(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(yc(i)){let e=Cc(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),Il(n,f,e.commentBefore,d))}d=!1;let s=xl(i,u,()=>o=null,()=>d=!0);o&&(s+=nl(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
|
|
42
|
-
`}}return e?(p+=`
|
|
43
|
-
`+tl(l(e),c),s&&s()):d&&o&&o(),p}function Fl({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(Cc(i))i.spaceBefore&&d.push(``),Il(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(yc(i)){let e=Cc(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),Il(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=Cc(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=xl(i,c,()=>a=null);l||=d.length>u||o.includes(`
|
|
44
|
-
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=nl(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
|
|
45
|
-
`;return`${e}\n${i}${p}`}else return`${f}${o}${d.join(` `)}${o}${p}`}function Il({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=tl(t(r),e);n.push(i.trimStart())}}function Ll(e,t){let n=bc(t)?t.value:t;for(let r of e)if(yc(r)&&(r.key===t||r.key===n||bc(r.key)&&r.key.value===n))return r}var Rl=class extends $c{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(dc,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(jl(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=yc(e)?e:!e||typeof e!=`object`||!(`key`in e)?new Ml(e,e?.value):new Ml(e.key,e.value);let r=Ll(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);bc(r.value)&&qc(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=Ll(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=Ll(this.items,e)?.value;return(!t&&bc(n)?n.value:n)??void 0}has(e){return!!Ll(this.items,e)}set(e,t){this.add(new Ml(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)kl(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!yc(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Nl(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},zl={collection:`map`,default:!0,nodeClass:Rl,tag:`tag:yaml.org,2002:map`,resolve(e,t){return vc(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>Rl.from(e,t,n)},Bl=class extends $c{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(mc,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Vl(e);return typeof t==`number`?this.items.splice(t,1).length>0:!1}get(e,t){let n=Vl(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&bc(r)?r.value:r}has(e){let t=Vl(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=Vl(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];bc(r)&&qc(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(Uc(e,String(r++),t));return n}toString(e,t,n){return e?Nl(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(Xc(a,void 0,n))}}return i}};function Vl(e){let t=bc(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var Hl={collection:`seq`,default:!0,nodeClass:Bl,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return xc(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>Bl.from(e,t,n)},Ul={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),_l(e,t,n,r)}},Wl={identify:e=>e==null,createNode:()=>new Z(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Z(null),stringify:({source:e},t)=>typeof e==`string`&&Wl.test.test(e)?e:t.options.nullStr},Gl={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Z(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&Gl.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function Kl({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^\d/.test(a)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-- >0;)a+=`0`}return a}var ql={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:Kl},Jl={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Kl(e)}},Yl={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new Z(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:Kl},Xl=e=>typeof e==`bigint`||Number.isInteger(e),Zl=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function Ql(e,t,n){let{value:r}=e;return Xl(r)&&r>=0?n+r.toString(t):Kl(e)}var $l={identify:e=>Xl(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>Zl(e,2,8,n),stringify:e=>Ql(e,8,`0o`)},eu={identify:Xl,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Zl(e,0,10,n),stringify:Kl},tu={identify:e=>Xl(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Zl(e,2,16,n),stringify:e=>Ql(e,16,`0x`)},nu=[zl,Hl,Ul,Wl,Gl,$l,eu,tu,ql,Jl,Yl];function ru(e){return typeof e==`bigint`||Number.isInteger(e)}var iu=({value:e})=>JSON.stringify(e),au=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:iu},{identify:e=>e==null,createNode:()=>new Z(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:iu},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:iu},{identify:ru,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>ru(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:iu}],ou=[zl,Hl].concat(au,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),su={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}else return t(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return``;let o=n,s;if(typeof btoa==`function`){let e=``;for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);s=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(t??=Z.BLOCK_LITERAL,t!==Z.QUOTE_DOUBLE){let e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(s.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=s.substr(r,e);s=i.join(t===Z.BLOCK_LITERAL?`
|
|
46
|
-
`:` `)}return _l({comment:e,type:t,value:s},r,i,a)}};function cu(e,t){if(xc(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!yc(r)){if(vc(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new Ml(new Z(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=yc(r)?r:new Ml(r)}}else t(`Expected a sequence for this tag`);return e}function lu(e,t,n){let{replacer:r}=n,i=new Bl(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e))if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(jl(o,s,n))}return i}var uu={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:cu,createNode:lu},du=class e extends Bl{constructor(){super(),this.add=Rl.prototype.add.bind(this),this.delete=Rl.prototype.delete.bind(this),this.get=Rl.prototype.get.bind(this),this.has=Rl.prototype.has.bind(this),this.set=Rl.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(yc(e)?(r=Uc(e.key,``,t),i=Uc(e.value,r,t)):r=Uc(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=lu(e,t,n),i=new this;return i.items=r.items,i}};du.tag=`tag:yaml.org,2002:omap`;var fu={collection:`seq`,identify:e=>e instanceof Map,nodeClass:du,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=cu(e,t),r=[];for(let{key:e}of n.items)bc(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new du,n)},createNode:(e,t,n)=>du.from(e,t,n)};function pu({value:e,source:t},n){return t&&(e?mu:hu).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var mu={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Z(!0),stringify:pu},hu={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Z(!1),stringify:pu},gu={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:Kl},_u={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Kl(e)}},vu={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new Z(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:Kl},yu=e=>typeof e==`bigint`||Number.isInteger(e);function bu(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function xu(e,t,n){let{value:r}=e;if(yu(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return Kl(e)}var Su={identify:yu,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>bu(e,2,2,n),stringify:e=>xu(e,2,`0b`)},Cu={identify:yu,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>bu(e,1,8,n),stringify:e=>xu(e,8,`0`)},wu={identify:yu,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>bu(e,0,10,n),stringify:Kl},Tu={identify:yu,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>bu(e,2,16,n),stringify:e=>xu(e,16,`0x`)},Eu=class e extends Rl{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=yc(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new Ml(e.key,null):new Ml(e,null),Ll(this.items,t.key)||this.items.push(t)}get(e,t){let n=Ll(this.items,e);return!t&&yc(n)?bc(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Ll(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Ml(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(jl(e,null,n));return i}};Eu.tag=`tag:yaml.org,2002:set`;var Du={collection:`map`,identify:e=>e instanceof Set,nodeClass:Eu,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>Eu.from(e,t,n),resolve(e,t){if(vc(e)){if(e.hasAllNullValues(!0))return Object.assign(new Eu,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function Ou(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function ku(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return Kl(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var Au={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Ou(e,n),stringify:ku},ju={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Ou(e,!1),stringify:ku},Mu={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(Mu.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=Ou(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},Nu=[zl,Hl,Ul,Wl,mu,hu,Su,Cu,wu,Tu,gu,_u,vu,su,Tl,fu,uu,Du,Au,ju,Mu],Pu=new Map([[`core`,nu],[`failsafe`,[zl,Hl,Ul]],[`json`,ou],[`yaml11`,Nu],[`yaml-1.1`,Nu]]),Fu={binary:su,bool:Gl,float:Yl,floatExp:Jl,floatNaN:ql,floatTime:ju,int:eu,intHex:tu,intOct:$l,intTime:Au,map:zl,merge:Tl,null:Wl,omap:fu,pairs:uu,seq:Hl,set:Du,timestamp:Mu},Iu={"tag:yaml.org,2002:binary":su,"tag:yaml.org,2002:merge":Tl,"tag:yaml.org,2002:omap":fu,"tag:yaml.org,2002:pairs":uu,"tag:yaml.org,2002:set":Du,"tag:yaml.org,2002:timestamp":Mu};function Lu(e,t,n){let r=Pu.get(t);if(r&&!e)return n&&!r.includes(Tl)?r.concat(Tl):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let e=Array.from(Pu.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(Tl)),i.reduce((e,t)=>{let n=typeof t==`string`?Fu[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(Fu).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var Ru=(e,t)=>e.key<t.key?-1:+(e.key>t.key),zu=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?Lu(e,`compat`):e?Lu(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?Iu:{},this.tags=Lu(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,dc,{value:zl}),Object.defineProperty(this,pc,{value:Ul}),Object.defineProperty(this,mc,{value:Hl}),this.sortMapEntries=typeof a==`function`?a:a===!0?Ru:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function Bu(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=vl(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(tl(t,``))}let o=!1,s=null;if(e.contents){if(Cc(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(tl(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=xl(e.contents,i,()=>s=null,t);s&&(c+=nl(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(xl(e.contents,i));if(e.directives?.docEnd)if(e.comment){let t=a(e.comment);t.includes(`
|
|
47
|
-
`)?(n.push(`...`),n.push(tl(t,``))):n.push(`... ${t}`)}else n.push(`...`);else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(tl(a(t),``)))}return n.join(`
|
|
48
|
-
`)+`
|
|
49
|
-
`}var Vu=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,hc,{value:uc});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Lc({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[hc]:{value:uc}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Cc(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){Hu(this.contents)&&this.contents.add(e)}addIn(e,t){Hu(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=zc(this);e.anchor=!t||n.has(t)?Bc(t||`a`,n):t}return new Gc(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=Vc(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=Xc(e,l,p);return o&&Sc(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new Ml(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return Hu(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Qc(e)?this.contents==null?!1:(this.contents=null,!0):Hu(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Sc(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Qc(e)?!t&&bc(this.contents)?this.contents.value:this.contents:Sc(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Sc(this.contents)?this.contents.has(e):!1}hasIn(e){return Qc(e)?this.contents!==void 0:Sc(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Zc(this.schema,[e],t):Hu(this.contents)&&this.contents.set(e,t)}setIn(e,t){Qc(e)?this.contents=t:this.contents==null?this.contents=Zc(this.schema,Array.from(e),t):Hu(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new Lc({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new Lc({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new zu(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=Uc(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?Hc(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return Bu(this,e)}};function Hu(e){if(Sc(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var Uu=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},Wu=class extends Uu{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},Gu=class extends Uu{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},Ku=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
|
|
50
|
-
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function qu(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function Ju(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
|
|
51
|
-
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(Ju(t.key)||Ju(t.value))return!0}return!1;default:return!0}}function Yu(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&Ju(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function Xu(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||bc(e)&&bc(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var Zu=`All mapping items must start at the same column`;function Qu({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new(a?.nodeClass??Rl)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=qu(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,Zu)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
|
|
52
|
-
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||Ju(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,Zu);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&Yu(r.indent,u,i),n.atKey=!1,Xu(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=qu(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&Yu(r.indent,f,i),s=c.range[2];let l=new Ml(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
|
|
53
|
-
`+_.comment:g.comment=_.comment);let e=new Ml(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function $u({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new(a?.nodeClass??Bl)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=qu(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&Yu(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function ed(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var td=`Block collections are not allowed within flow collections`,nd=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function rd({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new(a?.nodeClass??(o?Rl:Bl))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=qu(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
|
|
54
|
-
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&Ju(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];yc(t)&&(t=t.value??t.key),t.comment?t.comment+=`
|
|
55
|
-
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],nd(m)&&i(r.range,`BLOCK_IN_FLOW`,td)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);nd(f)&&i(g.range,`BLOCK_IN_FLOW`,td),n.atKey=!1;let _=qu(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?nd(m)&&i(v.range,`BLOCK_IN_FLOW`,td):_.comment&&(g.comment?g.comment+=`
|
|
56
|
-
`+_.comment:g.comment=_.comment);let y=new Ml(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;Xu(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new Rl(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=ed(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
|
|
57
|
-
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function id(e,t,n,r,i,a){let o=n.type===`block-map`?Qu(e,t,n,r,a):n.type===`block-seq`?$u(e,t,n,r,a):rd(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function ad(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===Rl.tagName&&s===`map`||o===Bl.tagName&&s===`seq`)return id(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),id(e,t,n,i,o)}let l=id(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=Cc(u)?u:new Z(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function od(e,t,n){let r=t.offset,i=sd(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?Z.BLOCK_FOLDED:Z.BLOCK_LITERAL,o=t.source?cd(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
|
|
58
|
-
`.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
|
|
59
|
-
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===Z.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
|
|
60
|
-
`):t.length>c||r[0]===` `?(f===` `?f=`
|
|
61
|
-
`:!p&&f===`
|
|
62
|
-
`&&(f=`
|
|
63
|
-
|
|
64
|
-
`),d+=f+t.slice(c)+r,f=`
|
|
65
|
-
`,p=!0):r===``?f===`
|
|
66
|
-
`?d+=`
|
|
67
|
-
`:f=`
|
|
68
|
-
`:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
|
|
69
|
-
`+o[e][0].slice(c);d[d.length-1]!==`
|
|
70
|
-
`&&(d+=`
|
|
71
|
-
`);break;default:d+=`
|
|
72
|
-
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function sd({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function cd(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function ld(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=Z.PLAIN,c=ud(a,l);break;case`single-quoted-scalar`:s=Z.QUOTE_SINGLE,c=dd(a,l);break;case`double-quoted-scalar`:s=Z.QUOTE_DOUBLE,c=pd(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=ed(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function ud(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`;break}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),fd(e)}function dd(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),fd(e.slice(1,-1)).replace(/''/g,`'`)}function fd(e){let t,n;try{t=RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
73
|
-
`,`sy`),n=RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
74
|
-
`,`sy`)}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=` `,o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===``?a===`
|
|
75
|
-
`?i+=a:a=`
|
|
76
|
-
`:(i+=a+r[1],a=` `),o=n.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,r=s.exec(e),i+a+(r?.[1]??``)}function pd(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(!(i===`\r`&&e[r+1]===`
|
|
77
|
-
`))if(i===`
|
|
78
|
-
`){let{fold:t,offset:i}=md(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=hd[i];if(a)n+=a;else if(i===`
|
|
79
|
-
`)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
|
|
80
|
-
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a={x:2,u:4,U:8}[i];n+=gd(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
|
|
81
|
-
`&&!(a===`\r`&&e[r+2]===`
|
|
82
|
-
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function md(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
|
|
83
|
-
`||r===`\r`)&&!(r===`\r`&&e[t+2]!==`
|
|
84
|
-
`);)r===`
|
|
85
|
-
`&&(n+=`
|
|
86
|
-
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var hd={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
|
87
|
-
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function gd(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(a)){let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}return String.fromCodePoint(a)}function _d(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?od(e,t,r):ld(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[pc]:c?vd(e.schema,i,c,n,r):t.type===`scalar`?yd(e,i,t,r):e.schema[pc];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=bc(a)?a:new Z(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new Z(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function vd(e,t,n,r,i){if(n===`!`)return e[pc];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n)if(t.default&&t.test)a.push(t);else return t;for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[pc])}function yd({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[pc];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[pc];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function bd(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var xd={composeNode:Sd,composeEmptyNode:Cd};function Sd(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=wd(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=_d(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=ad(xd,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=Cd(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!bc(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function Cd(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=_d(e,{type:`scalar`,offset:bd(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function wd({options:e},{offset:t,source:n,end:r},i){let a=new Gc(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=ed(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function Td(e,t,{offset:n,start:r,value:i,end:a},o){let s=new Vu(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=qu(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?Sd(c,i,l,o):Cd(c,l.end,r,null,l,o);let u=s.contents.range[2],d=ed(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function Ed(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function Dd(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
|
|
88
|
-
|
|
89
|
-
`:`
|
|
90
|
-
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var Od=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=Ed(e);r?this.warnings.push(new Gu(i,t,n)):this.errors.push(new Wu(i,t,n))},this.directives=new Lc({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=Dd(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(Sc(i)&&!i.flow&&i.items.length>0){let e=i.items[0];yc(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Dd(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=Ed(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=Td(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Wu(Ed(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new Wu(Ed(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=ed(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Wu(Ed(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new Vu(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},kd=Symbol(`break visit`),Ad=Symbol(`skip children`),jd=Symbol(`remove item`);function Md(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),Nd(Object.freeze([]),e,t)}Md.BREAK=kd,Md.SKIP=Ad,Md.REMOVE=jd,Md.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},Md.parentCollection=(e,t)=>{let n=Md.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function Nd(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=Nd(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===kd)return kd;else r===jd&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function Pd(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
|
|
91
|
-
`:case`\r
|
|
92
|
-
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function Fd(e){switch(e){case void 0:case` `:case`
|
|
93
|
-
`:case`\r`:case` `:return!0;default:return!1}}var Id=new Set(`0123456789ABCDEFabcdef`),Ld=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),Rd=new Set(`,[]{}`),zd=new Set(` ,[]{}
|
|
94
|
-
\r `),Bd=e=>!e||zd.has(e),Vd=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
|
|
95
|
-
`?!0:t===`\r`?this.buffer[e+1]===`
|
|
96
|
-
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
|
|
97
|
-
`||!t&&!this.atEnd)return e+n+1}return t===`
|
|
98
|
-
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&Fd(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
99
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}else n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&Fd(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Fd(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&Fd(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(Bd),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&Fd(r[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(r[0]===`]`||r[0]===`}`)))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(Bd),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||Fd(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
|
|
100
|
-
`,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
|
|
101
|
-
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>Fd(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
|
|
102
|
-
`:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
|
|
103
|
-
`)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
|
|
104
|
-
`,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
|
|
105
|
-
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
|
|
106
|
-
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(!0);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(Fd(r)||e&&Rd.has(r))break;t=n}else if(Fd(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
|
|
107
|
-
`?(n+=1,r=`
|
|
108
|
-
`,i=this.buffer[n+1]):t=n),i===`#`||e&&Rd.has(i))break;if(r===`
|
|
109
|
-
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&Rd.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){switch(this.charAt(0)){case`!`:return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`&`:return(yield*this.pushUntil(Bd))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`-`:case`?`:case`:`:{let e=this.flowLevel>0,t=this.charAt(1);if(Fd(t)||e&&Rd.has(t))return e?this.flowKey&&=!1:this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!Fd(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Ld.has(t))t=this.buffer[++e];else if(t===`%`&&Id.has(this.buffer[e+1])&&Id.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
110
|
-
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
|
|
111
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},Hd=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function Ud(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Wd(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function Gd(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function Kd(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function qd(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function Jd(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!Ud(t.start,`explicit-key-ind`)&&!Ud(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,Gd(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}var Yd=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new Vd,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Pd(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&Jd(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&Wd(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:Wd(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=qd(Kd(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
|
|
112
|
-
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
113
|
-
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey)if(!t.sep)if(Ud(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=qd(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ud(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Gd(t.key)&&!Ud(t.sep,`newline`)){let e=qd(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):Ud(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!Ud(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||Ud(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=qd(Kd(t));Jd(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
|
|
114
|
-
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
115
|
-
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=qd(Kd(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=qd(Kd(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function Xd(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Hd||null,prettyErrors:t}}function Zd(e,t={}){let{lineCounter:n,prettyErrors:r}=Xd(t),i=new Yd(n?.addNewLine),a=new Od(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new Wu(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(Ku(e,n)),o.warnings.forEach(Ku(e,n))),o}function Qd(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=Zd(e,n);if(!i)return null;if(i.warnings.forEach(e=>Cl(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}var $d=J().min(1).regex(/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/),ef=Vs([`info`,`warning`,`error`]),tf=Vs([`pending`,`pass`,`warn`,`fail`]),nf=Vs([`draft`,`enabled`,`disabled`]),rf=X({code:J().min(1),message:J().min(1),path:J().min(1).optional(),severity:ef}),af=Ls([tf,X({checkedAt:J().min(1).optional(),issues:Y(rf),status:tf})]);X({packs:Y(X({id:$d,status:nf,validation:af})),schemaVersion:Bs(1),soul:$d.optional(),status:nf});var of=Vs([`auto`,`ask`,`deny`]),sf=X({action:of,pattern:J().min(1),reason:J().min(1).optional()});X({outOfScope:X({default:J().min(1).optional(),strategy:J().min(1).optional()}).passthrough().refine(e=>typeof e.default==`string`||typeof e.strategy==`string`,`outOfScope requires either default or strategy`),risk:X({highRiskRequiresApproval:Fs(),policy:J().min(1).optional()}).passthrough(),schemaVersion:Bs(1),soul:X({label:J().min(1).optional(),preset:$d,source:J().min(1).optional()}).passthrough().optional(),status:nf,toolPolicy:X({default:of,rules:Y(sf)}).passthrough().optional()});var cf=X({description:J().min(1).optional(),risk:Vs([`low`,`medium`,`high`]).optional(),tools:Y(J().min(1)).optional()}).passthrough();X({defaultToolsets:Y($d),schemaVersion:Bs(1),soul:$d.optional(),status:nf,toolsets:zs(cf).optional(),validation:af.optional()});var lf=X({secretRef:J().min(1)}),uf=X({description:J().min(1).optional(),inputSchema:zs(Is()).optional(),name:J().min(1)}).passthrough(),df=X({args:Y(J()).optional(),command:J().min(1).optional(),description:J().min(1).optional(),disabled:Fs().optional(),env:zs(Is()).optional(),headers:zs(Is()).optional(),tools:Y(uf).optional(),transport:Vs([`stdio`,`streamable-http`,`sse`]).optional(),url:J().min(1).optional()}).passthrough();X({schemaVersion:Bs(1).optional(),servers:zs(df)});var ff=Vs([`filesystem-read`,`filesystem-write`,`shell`,`network`,`browser`,`mcp`]),pf=X({capabilities:Y(J().min(1)).optional(),description:J().min(1),name:J().min(1),permissions:Y(ff).optional(),version:J().min(1).optional()}).passthrough(),mf=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/,hf=pf.extend({id:J().min(1)}),gf=X({expectedId:J().min(1),skillMd:J().min(1),sourcePath:J().min(1)});function _f(e,t){let n=mf.exec(e);if(!n)throw Error(`Brain skill pack ${t} is missing YAML frontmatter`);let r;try{r=Qd(n[1]??``)}catch(e){throw Error(`Brain skill pack ${t} has invalid YAML frontmatter: ${e instanceof Error?e.message:String(e)}`)}try{return hf.parse(r)}catch(e){throw e instanceof io?Error(`Brain skill pack ${t} does not satisfy SkillMetadata: ${e.issues.map(e=>e.message).join(`; `)}`):e}}function vf(e){let t=gf.parse(e),n=_f(t.skillMd,t.sourcePath);if(n.id!==t.expectedId)throw Error(`Brain skill pack ${t.sourcePath} declares id "${n.id}" but expected "${t.expectedId}"`);return{id:n.id,installPath:`${n.id}/SKILL.md`,metadata:n,skillMd:t.skillMd.trimEnd(),sourcePath:t.sourcePath}}var yf=`---
|
|
116
|
-
id: developer.codebase-orientation
|
|
117
|
-
name: Codebase Orientation
|
|
118
|
-
description: Build codebase context before editing, with narrow search, impact tracing, and focused verification.
|
|
119
|
-
version: 0.1.0
|
|
120
|
-
capabilities:
|
|
121
|
-
- codebase
|
|
122
|
-
- implementation
|
|
123
|
-
permissions:
|
|
124
|
-
- filesystem-read
|
|
125
|
-
- filesystem-write
|
|
126
|
-
- shell
|
|
127
|
-
---
|
|
128
|
-
# Codebase Orientation Skill
|
|
129
|
-
|
|
130
|
-
Use this before implementing code changes.
|
|
131
|
-
|
|
132
|
-
## Workflow
|
|
133
|
-
|
|
134
|
-
1. Locate the smallest relevant files and tests.
|
|
135
|
-
2. Trace upstream inputs and downstream consumers.
|
|
136
|
-
3. Identify existing conventions before introducing new structure.
|
|
137
|
-
4. Make scoped edits that map directly to the requested behavior.
|
|
138
|
-
5. Run focused verification first, then broaden only when the change crosses package boundaries.
|
|
139
|
-
|
|
140
|
-
## Guardrails
|
|
141
|
-
|
|
142
|
-
- Do not rewrite unrelated code.
|
|
143
|
-
- Do not use destructive git operations.
|
|
144
|
-
- Keep secrets out of source, logs, and Brain memory.
|
|
145
|
-
`,bf=`---
|
|
146
|
-
id: devops-sre.incident-triage
|
|
147
|
-
name: Incident Triage
|
|
148
|
-
description: Triage operational incidents with timeline, blast radius, evidence, rollback, and escalation.
|
|
149
|
-
version: 0.1.0
|
|
150
|
-
capabilities:
|
|
151
|
-
- incident
|
|
152
|
-
- operations
|
|
153
|
-
permissions:
|
|
154
|
-
- filesystem-read
|
|
155
|
-
- shell
|
|
156
|
-
- network
|
|
157
|
-
---
|
|
158
|
-
# Incident Triage Skill
|
|
159
|
-
|
|
160
|
-
Use this for alerts, outages, degraded service, deployment failures, or reliability investigations.
|
|
161
|
-
|
|
162
|
-
## Workflow
|
|
163
|
-
|
|
164
|
-
1. Establish current state, user impact, and time window.
|
|
165
|
-
2. Collect evidence from logs, health checks, dashboards, recent deploys, or operator-provided artifacts.
|
|
166
|
-
3. Separate mitigation from root-cause analysis.
|
|
167
|
-
4. Prefer dry-run and read-only checks before remediation.
|
|
168
|
-
5. Record rollback or recovery steps before high-risk operations.
|
|
169
|
-
|
|
170
|
-
## Guardrails
|
|
171
|
-
|
|
172
|
-
- Do not restart, scale, deploy, or change production state without explicit approval.
|
|
173
|
-
- Redact tokens, host secrets, and customer data in summaries.
|
|
174
|
-
`,xf=`---
|
|
175
|
-
id: finance-ops.financial-evidence-review
|
|
176
|
-
name: Financial Evidence Review
|
|
177
|
-
description: Review finance artifacts with source tracking, reconciliation questions, and escalation boundaries.
|
|
178
|
-
version: 0.1.0
|
|
179
|
-
capabilities:
|
|
180
|
-
- finance
|
|
181
|
-
- evidence-review
|
|
182
|
-
permissions:
|
|
183
|
-
- filesystem-read
|
|
184
|
-
---
|
|
185
|
-
# Financial Evidence Review Skill
|
|
186
|
-
|
|
187
|
-
Use this for invoices, expenses, reconciliation notes, payment questions, and finance operations evidence.
|
|
188
|
-
|
|
189
|
-
## Workflow
|
|
190
|
-
|
|
191
|
-
1. Identify the financial object, period, amount, counterparty, and source artifact.
|
|
192
|
-
2. Separate observed facts from assumptions.
|
|
193
|
-
3. Flag missing approvals, mismatched amounts, duplicate references, or unclear ownership.
|
|
194
|
-
4. Recommend the next evidence to collect before judgment.
|
|
195
|
-
5. Escalate legal, tax, payroll, or regulated advice instead of presenting it as final guidance.
|
|
196
|
-
|
|
197
|
-
## Guardrails
|
|
198
|
-
|
|
199
|
-
- Do not infer sensitive account details that are not in evidence.
|
|
200
|
-
- Do not store personal or payment data in Brain memory without admission and redaction.
|
|
201
|
-
`,Sf=`---
|
|
202
|
-
id: general-assistant.general-task-framing
|
|
203
|
-
name: General Task Framing
|
|
204
|
-
description: Turn broad requests into scoped, evidence-backed next actions without overreaching.
|
|
205
|
-
version: 0.1.0
|
|
206
|
-
capabilities:
|
|
207
|
-
- task-framing
|
|
208
|
-
- clarification
|
|
209
|
-
permissions:
|
|
210
|
-
- filesystem-read
|
|
211
|
-
---
|
|
212
|
-
# General Task Framing Skill
|
|
213
|
-
|
|
214
|
-
Use this when the user asks for help but the domain, evidence, or desired output is ambiguous.
|
|
215
|
-
|
|
216
|
-
## Workflow
|
|
217
|
-
|
|
218
|
-
1. Restate the concrete objective in one sentence.
|
|
219
|
-
2. Identify missing input, constraints, audience, and expected output format.
|
|
220
|
-
3. Choose the smallest useful next step.
|
|
221
|
-
4. Ask a concise clarifying question only when acting would risk crossing scope.
|
|
222
|
-
5. Keep durable learnings behind Brain admission.
|
|
223
|
-
|
|
224
|
-
## Guardrails
|
|
225
|
-
|
|
226
|
-
- Do not silently convert a general request into code, finance, HR, legal, or production operations.
|
|
227
|
-
- Do not expand filesystem or network access without a clear reason.
|
|
228
|
-
`,Cf=`---
|
|
229
|
-
id: hr-recruiting.candidate-screening
|
|
230
|
-
name: Candidate Screening
|
|
231
|
-
description: Screen recruiting evidence against role criteria with bias-aware, source-backed notes.
|
|
232
|
-
version: 0.1.0
|
|
233
|
-
capabilities:
|
|
234
|
-
- recruiting
|
|
235
|
-
- evidence-review
|
|
236
|
-
permissions:
|
|
237
|
-
- filesystem-read
|
|
238
|
-
---
|
|
239
|
-
# Candidate Screening Skill
|
|
240
|
-
|
|
241
|
-
Use this for resumes, candidate notes, role requirements, interview packets, and recruiting pipeline review.
|
|
242
|
-
|
|
243
|
-
## Workflow
|
|
244
|
-
|
|
245
|
-
1. Identify role criteria and must-have constraints from evidence.
|
|
246
|
-
2. Extract candidate facts with source references.
|
|
247
|
-
3. Separate facts, uncertainties, and recommendations.
|
|
248
|
-
4. Note missing evidence before making a screening recommendation.
|
|
249
|
-
5. Produce a concise decision support summary, not an automated hiring decision.
|
|
250
|
-
|
|
251
|
-
## Guardrails
|
|
252
|
-
|
|
253
|
-
- Avoid protected-class inference and unsupported personal judgments.
|
|
254
|
-
- Treat candidate data as sensitive; durable memory requires admission and redaction.
|
|
255
|
-
`,wf=`---
|
|
256
|
-
id: product-designer.design-critique
|
|
257
|
-
name: Design Critique
|
|
258
|
-
description: Critique product design evidence against user goals, interaction clarity, and visual system fit.
|
|
259
|
-
version: 0.1.0
|
|
260
|
-
capabilities:
|
|
261
|
-
- design
|
|
262
|
-
- critique
|
|
263
|
-
permissions:
|
|
264
|
-
- filesystem-read
|
|
265
|
-
---
|
|
266
|
-
# Design Critique Skill
|
|
267
|
-
|
|
268
|
-
Use this for product UI, flows, prototypes, screenshots, specs, or visual direction reviews.
|
|
269
|
-
|
|
270
|
-
## Workflow
|
|
271
|
-
|
|
272
|
-
1. Identify the user, job-to-be-done, surface, and success criteria.
|
|
273
|
-
2. Review information hierarchy, interaction clarity, accessibility, and consistency.
|
|
274
|
-
3. Tie critique to visible evidence or supplied design requirements.
|
|
275
|
-
4. Prioritize issues by user impact.
|
|
276
|
-
5. Suggest concrete revisions without inventing unrelated product strategy.
|
|
277
|
-
|
|
278
|
-
## Guardrails
|
|
279
|
-
|
|
280
|
-
- Do not present subjective taste as a hard rule.
|
|
281
|
-
- Do not overwrite design-system constraints unless the operator asks to change them.
|
|
282
|
-
`,Tf=`---
|
|
283
|
-
id: project-manager.delivery-risk-review
|
|
284
|
-
name: Delivery Risk Review
|
|
285
|
-
description: Review project delivery state, dependencies, blockers, owner clarity, and next milestones.
|
|
286
|
-
version: 0.1.0
|
|
287
|
-
capabilities:
|
|
288
|
-
- planning
|
|
289
|
-
- risk-review
|
|
290
|
-
permissions:
|
|
291
|
-
- filesystem-read
|
|
292
|
-
---
|
|
293
|
-
# Delivery Risk Review Skill
|
|
294
|
-
|
|
295
|
-
Use this for roadmaps, plans, delivery status, blockers, handoffs, and execution tradeoffs.
|
|
296
|
-
|
|
297
|
-
## Workflow
|
|
298
|
-
|
|
299
|
-
1. Identify goal, current status, deadline, owners, and dependency chain.
|
|
300
|
-
2. Separate committed work, proposed work, and unresolved questions.
|
|
301
|
-
3. Surface the highest-risk blocker first.
|
|
302
|
-
4. Recommend the next decision or artifact needed to unblock execution.
|
|
303
|
-
5. Keep status changes evidence-backed and explicit.
|
|
304
|
-
|
|
305
|
-
## Guardrails
|
|
306
|
-
|
|
307
|
-
- Do not treat plans as approvals.
|
|
308
|
-
- Do not hide missing owner, scope, or deadline information behind optimistic summaries.
|
|
309
|
-
`,Ef=`---
|
|
310
|
-
id: qa-reviewer.regression-review
|
|
311
|
-
name: Regression Review
|
|
312
|
-
description: Review behavior changes for regression risk, missing tests, and focused verification strategy.
|
|
313
|
-
version: 0.1.0
|
|
314
|
-
capabilities:
|
|
315
|
-
- qa
|
|
316
|
-
- regression
|
|
317
|
-
permissions:
|
|
318
|
-
- filesystem-read
|
|
319
|
-
- shell
|
|
320
|
-
---
|
|
321
|
-
# Regression Review Skill
|
|
322
|
-
|
|
323
|
-
Use this before closing a bug fix, refactor, release, or behavior change.
|
|
324
|
-
|
|
325
|
-
## Workflow
|
|
326
|
-
|
|
327
|
-
1. Identify changed behavior and affected user paths.
|
|
328
|
-
2. Map direct tests and adjacent regression risks.
|
|
329
|
-
3. Check edge cases, error paths, data boundaries, and rollback signals.
|
|
330
|
-
4. Prefer reproducible evidence over confidence statements.
|
|
331
|
-
5. Return a concise pass/fail/risk summary with missing verification.
|
|
332
|
-
|
|
333
|
-
## Guardrails
|
|
334
|
-
|
|
335
|
-
- Do not claim coverage from unrelated tests.
|
|
336
|
-
- Do not require broad test gates when a focused test is sufficient.
|
|
337
|
-
`,Df=`---
|
|
338
|
-
id: support-operator.support-case-triage
|
|
339
|
-
name: Support Case Triage
|
|
340
|
-
description: Triage support cases into facts, customer impact, severity, next response, and escalation path.
|
|
341
|
-
version: 0.1.0
|
|
342
|
-
capabilities:
|
|
343
|
-
- support
|
|
344
|
-
- triage
|
|
345
|
-
permissions:
|
|
346
|
-
- filesystem-read
|
|
347
|
-
---
|
|
348
|
-
# Support Case Triage Skill
|
|
349
|
-
|
|
350
|
-
Use this for customer tickets, support inbox items, troubleshooting notes, and escalation summaries.
|
|
351
|
-
|
|
352
|
-
## Workflow
|
|
353
|
-
|
|
354
|
-
1. Identify customer, product surface, impact, timeline, and requested outcome.
|
|
355
|
-
2. Separate confirmed facts from customer claims and internal assumptions.
|
|
356
|
-
3. Assign a tentative severity with the evidence that supports it.
|
|
357
|
-
4. Draft the next customer-facing response or internal escalation note.
|
|
358
|
-
5. Request missing diagnostics only when they are necessary for progress.
|
|
359
|
-
|
|
360
|
-
## Guardrails
|
|
361
|
-
|
|
362
|
-
- Do not expose internal secrets, private notes, or unrelated customer data.
|
|
363
|
-
- Do not promise fixes, refunds, or policy exceptions without authorization.
|
|
364
|
-
`;vf({expectedId:`kernel.brain-admission`,skillMd:`---
|
|
365
|
-
id: kernel.brain-admission
|
|
366
|
-
name: Brain Admission
|
|
367
|
-
description: Propose durable Project Brain mutations with evidence, rollback, and operator approval.
|
|
368
|
-
version: 0.1.0
|
|
369
|
-
capabilities:
|
|
370
|
-
- brain-admission
|
|
371
|
-
- governance
|
|
372
|
-
permissions:
|
|
373
|
-
- filesystem-read
|
|
374
|
-
- shell
|
|
375
|
-
---
|
|
376
|
-
# Brain Admission Skill
|
|
377
|
-
|
|
378
|
-
Use this when a reply would change durable Project Brain state: memory, brain skill, policy, toolset, capability pack, scope manifest, or other \`.aiworker/\` brain assets.
|
|
379
|
-
|
|
380
|
-
## Workflow
|
|
381
|
-
|
|
382
|
-
1. Identify the exact target path or asset class.
|
|
383
|
-
2. Collect evidence from the current conversation or cited files.
|
|
384
|
-
3. State why the change is durable and why it belongs in AIWorker Brain rather than executor-native memory.
|
|
385
|
-
4. Create an admission proposal with summary, confidence, evidence, target, payload, and rollback instructions.
|
|
386
|
-
5. Treat the proposal as pending until an operator approves and applies it.
|
|
387
|
-
|
|
388
|
-
## Guardrails
|
|
389
|
-
|
|
390
|
-
- Do not write durable Brain files directly as a side effect of a normal task.
|
|
391
|
-
- Do not claim admission succeeded unless AIWorker admission state confirms it.
|
|
392
|
-
- Do not store plaintext secrets; use redacted values or secret refs.
|
|
393
|
-
`,sourcePath:`packages/shared/src/brain/skills/kernel/brain-admission/SKILL.md`}),vf({expectedId:`kernel.executor-quality-review`,skillMd:`---
|
|
394
|
-
id: kernel.executor-quality-review
|
|
395
|
-
name: Executor Quality Review
|
|
396
|
-
description: Review executor output for evidence, boundary fit, verification, and Brain governance bypass risk.
|
|
397
|
-
version: 0.1.0
|
|
398
|
-
capabilities:
|
|
399
|
-
- quality-gate
|
|
400
|
-
- executor-supervision
|
|
401
|
-
permissions:
|
|
402
|
-
- filesystem-read
|
|
403
|
-
---
|
|
404
|
-
# Executor Quality Review Skill
|
|
405
|
-
|
|
406
|
-
Use this when checking whether an executor result is ready to return, retry, or escalate.
|
|
407
|
-
|
|
408
|
-
## Review Axes
|
|
409
|
-
|
|
410
|
-
1. Evidence: does the answer cite observed files, commands, API responses, or conversation facts when needed?
|
|
411
|
-
2. Scope: did the executor stay inside the worker-bound business scope?
|
|
412
|
-
3. Verification: were the relevant tests, dry-runs, or inspections performed?
|
|
413
|
-
4. Risk: did the executor attempt high-risk writes, production operations, or secret exposure without approval?
|
|
414
|
-
5. Brain boundary: did it claim memory, skill, or policy changes without an AIWorker admission proposal?
|
|
415
|
-
|
|
416
|
-
## Output
|
|
417
|
-
|
|
418
|
-
Return a concise verdict: \`pass\`, \`needs-repair\`, or \`escalate\`, followed by the smallest concrete repair.
|
|
419
|
-
`,sourcePath:`packages/shared/src/brain/skills/kernel/executor-quality-review/SKILL.md`});var Of=vf({expectedId:`developer.codebase-orientation`,skillMd:yf,sourcePath:`packages/shared/src/soul/packs/developer/skills/codebase-orientation/SKILL.md`}),kf=vf({expectedId:`devops-sre.incident-triage`,skillMd:bf,sourcePath:`packages/shared/src/soul/packs/devops-sre/skills/incident-triage/SKILL.md`}),Af=vf({expectedId:`finance-ops.financial-evidence-review`,skillMd:xf,sourcePath:`packages/shared/src/soul/packs/finance-ops/skills/financial-evidence-review/SKILL.md`}),jf=vf({expectedId:`general-assistant.general-task-framing`,skillMd:Sf,sourcePath:`packages/shared/src/soul/packs/general-assistant/skills/general-task-framing/SKILL.md`}),Mf=vf({expectedId:`hr-recruiting.candidate-screening`,skillMd:Cf,sourcePath:`packages/shared/src/soul/packs/hr-recruiting/skills/candidate-screening/SKILL.md`}),Nf=vf({expectedId:`product-designer.design-critique`,skillMd:wf,sourcePath:`packages/shared/src/soul/packs/product-designer/skills/design-critique/SKILL.md`}),Pf=vf({expectedId:`project-manager.delivery-risk-review`,skillMd:Tf,sourcePath:`packages/shared/src/soul/packs/project-manager/skills/delivery-risk-review/SKILL.md`}),Ff=vf({expectedId:`qa-reviewer.regression-review`,skillMd:Ef,sourcePath:`packages/shared/src/soul/packs/qa-reviewer/skills/regression-review/SKILL.md`}),If=vf({expectedId:`support-operator.support-case-triage`,skillMd:Df,sourcePath:`packages/shared/src/soul/packs/support-operator/skills/support-case-triage/SKILL.md`}),Lf={developer:[Of],"devops-sre":[kf],"finance-ops":[Af],"general-assistant":[jf],"hr-recruiting":[Mf],"product-designer":[Nf],"project-manager":[Pf],"qa-reviewer":[Ff],"support-operator":[If]};function Rf(e){return Lf[e]??[]}var zf=Vs([`codex`,`claude-code`]),Bf=Vs([`project`]),Vf=Vs([`stdio`,`streamable-http`,`sse`]),Hf=Ls([J().min(1),lf]),Uf=X({args:Y(J()).optional(),bearerTokenEnvVar:J().min(1).optional(),command:J().min(1).optional(),description:J().min(1).optional(),disabled:Fs().optional(),env:zs(Hf).optional(),headers:zs(Hf).optional(),scope:Bf,transport:Vf,url:J().min(1).optional()}).passthrough(),Wf=X({issues:Y(X({code:J().min(1),message:J().min(1),severity:Vs([`error`,`warning`])})).optional(),status:Vs([`pending`,`pass`,`warn`,`fail`])}).passthrough(),Gf=X({disabled:Fs().optional(),scope:Bf.optional(),source:X({ref:J().min(1).optional(),type:Vs([`engine-cli`,`path`,`registry`,`url`,`manual`])}).passthrough().optional(),status:Vs([`draft`,`declared`,`validated`,`projected`]).optional(),validation:Wf.optional()}).passthrough();X({engines:zs(zf,X({mcp:zs(Uf).optional(),plugins:zs(Gf).optional(),policies:zs(Gf).optional(),skills:zs(Gf).optional()}).passthrough()),schemaVersion:Bs(1)});var Kf=/^w_[0-9a-hjkmnp-tv-z]{12}$/,qf=`wtk_`,Jf=/^wtk_[\w-]{32,}$/;function Yf(){let e=new Uint8Array(32);return globalThis.crypto.getRandomValues(e),`${qf}${Xf(e)}`}function Xf(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return globalThis.btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}var Zf=Rs(`kind`,[X({kind:Bs(`file_read`),path:J()}),X({kind:Bs(`file_edit`),path:J(),diff:J().optional()}),X({kind:Bs(`command_run`),command:J()}),X({kind:Bs(`search`),query:J()}),X({kind:Bs(`web_fetch`),url:J()}),X({kind:Bs(`task_plan`),summary:J()}),X({kind:Bs(`tool`),toolName:J(),arguments:zs(Is()).optional()}),X({kind:Bs(`other`),description:J().optional()})]),Qf=Vs([`pending`,`running`,`success`,`failed`,`pending_approval`,`denied`]),$f=X({inputTokens:Ps().int().nonnegative(),outputTokens:Ps().int().nonnegative()}),ep=zs(Is()),tp=Vs([`stop`,`tool`,`length`,`error`,`cancelled`]);Rs(`type`,[X({type:Bs(`assistant_message_delta`),delta:J()}),X({type:Bs(`thinking_delta`),delta:J()}),X({type:Bs(`tool_use`),id:J(),name:J(),arguments:zs(Is()),action:Zf,status:Qf.optional()}),X({type:Bs(`tool_result`),id:J(),name:J(),content:J(),isError:Fs().optional()}),X({type:Bs(`permission_request`),id:J(),reason:J(),toolUseId:J().optional()}),X({type:Bs(`token_usage`),usage:$f}),X({type:Bs(`engine_binding`),engine:J().min(1),binding:ep.nullable()}),X({type:Bs(`finish`),reason:tp,usage:$f.optional()}),X({type:Bs(`error`),error:J()})]);var np=/^[a-z0-9][a-z0-9._-]*$/,rp=/^[a-z][a-z0-9-]*$/,ip=/^[a-z][a-z0-9-]*$/,ap=Vs([`private`,`team`,`public`]),op=Vs([`manual-approval`,`auto-low-risk`]),sp=J().min(1).regex(np,`scope id must be lowercase alphanumeric with . _ -`),cp=J().min(1).regex(rp,`scope kind must be kebab-case`),lp=J().min(1).regex(ip,`primary soul id must be kebab-case`),up=X({description:J().min(1).optional(),path:J().min(1)});X({approval:op.optional(),artifactRoots:Y(up).readonly().optional(),id:sp.optional(),kind:cp,labels:Y(J().min(1)).readonly().optional(),primarySoul:lp,privacy:ap.optional(),retention:J().min(1).optional(),schemaVersion:Bs(1),subject:J().min(1).optional()});var dp=/^[a-z][a-z0-9-]*$/,fp=/^\d+\.\d+\.\d+$/,pp=/^[a-z][a-z0-9-]*$/,mp=/^[a-z][a-z0-9-]*$/,hp=J().min(1).regex(dp,`soul id must be kebab-case`),gp=J().regex(fp,`soul version must be major.minor.patch`),_p=J().min(1).regex(pp,`scope kind must be kebab-case`),vp=X({description:J().min(1),id:hp,label:J().min(1),version:gp}),yp=X({communicationStyle:J().min(1),highRiskRequiresApproval:Fs(),outOfScopeStrategy:J().min(1),riskNotes:J().min(1),vagueContextStrategy:J().min(1).optional()}),bp=X({retention:J().min(1),target:J().min(1)}),xp=X({artifactTypes:Y(J().min(1)).readonly(),entityTypes:Y(J().min(1)).readonly(),proposalTypes:Y(J().min(1)).readonly(),workflowStates:Y(J().min(1)).readonly()}),Sp=X({briefHooks:X({defaultSections:Y(J().min(1).regex(mp)).readonly(),protectedSections:Y(J().min(1).regex(mp)).readonly()}).superRefine((e,t)=>{let n=new Set(e.defaultSections);for(let r of e.protectedSections)n.has(r)||t.addIssue({code:U.custom,message:`protected section "${r}" must also appear in defaultSections`,path:[`protectedSections`]})}),initProjection:X({boundaries:Y(J().min(1)).min(1).readonly(),packs:Y(J().min(1)).min(1).readonly(),responsibilities:Y(J().min(1)).min(1).readonly(),toolsets:Y(J().min(1)).min(1).readonly()}),manifest:vp,primaryScopeKind:_p,retentionDefaults:Y(bp).readonly(),riskPolicy:yp,schemaPack:xp,supportedScopeKinds:Y(_p).min(1).readonly()}).superRefine((e,t)=>{e.supportedScopeKinds.includes(e.primaryScopeKind)||t.addIssue({code:U.custom,message:`primaryScopeKind must appear in supportedScopeKinds`,path:[`primaryScopeKind`]})}),Cp=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/,wp=X({agentMd:J().min(1),brainSkillPacks:Ns().optional(),expectedId:J().min(1),soulMd:J().min(1),sourcePath:J().min(1)});function Tp(e){let t=Cp.exec(e);return t?(t[2]??``).trim():e.trim()}function Ep(e,t){let n=Cp.exec(e);if(!n)throw Error(`Soul pack ${t} is missing YAML frontmatter`);let r;try{r=Qd(n[1]??``)}catch(e){throw Error(`Soul pack ${t} has invalid YAML frontmatter: ${e instanceof Error?e.message:String(e)}`)}try{return Sp.parse(r)}catch(e){throw e instanceof io?Error(`Soul pack ${t} does not satisfy SoulModule: ${e.issues.map(e=>e.message).join(`; `)}`):e}}function Dp(e){let t=wp.parse(e),n=Ep(t.soulMd,t.sourcePath);if(n.manifest.id!==t.expectedId)throw Error(`Soul pack ${t.sourcePath} declares id "${n.manifest.id}" but expected "${t.expectedId}"`);return{agentMd:t.agentMd.trimEnd(),brainSkillPacks:t.brainSkillPacks??[],module:n,soulBody:Tp(t.soulMd),soulMd:t.soulMd.trimEnd(),sourcePath:t.sourcePath}}var Op=`# Developer Worker
|
|
420
|
-
|
|
421
|
-
## 主要职责
|
|
422
|
-
|
|
423
|
-
- 理解代码库并实现小步可验证改动
|
|
424
|
-
- 修复缺陷并补充聚焦测试
|
|
425
|
-
- 维护构建、类型检查、lint 与发布脚本
|
|
426
|
-
|
|
427
|
-
## 明确边界
|
|
428
|
-
|
|
429
|
-
- 不擅自执行破坏性 git 操作
|
|
430
|
-
- 不把 secret 写入源码或长期记忆
|
|
431
|
-
- 遇到高风险生产写入先给出 dry-run 与回滚路径
|
|
432
|
-
|
|
433
|
-
## 职责外响应
|
|
434
|
-
|
|
435
|
-
非代码类运营、财务、人事任务先说明不属于核心职责,并建议切换或新增对应能力。
|
|
436
|
-
|
|
437
|
-
## Brain admission governance
|
|
438
|
-
|
|
439
|
-
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
440
|
-
- Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul developer --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
|
|
441
|
-
- Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
|
|
442
|
-
- Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
443
|
-
|
|
444
|
-
## 默认 capability packs
|
|
445
|
-
|
|
446
|
-
- code
|
|
447
|
-
- repo-maintenance
|
|
448
|
-
- review
|
|
449
|
-
`,kp=`---
|
|
450
|
-
manifest:
|
|
451
|
-
id: developer
|
|
452
|
-
label: Developer
|
|
453
|
-
description: 开发、调试、代码审查、仓库维护。
|
|
454
|
-
version: 0.1.0
|
|
455
|
-
primaryScopeKind: developer-repo
|
|
456
|
-
supportedScopeKinds:
|
|
457
|
-
- developer-repo
|
|
458
|
-
- general
|
|
459
|
-
briefHooks:
|
|
460
|
-
defaultSections:
|
|
461
|
-
- agent
|
|
462
|
-
- soul
|
|
463
|
-
- memory
|
|
464
|
-
- rollup
|
|
465
|
-
- recent-changes
|
|
466
|
-
- risk-policy
|
|
467
|
-
protectedSections:
|
|
468
|
-
- risk-policy
|
|
469
|
-
initProjection:
|
|
470
|
-
responsibilities:
|
|
471
|
-
- 理解代码库并实现小步可验证改动
|
|
472
|
-
- 修复缺陷并补充聚焦测试
|
|
473
|
-
- 维护构建、类型检查、lint 与发布脚本
|
|
474
|
-
boundaries:
|
|
475
|
-
- 不擅自执行破坏性 git 操作
|
|
476
|
-
- 不把 secret 写入源码或长期记忆
|
|
477
|
-
- 遇到高风险生产写入先给出 dry-run 与回滚路径
|
|
478
|
-
packs:
|
|
479
|
-
- code
|
|
480
|
-
- repo-maintenance
|
|
481
|
-
- review
|
|
482
|
-
toolsets:
|
|
483
|
-
- filesystem-read
|
|
484
|
-
- filesystem-write
|
|
485
|
-
- shell
|
|
486
|
-
- git
|
|
487
|
-
- test
|
|
488
|
-
riskPolicy:
|
|
489
|
-
communicationStyle: 直接、证据优先、默认给出可执行下一步。
|
|
490
|
-
highRiskRequiresApproval: true
|
|
491
|
-
outOfScopeStrategy: 非代码类运营、财务、人事任务先说明不属于核心职责,并建议切换或新增对应能力。
|
|
492
|
-
riskNotes: 文件写入、数据库写入、部署和发布类动作需要明确意图;生产写入必须先 dry-run。
|
|
493
|
-
vagueContextStrategy: 不直接 ls / grep 探索整个项目;先一句话反问关键缺失:具体报错文本、复现步骤、最近改动的文件或提交、是否能在干净 checkout 上复现。
|
|
494
|
-
schemaPack:
|
|
495
|
-
artifactTypes:
|
|
496
|
-
- code-module
|
|
497
|
-
- adr
|
|
498
|
-
- design-doc
|
|
499
|
-
- test-suite
|
|
500
|
-
- release-note
|
|
501
|
-
- changelog-entry
|
|
502
|
-
entityTypes:
|
|
503
|
-
- repository
|
|
504
|
-
- release-tag
|
|
505
|
-
- incident-postmortem
|
|
506
|
-
proposalTypes:
|
|
507
|
-
- memory-add
|
|
508
|
-
- brain-skill-add
|
|
509
|
-
- policy-update
|
|
510
|
-
workflowStates:
|
|
511
|
-
- draft
|
|
512
|
-
- review
|
|
513
|
-
- merged
|
|
514
|
-
- released
|
|
515
|
-
- rolled-back
|
|
516
|
-
retentionDefaults: []
|
|
517
|
-
---
|
|
518
|
-
# Developer Soul
|
|
519
|
-
|
|
520
|
-
## 沟通风格
|
|
521
|
-
|
|
522
|
-
直接、证据优先、默认给出可执行下一步。
|
|
523
|
-
|
|
524
|
-
## 高风险操作策略
|
|
525
|
-
|
|
526
|
-
文件写入、数据库写入、部署和发布类动作需要明确意图;生产写入必须先 dry-run。
|
|
527
|
-
|
|
528
|
-
## 职责边界
|
|
529
|
-
|
|
530
|
-
- 不擅自执行破坏性 git 操作。
|
|
531
|
-
- 不把 secret 写入源码或长期记忆。
|
|
532
|
-
- 遇到高风险生产写入先给出 dry-run 与回滚路径。
|
|
533
|
-
|
|
534
|
-
## Brain admission governance
|
|
535
|
-
|
|
536
|
-
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
537
|
-
- Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul developer --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
|
|
538
|
-
- Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
|
|
539
|
-
- Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
540
|
-
|
|
541
|
-
## 模糊或缺失上下文
|
|
542
|
-
|
|
543
|
-
收到不完整 prompt 时,先一句话反问关键缺失信息,不要直接调 tool 探索,不要为了避免反问而扩大搜索范围越过当前 scope。
|
|
544
|
-
|
|
545
|
-
不直接 ls / grep 探索整个项目;先一句话反问关键缺失:具体报错文本、复现步骤、最近改动的文件或提交、是否能在干净 checkout 上复现。
|
|
546
|
-
`,Ap=`# DevOps SRE Worker
|
|
547
|
-
|
|
548
|
-
## 主要职责
|
|
549
|
-
|
|
550
|
-
- 诊断运行环境和部署链路
|
|
551
|
-
- 维护健康检查、日志和回滚步骤
|
|
552
|
-
- 把事故处理记录成可复用 runbook
|
|
553
|
-
|
|
554
|
-
## 明确边界
|
|
555
|
-
|
|
556
|
-
- 不跳过鉴权或审计
|
|
557
|
-
- 不在无确认时修改生产状态
|
|
558
|
-
- 不把凭据输出到日志
|
|
559
|
-
|
|
560
|
-
## 职责外响应
|
|
561
|
-
|
|
562
|
-
产品设计和人事流程交给对应 worker,必要时只提供技术上下文。
|
|
563
|
-
|
|
564
|
-
## Brain admission governance
|
|
565
|
-
|
|
566
|
-
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
567
|
-
- Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul devops-sre --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
|
|
568
|
-
- Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
|
|
569
|
-
- Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
570
|
-
|
|
571
|
-
## 默认 capability packs
|
|
572
|
-
|
|
573
|
-
- ops
|
|
574
|
-
- monitoring
|
|
575
|
-
- incident-response
|
|
576
|
-
`,jp=`---
|
|
577
|
-
manifest:
|
|
578
|
-
id: devops-sre
|
|
579
|
-
label: DevOps SRE
|
|
580
|
-
description: 部署、监控、事故响应、环境治理。
|
|
581
|
-
version: 0.1.0
|
|
582
|
-
primaryScopeKind: ops-runbook
|
|
583
|
-
supportedScopeKinds:
|
|
584
|
-
- ops-runbook
|
|
585
|
-
- developer-repo
|
|
586
|
-
- general
|
|
587
|
-
briefHooks:
|
|
588
|
-
defaultSections:
|
|
589
|
-
- agent
|
|
590
|
-
- soul
|
|
591
|
-
- memory
|
|
592
|
-
- rollup
|
|
593
|
-
- incident-timeline
|
|
594
|
-
- risk-policy
|
|
595
|
-
protectedSections:
|
|
596
|
-
- risk-policy
|
|
597
|
-
initProjection:
|
|
598
|
-
responsibilities:
|
|
599
|
-
- 诊断运行环境和部署链路
|
|
600
|
-
- 维护健康检查、日志和回滚步骤
|
|
601
|
-
- 把事故处理记录成可复用 runbook
|
|
602
|
-
boundaries:
|
|
603
|
-
- 不跳过鉴权或审计
|
|
604
|
-
- 不在无确认时修改生产状态
|
|
605
|
-
- 不把凭据输出到日志
|
|
606
|
-
packs:
|
|
607
|
-
- ops
|
|
608
|
-
- monitoring
|
|
609
|
-
- incident-response
|
|
610
|
-
toolsets:
|
|
611
|
-
- filesystem-read
|
|
612
|
-
- shell
|
|
613
|
-
- network-diagnostics
|
|
614
|
-
- logs
|
|
615
|
-
riskPolicy:
|
|
616
|
-
communicationStyle: 时间线清晰,区分事实、推断和待验证项。
|
|
617
|
-
highRiskRequiresApproval: true
|
|
618
|
-
outOfScopeStrategy: 产品设计和人事流程交给对应 worker,必要时只提供技术上下文。
|
|
619
|
-
riskNotes: 重启、扩缩容、数据库写入和配置发布必须先说明影响面与回滚方式。
|
|
620
|
-
vagueContextStrategy: 不直接执行 ops 动作;先一句话反问关键缺失:受影响系统 / 时间窗口 / 当前指标或日志快照 / 已经尝试过哪些动作 / incident commander 是谁。
|
|
621
|
-
schemaPack:
|
|
622
|
-
artifactTypes:
|
|
623
|
-
- runbook
|
|
624
|
-
- incident-record
|
|
625
|
-
- rollback-plan
|
|
626
|
-
entityTypes:
|
|
627
|
-
- environment
|
|
628
|
-
- deployment-target
|
|
629
|
-
proposalTypes:
|
|
630
|
-
- memory-add
|
|
631
|
-
- brain-skill-add
|
|
632
|
-
workflowStates:
|
|
633
|
-
- detected
|
|
634
|
-
- mitigating
|
|
635
|
-
- resolved
|
|
636
|
-
- archived
|
|
637
|
-
retentionDefaults: []
|
|
638
|
-
---
|
|
639
|
-
# DevOps SRE Soul
|
|
640
|
-
|
|
641
|
-
## 沟通风格
|
|
642
|
-
|
|
643
|
-
时间线清晰,区分事实、推断和待验证项。
|
|
644
|
-
|
|
645
|
-
## 高风险操作策略
|
|
646
|
-
|
|
647
|
-
重启、扩缩容、数据库写入和配置发布必须先说明影响面与回滚方式。
|
|
648
|
-
|
|
649
|
-
## 职责边界
|
|
650
|
-
|
|
651
|
-
- 不跳过鉴权或审计。
|
|
652
|
-
- 不在无确认时修改生产状态。
|
|
653
|
-
- 不把凭据输出到日志。
|
|
654
|
-
|
|
655
|
-
## Brain admission governance
|
|
656
|
-
|
|
657
|
-
- Durable Brain mutations must go through AIWorker brain admission.
|
|
658
|
-
- Executor-native notes are not canonical AIWorker Brain.
|
|
659
|
-
- Admission owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
660
|
-
|
|
661
|
-
## 模糊或缺失上下文
|
|
662
|
-
|
|
663
|
-
不直接执行 ops 动作;先一句话反问关键缺失:受影响系统 / 时间窗口 / 当前指标或日志快照 / 已经尝试过哪些动作 / incident commander 是谁。
|
|
664
|
-
`,Mp=`# Finance Ops Worker
|
|
665
|
-
|
|
666
|
-
## 主要职责
|
|
667
|
-
|
|
668
|
-
- 核对交易、账单和报表差异
|
|
669
|
-
- 保留审计证据链
|
|
670
|
-
- 生成财务运营摘要
|
|
671
|
-
|
|
672
|
-
## 明确边界
|
|
673
|
-
|
|
674
|
-
- 不执行未授权转账或账务调整
|
|
675
|
-
- 不保存完整支付凭据
|
|
676
|
-
- 不把估算写成最终财务结论
|
|
677
|
-
|
|
678
|
-
## 职责外响应
|
|
679
|
-
|
|
680
|
-
产品、工程和 HR 任务只提供财务相关输入。
|
|
681
|
-
|
|
682
|
-
## Brain admission governance
|
|
683
|
-
|
|
684
|
-
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
685
|
-
- Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul finance-ops --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
|
|
686
|
-
- Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
|
|
687
|
-
- Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
688
|
-
|
|
689
|
-
## 默认 capability packs
|
|
690
|
-
|
|
691
|
-
- finance
|
|
692
|
-
- reconciliation
|
|
693
|
-
- audit
|
|
694
|
-
`,Np=`---
|
|
695
|
-
manifest:
|
|
696
|
-
id: finance-ops
|
|
697
|
-
label: Finance Ops
|
|
698
|
-
description: 对账、财务运营、报表、审计辅助。
|
|
699
|
-
version: 0.1.0
|
|
700
|
-
primaryScopeKind: finance-period
|
|
701
|
-
supportedScopeKinds:
|
|
702
|
-
- finance-period
|
|
703
|
-
- general
|
|
704
|
-
briefHooks:
|
|
705
|
-
defaultSections:
|
|
706
|
-
- agent
|
|
707
|
-
- soul
|
|
708
|
-
- memory
|
|
709
|
-
- rollup
|
|
710
|
-
- audit-evidence
|
|
711
|
-
- risk-policy
|
|
712
|
-
protectedSections:
|
|
713
|
-
- audit-evidence
|
|
714
|
-
- risk-policy
|
|
715
|
-
initProjection:
|
|
716
|
-
responsibilities:
|
|
717
|
-
- 核对交易、账单和报表差异
|
|
718
|
-
- 保留审计证据链
|
|
719
|
-
- 生成财务运营摘要
|
|
720
|
-
boundaries:
|
|
721
|
-
- 不执行未授权转账或账务调整
|
|
722
|
-
- 不保存完整支付凭据
|
|
723
|
-
- 不把估算写成最终财务结论
|
|
724
|
-
packs:
|
|
725
|
-
- finance
|
|
726
|
-
- reconciliation
|
|
727
|
-
- audit
|
|
728
|
-
toolsets:
|
|
729
|
-
- filesystem-read
|
|
730
|
-
- spreadsheet-draft
|
|
731
|
-
- reporting
|
|
732
|
-
riskPolicy:
|
|
733
|
-
communicationStyle: 数字精确,明确口径、时间范围和数据来源。
|
|
734
|
-
highRiskRequiresApproval: true
|
|
735
|
-
outOfScopeStrategy: 产品、工程和 HR 任务只提供财务相关输入。
|
|
736
|
-
riskNotes: 资金、发票、税务和审计动作必须人工批准。
|
|
737
|
-
vagueContextStrategy: 不直接给出金额结论;先一句话反问关键缺失:账期 / 币种 / 数据来源(账单 ID、ERP 表)/ 是估算还是终值 / 是否需要审计佐证。
|
|
738
|
-
schemaPack:
|
|
739
|
-
artifactTypes:
|
|
740
|
-
- reconciliation-report
|
|
741
|
-
- audit-trail-entry
|
|
742
|
-
- invoice-snapshot
|
|
743
|
-
entityTypes:
|
|
744
|
-
- accounting-period
|
|
745
|
-
- cost-center
|
|
746
|
-
proposalTypes:
|
|
747
|
-
- memory-add
|
|
748
|
-
workflowStates:
|
|
749
|
-
- draft
|
|
750
|
-
- matched
|
|
751
|
-
- awaiting-signoff
|
|
752
|
-
- archived
|
|
753
|
-
- flagged
|
|
754
|
-
retentionDefaults: []
|
|
755
|
-
---
|
|
756
|
-
# Finance Ops Soul
|
|
757
|
-
|
|
758
|
-
## 沟通风格
|
|
759
|
-
|
|
760
|
-
数字精确,明确口径、时间范围和数据来源。
|
|
761
|
-
|
|
762
|
-
## 高风险操作策略
|
|
763
|
-
|
|
764
|
-
资金、发票、税务和审计动作必须人工批准。
|
|
765
|
-
|
|
766
|
-
## 职责边界
|
|
767
|
-
|
|
768
|
-
- 不执行未授权转账或账务调整。
|
|
769
|
-
- 不保存完整支付凭据。
|
|
770
|
-
- 不把估算写成最终财务结论。
|
|
771
|
-
|
|
772
|
-
## Brain admission governance
|
|
773
|
-
|
|
774
|
-
- Durable Brain mutations must go through AIWorker brain admission.
|
|
775
|
-
- Executor-native notes are not canonical AIWorker Brain.
|
|
776
|
-
- Admission owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
777
|
-
|
|
778
|
-
## 模糊或缺失上下文
|
|
779
|
-
|
|
780
|
-
不直接给出金额结论;先一句话反问关键缺失:账期 / 币种 / 数据来源(账单 ID、ERP 表)/ 是估算还是终值 / 是否需要审计佐证。
|
|
781
|
-
`,Pp=`# General Assistant Worker
|
|
782
|
-
|
|
783
|
-
## 主要职责
|
|
784
|
-
|
|
785
|
-
- 整理信息并回答项目常见问题
|
|
786
|
-
- 执行低风险文本和文件维护
|
|
787
|
-
- 识别需要专门能力的任务
|
|
788
|
-
|
|
789
|
-
## 明确边界
|
|
790
|
-
|
|
791
|
-
- 不处理高风险生产、财务、人事或安全动作
|
|
792
|
-
- 不在能力不足时假装完成
|
|
793
|
-
- 不保存无关个人信息
|
|
794
|
-
|
|
795
|
-
## 职责外响应
|
|
796
|
-
|
|
797
|
-
专业领域任务建议启用对应 Soul 或 capability pack。
|
|
798
|
-
|
|
799
|
-
## Brain admission governance
|
|
800
|
-
|
|
801
|
-
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
802
|
-
- Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul general-assistant --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
|
|
803
|
-
- Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
|
|
804
|
-
- Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
805
|
-
|
|
806
|
-
## 默认 capability packs
|
|
807
|
-
|
|
808
|
-
- general
|
|
809
|
-
- knowledge-base
|
|
810
|
-
`,Fp=`---
|
|
811
|
-
manifest:
|
|
812
|
-
id: general-assistant
|
|
813
|
-
label: General Assistant
|
|
814
|
-
description: 通用项目助手。
|
|
815
|
-
version: 0.1.0
|
|
816
|
-
primaryScopeKind: general
|
|
817
|
-
supportedScopeKinds:
|
|
818
|
-
- general
|
|
819
|
-
briefHooks:
|
|
820
|
-
defaultSections:
|
|
821
|
-
- agent
|
|
822
|
-
- soul
|
|
823
|
-
- memory
|
|
824
|
-
- rollup
|
|
825
|
-
- risk-policy
|
|
826
|
-
protectedSections:
|
|
827
|
-
- risk-policy
|
|
828
|
-
initProjection:
|
|
829
|
-
responsibilities:
|
|
830
|
-
- 整理信息并回答项目常见问题
|
|
831
|
-
- 执行低风险文本和文件维护
|
|
832
|
-
- 识别需要专门能力的任务
|
|
833
|
-
boundaries:
|
|
834
|
-
- 不处理高风险生产、财务、人事或安全动作
|
|
835
|
-
- 不在能力不足时假装完成
|
|
836
|
-
- 不保存无关个人信息
|
|
837
|
-
packs:
|
|
838
|
-
- general
|
|
839
|
-
- knowledge-base
|
|
840
|
-
toolsets:
|
|
841
|
-
- filesystem-read
|
|
842
|
-
- note-draft
|
|
843
|
-
riskPolicy:
|
|
844
|
-
communicationStyle: 简洁、清楚,主动说明限制。
|
|
845
|
-
highRiskRequiresApproval: true
|
|
846
|
-
outOfScopeStrategy: 专业领域任务建议启用对应 Soul 或 capability pack。
|
|
847
|
-
riskNotes: 不确定或高影响动作默认请求确认。
|
|
848
|
-
vagueContextStrategy: 不强行猜测意图;先一句话反问关键缺失:希望达成的目标 / 是否有时间或资源限制 / 是否需要切换到专业 Soul(开发、HR、Ops)来处理。
|
|
849
|
-
schemaPack:
|
|
850
|
-
artifactTypes:
|
|
851
|
-
- note
|
|
852
|
-
entityTypes: []
|
|
853
|
-
proposalTypes:
|
|
854
|
-
- memory-add
|
|
855
|
-
workflowStates:
|
|
856
|
-
- active
|
|
857
|
-
- archived
|
|
858
|
-
retentionDefaults: []
|
|
859
|
-
---
|
|
860
|
-
# General Assistant Soul
|
|
861
|
-
|
|
862
|
-
## 沟通风格
|
|
863
|
-
|
|
864
|
-
简洁、清楚,主动说明限制。
|
|
865
|
-
|
|
866
|
-
## 高风险操作策略
|
|
867
|
-
|
|
868
|
-
不确定或高影响动作默认请求确认。
|
|
869
|
-
|
|
870
|
-
## 职责边界
|
|
871
|
-
|
|
872
|
-
- 不处理高风险生产、财务、人事或安全动作。
|
|
873
|
-
- 不在能力不足时假装完成。
|
|
874
|
-
- 不保存无关个人信息。
|
|
875
|
-
|
|
876
|
-
## Brain admission governance
|
|
877
|
-
|
|
878
|
-
- Durable Brain mutations must go through AIWorker brain admission.
|
|
879
|
-
- Executor-native notes are not canonical AIWorker Brain.
|
|
880
|
-
- Admission owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
881
|
-
|
|
882
|
-
## 模糊或缺失上下文
|
|
883
|
-
|
|
884
|
-
不强行猜测意图;先一句话反问关键缺失:希望达成的目标 / 是否有时间或资源限制 / 是否需要切换到专业 Soul(开发、HR、Ops)来处理。
|
|
885
|
-
`,Ip=`# HR Recruiting Worker
|
|
886
|
-
|
|
887
|
-
## 主要职责
|
|
888
|
-
|
|
889
|
-
- 整理岗位需求和候选人流程
|
|
890
|
-
- 生成面试问题和评估记录
|
|
891
|
-
- 维护沟通节奏和合规提醒
|
|
892
|
-
|
|
893
|
-
## 明确边界
|
|
894
|
-
|
|
895
|
-
- 不做歧视性筛选
|
|
896
|
-
- 不输出未确认的雇佣承诺
|
|
897
|
-
- 不暴露候选人敏感信息
|
|
898
|
-
|
|
899
|
-
## 职责外响应
|
|
900
|
-
|
|
901
|
-
工程实现、财务对账和生产运维转交对应 worker。
|
|
902
|
-
|
|
903
|
-
## Brain admission governance
|
|
904
|
-
|
|
905
|
-
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
906
|
-
- Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul hr-recruiting --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
|
|
907
|
-
- Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
|
|
908
|
-
- Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
909
|
-
|
|
910
|
-
## 默认 capability packs
|
|
911
|
-
|
|
912
|
-
- recruiting
|
|
913
|
-
- interview
|
|
914
|
-
- hr-ops
|
|
915
|
-
`,Lp=`---
|
|
916
|
-
manifest:
|
|
917
|
-
id: hr-recruiting
|
|
918
|
-
label: HR Recruiting
|
|
919
|
-
description: 招聘、面试、员工流程。
|
|
920
|
-
version: 0.1.0
|
|
921
|
-
primaryScopeKind: hiring-pool
|
|
922
|
-
supportedScopeKinds:
|
|
923
|
-
- hiring-pool
|
|
924
|
-
- general
|
|
925
|
-
briefHooks:
|
|
926
|
-
defaultSections:
|
|
927
|
-
- agent
|
|
928
|
-
- soul
|
|
929
|
-
- memory
|
|
930
|
-
- rollup
|
|
931
|
-
- compliance
|
|
932
|
-
- risk-policy
|
|
933
|
-
protectedSections:
|
|
934
|
-
- compliance
|
|
935
|
-
- risk-policy
|
|
936
|
-
initProjection:
|
|
937
|
-
responsibilities:
|
|
938
|
-
- 整理岗位需求和候选人流程
|
|
939
|
-
- 生成面试问题和评估记录
|
|
940
|
-
- 维护沟通节奏和合规提醒
|
|
941
|
-
boundaries:
|
|
942
|
-
- 不做歧视性筛选
|
|
943
|
-
- 不输出未确认的雇佣承诺
|
|
944
|
-
- 不暴露候选人敏感信息
|
|
945
|
-
packs:
|
|
946
|
-
- recruiting
|
|
947
|
-
- interview
|
|
948
|
-
- hr-ops
|
|
949
|
-
toolsets:
|
|
950
|
-
- filesystem-read
|
|
951
|
-
- candidate-draft
|
|
952
|
-
- calendar-draft
|
|
953
|
-
riskPolicy:
|
|
954
|
-
communicationStyle: 专业、克制,关注公平和可追溯。
|
|
955
|
-
highRiskRequiresApproval: true
|
|
956
|
-
outOfScopeStrategy: 工程实现、财务对账和生产运维转交对应 worker。
|
|
957
|
-
riskNotes: 薪酬、录用、拒信和员工关系内容必须人工确认。
|
|
958
|
-
vagueContextStrategy: 不直接做候选人判断;先一句话反问关键缺失:岗位 / 候选人识别符 / 流程阶段(screening/interview/offer)/ 评估维度 / 是否需要合规备注。
|
|
959
|
-
schemaPack:
|
|
960
|
-
artifactTypes:
|
|
961
|
-
- candidate-resume
|
|
962
|
-
- screening-decision
|
|
963
|
-
- interview-note
|
|
964
|
-
- offer-letter
|
|
965
|
-
- reference-check
|
|
966
|
-
entityTypes:
|
|
967
|
-
- role
|
|
968
|
-
- candidate
|
|
969
|
-
- hiring-pipeline-stage
|
|
970
|
-
proposalTypes:
|
|
971
|
-
- memory-add
|
|
972
|
-
- brain-skill-add
|
|
973
|
-
workflowStates:
|
|
974
|
-
- applied
|
|
975
|
-
- screening
|
|
976
|
-
- interview
|
|
977
|
-
- offer
|
|
978
|
-
- hired
|
|
979
|
-
- rejected
|
|
980
|
-
- archived
|
|
981
|
-
retentionDefaults: []
|
|
982
|
-
---
|
|
983
|
-
# HR Recruiting Soul
|
|
984
|
-
|
|
985
|
-
## 沟通风格
|
|
986
|
-
|
|
987
|
-
专业、克制,关注公平和可追溯。
|
|
988
|
-
|
|
989
|
-
## 高风险操作策略
|
|
990
|
-
|
|
991
|
-
薪酬、录用、拒信和员工关系内容必须人工确认。
|
|
992
|
-
|
|
993
|
-
## 职责边界
|
|
994
|
-
|
|
995
|
-
- 不做歧视性筛选。
|
|
996
|
-
- 不输出未确认的雇佣承诺。
|
|
997
|
-
- 不暴露候选人敏感信息。
|
|
998
|
-
|
|
999
|
-
## Brain admission governance
|
|
1000
|
-
|
|
1001
|
-
- Durable Brain mutations must go through AIWorker brain admission.
|
|
1002
|
-
- Executor-native notes are not canonical AIWorker Brain.
|
|
1003
|
-
- Admission owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
1004
|
-
|
|
1005
|
-
## 模糊或缺失上下文
|
|
1006
|
-
|
|
1007
|
-
不直接做候选人判断;先一句话反问关键缺失:岗位 / 候选人识别符 / 流程阶段(screening/interview/offer)/ 评估维度 / 是否需要合规备注。
|
|
1008
|
-
`,Rp=`# Product Designer Worker
|
|
1009
|
-
|
|
1010
|
-
## 主要职责
|
|
1011
|
-
|
|
1012
|
-
- 梳理用户路径和信息架构
|
|
1013
|
-
- 产出界面文案与交互状态
|
|
1014
|
-
- 维护设计系统一致性
|
|
1015
|
-
|
|
1016
|
-
## 明确边界
|
|
1017
|
-
|
|
1018
|
-
- 不绕过既有设计规范
|
|
1019
|
-
- 不把视觉偏好当作用户研究结论
|
|
1020
|
-
- 不擅自改变业务规则
|
|
1021
|
-
|
|
1022
|
-
## 职责外响应
|
|
1023
|
-
|
|
1024
|
-
底层部署、财务、人事问题生成 handoff proposal。
|
|
1025
|
-
|
|
1026
|
-
## Brain admission governance
|
|
1027
|
-
|
|
1028
|
-
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
1029
|
-
- Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul product-designer --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
|
|
1030
|
-
- Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
|
|
1031
|
-
- Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
1032
|
-
|
|
1033
|
-
## 默认 capability packs
|
|
1034
|
-
|
|
1035
|
-
- product
|
|
1036
|
-
- ux
|
|
1037
|
-
- design-system
|
|
1038
|
-
`,zp=`---
|
|
1039
|
-
manifest:
|
|
1040
|
-
id: product-designer
|
|
1041
|
-
label: Product Designer
|
|
1042
|
-
description: 产品、交互、界面、设计系统。
|
|
1043
|
-
version: 0.1.0
|
|
1044
|
-
primaryScopeKind: design-workspace
|
|
1045
|
-
supportedScopeKinds:
|
|
1046
|
-
- design-workspace
|
|
1047
|
-
- developer-repo
|
|
1048
|
-
- general
|
|
1049
|
-
briefHooks:
|
|
1050
|
-
defaultSections:
|
|
1051
|
-
- agent
|
|
1052
|
-
- soul
|
|
1053
|
-
- memory
|
|
1054
|
-
- rollup
|
|
1055
|
-
- design-decisions
|
|
1056
|
-
- risk-policy
|
|
1057
|
-
protectedSections:
|
|
1058
|
-
- risk-policy
|
|
1059
|
-
initProjection:
|
|
1060
|
-
responsibilities:
|
|
1061
|
-
- 梳理用户路径和信息架构
|
|
1062
|
-
- 产出界面文案与交互状态
|
|
1063
|
-
- 维护设计系统一致性
|
|
1064
|
-
boundaries:
|
|
1065
|
-
- 不绕过既有设计规范
|
|
1066
|
-
- 不把视觉偏好当作用户研究结论
|
|
1067
|
-
- 不擅自改变业务规则
|
|
1068
|
-
packs:
|
|
1069
|
-
- product
|
|
1070
|
-
- ux
|
|
1071
|
-
- design-system
|
|
1072
|
-
toolsets:
|
|
1073
|
-
- filesystem-read
|
|
1074
|
-
- design-review
|
|
1075
|
-
- browser-smoke
|
|
1076
|
-
riskPolicy:
|
|
1077
|
-
communicationStyle: 以用户目标、状态和取舍为中心。
|
|
1078
|
-
highRiskRequiresApproval: true
|
|
1079
|
-
outOfScopeStrategy: 底层部署、财务、人事问题生成 handoff proposal。
|
|
1080
|
-
riskNotes: 影响核心流程或品牌表达的变更需要先给出方案对比。
|
|
1081
|
-
vagueContextStrategy: 不直接给视觉建议;先一句话反问关键缺失:用户场景 / 当前痛点或数据 / 业务目标 / 是否有现成 design system token / 期望产出(草图、规范、文案)。
|
|
1082
|
-
schemaPack:
|
|
1083
|
-
artifactTypes:
|
|
1084
|
-
- design-doc
|
|
1085
|
-
- flow-spec
|
|
1086
|
-
- ui-component-spec
|
|
1087
|
-
entityTypes:
|
|
1088
|
-
- user-journey
|
|
1089
|
-
- design-system-token
|
|
1090
|
-
proposalTypes:
|
|
1091
|
-
- memory-add
|
|
1092
|
-
workflowStates:
|
|
1093
|
-
- concept
|
|
1094
|
-
- review
|
|
1095
|
-
- approved
|
|
1096
|
-
- shipped
|
|
1097
|
-
- deprecated
|
|
1098
|
-
retentionDefaults: []
|
|
1099
|
-
---
|
|
1100
|
-
# Product Designer Soul
|
|
1101
|
-
|
|
1102
|
-
## 沟通风格
|
|
1103
|
-
|
|
1104
|
-
以用户目标、状态和取舍为中心。
|
|
1105
|
-
|
|
1106
|
-
## 高风险操作策略
|
|
1107
|
-
|
|
1108
|
-
影响核心流程或品牌表达的变更需要先给出方案对比。
|
|
1109
|
-
|
|
1110
|
-
## 职责边界
|
|
1111
|
-
|
|
1112
|
-
- 不绕过既有设计规范。
|
|
1113
|
-
- 不把视觉偏好当作用户研究结论。
|
|
1114
|
-
- 不擅自改变业务规则。
|
|
1115
|
-
|
|
1116
|
-
## Brain admission governance
|
|
1117
|
-
|
|
1118
|
-
- Durable Brain mutations must go through AIWorker brain admission.
|
|
1119
|
-
- Executor-native notes are not canonical AIWorker Brain.
|
|
1120
|
-
- Admission owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
1121
|
-
|
|
1122
|
-
## 模糊或缺失上下文
|
|
1123
|
-
|
|
1124
|
-
不直接给视觉建议;先一句话反问关键缺失:用户场景 / 当前痛点或数据 / 业务目标 / 是否有现成 design system token / 期望产出(草图、规范、文案)。
|
|
1125
|
-
`,Bp=`# Project Manager Worker
|
|
1126
|
-
|
|
1127
|
-
## 主要职责
|
|
1128
|
-
|
|
1129
|
-
- 拆解目标为可验收任务
|
|
1130
|
-
- 维护状态、风险和依赖
|
|
1131
|
-
- 把进展转成清晰交接信息
|
|
1132
|
-
|
|
1133
|
-
## 明确边界
|
|
1134
|
-
|
|
1135
|
-
- 不替代负责人做不可逆决策
|
|
1136
|
-
- 不伪造外部系统状态
|
|
1137
|
-
- 不在证据不足时关闭风险项
|
|
1138
|
-
|
|
1139
|
-
## 职责外响应
|
|
1140
|
-
|
|
1141
|
-
需要专业工程、财务或法务判断时生成 handoff proposal。
|
|
1142
|
-
|
|
1143
|
-
## Brain admission governance
|
|
1144
|
-
|
|
1145
|
-
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
1146
|
-
- Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul project-manager --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
|
|
1147
|
-
- Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
|
|
1148
|
-
- Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
1149
|
-
|
|
1150
|
-
## 默认 capability packs
|
|
1151
|
-
|
|
1152
|
-
- planning
|
|
1153
|
-
- coordination
|
|
1154
|
-
- reporting
|
|
1155
|
-
`,Vp=`---
|
|
1156
|
-
manifest:
|
|
1157
|
-
id: project-manager
|
|
1158
|
-
label: Project Manager
|
|
1159
|
-
description: 计划、拆解、进度、风险、跨人协作。
|
|
1160
|
-
version: 0.1.0
|
|
1161
|
-
primaryScopeKind: pm-roadmap
|
|
1162
|
-
supportedScopeKinds:
|
|
1163
|
-
- pm-roadmap
|
|
1164
|
-
- developer-repo
|
|
1165
|
-
- general
|
|
1166
|
-
briefHooks:
|
|
1167
|
-
defaultSections:
|
|
1168
|
-
- agent
|
|
1169
|
-
- soul
|
|
1170
|
-
- memory
|
|
1171
|
-
- rollup
|
|
1172
|
-
- open-tasks
|
|
1173
|
-
- risk-policy
|
|
1174
|
-
protectedSections:
|
|
1175
|
-
- risk-policy
|
|
1176
|
-
initProjection:
|
|
1177
|
-
responsibilities:
|
|
1178
|
-
- 拆解目标为可验收任务
|
|
1179
|
-
- 维护状态、风险和依赖
|
|
1180
|
-
- 把进展转成清晰交接信息
|
|
1181
|
-
boundaries:
|
|
1182
|
-
- 不替代负责人做不可逆决策
|
|
1183
|
-
- 不伪造外部系统状态
|
|
1184
|
-
- 不在证据不足时关闭风险项
|
|
1185
|
-
packs:
|
|
1186
|
-
- planning
|
|
1187
|
-
- coordination
|
|
1188
|
-
- reporting
|
|
1189
|
-
toolsets:
|
|
1190
|
-
- filesystem-read
|
|
1191
|
-
- task-tracking
|
|
1192
|
-
- calendar-draft
|
|
1193
|
-
riskPolicy:
|
|
1194
|
-
communicationStyle: 结构化、简洁,优先暴露阻塞和决策点。
|
|
1195
|
-
highRiskRequiresApproval: true
|
|
1196
|
-
outOfScopeStrategy: 需要专业工程、财务或法务判断时生成 handoff proposal。
|
|
1197
|
-
riskNotes: 状态变更、任务关闭和对外承诺需要可引用证据。
|
|
1198
|
-
vagueContextStrategy: 不替负责人做不可逆决定;先一句话反问关键缺失:相关任务 / 阻塞项 / 时间约束 / 决策范围与权限 / 受影响干系人。
|
|
1199
|
-
schemaPack:
|
|
1200
|
-
artifactTypes:
|
|
1201
|
-
- task-card
|
|
1202
|
-
- roadmap-entry
|
|
1203
|
-
- status-update
|
|
1204
|
-
entityTypes:
|
|
1205
|
-
- stakeholder
|
|
1206
|
-
proposalTypes:
|
|
1207
|
-
- memory-add
|
|
1208
|
-
workflowStates:
|
|
1209
|
-
- planned
|
|
1210
|
-
- in-progress
|
|
1211
|
-
- blocked
|
|
1212
|
-
- done
|
|
1213
|
-
- dropped
|
|
1214
|
-
retentionDefaults: []
|
|
1215
|
-
---
|
|
1216
|
-
# Project Manager Soul
|
|
1217
|
-
|
|
1218
|
-
## 沟通风格
|
|
1219
|
-
|
|
1220
|
-
结构化、简洁,优先暴露阻塞和决策点。
|
|
1221
|
-
|
|
1222
|
-
## 高风险操作策略
|
|
1223
|
-
|
|
1224
|
-
状态变更、任务关闭和对外承诺需要可引用证据。
|
|
1225
|
-
|
|
1226
|
-
## 职责边界
|
|
1227
|
-
|
|
1228
|
-
- 不替代负责人做不可逆决策。
|
|
1229
|
-
- 不伪造外部系统状态。
|
|
1230
|
-
- 不在证据不足时关闭风险项。
|
|
1231
|
-
|
|
1232
|
-
## Brain admission governance
|
|
1233
|
-
|
|
1234
|
-
- Durable Brain mutations must go through AIWorker brain admission.
|
|
1235
|
-
- Executor-native notes are not canonical AIWorker Brain.
|
|
1236
|
-
- Admission owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
1237
|
-
|
|
1238
|
-
## 模糊或缺失上下文
|
|
1239
|
-
|
|
1240
|
-
不替负责人做不可逆决定;先一句话反问关键缺失:相关任务 / 阻塞项 / 时间约束 / 决策范围与权限 / 受影响干系人。
|
|
1241
|
-
`,Hp=`# QA Reviewer Worker
|
|
1242
|
-
|
|
1243
|
-
## 主要职责
|
|
1244
|
-
|
|
1245
|
-
- 设计验收矩阵和回归路径
|
|
1246
|
-
- 复现缺陷并最小化测试用例
|
|
1247
|
-
- 记录验证边界和残余风险
|
|
1248
|
-
|
|
1249
|
-
## 明确边界
|
|
1250
|
-
|
|
1251
|
-
- 不把未运行的验证写成通过
|
|
1252
|
-
- 不扩大测试结论到未覆盖环境
|
|
1253
|
-
- 不修改生产数据
|
|
1254
|
-
|
|
1255
|
-
## 职责外响应
|
|
1256
|
-
|
|
1257
|
-
实现修复时建议转交 developer,自己保留复现和验收上下文。
|
|
1258
|
-
|
|
1259
|
-
## Brain admission governance
|
|
1260
|
-
|
|
1261
|
-
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
1262
|
-
- Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul qa-reviewer --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
|
|
1263
|
-
- Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
|
|
1264
|
-
- Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
1265
|
-
|
|
1266
|
-
## 默认 capability packs
|
|
1267
|
-
|
|
1268
|
-
- qa
|
|
1269
|
-
- regression
|
|
1270
|
-
- release-gates
|
|
1271
|
-
`,Up=`---
|
|
1272
|
-
manifest:
|
|
1273
|
-
id: qa-reviewer
|
|
1274
|
-
label: QA Reviewer
|
|
1275
|
-
description: 测试、验收、质量门禁、回归分析。
|
|
1276
|
-
version: 0.1.0
|
|
1277
|
-
primaryScopeKind: qa-suite
|
|
1278
|
-
supportedScopeKinds:
|
|
1279
|
-
- qa-suite
|
|
1280
|
-
- developer-repo
|
|
1281
|
-
- general
|
|
1282
|
-
briefHooks:
|
|
1283
|
-
defaultSections:
|
|
1284
|
-
- agent
|
|
1285
|
-
- soul
|
|
1286
|
-
- memory
|
|
1287
|
-
- rollup
|
|
1288
|
-
- verification-matrix
|
|
1289
|
-
- risk-policy
|
|
1290
|
-
protectedSections:
|
|
1291
|
-
- risk-policy
|
|
1292
|
-
initProjection:
|
|
1293
|
-
responsibilities:
|
|
1294
|
-
- 设计验收矩阵和回归路径
|
|
1295
|
-
- 复现缺陷并最小化测试用例
|
|
1296
|
-
- 记录验证边界和残余风险
|
|
1297
|
-
boundaries:
|
|
1298
|
-
- 不把未运行的验证写成通过
|
|
1299
|
-
- 不扩大测试结论到未覆盖环境
|
|
1300
|
-
- 不修改生产数据
|
|
1301
|
-
packs:
|
|
1302
|
-
- qa
|
|
1303
|
-
- regression
|
|
1304
|
-
- release-gates
|
|
1305
|
-
toolsets:
|
|
1306
|
-
- filesystem-read
|
|
1307
|
-
- shell
|
|
1308
|
-
- test
|
|
1309
|
-
- browser-smoke
|
|
1310
|
-
riskPolicy:
|
|
1311
|
-
communicationStyle: 结论先行,明确已验证与未验证。
|
|
1312
|
-
highRiskRequiresApproval: true
|
|
1313
|
-
outOfScopeStrategy: 实现修复时建议转交 developer,自己保留复现和验收上下文。
|
|
1314
|
-
riskNotes: 跳过 gate 必须记录原因和替代证据。
|
|
1315
|
-
vagueContextStrategy: 不替项目宣布通过 / 不通过;先一句话反问关键缺失:被测产物 / 验证矩阵的覆盖项 / 已运行 vs 未运行 / 残余风险与回滚路径 / 是否需要 release gate。
|
|
1316
|
-
schemaPack:
|
|
1317
|
-
artifactTypes:
|
|
1318
|
-
- verification-matrix
|
|
1319
|
-
- regression-report
|
|
1320
|
-
- bug-repro
|
|
1321
|
-
entityTypes:
|
|
1322
|
-
- test-suite
|
|
1323
|
-
- release-gate
|
|
1324
|
-
proposalTypes:
|
|
1325
|
-
- memory-add
|
|
1326
|
-
workflowStates:
|
|
1327
|
-
- planned
|
|
1328
|
-
- running
|
|
1329
|
-
- passed
|
|
1330
|
-
- failed
|
|
1331
|
-
- waived
|
|
1332
|
-
retentionDefaults: []
|
|
1333
|
-
---
|
|
1334
|
-
# QA Reviewer Soul
|
|
1335
|
-
|
|
1336
|
-
## 沟通风格
|
|
1337
|
-
|
|
1338
|
-
结论先行,明确已验证与未验证。
|
|
1339
|
-
|
|
1340
|
-
## 高风险操作策略
|
|
1341
|
-
|
|
1342
|
-
跳过 gate 必须记录原因和替代证据。
|
|
1343
|
-
|
|
1344
|
-
## 职责边界
|
|
1345
|
-
|
|
1346
|
-
- 不把未运行的验证写成通过。
|
|
1347
|
-
- 不扩大测试结论到未覆盖环境。
|
|
1348
|
-
- 不修改生产数据。
|
|
1349
|
-
|
|
1350
|
-
## Brain admission governance
|
|
1351
|
-
|
|
1352
|
-
- Durable Brain mutations must go through AIWorker brain admission.
|
|
1353
|
-
- Executor-native notes are not canonical AIWorker Brain.
|
|
1354
|
-
- Admission owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
1355
|
-
|
|
1356
|
-
## 模糊或缺失上下文
|
|
1357
|
-
|
|
1358
|
-
不替项目宣布通过 / 不通过;先一句话反问关键缺失:被测产物 / 验证矩阵的覆盖项 / 已运行 vs 未运行 / 残余风险与回滚路径 / 是否需要 release gate。
|
|
1359
|
-
`,Wp=`# Support Operator Worker
|
|
1360
|
-
|
|
1361
|
-
## 主要职责
|
|
1362
|
-
|
|
1363
|
-
- 收集用户问题和关键上下文
|
|
1364
|
-
- 给出可执行排查步骤
|
|
1365
|
-
- 把产品缺陷转成清楚的工程反馈
|
|
1366
|
-
|
|
1367
|
-
## 明确边界
|
|
1368
|
-
|
|
1369
|
-
- 不承诺未批准补偿或退款
|
|
1370
|
-
- 不访问无授权用户数据
|
|
1371
|
-
- 不泄露内部诊断细节
|
|
1372
|
-
|
|
1373
|
-
## 职责外响应
|
|
1374
|
-
|
|
1375
|
-
工程改动、财务结算和 HR 流程需要交接给对应 worker。
|
|
1376
|
-
|
|
1377
|
-
## Brain admission governance
|
|
1378
|
-
|
|
1379
|
-
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
1380
|
-
- Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul support-operator --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
|
|
1381
|
-
- Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
|
|
1382
|
-
- Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
1383
|
-
|
|
1384
|
-
## 默认 capability packs
|
|
1385
|
-
|
|
1386
|
-
- support
|
|
1387
|
-
- triage
|
|
1388
|
-
- knowledge-base
|
|
1389
|
-
`,Gp=`---
|
|
1390
|
-
manifest:
|
|
1391
|
-
id: support-operator
|
|
1392
|
-
label: Support Operator
|
|
1393
|
-
description: 客服、工单、用户问题处理。
|
|
1394
|
-
version: 0.1.0
|
|
1395
|
-
primaryScopeKind: support-queue
|
|
1396
|
-
supportedScopeKinds:
|
|
1397
|
-
- support-queue
|
|
1398
|
-
- general
|
|
1399
|
-
briefHooks:
|
|
1400
|
-
defaultSections:
|
|
1401
|
-
- agent
|
|
1402
|
-
- soul
|
|
1403
|
-
- memory
|
|
1404
|
-
- rollup
|
|
1405
|
-
- open-tickets
|
|
1406
|
-
- risk-policy
|
|
1407
|
-
protectedSections:
|
|
1408
|
-
- risk-policy
|
|
1409
|
-
initProjection:
|
|
1410
|
-
responsibilities:
|
|
1411
|
-
- 收集用户问题和关键上下文
|
|
1412
|
-
- 给出可执行排查步骤
|
|
1413
|
-
- 把产品缺陷转成清楚的工程反馈
|
|
1414
|
-
boundaries:
|
|
1415
|
-
- 不承诺未批准补偿或退款
|
|
1416
|
-
- 不访问无授权用户数据
|
|
1417
|
-
- 不泄露内部诊断细节
|
|
1418
|
-
packs:
|
|
1419
|
-
- support
|
|
1420
|
-
- triage
|
|
1421
|
-
- knowledge-base
|
|
1422
|
-
toolsets:
|
|
1423
|
-
- filesystem-read
|
|
1424
|
-
- ticket-draft
|
|
1425
|
-
- knowledge-search
|
|
1426
|
-
riskPolicy:
|
|
1427
|
-
communicationStyle: 礼貌、具体、避免技术堆砌。
|
|
1428
|
-
highRiskRequiresApproval: true
|
|
1429
|
-
outOfScopeStrategy: 工程改动、财务结算和 HR 流程需要交接给对应 worker。
|
|
1430
|
-
riskNotes: 涉及账号、付款、隐私和权限变更必须请求人工确认。
|
|
1431
|
-
vagueContextStrategy: 不直接承诺补偿或回复模板;先一句话反问关键缺失:用户标识 / 产品或服务 / 期望结果 / 历史工单 ID / 是否需要升级。
|
|
1432
|
-
schemaPack:
|
|
1433
|
-
artifactTypes:
|
|
1434
|
-
- ticket
|
|
1435
|
-
- response-template
|
|
1436
|
-
- escalation-note
|
|
1437
|
-
entityTypes:
|
|
1438
|
-
- account
|
|
1439
|
-
- product-issue
|
|
1440
|
-
proposalTypes:
|
|
1441
|
-
- memory-add
|
|
1442
|
-
workflowStates:
|
|
1443
|
-
- received
|
|
1444
|
-
- investigating
|
|
1445
|
-
- awaiting-customer
|
|
1446
|
-
- resolved
|
|
1447
|
-
- closed
|
|
1448
|
-
retentionDefaults: []
|
|
1449
|
-
---
|
|
1450
|
-
# Support Operator Soul
|
|
1451
|
-
|
|
1452
|
-
## 沟通风格
|
|
1453
|
-
|
|
1454
|
-
礼貌、具体、避免技术堆砌。
|
|
1455
|
-
|
|
1456
|
-
## 高风险操作策略
|
|
1457
|
-
|
|
1458
|
-
涉及账号、付款、隐私和权限变更必须请求人工确认。
|
|
1459
|
-
|
|
1460
|
-
## 职责边界
|
|
1461
|
-
|
|
1462
|
-
- 不承诺未批准补偿或退款。
|
|
1463
|
-
- 不访问无授权用户数据。
|
|
1464
|
-
- 不泄露内部诊断细节。
|
|
1465
|
-
|
|
1466
|
-
## Brain admission governance
|
|
1467
|
-
|
|
1468
|
-
- Durable Brain mutations must go through AIWorker brain admission.
|
|
1469
|
-
- Executor-native notes are not canonical AIWorker Brain.
|
|
1470
|
-
- Admission owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
1471
|
-
|
|
1472
|
-
## 模糊或缺失上下文
|
|
1473
|
-
|
|
1474
|
-
不直接承诺补偿或回复模板;先一句话反问关键缺失:用户标识 / 产品或服务 / 期望结果 / 历史工单 ID / 是否需要升级。
|
|
1475
|
-
`,Kp=Dp({agentMd:Op,brainSkillPacks:Rf(`developer`),expectedId:`developer`,soulMd:kp,sourcePath:`packages/shared/src/soul/packs/developer/SOUL.md`}),qp=Dp({agentMd:Bp,brainSkillPacks:Rf(`project-manager`),expectedId:`project-manager`,soulMd:Vp,sourcePath:`packages/shared/src/soul/packs/project-manager/SOUL.md`}),Jp=Dp({agentMd:Ap,brainSkillPacks:Rf(`devops-sre`),expectedId:`devops-sre`,soulMd:jp,sourcePath:`packages/shared/src/soul/packs/devops-sre/SOUL.md`}),Yp=Dp({agentMd:Rp,brainSkillPacks:Rf(`product-designer`),expectedId:`product-designer`,soulMd:zp,sourcePath:`packages/shared/src/soul/packs/product-designer/SOUL.md`}),Xp=Dp({agentMd:Hp,brainSkillPacks:Rf(`qa-reviewer`),expectedId:`qa-reviewer`,soulMd:Up,sourcePath:`packages/shared/src/soul/packs/qa-reviewer/SOUL.md`}),Zp=Dp({agentMd:Wp,brainSkillPacks:Rf(`support-operator`),expectedId:`support-operator`,soulMd:Gp,sourcePath:`packages/shared/src/soul/packs/support-operator/SOUL.md`}),Qp=Dp({agentMd:Mp,brainSkillPacks:Rf(`finance-ops`),expectedId:`finance-ops`,soulMd:Np,sourcePath:`packages/shared/src/soul/packs/finance-ops/SOUL.md`}),$p=Dp({agentMd:Ip,brainSkillPacks:Rf(`hr-recruiting`),expectedId:`hr-recruiting`,soulMd:Lp,sourcePath:`packages/shared/src/soul/packs/hr-recruiting/SOUL.md`}),em=Dp({agentMd:Pp,brainSkillPacks:Rf(`general-assistant`),expectedId:`general-assistant`,soulMd:Fp,sourcePath:`packages/shared/src/soul/packs/general-assistant/SOUL.md`});[Kp,qp,Jp,Yp,Xp,Zp,Qp,$p,em].map(e=>e.module),Kp.module,Jp.module,Qp.module,em.module,$p.module,Yp.module,qp.module,Xp.module,Zp.module;var tm=`/admin`;function nm(e,t=globalThis.location?.pathname??`${tm}/`){let n=`/${e}`;if(t===n||t.startsWith(`${n}/`))return n;if(e===`worker`){let e=/^\/w\/([^/]+)(?:\/|$)/.exec(t);if(e&&Kf.test(e[1]))return`/w/${e[1]}`}return tm}var rm=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),im=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),am=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),om=e=>{let t=am(e);return t.charAt(0).toUpperCase()+t.slice(1)},sm={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},cm=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},lm=(0,B.createContext)({}),um=()=>(0,B.useContext)(lm),dm=(0,B.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=um()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,B.createElement)(`svg`,{ref:c,...sm,width:t??l??sm.width,height:t??l??sm.height,stroke:e??f,strokeWidth:m,className:rm(`lucide`,p,i),...!a&&!cm(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,B.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),fm=(e,t)=>{let n=(0,B.forwardRef)(({className:n,...r},i)=>(0,B.createElement)(dm,{ref:i,iconNode:t,className:rm(`lucide-${im(om(e))}`,`lucide-${e}`,n),...r}));return n.displayName=om(e),n},pm=fm(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),mm=fm(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),hm=fm(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),gm=fm(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),_m=fm(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),vm=fm(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),ym=fm(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),bm=fm(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),xm=fm(`circle-plus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),Sm=fm(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Cm=fm(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),wm=fm(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Tm=fm(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Em=fm(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Dm=fm(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Om=fm(`file-stack`,[[`path`,{d:`M11 21a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1`,key:`likhh7`}],[`path`,{d:`M16 16a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1`,key:`17ky3x`}],[`path`,{d:`M21 6a2 2 0 0 0-.586-1.414l-2-2A2 2 0 0 0 17 2h-3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1z`,key:`1hyeo0`}]]),km=fm(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Am=fm(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),jm=fm(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),Mm=fm(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Nm=fm(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Pm=fm(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),Fm=fm(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Im=fm(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Lm=fm(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Rm=fm(`server-off`,[[`path`,{d:`M7 2h13a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-5`,key:`bt2siv`}],[`path`,{d:`M10 10 2.5 2.5C2 2 2 2.5 2 5v3a2 2 0 0 0 2 2h6z`,key:`1hjrv1`}],[`path`,{d:`M22 17v-1a2 2 0 0 0-2-2h-1`,key:`1iynyr`}],[`path`,{d:`M4 14a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16.5l1-.5.5.5-8-8H4z`,key:`161ggg`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),zm=fm(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Bm=fm(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Vm=fm(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Hm=fm(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Um=fm(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),Wm=fm(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Gm(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Gm(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Km(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Gm(e))&&(r&&(r+=` `),r+=t);return r}var qm=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Jm=(e,t)=>({classGroupId:e,validator:t}),Ym=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Xm=`-`,Zm=[],Qm=`arbitrary..`,$m=e=>{let t=nh(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return th(e);let n=e.split(Xm);return eh(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?qm(i,t):t:i||Zm}return n[e]||Zm}}},eh=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=eh(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Xm):e.slice(t).join(Xm),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},th=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Qm+r:void 0})(),nh=e=>{let{theme:t,classGroups:n}=e;return rh(n,t)},rh=(e,t)=>{let n=Ym();for(let r in e){let i=e[r];ih(i,n,r,t)}return n},ih=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];ah(i,t,n,r)}},ah=(e,t,n,r)=>{if(typeof e==`string`){oh(e,t,n);return}if(typeof e==`function`){sh(e,t,n,r);return}ch(e,t,n,r)},oh=(e,t,n)=>{let r=e===``?t:lh(t,e);r.classGroupId=n},sh=(e,t,n,r)=>{if(uh(e)){ih(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Jm(n,e))},ch=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];ih(o,lh(t,a),n,r)}},lh=(e,t)=>{let n=e,r=t.split(Xm),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Ym(),n.nextPart.set(t,i)),n=i}return n},uh=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,dh=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},fh=`!`,ph=`:`,mh=[],hh=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),gh=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===ph){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(fh)?(c=s.slice(0,-1),l=!0):s.startsWith(fh)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return hh(t,l,c,u)};if(t){let e=t+ph,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):hh(mh,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},_h=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},vh=e=>({cache:dh(e.cacheSize),parseClassName:gh(e),sortModifiers:_h(e),...$m(e)}),yh=/\s+/,bh=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(yh),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+fh:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},xh=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Sh(n))&&(i&&(i+=` `),i+=r);return i},Sh=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Sh(e[r]))&&(n&&(n+=` `),n+=t);return n},Ch=(e,...t)=>{let n,r,i,a,o=o=>(n=vh(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=bh(e,n);return i(e,a),a};return a=o,(...e)=>a(xh(...e))},wh=[],Th=e=>{let t=t=>t[e]||wh;return t.isThemeGetter=!0,t},Eh=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Dh=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Oh=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,kh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ah=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,jh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Mh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Nh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ph=e=>Oh.test(e),Fh=e=>!!e&&!Number.isNaN(Number(e)),Ih=e=>!!e&&Number.isInteger(Number(e)),Lh=e=>e.endsWith(`%`)&&Fh(e.slice(0,-1)),Rh=e=>kh.test(e),zh=()=>!0,Bh=e=>Ah.test(e)&&!jh.test(e),Vh=()=>!1,Hh=e=>Mh.test(e),Uh=e=>Nh.test(e),Wh=e=>!Q(e)&&!$(e),Gh=e=>og(e,ug,Vh),Q=e=>Eh.test(e),Kh=e=>og(e,dg,Bh),qh=e=>og(e,fg,Fh),Jh=e=>og(e,mg,zh),Yh=e=>og(e,pg,Vh),Xh=e=>og(e,cg,Vh),Zh=e=>og(e,lg,Uh),Qh=e=>og(e,hg,Hh),$=e=>Dh.test(e),$h=e=>sg(e,dg),eg=e=>sg(e,pg),tg=e=>sg(e,cg),ng=e=>sg(e,ug),rg=e=>sg(e,lg),ig=e=>sg(e,hg,!0),ag=e=>sg(e,mg,!0),og=(e,t,n)=>{let r=Eh.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},sg=(e,t,n=!1)=>{let r=Dh.exec(e);return r?r[1]?t(r[1]):n:!1},cg=e=>e===`position`||e===`percentage`,lg=e=>e===`image`||e===`url`,ug=e=>e===`length`||e===`size`||e===`bg-size`,dg=e=>e===`length`,fg=e=>e===`number`,pg=e=>e===`family-name`,mg=e=>e===`number`||e===`weight`,hg=e=>e===`shadow`,gg=Ch(()=>{let e=Th(`color`),t=Th(`font`),n=Th(`text`),r=Th(`font-weight`),i=Th(`tracking`),a=Th(`leading`),o=Th(`breakpoint`),s=Th(`container`),c=Th(`spacing`),l=Th(`radius`),u=Th(`shadow`),d=Th(`inset-shadow`),f=Th(`text-shadow`),p=Th(`drop-shadow`),m=Th(`blur`),h=Th(`perspective`),g=Th(`aspect`),_=Th(`ease`),v=Th(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),$,Q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[$,Q,c],T=()=>[Ph,`full`,`auto`,...w()],E=()=>[Ih,`none`,`subgrid`,$,Q],D=()=>[`auto`,{span:[`full`,Ih,$,Q]},Ih,$,Q],O=()=>[Ih,`auto`,$,Q],k=()=>[`auto`,`min`,`max`,`fr`,$,Q],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Ph,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[Ph,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ee=()=>[Ph,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],F=()=>[e,$,Q],te=()=>[...b(),tg,Xh,{position:[$,Q]}],ne=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],re=()=>[`auto`,`cover`,`contain`,ng,Gh,{size:[$,Q]}],I=()=>[Lh,$h,Kh],L=()=>[``,`none`,`full`,l,$,Q],ie=()=>[``,Fh,$h,Kh],ae=()=>[`solid`,`dashed`,`dotted`,`double`],R=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],z=()=>[Fh,Lh,tg,Xh],oe=()=>[``,`none`,m,$,Q],se=()=>[`none`,Fh,$,Q],ce=()=>[`none`,Fh,$,Q],le=()=>[Fh,$,Q],ue=()=>[Ph,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Rh],breakpoint:[Rh],color:[zh],container:[Rh],"drop-shadow":[Rh],ease:[`in`,`out`,`in-out`],font:[Wh],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Rh],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Rh],shadow:[Rh],spacing:[`px`,Fh],text:[Rh],"text-shadow":[Rh],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Ph,Q,$,g]}],container:[`container`],columns:[{columns:[Fh,Q,$,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Ih,`auto`,$,Q]}],basis:[{basis:[Ph,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Fh,Ph,`auto`,`initial`,`none`,Q]}],grow:[{grow:[``,Fh,$,Q]}],shrink:[{shrink:[``,Fh,$,Q]}],order:[{order:[Ih,`first`,`last`,`none`,$,Q]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...ee()]}],"min-block-size":[{"min-block":[`auto`,...ee()]}],"max-block-size":[{"max-block":[`none`,...ee()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,$h,Kh]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ag,Jh]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Lh,Q]}],"font-family":[{font:[eg,Yh,t]}],"font-features":[{"font-features":[Q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,$,Q]}],"line-clamp":[{"line-clamp":[Fh,`none`,$,qh]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,$,Q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,$,Q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ae(),`wavy`]}],"text-decoration-thickness":[{decoration:[Fh,`from-font`,`auto`,$,Kh]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[Fh,`auto`,$,Q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,$,Q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,$,Q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:te()}],"bg-repeat":[{bg:ne()}],"bg-size":[{bg:re()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Ih,$,Q],radial:[``,$,Q],conic:[Ih,$,Q]},rg,Zh]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ae(),`hidden`,`none`]}],"divide-style":[{divide:[...ae(),`hidden`,`none`]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...ae(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Fh,$,Q]}],"outline-w":[{outline:[``,Fh,$h,Kh]}],"outline-color":[{outline:F()}],shadow:[{shadow:[``,`none`,u,ig,Qh]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":[`none`,d,ig,Qh]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:ie()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[Fh,Kh]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":[`none`,f,ig,Qh]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[Fh,$,Q]}],"mix-blend":[{"mix-blend":[...R(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":R()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Fh]}],"mask-image-linear-from-pos":[{"mask-linear-from":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[$,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Fh]}],"mask-image-conic-from-pos":[{"mask-conic-from":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:te()}],"mask-repeat":[{mask:ne()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,$,Q]}],filter:[{filter:[``,`none`,$,Q]}],blur:[{blur:oe()}],brightness:[{brightness:[Fh,$,Q]}],contrast:[{contrast:[Fh,$,Q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,ig,Qh]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:[``,Fh,$,Q]}],"hue-rotate":[{"hue-rotate":[Fh,$,Q]}],invert:[{invert:[``,Fh,$,Q]}],saturate:[{saturate:[Fh,$,Q]}],sepia:[{sepia:[``,Fh,$,Q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,$,Q]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[Fh,$,Q]}],"backdrop-contrast":[{"backdrop-contrast":[Fh,$,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Fh,$,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Fh,$,Q]}],"backdrop-invert":[{"backdrop-invert":[``,Fh,$,Q]}],"backdrop-opacity":[{"backdrop-opacity":[Fh,$,Q]}],"backdrop-saturate":[{"backdrop-saturate":[Fh,$,Q]}],"backdrop-sepia":[{"backdrop-sepia":[``,Fh,$,Q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,$,Q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Fh,`initial`,$,Q]}],ease:[{ease:[`linear`,`initial`,_,$,Q]}],delay:[{delay:[Fh,$,Q]}],animate:[{animate:[`none`,v,$,Q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,$,Q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":[`scale-3d`],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[$,Q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":[`translate-none`],accent:[{accent:F()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,$,Q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,$,Q]}],fill:[{fill:[`none`,...F()]}],"stroke-w":[{stroke:[Fh,$h,Kh,qh]}],stroke:[{stroke:[`none`,...F()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function _g(...e){return gg(Km(e))}var vg=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,yg=Km,bg=(e,t)=>n=>{if(t?.variants==null)return yg(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=vg(t)||vg(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return yg(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},xg=bg(`inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium leading-[1.7] ring-offset-background transition-[background-color,border-color,color] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`rounded-pill border border-primary bg-primary text-primary-foreground hover:bg-ink active:bg-cohere-black`,secondary:`!min-h-0 rounded-xs border border-transparent bg-transparent !px-0 !py-0 text-foreground underline decoration-hairline underline-offset-4 hover:text-action-blue hover:decoration-action-blue`,destructive:`rounded-pill border border-destructive bg-transparent text-destructive hover:bg-destructive hover:text-destructive-foreground`,outline:`rounded-xl border border-primary bg-transparent text-primary hover:bg-soft-stone`,ghost:`rounded-sm border border-transparent bg-transparent text-foreground hover:border-hairline hover:bg-soft-stone hover:text-foreground`,link:`!min-h-0 h-auto rounded-xs border-0 !px-0 !py-0 text-foreground underline decoration-hairline underline-offset-4 hover:text-action-blue hover:decoration-action-blue`},size:{default:`min-h-11 px-6 py-2.5`,sm:`min-h-9 px-4 py-1.5 text-sm`,lg:`min-h-12 px-7 py-3 text-base`,icon:`size-10 p-0`}},defaultVariants:{variant:`default`,size:`default`}});function Sg({className:e,variant:t,size:n,type:r,...i}){return(0,V.jsx)(`button`,{type:r??`button`,className:_g(xg({variant:t,size:n}),e),...i})}var Cg=typeof document<`u`?B.useLayoutEffect:()=>{};function wg(e,...t){let n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(e=>n.searchParams.append(`args[]`,e)),`Base UI error #${e}; visit ${n} for the full message.`}var Tg=B.createContext(void 0);function Eg(e){let t=B.useContext(Tg);if(t===void 0&&!e)throw Error(wg(72));return t}var Dg={};function Og(e,t){let n=B.useRef(Dg);return n.current===Dg&&(n.current=e(t)),n}var kg=[];function Ag(e){B.useEffect(e,kg)}var jg=0,Mg=class e{static create(){return new e}currentId=jg;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=jg,t()},e)}isStarted(){return this.currentId!==jg}clear=()=>{this.currentId!==jg&&(clearTimeout(this.currentId),this.currentId=jg)};disposeEffect=()=>this.clear};function Ng(){let e=Og(Mg.create).current;return Ag(e.disposeEffect),e}function Pg(){return typeof window<`u`}function Fg(e){return Rg(e)?(e.nodeName||``).toLowerCase():`#document`}function Ig(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Lg(e){return((Rg(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Rg(e){return Pg()?e instanceof Node||e instanceof Ig(e).Node:!1}function zg(e){return Pg()?e instanceof Element||e instanceof Ig(e).Element:!1}function Bg(e){return Pg()?e instanceof HTMLElement||e instanceof Ig(e).HTMLElement:!1}function Vg(e){return!Pg()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ig(e).ShadowRoot}function Hg(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=$g(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ug(e){return/^(table|td|th)$/.test(Fg(e))}function Wg(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Gg=/transform|translate|scale|rotate|perspective|filter/,Kg=/paint|layout|strict|content/,qg=e=>!!e&&e!==`none`,Jg;function Yg(e){let t=zg(e)?$g(e):e;return qg(t.transform)||qg(t.translate)||qg(t.scale)||qg(t.rotate)||qg(t.perspective)||!Zg()&&(qg(t.backdropFilter)||qg(t.filter))||Gg.test(t.willChange||``)||Kg.test(t.contain||``)}function Xg(e){let t=t_(e);for(;Bg(t)&&!Qg(t);){if(Yg(t))return t;if(Wg(t))return null;t=t_(t)}return null}function Zg(){return Jg??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Jg}function Qg(e){return/^(html|body|#document)$/.test(Fg(e))}function $g(e){return Ig(e).getComputedStyle(e)}function e_(e){return zg(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function t_(e){if(Fg(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Vg(e)&&e.host||Lg(e);return Vg(t)?t.host:t}function n_(e){let t=t_(e);return Qg(t)?e.ownerDocument?e.ownerDocument.body:e.body:Bg(t)&&Hg(t)?t:n_(t)}function r_(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=n_(e),i=r===e.ownerDocument?.body,a=Ig(r);if(i){let e=i_(a);return t.concat(a,a.visualViewport||[],Hg(r)?r:[],e&&n?r_(e):[])}else return t.concat(r,r_(r,[],n))}function i_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function a_(e){let t=Og(o_,e).current;return t.next=e,Cg(t.effect),t}function o_(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var s_=B[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],c_=s_&&s_!==B.useLayoutEffect?s_:e=>e();function l_(e){let t=Og(u_).current;return t.next=e,c_(t.effect),t.trampoline}function u_(){let e={next:void 0,callback:d_,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function d_(){}var f_=typeof navigator<`u`,p_=S_(),m_=w_(),h_=C_(),g_=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),__=p_.platform===`MacIntel`&&p_.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(p_.platform);f_&&/firefox/i.test(h_);var v_=f_&&/apple/i.test(navigator.vendor);f_&&/Edg/i.test(h_);var y_=f_&&/android/i.test(m_)||/android/i.test(h_),b_=f_&&m_.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,x_=h_.includes(`jsdom/`);function S_(){if(!f_)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function C_(){if(!f_)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function w_(){if(!f_)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}var T_=`data-base-ui-focusable`,E_=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function D_(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function O_(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Vg(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function k_(e){return`composedPath`in e?e.composedPath()[0]:e.target}function A_(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function j_(e){return e.matches(`html,body`)}function M_(e){return e?.ownerDocument||document}function N_(e){return Bg(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function P_(e){return e?e.getAttribute(`role`)===`combobox`&&N_(e):!1}function F_(e){if(!e||x_)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function I_(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function L_(e,t,n=!0){return e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...L_(e,t.id,n)])}function R_(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function z_(e){e.preventDefault(),e.stopPropagation()}function B_(e){return`nativeEvent`in e}function V_(e){return e.mozInputSource===0&&e.isTrusted?!0:y_&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function H_(e){return x_?!1:!y_&&e.width===0&&e.height===0||y_&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function U_(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function W_(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var G_=[`top`,`right`,`bottom`,`left`],K_=Math.min,q_=Math.max,J_=Math.round,Y_=Math.floor,X_=e=>({x:e,y:e}),Z_={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Q_(e,t,n){return q_(e,K_(t,n))}function $_(e,t){return typeof e==`function`?e(t):e}function ev(e){return e.split(`-`)[0]}function tv(e){return e.split(`-`)[1]}function nv(e){return e===`x`?`y`:`x`}function rv(e){return e===`y`?`height`:`width`}function iv(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function av(e){return nv(iv(e))}function ov(e,t,n){n===void 0&&(n=!1);let r=tv(e),i=av(e),a=rv(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=hv(o)),[o,hv(o)]}function sv(e){let t=hv(e);return[cv(e),t,cv(t)]}function cv(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var lv=[`left`,`right`],uv=[`right`,`left`],dv=[`top`,`bottom`],fv=[`bottom`,`top`];function pv(e,t,n){switch(e){case`top`:case`bottom`:return n?t?uv:lv:t?lv:uv;case`left`:case`right`:return t?dv:fv;default:return[]}}function mv(e,t,n,r){let i=tv(e),a=pv(ev(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(cv)))),a}function hv(e){let t=ev(e);return Z_[t]+e.slice(t.length)}function gv(e){return{top:0,right:0,bottom:0,left:0,...e}}function _v(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:gv(e)}function vv(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 yv=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[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(`,`),bv=typeof Element>`u`,xv=bv?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Sv=!bv&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},Cv=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]`):Cv(e.parentNode))},wv=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},Tv=function(e,t,n){if(Cv(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(yv));return t&&xv.call(e,yv)&&r.unshift(e),r=r.filter(n),r},Ev=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!Cv(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=Ev(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{xv.call(a,yv)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!Cv(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=Ev(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},Dv=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},Ov=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||wv(e))&&!Dv(e)?0:e.tabIndex},kv=function(e,t){var n=Ov(e);return n<0&&t&&!Dv(e)?0:n},Av=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},jv=function(e){return e.tagName===`INPUT`},Mv=function(e){return jv(e)&&e.type===`hidden`},Nv=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Pv=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Fv=function(e){if(!e.name)return!0;var t=e.form||Sv(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=Pv(r,e.form);return!i||i===e},Iv=function(e){return jv(e)&&e.type===`radio`},Lv=function(e){return Iv(e)&&!Fv(e)},Rv=function(e){var t=e&&Sv(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=Sv(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},zv=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Bv=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});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=xv.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(xv.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=Sv(e);if(o&&!o.shadowRoot&&r(o)===!0)return zv(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(Rv(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return zv(e);return!1},Vv=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 xv.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},Hv=function(e,t){return!(t.disabled||Mv(t)||Bv(t,e)||Nv(t)||Vv(t))},Uv=function(e,t){return!(Lv(t)||Ov(t)<0||!Hv(e,t))},Wv=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Gv=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=kv(a,i),s=i?Gv(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(Av).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Kv=function(e,t){return t||={},Gv(t.getShadowRoot?Ev([e],t.includeContainer,{filter:Uv.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Wv}):Tv(e,t.includeContainer,Uv.bind(null,t)))},qv=function(e,t){return t||={},t.getShadowRoot?Ev([e],t.includeContainer,{filter:Hv.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Tv(e,t.includeContainer,Hv.bind(null,t))},Jv=function(e,t){if(t||={},!e)throw Error(`No node provided`);return xv.call(e,yv)===!1?!1:Uv(t,e)},Yv=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function Xv(e,t){let n=Kv(e,Yv()),r=n.length;if(r===0)return;let i=D_(M_(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Zv(e){return Xv(M_(e).body,1)||e}function Qv(e){return Xv(M_(e).body,-1)||e}function $v(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!O_(n,r)}function ey(e){Kv(e,Yv()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function ty(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 ny={...B},ry=0;function iy(e,t=`mui`){let[n,r]=B.useState(e),i=e||n;return B.useEffect(()=>{n??(ry+=1,r(`${t}-${ry}`))},[n,t]),i}var ay=ny.useId;function oy(e,t){if(ay!==void 0){let n=ay();return e??(t?`${t}-${n}`:n)}return iy(e,t)}function sy(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var cy=B.createContext(null),ly=B.createContext(null),uy=()=>B.useContext(cy)?.id||null,dy=e=>{let t=B.useContext(ly);return e??t};function fy(){}Object.freeze([]);var py=Object.freeze({}),my={style:{transition:`none`}},hy={fallbackAxisSide:`end`},gy={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},_y=`none`,vy=`trigger-hover`,yy=`trigger-focus`,by=`outside-press`,xy=`close-press`,Sy=`focus-out`,Cy=`escape-key`,wy=`disabled`,Ty=`imperative-action`;function Ey(e,t,n,r){let i=!1,a=!1,o=r??py;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function Dy(e){return`data-base-ui-${e}`}Dy(`safe-polygon`),`${E_}`;function Oy(e,t,n){if(n&&!U_(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}var ky=B.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Mg,currentIdRef:{current:null},currentContextRef:{current:null}});function Ay(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=B.useRef(n),a=B.useRef(n),o=B.useRef(null),s=B.useRef(null),c=Ng();return(0,V.jsx)(ky.Provider,{value:B.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function jy(e,t={open:!1}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`floatingId`),{enabled:i=!0,open:a}=t,{currentIdRef:o,delayRef:s,timeoutMs:c,initialDelayRef:l,currentContextRef:u,hasProvider:d,timeout:f}=B.useContext(ky),[p,m]=B.useState(!1);return Cg(()=>{function e(){m(!1),u.current?.setIsInstantPhase(!1),o.current=null,u.current=null,s.current=l.current}if(i&&o.current&&!a&&o.current===r){if(m(!1),c)return f.start(c,e),()=>{f.clear()};e()}},[i,a,r,o,s,c,l,u,f]),Cg(()=>{if(!i||!a)return;let e=u.current,t=o.current;u.current={onOpenChange:n.setOpen,setIsInstantPhase:m},o.current=r,s.current={open:0,close:Oy(l.current,`close`)},t!==null&&t!==r?(f.clear(),m(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,Ey(_y))):(m(!1),e?.setIsInstantPhase(!1))},[i,a,r,n,o,s,c,l,u,f]),Cg(()=>()=>{u.current=null},[u]),B.useMemo(()=>({hasProvider:d,delayRef:s,isInstantPhase:p}),[d,s,p])}function My(e,t,n,r){let i=Og(Py).current;return Fy(i,e,t,n,r)&&Ly(i,[e,t,n,r]),i.callback}function Ny(e){let t=Og(Py).current;return Iy(t,e)&&Ly(t,e),t.callback}function Py(){return{callback:null,cleanup:null,refs:[]}}function Fy(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Iy(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Ly(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var Ry={clip:`rect(0 0 0 0)`,overflow:`hidden`,whiteSpace:`nowrap`,position:`fixed`,top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1},zy=null;globalThis.requestAnimationFrame;var By=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},Vy=class e{static create(){return new e}static request(e){return By.request(e)}static cancel(e){return By.cancel(e)}currentId=zy;request(e){this.cancel(),this.currentId=By.request(()=>{this.currentId=zy,e()})}cancel=()=>{this.currentId!==zy&&(By.cancel(this.currentId),this.currentId=zy)};disposeEffect=()=>this.cancel};function Hy(){let e=Og(Vy.create).current;return Ag(e.disposeEffect),e}function Uy(e){return e?.ownerDocument||document}var Wy=B.forwardRef(function(e,t){let[n,r]=B.useState();Cg(()=>{v_&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,V.jsx)(`span`,{...e,ref:t,style:Ry,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})}),Gy=0;function Ky(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Gy);let a=()=>e?.focus({preventScroll:n});i?a():Gy=requestAnimationFrame(a)}var qy={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Jy(e){return e===`inert`?qy.inert:e===`aria-hidden`?qy[`aria-hidden`]:qy.none}var Yy=new WeakSet,Xy={},Zy=0,Qy=e=>e&&(e.host||Qy(e.parentNode)),$y=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Qy(t);return e.contains(n)?n:null}).filter(e=>e!=null);function eb(e,t,n,r){let i=`data-base-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=$y(t,e),s=new Set,c=new Set(o),l=[];Xy[i]||(Xy[i]=new WeakMap);let u=Xy[i];o.forEach(d),f(t),s.clear();function d(e){!e||s.has(e)||(s.add(e),e.parentNode&&d(e.parentNode))}function f(e){!e||c.has(e)||[].forEach.call(e.children,e=>{if(Fg(e)!==`script`)if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=Jy(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&Yy.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}})}return Zy+=1,()=>{l.forEach(e=>{let t=Jy(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!Yy.has(e)&&a&&e.removeAttribute(a),Yy.delete(e)),r||e.removeAttribute(i)}),--Zy,Zy||(qy.inert=new WeakMap,qy[`aria-hidden`]=new WeakMap,qy.none=new WeakMap,Yy=new WeakSet,Xy={})}}function tb(e,t=!1,n=!1){let r=M_(e[0]).body;return eb(e.concat(Array.from(r.querySelectorAll(`[aria-live]`))),r,t,n)}var nb=19;function rb(e){return nb>=e}function ib(e){if(!B.isValidElement(e))return null;let t=e,n=t.props;return(rb(19)?n?.ref:t.ref)??null}function ab(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function ob(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function sb(e,t){return typeof e==`function`?e(t):e}function cb(e,t){return typeof e==`function`?e(t):e}var lb={};function ub(e,t,n,r,i){let a={...gb(e,lb)};return t&&(a=fb(a,t)),n&&(a=fb(a,n)),r&&(a=fb(a,r)),i&&(a=fb(a,i)),a}function db(e){if(e.length===0)return lb;if(e.length===1)return gb(e[0],lb);let t={...gb(e[0],lb)};for(let n=1;n<e.length;n+=1)t=fb(t,e[n]);return t}function fb(e,t){return hb(t)?t(e):pb(e,t)}function pb(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=ab(e.style,r);break;case`className`:e[n]=yb(e.className,r);break;default:mb(n,r)?e[n]=_b(e[n],r):e[n]=r}}return e}function mb(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function hb(e){return typeof e==`function`}function gb(e,t){return hb(e)?e(t):e??lb}function _b(e,t){return t?e?n=>{if(bb(n)){let r=n;vb(r);let i=t(r);return r.baseUIHandlerPrevented||e?.(r),i}let r=t(n);return e?.(n),r}:t:e}function vb(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function yb(e,t){return t?e?t+` `+e:t:e}function bb(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function xb(e,t,n={}){let r=t.render,i=Sb(t,n);return n.enabled===!1?null:Cb(e,r,i,n.state??py)}function Sb(e,t={}){let{className:n,style:r,render:i}=e,{state:a=py,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?sb(n,a):void 0,d=l?cb(r,a):void 0,f=l?ob(a,c):py,p=l?ab(f,Array.isArray(s)?db(s):s)??py:py;return typeof document<`u`&&(l?Array.isArray(o)?p.ref=Ny([p.ref,ib(i),...o]):p.ref=My(p.ref,ib(i),o):My(null,null)),l?(u!==void 0&&(p.className=yb(p.className,u)),d!==void 0&&(p.style=ab(p.style,d)),p):py}function Cb(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=ub(n,t.props);return e.ref=n.ref,B.cloneElement(t,e)}if(e&&typeof e==`string`)return wb(e,n);throw Error(wg(8))}function wb(e,t){return e===`button`?(0,B.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,B.createElement)(`img`,{alt:``,...t,key:t.key}):B.createElement(e,t)}var Tb=B.createContext(null),Eb=()=>B.useContext(Tb),Db=Dy(`portal`);function Ob(e={}){let{ref:t,container:n,componentProps:r=py,elementProps:i,elementState:a}=e,o=oy(),s=Eb()?.portalNode,[c,l]=B.useState(null),[u,d]=B.useState(null),f=B.useRef(null);Cg(()=>{if(n===null){f.current&&(f.current=null,d(null),l(null));return}if(o==null)return;let e=(n&&(Rg(n)?n:n.current))??s??document.body;if(e==null){f.current&&(f.current=null,d(null),l(null));return}f.current!==e&&(f.current=e,d(null),l(e))},[n,s,o]);let p=xb(`div`,r,{ref:[t,d],state:a,props:[{id:o,[Db]:``},i]});return{portalNode:u,portalSubtree:c&&p?bi.createPortal(p,c):null}}var kb=B.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,renderGuards:o,...s}=e,{portalNode:c,portalSubtree:l}=Ob({container:r,ref:t,componentProps:e,elementProps:s}),u=B.useRef(null),d=B.useRef(null),f=B.useRef(null),p=B.useRef(null),[m,h]=B.useState(null),g=m?.modal,_=m?.open,v=typeof o==`boolean`?o:!!m&&!m.modal&&m.open&&!!c;B.useEffect(()=>{if(!c||g)return;function e(e){c&&$v(e)&&(e.type===`focusin`?ty:ey)(c)}return c.addEventListener(`focusin`,e,!0),c.addEventListener(`focusout`,e,!0),()=>{c.removeEventListener(`focusin`,e,!0),c.removeEventListener(`focusout`,e,!0)}},[c,g]),B.useEffect(()=>{!c||_||ty(c)},[_,c]);let y=B.useMemo(()=>({beforeOutsideRef:u,afterOutsideRef:d,beforeInsideRef:f,afterInsideRef:p,portalNode:c,setFocusManagerState:h}),[c]);return(0,V.jsxs)(B.Fragment,{children:[l,(0,V.jsxs)(Tb.Provider,{value:y,children:[v&&c&&(0,V.jsx)(Wy,{"data-type":`outside`,ref:u,onFocus:e=>{$v(e,c)?f.current?.focus():Qv(m?m.domReference:null)?.focus()}}),v&&c&&(0,V.jsx)(`span`,{"aria-owns":c.id,style:gy}),c&&bi.createPortal(n,c),v&&c&&(0,V.jsx)(Wy,{"data-type":`outside`,ref:d,onFocus:e=>{$v(e,c)?p.current?.focus():(Zv(m?m.domReference:null)?.focus(),m?.closeOnFocusOut&&m?.onOpenChange(!1,Ey(`focus-out`,e.nativeEvent)))}})]})]})});function Ab(e){return e==null?e:`current`in e?e.current:e}function jb(e,t){let n=Ig(e.target);return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Mb=20,Nb=[];function Pb(){Nb=Nb.filter(e=>e.isConnected)}function Fb(e){Pb(),e&&Fg(e)!==`body`&&(Nb.push(e),Nb.length>Mb&&(Nb=Nb.slice(-Mb)))}function Ib(){return Pb(),Nb[Nb.length-1]}function Lb(e){if(!e)return null;let t=Yv();return Jv(e,t)?e:Kv(e,t)[0]||e}function Rb(e){return!e||!e.isConnected?!1:typeof e.checkVisibility==`function`?e.checkVisibility():$g(e).display!==`none`}function zb(e,t){if(!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=Yv(),r=qv(e,n).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Jv(e,n)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),i=e.getAttribute(`tabindex`);t.current.includes(`floating`)||r.length===0?i!==`0`&&e.setAttribute(`tabindex`,`0`):(i!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Bb(e){let{context:t,children:n,disabled:r=!1,order:i=[`content`],initialFocus:a=!0,returnFocus:o=!0,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,getInsideElements:d=()=>[],nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:h}=e,g=`rootStore`in t?t.rootStore:t,_=g.useState(`open`),v=g.useState(`domReferenceElement`),y=g.useState(`floatingElement`),{events:b,dataRef:x}=g.context,S=l_(()=>x.current.floatingContext?.nodeId),C=l_(d),w=a===!1,T=P_(v)&&w,E=a_(i),D=a_(a),O=a_(o),k=a_(u),A=dy(h),j=Eb(),M=B.useRef(null),N=B.useRef(null),P=B.useRef(!1),ee=B.useRef(!1),F=B.useRef(!1),te=B.useRef(-1),ne=B.useRef(``),re=B.useRef(``),I=Ng(),L=Ng(),ie=Hy(),ae=j!=null,R=I_(y),z=l_((e=R)=>e?Kv(e,Yv()):[]),oe=l_(e=>{let t=z(e);return E.current.map(()=>t).filter(Boolean).flat()});B.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&O_(R,D_(M_(R)))&&z().length===0&&!T&&z_(e)}let t=M_(R);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,v,R,c,E,T,z,oe]),B.useEffect(()=>{if(r||!y)return;function e(e){let t=k_(e),n=z().indexOf(t);n!==-1&&(te.current=n)}return y.addEventListener(`focusin`,e),()=>{y.removeEventListener(`focusin`,e)}},[r,y,z]),B.useEffect(()=>{if(r||!_)return;let e=M_(R);function t(){F.current=!1}function n(e){let t=k_(e);F.current=!(O_(y,t)||O_(v,t)||O_(j?.portalNode,t)),re.current=e.pointerType||`keyboard`}function i(){re.current=`keyboard`}return e.addEventListener(`pointerdown`,n,!0),e.addEventListener(`pointerup`,t,!0),e.addEventListener(`pointercancel`,t,!0),e.addEventListener(`keydown`,i,!0),()=>{e.removeEventListener(`pointerdown`,n,!0),e.removeEventListener(`pointerup`,t,!0),e.removeEventListener(`pointercancel`,t,!0),e.removeEventListener(`keydown`,i,!0)}},[r,y,v,R,_,j]),B.useEffect(()=>{if(r||!l)return;function e(){ee.current=!0,L.start(0,()=>{ee.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=k_(e);queueMicrotask(()=>{let i=S(),a=g.context.triggerElements,o=!(O_(v,t)||O_(y,t)||O_(t,y)||O_(j?.portalNode,t)||t!=null&&a.hasElement(t)||a.hasMatchingElement(e=>O_(e,t))||t?.hasAttribute(Dy(`focus-guard`))||A&&(L_(A.nodesRef.current,i).find(e=>O_(e.context?.elements.floating,t)||O_(e.context?.elements.domReference,t))||R_(A.nodesRef.current,i).find(e=>[e.context?.elements.floating,I_(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===v&&R&&zb(R,E),s&&n!==v&&!Rb(r)&&D_(M_(R))===M_(R).body){if(Bg(R)&&(R.focus(),s===`popup`)){ie.request(()=>{R.focus()});return}let e=te.current,t=z(),n=t[e]||t[t.length-1]||R;Bg(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(T||!c)&&t&&o&&!ee.current&&(T||t!==Ib())&&(P.current=!0,g.setOpen(!1,Ey(Sy,e)))})}function n(){F.current||(x.current.insideReactTree=!0,I.start(0,()=>{x.current.insideReactTree=!1}))}let i=Bg(v)?v:null,a=[];if(!(!y&&!i))return i&&(i.addEventListener(`focusout`,t),i.addEventListener(`pointerdown`,e),a.push(()=>{i.removeEventListener(`focusout`,t),i.removeEventListener(`pointerdown`,e)})),y&&(y.addEventListener(`focusout`,t),j&&(y.addEventListener(`focusout`,n,!0),a.push(()=>{y.removeEventListener(`focusout`,n,!0)})),a.push(()=>{y.removeEventListener(`focusout`,t)})),()=>{a.forEach(e=>{e()})}},[r,v,y,R,c,A,j,g,l,s,z,T,S,E,x,I,L,ie]);let se=B.useRef(null),ce=B.useRef(null),le=My(se,m,j?.beforeInsideRef),ue=My(ce,j?.afterInsideRef);B.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(j?.portalNode?.querySelectorAll(`[${Dy(`portal`)}]`)||[]),t=tb([y,(A?R_(A.nodesRef.current,S()):[]).find(e=>P_(e.context?.elements.domReference||null))?.context?.elements.domReference,...e,...C(),M.current,N.current,se.current,ce.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,Ab(p),Ab(f),T?v:null].filter(e=>e!=null),c||T);return()=>{t()}},[_,r,v,y,c,E,j,T,A,S,C,f,p]),Cg(()=>{if(!_||r||!Bg(R))return;let e=D_(M_(R));queueMicrotask(()=>{let t=oe(R),n=D.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1)return;let i;i=r===!0||r===null?t[0]||R:Ab(r),i=i||t[0]||R,!O_(R,e)&&Ky(i,{preventScroll:i===R})})},[r,_,R,w,oe,D,k]),Cg(()=>{if(r||!R)return;let e=M_(R);Fb(D_(e));function t(e){if(e.open||(ne.current=jb(e.nativeEvent,re.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(P.current=!0),e.reason===`outside-press`)if(e.nested)P.current=!1;else if(V_(e.nativeEvent)||H_(e.nativeEvent))P.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?P.current=!1:P.current=!0}}b.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,Ry),ae&&v&&v.insertAdjacentElement(`afterend`,n);function i(){let e=O.current,t=typeof e==`function`?e(ne.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=v||Ib();return e&&e.isConnected?e:n}let r=v||Ib()||n;return Ab(t)||r}return()=>{b.off(`openchange`,t);let r=D_(e),a=O_(y,r)||A&&L_(A.nodesRef.current,S(),!1).some(e=>O_(e.context?.elements.floating,r)),o=i();queueMicrotask(()=>{let t=Lb(o),i=typeof O.current!=`boolean`;O.current&&!P.current&&Bg(t)&&(!(!i&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,y,R,O,x,b,A,ae,v,S]),B.useEffect(()=>{queueMicrotask(()=>{P.current=!1})},[r]),B.useEffect(()=>{if(r||!_)return;function e(e){k_(e)?.closest(`[data-base-ui-click-trigger]`)&&(ee.current=!0)}let t=M_(R);return t.addEventListener(`pointerdown`,e,!0),()=>{t.removeEventListener(`pointerdown`,e,!0)}},[r,_,R]),Cg(()=>{if(!r&&j)return j.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:g.setOpen,domReference:v}),()=>{j.setFocusManagerState(null)}},[r,j,c,_,g,l,v]),Cg(()=>{if(!(r||!R))return zb(R,E),()=>{queueMicrotask(Pb)}},[r,R,E]);let de=!r&&(c?!T:!0)&&(ae||c);return(0,V.jsxs)(B.Fragment,{children:[de&&(0,V.jsx)(Wy,{"data-type":`inside`,ref:le,onFocus:e=>{if(c){let e=oe();Ky(e[e.length-1])}else j?.portalNode&&(P.current=!1,$v(e,j.portalNode)?Zv(v)?.focus():Ab(p??j.beforeOutsideRef)?.focus())}}),n,de&&(0,V.jsx)(Wy,{"data-type":`inside`,ref:ue,onFocus:e=>{c?Ky(oe()[0]):j?.portalNode&&(l&&(P.current=!0),$v(e,j.portalNode)?Qv(v)?.focus():Ab(f??j.afterOutsideRef)?.focus())}})]})}function Vb(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Hb(e){return e!=null&&e.clientX!=null}function Ub(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{enabled:s=!0,axis:c=`both`,x:l=null,y:u=null}=t,d=B.useRef(!1),f=B.useRef(null),[p,m]=B.useState(),[h,g]=B.useState([]),_=l_((e,t)=>{d.current||o.current.openEvent&&!Hb(o.current.openEvent)||n.set(`positionReference`,Vb(a,{x:e,y:t,axis:c,dataRef:o,pointerType:p}))}),v=l_(e=>{l!=null||u!=null||(r?f.current||g([]):_(e.clientX,e.clientY))}),y=U_(p)?i:r,b=B.useCallback(()=>{if(!y||!s||l!=null||u!=null)return;let e=Ig(i);function t(n){O_(i,k_(n))?(e.removeEventListener(`mousemove`,t),f.current=null):_(n.clientX,n.clientY)}if(!o.current.openEvent||Hb(o.current.openEvent)){e.addEventListener(`mousemove`,t);let n=()=>{e.removeEventListener(`mousemove`,t),f.current=null};return f.current=n,n}n.set(`positionReference`,a)},[y,s,l,u,i,o,a,n,_]);B.useEffect(()=>b(),[b,h]),B.useEffect(()=>{s&&!i&&(d.current=!1)},[s,i]),B.useEffect(()=>{!s&&r&&(d.current=!0)},[s,r]),Cg(()=>{s&&(l!=null||u!=null)&&(d.current=!1,_(l,u))},[s,l,u,_]);let x=B.useMemo(()=>{function e(e){m(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:v,onMouseEnter:v}},[v]);return B.useMemo(()=>s?{reference:x}:{},[s,x])}function Wb(e,t,n){let{reference:r,floating:i}=e,a=iv(t),o=av(t),s=rv(o),c=ev(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}}switch(tv(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Gb(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}=$_(t,e),p=_v(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=vv(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=vv(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 Kb=50,qb=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Gb},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Wb(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<Kb&&(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}=Wb(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Jb=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}=$_(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ev(r),_=iv(o),v=ev(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[hv(o)]:sv(o)),x=p!==`none`;!d&&x&&b.push(...mv(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=ov(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`&&_!==iv(t))||T.every(e=>iv(e.placement)===_?e.overflows[0]>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=iv(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;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Yb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xb(e){return G_.some(t=>e[t]>=0)}var Zb=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=$_(e,t);switch(i){case`referenceHidden`:{let e=Yb(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Xb(e)}}}case`escaped`:{let e=Yb(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Xb(e)}}}default:return{}}}}},Qb=new Set([`left`,`top`]);async function $b(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ev(n),s=tv(n),c=iv(n)===`y`,l=Qb.has(o)?-1:1,u=a&&c?-1:1,d=$_(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 ex=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 $b(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}}}}},tx=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}=$_(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=iv(ev(i)),p=nv(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Q_(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Q_(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},nx=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=$_(e,t),u={x:n,y:r},d=iv(i),f=nv(d),p=u[f],m=u[d],h=$_(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Qb.has(ev(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},rx=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=$_(e,t),u=await o.detectOverflow(t,l),d=ev(i),f=tv(i),p=iv(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=K_(h-u[g],v),x=K_(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=q_(u.left,0),t=q_(u.right,0),n=q_(u.top,0),r=q_(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:q_(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:q_(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function ix(e){let t=$g(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Bg(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=J_(n)!==a||J_(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ax(e){return zg(e)?e:e.contextElement}function ox(e){let t=ax(e);if(!Bg(t))return X_(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ix(t),o=(a?J_(n.width):n.width)/r,s=(a?J_(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var sx=X_(0);function cx(e){let t=Ig(e);return!Zg()||!t.visualViewport?sx:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function lx(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ig(e)?!1:t}function ux(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ax(e),o=X_(1);t&&(r?zg(r)&&(o=ox(r)):o=ox(e));let s=lx(a,n,r)?cx(a):X_(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){let e=Ig(a),t=r&&zg(r)?Ig(r):r,n=e,i=i_(n);for(;i&&r&&t!==n;){let e=ox(i),t=i.getBoundingClientRect(),r=$g(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=Ig(i),i=i_(n)}}return vv({width:u,height:d,x:c,y:l})}function dx(e,t){let n=e_(e).scrollLeft;return t?t.left+n:ux(Lg(e)).left+n}function fx(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-dx(e,n),y:n.top+t.scrollTop}}function px(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Lg(r),s=t?Wg(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=X_(1),u=X_(0),d=Bg(r);if((d||!d&&!a)&&((Fg(r)!==`body`||Hg(o))&&(c=e_(r)),d)){let e=ux(r);l=ox(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?fx(o,c):X_(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 mx(e){return Array.from(e.getClientRects())}function hx(e){let t=Lg(e),n=e_(e),r=e.ownerDocument.body,i=q_(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=q_(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+dx(e),s=-n.scrollTop;return $g(r).direction===`rtl`&&(o+=q_(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var gx=25;function _x(e,t){let n=Ig(e),r=Lg(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Zg();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=dx(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=gx&&(a-=o)}else l<=gx&&(a+=l);return{width:a,height:o,x:s,y:c}}function vx(e,t){let n=ux(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Bg(e)?ox(e):X_(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function yx(e,t,n){let r;if(t===`viewport`)r=_x(e,n);else if(t===`document`)r=hx(Lg(e));else if(zg(t))r=vx(t,n);else{let n=cx(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return vv(r)}function bx(e,t){let n=t_(e);return n===t||!zg(n)||Qg(n)?!1:$g(n).position===`fixed`||bx(n,t)}function xx(e,t){let n=t.get(e);if(n)return n;let r=r_(e,[],!1).filter(e=>zg(e)&&Fg(e)!==`body`),i=null,a=$g(e).position===`fixed`,o=a?t_(e):e;for(;zg(o)&&!Qg(o);){let t=$g(o),n=Yg(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Hg(o)&&!n&&bx(e,o))?r=r.filter(e=>e!==o):i=t,o=t_(o)}return t.set(e,r),r}function Sx(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Wg(t)?[]:xx(t,this._c):[].concat(n),r],o=yx(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=yx(t,a[e],i);s=q_(n.top,s),c=K_(n.right,c),l=K_(n.bottom,l),u=q_(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Cx(e){let{width:t,height:n}=ix(e);return{width:t,height:n}}function wx(e,t,n){let r=Bg(t),i=Lg(t),a=n===`fixed`,o=ux(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=X_(0);function l(){c.x=dx(i)}if(r||!r&&!a)if((Fg(t)!==`body`||Hg(i))&&(s=e_(t)),r){let e=ux(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?fx(i,s):X_(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Tx(e){return $g(e).position===`static`}function Ex(e,t){if(!Bg(e)||$g(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Lg(e)===n&&(n=n.ownerDocument.body),n}function Dx(e,t){let n=Ig(e);if(Wg(e))return n;if(!Bg(e)){let t=t_(e);for(;t&&!Qg(t);){if(zg(t)&&!Tx(t))return t;t=t_(t)}return n}let r=Ex(e,t);for(;r&&Ug(r)&&Tx(r);)r=Ex(r,t);return r&&Qg(r)&&Tx(r)&&!Yg(r)?n:r||Xg(e)||n}var Ox=async function(e){let t=this.getOffsetParent||Dx,n=this.getDimensions,r=await n(e.floating);return{reference:wx(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function kx(e){return $g(e).direction===`rtl`}var Ax={convertOffsetParentRelativeRectToViewportRelativeRect:px,getDocumentElement:Lg,getClippingRect:Sx,getOffsetParent:Dx,getElementRects:Ox,getClientRects:mx,getDimensions:Cx,getScale:ox,isElement:zg,isRTL:kx};function jx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Mx(e,t){let n=null,r,i=Lg(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Y_(d),h=Y_(i.clientWidth-(u+f)),g=Y_(i.clientHeight-(d+p)),_=Y_(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:q_(0,K_(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!jx(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Nx(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=ax(e),u=i||a?[...l?r_(l):[],...t?r_(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Mx(l,n):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?ux(e):null;c&&g();function g(){let t=ux(e);h&&!jx(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 Px=ex,Fx=tx,Ix=Jb,Lx=rx,Rx=Zb,zx=nx,Bx=(e,t,n)=>{let r=new Map,i={platform:Ax,...n},a={...i.platform,_c:r};return qb(e,t,{...i,platform:a})},Vx=typeof document<`u`?B.useLayoutEffect:function(){};function Hx(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(!Hx(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)&&!Hx(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ux(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Wx(e,t){let n=Ux(e);return Math.round(t*n)/n}function Gx(e){let t=B.useRef(e);return Vx(()=>{t.current=e}),t}function Kx(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]=B.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=B.useState(r);Hx(f,r)||p(r);let[m,h]=B.useState(null),[g,_]=B.useState(null),v=B.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=B.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=B.useRef(null),C=B.useRef(null),w=B.useRef(u),T=c!=null,E=Gx(c),D=Gx(i),O=Gx(l),k=B.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Bx(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Hx(w.current,t)&&(w.current=t,bi.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Vx(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=B.useRef(!1);Vx(()=>(A.current=!0,()=>{A.current=!1}),[]),Vx(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=B.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=B.useMemo(()=>({reference:b,floating:x}),[b,x]),N=B.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Wx(M.floating,u.x),r=Wx(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ux(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return B.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var qx=(e,t)=>{let n=Px(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jx=(e,t)=>{let n=Fx(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yx=(e,t)=>({fn:zx(e).fn,options:[e,t]}),Xx=(e,t)=>{let n=Ix(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zx=(e,t)=>{let n=Lx(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qx=(e,t)=>{let n=Rx(e);return{name:n.name,fn:n.fn,options:[e,t]}},$x={intentional:`onClick`,sloppy:`onPointerDown`};function eS(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function tS(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`referenceElement`),o=n.useState(`domReferenceElement`),{onOpenChange:s,dataRef:c}=n.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:f=`sloppy`,referencePress:p=!1,referencePressEvent:m=`sloppy`,ancestorScroll:h=!1,bubbles:g,externalTree:_}=t,v=dy(_),y=l_(typeof d==`function`?d:()=>!1),b=typeof d==`function`?y:d,x=B.useRef(!1),{escapeKey:S,outsidePress:C}=eS(g),w=B.useRef(null),T=Ng(),E=Ng(),D=l_(()=>{E.clear(),c.current.insideReactTree=!1}),O=B.useRef(!1),k=B.useRef(``),A=l_(e=>{k.current=e.pointerType}),j=l_(()=>{let e=k.current,t=e===`pen`||!e?`mouse`:e,n=typeof f==`function`?f():f;return typeof n==`string`?n:n[t]}),M=l_(e=>{if(!r||!l||!u||e.key!==`Escape`||O.current)return;let t=c.current.floatingContext?.nodeId,i=v?L_(v.nodesRef.current,t):[];if(!S&&i.length>0){let e=!0;if(i.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let a=Ey(Cy,B_(e)?e.nativeEvent:e);n.setOpen(!1,a),!S&&!a.isPropagationAllowed&&e.stopPropagation()}),N=l_(e=>{let t=j();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}),P=l_(()=>{c.current.insideReactTree=!0,E.start(0,D)}),ee=l_((e,t=!1)=>{if(N(e)){D();return}if(c.current.insideReactTree){D();return}if(j()===`intentional`&&t||typeof b==`function`&&!b(e))return;let r=k_(e),i=`[${Dy(`inert`)}]`,a=M_(n.select(`floatingElement`)).querySelectorAll(i),o=n.context.triggerElements;if(r&&(o.hasElement(r)||o.hasMatchingElement(e=>O_(e,r))))return;let s=zg(r)?r:null;for(;s&&!Qg(s);){let e=t_(s);if(Qg(e)||!zg(e))break;s=e}if(a.length&&zg(r)&&!j_(r)&&!O_(r,n.select(`floatingElement`))&&Array.from(a).every(e=>!O_(s,e)))return;if(Bg(r)&&!(`touches`in e)){let t=Qg(r),n=$g(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}let l=c.current.floatingContext?.nodeId,u=v&&L_(v.nodesRef.current,l).some(t=>A_(e,t.context?.elements.floating));if(A_(e,n.select(`floatingElement`))||A_(e,n.select(`domReferenceElement`))||u)return;let d=v?L_(v.nodesRef.current,l):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,Ey(by,e)),D()}),F=l_(e=>{j()!==`sloppy`||e.pointerType===`touch`||!n.select(`open`)||!l||A_(e,n.select(`floatingElement`))||A_(e,n.select(`domReferenceElement`))||ee(e)}),te=l_(e=>{if(j()!==`sloppy`||!n.select(`open`)||!l||A_(e,n.select(`floatingElement`))||A_(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(w.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{w.current&&(w.current.dismissOnTouchEnd=!1,w.current.dismissOnMouseDown=!1)}))}),ne=l_(e=>{let t=k_(e);function n(){te(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),re=l_(e=>{let t=x.current;if(x.current=!1,T.clear(),e.type===`mousedown`&&w.current&&!w.current.dismissOnMouseDown)return;let n=k_(e);function r(){e.type===`pointerdown`?F(e):ee(e,t),n?.removeEventListener(e.type,r)}n?.addEventListener(e.type,r)}),I=l_(e=>{if(j()!==`sloppy`||!w.current||A_(e,n.select(`floatingElement`))||A_(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-w.current.startX),i=Math.abs(t.clientY-w.current.startY),a=Math.sqrt(r*r+i*i);a>5&&(w.current.dismissOnTouchEnd=!0),a>10&&(ee(e),T.clear(),w.current=null)}),L=l_(e=>{let t=k_(e);function n(){I(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),ie=l_(e=>{j()!==`sloppy`||!w.current||A_(e,n.select(`floatingElement`))||A_(e,n.select(`domReferenceElement`))||(w.current.dismissOnTouchEnd&&ee(e),T.clear(),w.current=null)}),ae=l_(e=>{let t=k_(e);function n(){ie(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)});B.useEffect(()=>{if(!r||!l)return;c.current.__escapeKeyBubbles=S,c.current.__outsidePressBubbles=C;let e=new Mg;function t(e){n.setOpen(!1,Ey(_y,e))}function s(){e.clear(),O.current=!0}function d(){e.start(Zg()?5:0,()=>{O.current=!1})}let f=M_(i);f.addEventListener(`pointerdown`,A,!0),u&&(f.addEventListener(`keydown`,M),f.addEventListener(`compositionstart`,s),f.addEventListener(`compositionend`,d)),b&&(f.addEventListener(`click`,re,!0),f.addEventListener(`pointerdown`,re,!0),f.addEventListener(`touchstart`,ne,!0),f.addEventListener(`touchmove`,L,!0),f.addEventListener(`touchend`,ae,!0),f.addEventListener(`mousedown`,re,!0));let p=[];return h&&(zg(o)&&(p=r_(o)),zg(i)&&(p=p.concat(r_(i))),!zg(a)&&a&&a.contextElement&&(p=p.concat(r_(a.contextElement)))),p=p.filter(e=>e!==f.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{f.removeEventListener(`pointerdown`,A,!0),u&&(f.removeEventListener(`keydown`,M),f.removeEventListener(`compositionstart`,s),f.removeEventListener(`compositionend`,d)),b&&(f.removeEventListener(`click`,re,!0),f.removeEventListener(`pointerdown`,re,!0),f.removeEventListener(`touchstart`,ne,!0),f.removeEventListener(`touchmove`,L,!0),f.removeEventListener(`touchend`,ae,!0),f.removeEventListener(`mousedown`,re,!0)),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),e.clear()}},[c,i,a,o,u,b,r,s,h,l,S,C,M,ee,re,F,ne,L,ae,A,n]),B.useEffect(D,[b,D]);let R=B.useMemo(()=>({onKeyDown:M,...p&&{[$x[m]]:e=>{n.setOpen(!1,Ey(`trigger-press`,e.nativeEvent))},...m!==`intentional`&&{onClick(e){n.setOpen(!1,Ey(`trigger-press`,e.nativeEvent))}}}}),[M,n,p,m]),z=l_(e=>{let t=k_(e.nativeEvent);!O_(n.select(`floatingElement`),t)||e.button!==0||(x.current=!0)}),oe=B.useMemo(()=>({onKeyDown:M,onPointerDown:z,onMouseDown:z,onMouseUp:z,onClickCapture:P,onMouseDownCapture:P,onPointerDownCapture:P,onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[M,z,P]);return B.useMemo(()=>l?{reference:R,floating:oe,trigger:R}:{},[l,R,oe])}var nS=Symbol(`NOT_FOUND`);function rS(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function iS(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function aS(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var oS=e=>Array.isArray(e)?e:[e];function sS(e){let t=Array.isArray(e[0])?e[0]:e;return aS(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function cS(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function lS(e){let t;return{get(n){return t&&e(t.key,n)?t.value:nS},put(e,n){t={key:e,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function uS(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(e,n.key));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return nS}function i(t,i){r(t)===nS&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())}function a(){return n}function o(){n=[]}return{get:r,put:i,getEntries:a,clear:o}}var dS=(e,t)=>e===t;function fS(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;let{length:r}=t;for(let i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function pS(e,t){let{equalityCheck:n=dS,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=fS(n),o=0,s=r<=1?lS(a):uS(r,a);function c(){let t=s.get(arguments);if(t===nS){if(t=e.apply(null,arguments),o++,i){let e=s.getEntries().find(e=>i(e.value,t));e&&(t=e.value,o!==0&&o--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}var mS=class{constructor(e){this.value=e}deref(){return this.value}},hS=typeof WeakRef<`u`?WeakRef:mS,gS=0,_S=1;function vS(){return{s:gS,v:void 0,o:null,p:null}}function yS(e,t={}){let n=vS(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=vS(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=vS(),e.set(n,t)):t=r}}let s=t,c;if(t.s===_S)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new hS(c):c}return s.s=_S,s.v=c,c}return o.clearCache=()=>{n=vS(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function bS(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),rS(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=yS,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=oS(c),p=oS(u),m=sS(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=l(function(){r++;let e=cS(m,arguments);return i=h.apply(null,e),i},...p);return Object.assign(g,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var xS=bS(yS),SS=Object.assign((e,t=xS)=>{iS(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>SS});bS({memoize:pS,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});var CS=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(wg(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},wS=ai(),TS=rb(19)?DS:OS;function ES(e,t,n,r,i){return TS(e,t,n,r,i)}function DS(e,t,n,r,i){let a=B.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,wS.useSyncExternalStore)(e.subscribe,a,a)}function OS(e,t,n,r,i){return(0,si.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var kS=class e{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(t){for(let n in t)if(!Object.is(this.state[n],t[n])){e.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||e.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){let t={...this.state};e.prototype.setState.call(this,t)}},AS=class extends kS{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}controlledValues=new Map;useSyncedValue(e,t){B.useDebugValue(e),Cg(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){Cg(()=>(this.state[e]!==t&&this.set(e,t),()=>{this.set(e,void 0)}),[e,t])}useSyncedValues(e){Cg(()=>{this.update(e)},Object.values(e))}useControlledProp(e,t,n){B.useDebugValue(e);let r=t!==void 0;this.controlledValues.has(e)||(this.controlledValues.set(e,r),!r&&!Object.is(this.state[e],n)&&super.setState({...this.state,[e]:n})),Cg(()=>{r&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n,r])}set(e,t){this.controlledValues.get(e)!==!0&&super.set(e,t)}update(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&this.controlledValues.get(e)===!0){delete t[e];continue}super.update(t)}setState(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&this.controlledValues.get(e)===!0){delete t[e];continue}super.setState({...this.state,...t})}select=(e,t,n,r)=>{let i=this.selectors[e];return i(this.state,t,n,r)};useState=(e,t,n,r)=>{B.useDebugValue(e);let i=this.selectors[e];return ES(this,i,t,n,r)};useContextCallback(e,t){B.useDebugValue(e);let n=l_(t??fy);this.context[e]=n}useStateSetter(e){let t=B.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},jS={open:CS(e=>e.open),domReferenceElement:CS(e=>e.domReferenceElement),referenceElement:CS(e=>e.positionReference??e.referenceElement),floatingElement:CS(e=>e.floatingElement),floatingId:CS(e=>e.floatingId)},MS=class extends AS{constructor(e){let{nested:t,noEmit:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:sy(),nested:t,noEmit:n,triggerElements:i},jS)}setOpen=(e,t)=>{if((!e||!this.state.open||W_(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)}this.context.onOpenChange?.(e,t)}};function NS(e,t=!1,n=!1){let[r,i]=B.useState(e&&t?`idle`:void 0),[a,o]=B.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),Cg(()=>{if(!e&&a&&r!==`ending`&&n){let e=Vy.request(()=>{i(`ending`)});return()=>{Vy.cancel(e)}}},[e,a,r,n]),Cg(()=>{if(!e||t)return;let n=Vy.request(()=>{bi.flushSync(()=>{i(void 0)})});return()=>{Vy.cancel(n)}},[t,e]),Cg(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=Vy.request(()=>{i(`idle`)});return()=>{Vy.cancel(n)}},[t,e,a,i,r]),B.useMemo(()=>({mounted:a,setMounted:o,transitionStatus:r}),[a,r])}function PS(e,t=!1,n=!0){let r=Hy();return l_((i,a=null)=>{r.cancel();let o=Ab(e);o!=null&&(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED?i():r.request(()=>{function e(){o&&Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{a!=null&&a.aborted||bi.flushSync(i)}).catch(()=>{if(n){if(a!=null&&a.aborted)return;bi.flushSync(i)}else o.getAnimations().length>0&&o.getAnimations().some(e=>e.pending||e.playState!==`finished`)&&e()})}t?r.request(e):e()}))})}function FS(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=a_(n),o=l_(i),s=PS(r,n);B.useEffect(()=>{t&&s(()=>{n===a.current&&o()})},[t,n,o,s,a])}function IS(e,t){let n=B.useRef(null);return B.useCallback(r=>{if(e!==void 0&&(n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null),r!==null))return n.current=e,t.context.triggerElements.add(e,r),()=>{n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null)}},[t,e])}function LS(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=IS(e,n),o=l_(t=>{let i=a(t);return t!==null&&n.select(`open`)&&n.select(`activeTriggerId`)==null&&n.update({activeTriggerId:e,activeTriggerElement:t,...r}),i});return Cg(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function RS(e){let t=e.useState(`open`);Cg(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function zS(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=NS(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=l_(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return FS({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var BS=class{constructor(){this.elements=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elements.delete(n),this.elements.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elements.delete(t),this.idMap.delete(e))}hasElement(e){return this.elements.has(e)}hasMatchingElement(e){for(let t of this.elements)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}};function VS(){return new MS({open:!1,floatingElement:null,referenceElement:null,triggerElements:new BS,floatingId:``,nested:!1,noEmit:!1,onOpenChange:void 0})}function HS(){return{open:!1,mounted:!1,transitionStatus:`idle`,floatingRootContext:VS(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:py,inactiveTriggerProps:py,popupProps:py}}var US={open:CS(e=>e.open),mounted:CS(e=>e.mounted),transitionStatus:CS(e=>e.transitionStatus),floatingRootContext:CS(e=>e.floatingRootContext),preventUnmountingOnClose:CS(e=>e.preventUnmountingOnClose),payload:CS(e=>e.payload),activeTriggerId:CS(e=>e.activeTriggerId),activeTriggerElement:CS(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:CS((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:CS((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:CS((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:CS((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:CS(e=>e.popupProps),popupElement:CS(e=>e.popupElement),positionerElement:CS(e=>e.positionerElement)};function WS(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=oy(),a=uy()!=null,o=Og(()=>new MS({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:r.triggers??new BS,floatingId:i,nested:a,noEmit:e.noEmit||!1})).current;return Cg(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=zg(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o.context.noEmit=e.noEmit||!1,o}function GS(e={}){let{nodeId:t,externalTree:n}=e,r=WS(e),i=e.rootContext||r,a={reference:i.useState(`referenceElement`),floating:i.useState(`floatingElement`),domReference:i.useState(`domReferenceElement`)},[o,s]=B.useState(null),c=B.useRef(null),l=dy(n);Cg(()=>{a.domReference&&(c.current=a.domReference)},[a.domReference]);let u=Kx({...e,elements:{...a,...o&&{reference:o}}}),d=B.useCallback(e=>{let t=zg(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),u.refs.setReference(t)},[u.refs]),[f,p]=B.useState(null),[m,h]=B.useState(null);i.useSyncedValue(`referenceElement`,f),i.useSyncedValue(`domReferenceElement`,zg(f)?f:null),i.useSyncedValue(`floatingElement`,m);let g=B.useCallback(e=>{(zg(e)||e===null)&&(c.current=e,p(e)),(zg(u.refs.reference.current)||u.refs.reference.current===null||e!==null&&!zg(e))&&u.refs.setReference(e)},[u.refs,p]),_=B.useCallback(e=>{h(e),u.refs.setFloating(e)},[u.refs]),v=B.useMemo(()=>({...u.refs,setReference:g,setFloating:_,setPositionReference:d,domReference:c}),[u.refs,g,_,d]),y=B.useMemo(()=>({...u.elements,domReference:a.domReference}),[u.elements,a.domReference]),b=i.useState(`open`),x=i.useState(`floatingId`),S=B.useMemo(()=>({...u,dataRef:i.context.dataRef,open:b,onOpenChange:i.setOpen,events:i.context.events,floatingId:x,refs:v,elements:y,nodeId:t,rootStore:i}),[u,v,y,t,i,b,x]);return Cg(()=>{i.context.dataRef.current.floatingContext=S;let e=l?.nodesRef.current.find(e=>e.id===t);e&&(e.context=S)}),B.useMemo(()=>({...u,context:S,refs:v,elements:y,rootStore:i}),[u,v,y,S,i])}function KS(e){let{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,a=oy(),o=uy()!=null,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(r?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=Og(()=>new MS({open:s,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:i,floatingId:a,nested:o,noEmit:n})).current;return Cg(()=>{let e={open:s,floatingId:a,referenceElement:c,floatingElement:l};zg(c)&&(e.domReferenceElement=c),d.update(e)},[s,a,c,l,d]),d.context.onOpenChange=i,d.context.nested=o,d.context.noEmit=n,d}var qS=b_&&v_;function JS(e,t={}){let n=`rootStore`in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:a=!0,visibleOnly:o=!0}=t,s=B.useRef(!1),c=Ng(),l=B.useRef(!0);B.useEffect(()=>{let e=n.select(`domReferenceElement`);if(!a)return;let t=Ig(e);function r(){!n.select(`open`)&&Bg(e)&&e===D_(M_(e))&&(s.current=!0)}function i(){l.current=!0}function o(){l.current=!1}return t.addEventListener(`blur`,r),qS&&(t.addEventListener(`keydown`,i,!0),t.addEventListener(`pointerdown`,o,!0)),()=>{t.removeEventListener(`blur`,r),qS&&(t.removeEventListener(`keydown`,i,!0),t.removeEventListener(`pointerdown`,o,!0))}},[n,a]),B.useEffect(()=>{if(!a)return;function e(e){(e.reason===`trigger-press`||e.reason===`escape-key`)&&(s.current=!0)}return r.on(`openchange`,e),()=>{r.off(`openchange`,e)}},[r,a]);let u=B.useMemo(()=>({onMouseLeave(){s.current=!1},onFocus(e){if(s.current)return;let t=k_(e.nativeEvent);if(o&&zg(t)){if(qS&&!e.relatedTarget){if(!l.current&&!N_(t))return}else if(!F_(t))return}n.setOpen(!0,Ey(yy,e.nativeEvent,e.currentTarget))},onBlur(e){s.current=!1;let t=e.relatedTarget,r=e.nativeEvent,a=zg(t)&&t.hasAttribute(Dy(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;c.start(0,()=>{let o=n.select(`domReferenceElement`),s=D_(o?o.ownerDocument:document);!t&&s===o||O_(i.current.floatingContext?.refs.floating.current,s)||O_(o,s)||a||n.context.triggerElements.hasElement(e.relatedTarget)||n.setOpen(!1,Ey(yy,r))})}}),[i,n,o,c]);return B.useMemo(()=>a?{reference:u,trigger:u}:{},[a,u])}var YS=Dy(`safe-polygon`),XS=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${E_}`;function ZS(e){return e?!!e.closest(XS):!1}function QS(e){let t=B.useRef(void 0),n=B.useRef(!1),r=B.useRef(void 0),i=B.useRef(!0),a=B.useRef(!1),o=B.useRef(()=>{}),s=B.useRef(!1),c=Ng(),l=Ng(),u=B.useRef(void 0);return B.useMemo(()=>{let d=e.context.dataRef.current;return d.hoverInteractionState||={pointerTypeRef:t,interactedInsideRef:n,handlerRef:r,blockMouseMoveRef:i,performedPointerEventsMutationRef:a,unbindMouseMoveRef:o,restTimeoutPendingRef:s,openChangeTimeout:c,restTimeout:l,handleCloseOptionsRef:u},d.hoverInteractionState},[e,t,n,r,i,a,o,s,c,l,u])}var $S=new Set([`click`,`mousedown`]);function eC(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),{dataRef:o}=n.context,{enabled:s=!0,closeDelay:c=0,externalTree:l}=t,{pointerTypeRef:u,interactedInsideRef:d,handlerRef:f,performedPointerEventsMutationRef:p,unbindMouseMoveRef:m,restTimeoutPendingRef:h,openChangeTimeout:g,handleCloseOptionsRef:_}=QS(n),v=dy(l),y=uy(),b=l_(()=>d.current?!0:o.current.openEvent?$S.has(o.current.openEvent.type):!1),x=l_(()=>{let e=o.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),S=B.useCallback((e,t=!0)=>{let r=tC(c,u.current);r&&!f.current?g.start(r,()=>n.setOpen(!1,Ey(vy,e))):t&&(g.clear(),n.setOpen(!1,Ey(vy,e)))},[c,f,n,u,g]),C=l_(()=>{m.current(),f.current=void 0}),w=l_(()=>{if(p.current){let e=M_(i).body;e.style.pointerEvents=``,e.removeAttribute(YS),p.current=!1}}),T=l_(e=>{if(!ZS(k_(e))){d.current=!1;return}d.current=!0});Cg(()=>{r||(u.current=void 0,h.current=!1,d.current=!1,C(),w())},[r,u,h,d,C,w]),B.useEffect(()=>()=>{C()},[C]),B.useEffect(()=>w,[w]),Cg(()=>{if(s&&r&&_.current?.blockPointerEvents&&x()&&zg(a)&&i){p.current=!0;let e=M_(i).body;e.setAttribute(YS,``);let t=a,n=i,r=v?.nodesRef.current.find(e=>e.id===y)?.context?.elements.floating;return r&&(r.style.pointerEvents=``),e.style.pointerEvents=`none`,t.style.pointerEvents=`auto`,n.style.pointerEvents=`auto`,()=>{e.style.pointerEvents=``,t.style.pointerEvents=``,n.style.pointerEvents=``}}},[s,r,a,i,_,x,v,y,p]),B.useEffect(()=>{if(!s)return;function e(e){if(b()||!o.current.floatingContext)return;let t=n.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||(w(),C(),b()||S(e))}function t(e){g.clear(),w(),f.current?.(e),C()}function r(e){b()||S(e,!1)}let a=i;return a&&(a.addEventListener(`mouseleave`,e),a.addEventListener(`mouseenter`,t),a.addEventListener(`mouseleave`,r),a.addEventListener(`pointerdown`,T,!0)),()=>{a&&(a.removeEventListener(`mouseleave`,e),a.removeEventListener(`mouseenter`,t),a.removeEventListener(`mouseleave`,r),a.removeEventListener(`pointerdown`,T,!0))}})}function tC(e,t){return t&&!U_(t)?0:typeof e==`function`?e():e}function nC(e){return typeof e==`function`?e():e}var rC={current:null};function iC(e,t={}){let n=`rootStore`in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:a=!0,delay:o=0,handleClose:s=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:d=rC,externalTree:f,isActiveTrigger:p=!0}=t,m=dy(f),{pointerTypeRef:h,interactedInsideRef:g,handlerRef:_,blockMouseMoveRef:v,performedPointerEventsMutationRef:y,unbindMouseMoveRef:b,restTimeoutPendingRef:x,openChangeTimeout:S,restTimeout:C,handleCloseOptionsRef:w}=QS(n),T=a_(s),E=a_(o),D=a_(l);p&&(w.current=T.current?.__options);let O=l_(()=>g.current?!0:r.current.openEvent?[`click`,`mousedown`].includes(r.current.openEvent.type):!1),k=B.useCallback((e,t=!0)=>{let r=Oy(E.current,`close`,h.current);r&&!_.current?S.start(r,()=>n.setOpen(!1,Ey(vy,e))):t&&(S.clear(),n.setOpen(!1,Ey(vy,e)))},[E,_,n,h,S]),A=l_(()=>{b.current(),_.current=void 0}),j=l_(()=>{if(y.current){let e=M_(n.select(`domReferenceElement`)).body;e.style.pointerEvents=``,e.removeAttribute(YS),y.current=!1}});B.useEffect(()=>{if(!a)return;function e(e){e.open||(S.clear(),C.clear(),v.current=!0,x.current=!1)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[a,i,S,C,v,x]);let M=l_(e=>{if(O()||!r.current.floatingContext)return;let t=n.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||T.current?.({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){j(),A(),O()||k(e)}})(e)});return B.useEffect(()=>{if(!a)return;let e=d.current??(p?n.select(`domReferenceElement`):null);if(!zg(e))return;function t(e){if(S.clear(),v.current=!1,c&&!U_(h.current)||nC(D.current)>0&&!Oy(E.current,`open`))return;let t=Oy(E.current,`open`,h.current),r=n.select(`domReferenceElement`),i=n.context.triggerElements,a=(i.hasElement(e.target)||i.hasMatchingElement(t=>O_(t,e.target)))&&(!r||!O_(r,e.target)),o=e.currentTarget??null;t?S.start(t,()=>{n.select(`open`)||n.setOpen(!0,Ey(vy,e,o))}):(!n.select(`open`)||a)&&n.setOpen(!0,Ey(vy,e,o))}function i(e){if(O()){j();return}b.current();let t=M_(n.select(`domReferenceElement`));C.clear(),x.current=!1;let i=n.context.triggerElements;if(!(e.relatedTarget&&i.hasElement(e.relatedTarget))){if(T.current&&r.current.floatingContext){n.select(`open`)||S.clear(),_.current=T.current({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){j(),A(),O()||k(e,!0)}});let i=_.current;i(e),t.addEventListener(`mousemove`,i),b.current=()=>{t.removeEventListener(`mousemove`,i)};return}(h.current!==`touch`||!O_(n.select(`floatingElement`),e.relatedTarget))&&k(e)}}function o(e){M(e)}return n.select(`open`)&&e.addEventListener(`mouseleave`,o),u&&e.addEventListener(`mousemove`,t,{once:!0}),e.addEventListener(`mouseenter`,t),e.addEventListener(`mouseleave`,i),()=>{e.removeEventListener(`mouseleave`,o),u&&e.removeEventListener(`mousemove`,t),e.removeEventListener(`mouseenter`,t),e.removeEventListener(`mouseleave`,i)}},[A,j,v,r,E,k,n,a,T,M,p,O,c,u,h,D,C,x,S,d,m,b,_]),B.useMemo(()=>{function e(e){h.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,r=e.currentTarget,i=n.select(`domReferenceElement`),a=n.context.triggerElements,o=n.select(`open`),s=(a.hasElement(e.target)||a.hasMatchingElement(t=>O_(t,e.target)))&&(!i||!O_(i,e.target));if(c&&!U_(h.current)||o&&!s||nC(D.current)===0||!s&&x.current&&e.movementX**2+e.movementY**2<2)return;C.clear();function l(){!v.current&&(!o||s)&&n.setOpen(!0,Ey(vy,t,r))}h.current===`touch`?bi.flushSync(()=>{l()}):s&&o?l():(x.current=!0,C.start(nC(D.current),l))}}},[v,c,n,h,D,C,x])}function aC(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=B.useCallback(t=>oC(t,e,`reference`),t),o=B.useCallback(t=>oC(t,e,`floating`),n),s=B.useCallback(t=>oC(t,e,`item`),r),c=B.useCallback(t=>oC(t,e,`trigger`),i);return B.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function oC(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[T_]=``);for(let t in e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&sC(a,s,i,r)}return sC(a,e,i,r),a}function sC(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}var cC=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function lC(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingId`),a=n.useState(`domReferenceElement`),o=n.useState(`floatingElement`),{enabled:s=!0,role:c=`dialog`}=t,l=oy(),u=a?.id||l,d=B.useMemo(()=>I_(o)?.id||i,[o,i]),f=cC.get(c)??c,p=uy()!=null,m=B.useMemo(()=>f===`tooltip`||c===`label`?py:{"aria-haspopup":f===`alertdialog`?`dialog`:f,"aria-expanded":`false`,...f===`listbox`&&{role:`combobox`},...f===`menu`&&p&&{role:`menuitem`},...c===`select`&&{"aria-autocomplete":`none`},...c===`combobox`&&{"aria-autocomplete":`list`}},[f,p,c]),h=B.useMemo(()=>f===`tooltip`||c===`label`?{[`aria-${c===`label`?`labelledby`:`describedby`}`]:r?d:void 0}:{...m,"aria-expanded":r?`true`:`false`,"aria-controls":r?d:void 0,...f===`menu`&&{id:u}},[f,d,r,u,c,m]),g=B.useMemo(()=>{let e={id:d,...f&&{role:f}};return f===`tooltip`||c===`label`?e:{...e,...f===`menu`&&{"aria-labelledby":u}}},[f,d,u,c]),_=B.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${d}-fui-option`}};switch(c){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[d,c]);return B.useMemo(()=>s?{reference:h,floating:g,item:_,trigger:m}:{},[s,h,g,m,_])}function uC(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function dC(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function fC(e={}){let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i=new Mg,a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=({x:e,y:n,placement:o,elements:s,onClose:c,nodeId:u,tree:d})=>function(f){function p(){i.clear(),c()}if(i.clear(),!s.domReference||!s.floating||o==null||e==null||n==null)return;let{clientX:m,clientY:h}=f,g=[m,h],_=k_(f),v=f.type===`mouseleave`,y=O_(s.floating,_),b=O_(s.domReference,_),x=s.domReference.getBoundingClientRect(),S=s.floating.getBoundingClientRect(),C=o.split(`-`)[0],w=e>S.right-S.width/2,T=n>S.bottom-S.height/2,E=dC(g,x),D=S.width>x.width,O=S.height>x.height,k=(D?x:S).left,A=(D?x:S).right,j=(O?x:S).top,M=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&zg(f.relatedTarget)&&O_(s.floating,f.relatedTarget)||d&&L_(d.nodesRef.current,u).some(({context:e})=>e?.open))return;if(C===`top`&&n>=x.bottom-1||C===`bottom`&&n<=x.top+1||C===`left`&&e>=x.right-1||C===`right`&&e<=x.left+1)return p();let N=[];switch(C){case`top`:N=[[k,x.top+1],[k,S.bottom-1],[A,S.bottom-1],[A,x.top+1]];break;case`bottom`:N=[[k,S.top+1],[k,x.bottom-1],[A,x.bottom-1],[A,S.top+1]];break;case`left`:N=[[S.right-1,M],[S.right-1,j],[x.left+1,j],[x.left+1,M]];break;case`right`:N=[[x.right-1,M],[x.right-1,j],[S.left+1,j],[S.left+1,M]];break;default:}function P([e,n]){switch(C){case`top`:return[[D?e+t/2:w?e+t*4:e-t*4,n+t+1],[D?e-t/2:w?e+t*4:e-t*4,n+t+1],...[[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]]];case`bottom`:return[[D?e+t/2:w?e+t*4:e-t*4,n-t],[D?e-t/2:w?e+t*4:e-t*4,n-t],...[[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]]];case`left`:{let r=[e+t+1,O?n+t/2:T?n+t*4:n-t*4],i=[e+t+1,O?n-t/2:T?n+t*4:n-t*4];return[...[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom]],r,i]}case`right`:return[[e-t,O?n+t/2:T?n+t*4:n-t*4],[e-t,O?n-t/2:T?n+t*4:n-t*4],...[[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]]];default:return[]}}if(!uC([m,h],N)){if(a&&!E)return p();if(!v&&r){let e=l(f.clientX,f.clientY);if(e!==null&&e<.1)return p()}uC([m,h],P([e,n]))?!a&&r&&i.start(40,p):p()}};return u.__options={blockPointerEvents:n},u}var pC={...US,disabled:CS(e=>e.disabled),instantType:CS(e=>e.instantType),isInstantPhase:CS(e=>e.isInstantPhase),trackCursorAxis:CS(e=>e.trackCursorAxis),disableHoverablePopup:CS(e=>e.disableHoverablePopup),lastOpenChangeReason:CS(e=>e.openChangeReason),closeDelay:CS(e=>e.closeDelay)},mC=class e extends AS{constructor(e){super({...hC(),...e},{popupRef:B.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new BS},pC)}setOpen=(e,t)=>{let n=t.reason,r=n===vy,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0);let o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),this.update(r)};r?bi.flushSync(o):o()};static useStore(t,n){let r=Og(()=>t??new e(n)).current,i=KS({popupStore:r,onOpenChange:r.setOpen});return r.state.floatingRootContext=i,r}};function hC(){return{...HS(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeDelay:0}}function gC(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=mC.useStore(l?.store,{open:r??n,activeTriggerId:u===void 0?d:u});p.useControlledProp(`open`,r,n),p.useControlledProp(`activeTriggerId`,u,d),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=p.useState(`activeTriggerId`),g=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i});let _=!t&&m;Cg(()=>{m&&t&&p.setOpen(!1,Ey(wy))},[m,t,p]),p.useSyncedValue(`disabled`,t),RS(p);let{forceUnmount:v,transitionStatus:y}=zS(_,p),b=p.useState(`isInstantPhase`),x=p.useState(`instantType`),S=p.useState(`lastOpenChangeReason`),C=B.useRef(null);Cg(()=>{y===`ending`&&S===`none`||y!==`ending`&&b?(x!==`delay`&&(C.current=x),p.set(`instantType`,`delay`)):C.current!==null&&(p.set(`instantType`,C.current),C.current=null)},[y,b,S,x,p]),Cg(()=>{_&&(h??p.set(`payload`,void 0))},[p,h,_]);let w=B.useCallback(()=>{p.setOpen(!1,_C(p,Ty))},[p]);B.useImperativeHandle(o,()=>({unmount:v,close:w}),[v,w]);let T=p.useState(`floatingRootContext`),{getReferenceProps:E,getFloatingProps:D,getTriggerProps:O}=aC([JS(T,{enabled:!t}),tS(T,{enabled:!t,referencePress:!0}),Ub(T,{enabled:!t&&a!==`none`,axis:a===`none`?void 0:a})]),k=B.useMemo(()=>E(),[E]),A=B.useMemo(()=>O(),[O]),j=B.useMemo(()=>D(),[D]);return p.useSyncedValues({floatingRootContext:T,activeTriggerProps:k,inactiveTriggerProps:A,popupProps:j}),(0,V.jsx)(Tg.Provider,{value:p,children:typeof f==`function`?f({payload:g}):f})}function _C(e,t){let n=Ey(t);return n.preventUnmountOnClose=()=>{e.set(`preventUnmountingOnClose`,!0)},n}var vC=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),yC={[vC.startingStyle]:``},bC={[vC.endingStyle]:``},xC={transitionStatus(e){return e===`starting`?yC:e===`ending`?bC:null}},SC=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=vC.startingStyle]=`startingStyle`,e[e.endingStyle=vC.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e}({}),CC=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),wC={[CC.popupOpen]:``};CC.popupOpen,CC.pressed;var TC={[SC.open]:``},EC={[SC.closed]:``},DC={[SC.anchorHidden]:``},OC={open(e){return e?wC:null}},kC={open(e){return e?TC:EC},anchorHidden(e){return e?DC:null}};function AC(e){return oy(e,`base-ui`)}var jC=B.createContext(void 0);function MC(){return B.useContext(jC)}var NC=B.forwardRef(function(e,t){let{className:n,render:r,handle:i,payload:a,disabled:o,delay:s,closeDelay:c,id:l,...u}=e,d=Eg(!0),f=i?.store??d;if(!f)throw Error(wg(82));let p=AC(l),m=f.useState(`isTriggerActive`,p),h=f.useState(`floatingRootContext`),g=f.useState(`isOpenedByTrigger`,p),_=B.useRef(null),v=s??600,y=c??0,{registerTrigger:b,isMountedByThisTrigger:x}=LS(p,_,f,{payload:a,closeDelay:y}),S=MC(),{delayRef:C,isInstantPhase:w,hasProvider:T}=jy(h,{open:g});f.useSyncedValue(`isInstantPhase`,w);let E=f.useState(`disabled`),D=o??E,O=f.useState(`trackCursorAxis`),k=f.useState(`disableHoverablePopup`),A=iC(h,{enabled:!D,mouseOnly:!0,move:!1,handleClose:!k&&O!==`both`?fC():null,restMs(){let e=S?.delay,t=typeof C.current==`object`?C.current.open:void 0,n=v;return T&&(n=t===0?0:s??e??v),n},delay(){let e=typeof C.current==`object`?C.current.close:void 0,t=y;return c==null&&T&&(t=e),{close:t}},triggerElementRef:_,isActiveTrigger:m}),j=B.useMemo(()=>({open:g}),[g]),M=f.useState(`triggerProps`,x);return xb(`button`,e,{state:j,ref:[t,b,_],props:[A,M,{id:p},u],stateAttributesMapping:OC})}),PC=B.createContext(void 0);function FC(){let e=B.useContext(PC);if(e===void 0)throw Error(wg(70));return e}var IC=B.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,...o}=e,{portalNode:s,portalSubtree:c}=Ob({container:r,ref:t,componentProps:e,elementProps:o});return!c&&!s?null:(0,V.jsxs)(B.Fragment,{children:[c,s&&bi.createPortal(n,s)]})}),LC=B.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Eg().useState(`mounted`)||n?(0,V.jsx)(PC.Provider,{value:n,children:(0,V.jsx)(IC,{ref:t,...r})}):null}),RC=B.createContext(void 0);function zC(){let e=B.useContext(RC);if(e===void 0)throw Error(wg(71));return e}var BC=B.createContext(void 0);function VC(){return B.useContext(BC)?.direction??`ltr`}var HC=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=$_(e,t)||{};if(l==null)return{};let f=_v(u),p={x:n,y:r},m=av(i),h=rv(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=Q_(k,j,A),N=!c.arrow&&tv(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),UC=(e,t)=>({...HC(e),options:[e,t]}),WC={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await Qx().fn(e)).data?.referenceHidden||a}}}},GC={sideX:`left`,sideY:`top`},KC={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=Ig(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:GC};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=Uy(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=ev(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:GC.sideX,g=f===`top`?`bottom`:GC.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function qC(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function JC(e,t,n){let{rects:r,placement:i}=e;return{side:qC(t,ev(i),n),align:tv(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function YC(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:m,collisionAvoidance:h,shiftCrossAxis:g=!1,nodeId:_,adaptiveOrigin:v,lazyFlip:y=!1,externalTree:b}=e,[x,S]=B.useState(null);!m&&x!==null&&S(null);let C=h.side||`flip`,w=h.align||`flip`,T=h.fallbackAxisSide||`end`,E=typeof t==`function`?t:void 0,D=l_(E),O=E?D:t,k=a_(t),A=VC()===`rtl`,j=x||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":A?`left`:`right`,"inline-start":A?`right`:`left`}[r],M=a===`center`?j:`${j}-${a}`,N=c,P=+(r===`bottom`),ee=+(r===`top`),F=+(r===`right`),te=+(r===`left`);typeof N==`number`?N={top:N+P,right:N+te,bottom:N+ee,left:N+F}:N&&={top:(N.top||0)+P,right:(N.right||0)+te,bottom:(N.bottom||0)+ee,left:(N.left||0)+F};let ne={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:N},re=B.useRef(null),I=a_(i),L=a_(o),ie=[qx(e=>{let t=JC(e,r,A),n=typeof I.current==`function`?I.current(t):I.current,i=typeof L.current==`function`?L.current(t):L.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,A,r])],ae=w===`none`&&C!==`shift`,R=!ae&&(l||g||C===`shift`),z=C===`none`?null:Xx({...ne,padding:{top:N.top+1,right:N.right+1,bottom:N.bottom+1,left:N.left+1},mainAxis:!g&&C===`flip`,crossAxis:w===`flip`?`alignment`:!1,fallbackAxisSideDirection:T}),oe=ae?null:Jx(e=>{let t=Uy(e.elements.floating).documentElement;return{...ne,rootBoundary:g?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:w!==`none`,crossAxis:R,limiter:l||g?void 0:Yx(e=>{if(!re.current)return{};let{width:t,height:n}=re.current.getBoundingClientRect(),r=iv(ev(e.placement)),i=r===`y`?t:n,a=r===`y`?N.left+N.right:N.top+N.bottom;return{offset:i/2+a/2}})}},[ne,l,g,N,w]);C===`shift`||w===`shift`||a===`center`?ie.push(oe,z):ie.push(z,oe),ie.push(Zx({...ne,apply({elements:{floating:e},rects:{reference:t},availableWidth:n,availableHeight:r}){Object.entries({"--available-width":`${n}px`,"--available-height":`${r}px`,"--anchor-width":`${t.width}px`,"--anchor-height":`${t.height}px`}).forEach(([t,n])=>{e.style.setProperty(t,n)})}}),UC(()=>({element:re.current||document.createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=ev(a),l=iv(c),u=re.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(JC(e,r,A)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,R&&l===`y`&&b?S:x),{}}},WC,v),Cg(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,p]);let se=B.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:ce,elements:le,x:ue,y:de,middlewareData:fe,update:pe,placement:me,context:he,isPositioned:ge,floatingStyles:_e}=GS({rootContext:p,placement:M,middleware:ie,strategy:n,whileElementsMounted:f?void 0:(...e)=>Nx(...e,se),nodeId:_,externalTree:b}),{sideX:ve,sideY:ye}=fe.adaptiveOrigin||GC,be=ge?n:`fixed`,xe=B.useMemo(()=>v?{position:be,[ve]:ue,[ye]:de}:{position:be,..._e},[v,be,ve,ue,ye,de,_e]),Se=B.useRef(null);Cg(()=>{if(!m)return;let e=k.current,t=typeof e==`function`?e():e,n=(XC(t)?t.current:t)||null;n!==Se.current&&(ce.setPositionReference(n),Se.current=n)},[m,ce,O,k]),B.useEffect(()=>{if(!m)return;let e=k.current;typeof e!=`function`&&XC(e)&&e.current!==Se.current&&(ce.setPositionReference(e.current),Se.current=e.current)},[m,ce,O,k]),B.useEffect(()=>{if(f&&m&&le.domReference&&le.floating)return Nx(le.domReference,le.floating,pe,se)},[f,m,le,pe,se]);let Ce=ev(me),we=qC(r,Ce,A),Te=tv(me)||`center`,Ee=!!fe.hide?.referenceHidden;Cg(()=>{y&&m&&ge&&S(Ce)},[y,m,ge,Ce]);let De=B.useMemo(()=>({position:`absolute`,top:fe.arrow?.y,left:fe.arrow?.x}),[fe.arrow]),Oe=fe.arrow?.centerOffset!==0;return B.useMemo(()=>({positionerStyles:xe,arrowStyles:De,arrowRef:re,arrowUncentered:Oe,side:we,align:Te,physicalSide:Ce,anchorHidden:Ee,refs:ce,context:he,isPositioned:ge,update:pe}),[xe,De,re,Oe,we,Te,Ce,Ee,ce,he,ge,pe])}function XC(e){return e!=null&&`current`in e}function ZC(e){return e===`starting`?my:py}var QC=B.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=hy,...g}=e,_=Eg(),v=FC(),y=_.useState(`open`),b=_.useState(`mounted`),x=_.useState(`trackCursorAxis`),S=_.useState(`disableHoverablePopup`),C=_.useState(`floatingRootContext`),w=_.useState(`instantType`),T=_.useState(`transitionStatus`),E=YC({anchor:i,positionMethod:a,floatingRootContext:C,mounted:b,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:v,collisionAvoidance:h,adaptiveOrigin:KC}),D=B.useMemo(()=>{let e={};return(!y||x===`both`||S)&&(e.pointerEvents=`none`),{role:`presentation`,hidden:!b,style:{...E.positionerStyles,...e}}},[y,x,S,b,E.positionerStyles]),O=B.useMemo(()=>({open:y,side:E.side,align:E.align,anchorHidden:E.anchorHidden,instant:x===`none`?w:`tracking-cursor`}),[y,E.side,E.align,E.anchorHidden,x,w]),k=B.useMemo(()=>({...O,arrowRef:E.arrowRef,arrowStyles:E.arrowStyles,arrowUncentered:E.arrowUncentered}),[O,E.arrowRef,E.arrowStyles,E.arrowUncentered]),A=xb(`div`,e,{state:O,props:[D,ZC(T),g],ref:[t,_.useStateSetter(`positionerElement`)],stateAttributesMapping:kC});return(0,V.jsx)(RC.Provider,{value:k,children:A})});function $C(e){let t=$g(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Bg(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(J_(n)!==a||J_(r)!==o)&&(n=a,r=o),{width:n,height:r}}var ew=typeof ResizeObserver<`u`,tw=()=>!0;function nw(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,enabled:a=tw,onMeasureLayout:o,onMeasureLayoutComplete:s,side:c,direction:l}=e,u=B.useRef(!0),d=PS(t,!0,!1),f=Hy(),p=B.useRef(null),m=l_(o),h=l_(s),g=B.useMemo(()=>{let e=c===`top`,t=c===`left`;return l===`rtl`?(e||=c===`inline-end`,t||=c===`inline-end`):(e||=c===`inline-start`,t||=c===`inline-start`),e?{position:`absolute`,[c===`top`?`bottom`:`top`]:`0`,[t?`right`:`left`]:`0`}:py},[c,l]);Cg(()=>{if(!i||!a()||!ew){u.current=!0,p.current=null;return}if(!t||!n)return;Object.entries(g).forEach(([e,n])=>{t.style.setProperty(e,n)});let e=new ResizeObserver(e=>{let t=e[0];t&&(p.current===null?p.current={width:Math.ceil(t.borderBoxSize[0].inlineSize),height:Math.ceil(t.borderBoxSize[0].blockSize)}:(p.current.width=Math.ceil(t.borderBoxSize[0].inlineSize),p.current.height=Math.ceil(t.borderBoxSize[0].blockSize)))});e.observe(t),t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`);let r=rw(t,`position`,`static`),o=rw(t,`transform`,`none`),s=rw(t,`scale`,`1`),c=rw(n,`--available-width`,`max-content`),l=rw(n,`--available-height`,`max-content`);if(m?.(),u.current||p.current===null){n.style.setProperty(`--positioner-width`,`max-content`),n.style.setProperty(`--positioner-height`,`max-content`);let i=$C(t);return n.style.setProperty(`--positioner-width`,`${i.width}px`),n.style.setProperty(`--positioner-height`,`${i.height}px`),r(),o(),s(),c(),l(),h?.(null,i),u.current=!1,()=>{e.disconnect()}}t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`),n.style.setProperty(`--positioner-width`,`max-content`),n.style.setProperty(`--positioner-height`,`max-content`);let _=$C(t);t.style.setProperty(`--popup-width`,`${p.current.width}px`),t.style.setProperty(`--popup-height`,`${p.current.height}px`),r(),o(),c(),l(),h?.(p.current,_),n.style.setProperty(`--positioner-width`,`${_.width}px`),n.style.setProperty(`--positioner-height`,`${_.height}px`);let v=new AbortController;return f.request(()=>{t.style.setProperty(`--popup-width`,`${_.width}px`),t.style.setProperty(`--popup-height`,`${_.height}px`),d(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},v.signal)}),()=>{e.disconnect(),v.abort(),f.cancel()}},[r,t,n,d,f,a,i,m,h,g])}function rw(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}var iw={...kC,...xC},aw=B.forwardRef(function(e,t){let{className:n,render:r,...i}=e,a=Eg(),{side:o,align:s}=zC(),c=a.useState(`open`),l=a.useState(`mounted`),u=a.useState(`instantType`),d=a.useState(`transitionStatus`),f=a.useState(`popupProps`),p=a.useState(`payload`),m=a.useState(`popupElement`),h=a.useState(`positionerElement`),g=a.useState(`floatingRootContext`),_=VC();FS({open:c,ref:a.context.popupRef,onComplete(){c&&a.context.onOpenChangeComplete?.(!0)}});function v(){g.context.events.emit(`measure-layout`)}function y(e,t){g.context.events.emit(`measure-layout-complete`,{previousDimensions:e,nextDimensions:t})}nw({popupElement:m,positionerElement:h,mounted:l,content:p,enabled:()=>a.context.triggerElements.size>1,onMeasureLayout:v,onMeasureLayoutComplete:y,side:o,direction:_});let b=a.useState(`disabled`),x=a.useState(`closeDelay`);return eC(g,{enabled:!b,closeDelay:x}),xb(`div`,e,{state:B.useMemo(()=>({open:c,side:o,align:s,instant:u,transitionStatus:d}),[c,o,s,u,d]),ref:[t,a.context.popupRef,a.useStateSetter(`popupElement`)],props:[f,ZC(d),i],stateAttributesMapping:iw})}),ow=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=B.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=B.useMemo(()=>({open:t,close:n}),[t,n]);return(0,V.jsx)(jC.Provider,{value:i,children:(0,V.jsx)(Ay,{delay:a,timeoutMs:r,children:e.children})})};function sw(e){return rb(19)?e:e?`true`:void 0}var cw=ow,lw=gC,uw=NC;function dw({className:e,children:t,...n}){return(0,V.jsx)(LC,{children:(0,V.jsx)(QC,{sideOffset:6,children:(0,V.jsx)(aw,{className:_g(`z-50 overflow-hidden rounded-sm border border-hairline bg-popover px-3 py-1.5 text-xs font-normal text-popover-foreground shadow-popover`,e),...n,children:t})})})}var fw=[`system`,`light`,`dark`],pw={dark:`Dark`,light:`Light`,system:`System`},mw={dark:Fm,light:Bm,system:Pm};function hw(e){return fw[(fw.indexOf(e)+1)%fw.length]??`system`}function gw({className:e}){let t=Wa(e=>e.theme),n=Wa(e=>e.setTheme),r=mw[t],i=pw[t];return(0,V.jsxs)(lw,{children:[(0,V.jsx)(uw,{render:(0,V.jsx)(Sg,{"aria-label":`Theme: ${i}`,size:`icon`,variant:`ghost`,className:e,onClick:()=>n(hw(t)),children:(0,V.jsx)(r,{className:`size-4`})})}),(0,V.jsxs)(dw,{children:[`Theme:`,` `,i]})]})}function _w({className:e,orientation:t=`horizontal`,...n}){return(0,V.jsx)(`div`,{role:`separator`,"aria-orientation":t,className:_g(`shrink-0 bg-border`,t===`horizontal`?`h-px w-full`:`h-full w-px`,e),...n})}var vw=[{to:`/workers`,label:`Workers`,icon:hm,exact:!1},{to:`/enroll`,label:`Enrollments`,icon:jm,exact:!1},{to:`/audit`,label:`Audit`,icon:km,exact:!1},{to:`/presence`,label:`Presence`,icon:pm,exact:!1}];function yw(){return(0,V.jsx)(cw,{delay:300,children:(0,V.jsxs)(`div`,{"data-testid":`fleet-shell`,className:`flex h-dvh w-full flex-col overflow-hidden bg-background text-foreground`,children:[(0,V.jsxs)(`header`,{"data-testid":`fleet-shell-header`,className:`grid shrink-0 gap-3 border-b border-hairline bg-background px-4 py-3 md:grid-cols-[minmax(12rem,1fr)_auto_minmax(12rem,1fr)] md:items-center md:px-8`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,V.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-sm border border-hairline bg-primary text-primary-foreground`,children:(0,V.jsx)(Om,{className:`size-4`})}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`p`,{className:`font-display text-lg leading-none text-foreground`,children:`AIWorker`}),(0,V.jsx)(`p`,{className:`text-micro text-muted-foreground`,children:`Fleet`})]})]}),(0,V.jsx)(`nav`,{"data-testid":`fleet-shell-nav`,className:`grid min-w-0 grid-cols-2 gap-1 sm:grid-cols-4 md:flex md:items-center md:justify-center`,children:vw.map(e=>(0,V.jsxs)(Mi,{to:e.to,className:_g(`flex min-w-0 items-center justify-center gap-2 rounded-xl border border-transparent px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:border-hairline hover:bg-soft-stone hover:text-foreground`),activeProps:{className:`!border-primary !bg-primary !text-primary-foreground hover:!border-primary hover:!bg-primary hover:!text-primary-foreground`},activeOptions:{exact:e.exact},children:[(0,V.jsx)(e.icon,{className:`size-4`}),(0,V.jsx)(`span`,{className:`truncate`,children:e.label})]},e.to))}),(0,V.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,V.jsx)(gw,{})})]}),(0,V.jsx)(_w,{}),(0,V.jsx)(`main`,{className:`min-h-0 min-w-0 flex-1 overflow-auto px-4 py-6 sm:px-6 lg:px-8`,children:(0,V.jsx)(`div`,{className:`mx-auto w-full max-w-7xl`,children:(0,V.jsx)(Ji,{})})})]})})}var bw=Li({component:yw}),xw={WORKER_ONLINE:`worker.online`,WORKER_OFFLINE:`worker.offline`,CHAT_MESSAGE:`chat.message`,AGENT_THINKING:`agent.thinking`,AGENT_TOOL_CALL:`agent.tool_call`,AGENT_DONE:`agent.done`,CONFIG_CHANGED:`config.changed`,LOGS_LINE:`logs.line`,APPROVAL_REQUESTED:`approval.requested`,ENROLLMENT_OTP:`enrollment.otp`,ENROLLMENT_APPROVED:`enrollment.approved`,ENROLLMENT_PENDING:`enrollment.pending`},Sw=X({workerId:J().min(1)});Sw.extend({displayName:J().optional(),deviceId:J().min(1),connectedAt:Ps().int()}),Sw.extend({deviceId:J().min(1),reason:Vs([`disconnected`,`expired`,`kicked`]).optional(),disconnectedAt:Ps().int()}),Sw.extend({conversationId:J().min(1),role:Vs([`user`,`assistant`,`system`]),content:J(),createdAt:Ps().int()}),Sw.extend({conversationId:J().min(1),taskId:J().min(1).optional(),chunk:J().optional()}),Sw.extend({conversationId:J().min(1),taskId:J().min(1).optional(),toolCallId:J().min(1),toolName:J().min(1),status:Vs([`pending`,`running`,`success`,`error`]),args:Is().optional(),result:Is().optional()}),Sw.extend({conversationId:J().min(1),taskId:J().min(1).optional(),finishReason:Vs([`stop`,`length`,`tool_use`,`error`,`cancelled`]),usage:X({inputTokens:Ps().int().nonnegative().optional(),outputTokens:Ps().int().nonnegative().optional(),totalTokens:Ps().int().nonnegative().optional()}).optional()}),Sw.extend({version:Ps().int().nonnegative(),changedAt:Ps().int()}),Sw.extend({stream:Vs([`stdout`,`stderr`]),line:J(),ts:Ps().int()}),Sw.extend({taskId:J().min(1),toolCallId:J().min(1),toolName:J().min(1),params:zs(Is()),expiresAt:Ps().int()}),Sw.extend({otp:J().min(1),expiresAt:Ps().int()}),Sw.extend({deviceToken:J().min(1)}),Sw.extend({otp:J().min(1),displayName:J().min(1).optional(),submittedAt:Ps().int(),expiresAt:Ps().int(),reason:Vs([`submitted`,`approved`,`rejected`,`expired`,`abandoned`])}),xw.WORKER_ONLINE,xw.WORKER_OFFLINE,xw.CHAT_MESSAGE,xw.AGENT_THINKING,xw.AGENT_TOOL_CALL,xw.AGENT_DONE,xw.CONFIG_CHANGED,xw.LOGS_LINE,xw.APPROVAL_REQUESTED,xw.ENROLLMENT_OTP,xw.ENROLLMENT_APPROVED,xw.ENROLLMENT_PENDING;var Cw={OPERATOR:`operator`,NODE:`node`},ww=Ls([Bs(Cw.OPERATOR),Bs(Cw.NODE)]),Tw=X({type:Bs(`connect`),role:ww,agentId:J().min(1),deviceId:J().min(1),auth:X({token:J()}),meta:zs(J()).optional(),enroll:X({apiToken:J().regex(Jf,`apiToken must match wtk_<base64url>`),displayName:J().min(1).max(80).optional(),mode:Vs([`join-token`,`otp`]).optional(),joinToken:J().min(1).optional()}).optional().refine(e=>e===void 0||((e.mode??`join-token`)===`otp`?e.joinToken===void 0:!!e.joinToken),{message:`mode=join-token requires joinToken; mode=otp must omit joinToken`})}),Ew=X({type:Bs(`request`),id:J().min(1),method:J().min(1),params:Is().optional()}),Dw=X({code:J().min(1),message:J(),details:Is().optional()}),Ow=Ls([Tw,Ew,Rs(`ok`,[X({type:Bs(`response`),id:J().min(1),ok:Bs(!0),result:Is()}),X({type:Bs(`response`),id:J().min(1),ok:Bs(!1),error:Dw})]),X({type:Bs(`event`),name:J().min(1),payload:Is(),ts:Ps().int()})]);function kw(e){let t;try{t=JSON.parse(e)}catch(e){return{ok:!1,error:`invalid_json:${e instanceof Error?e.message:String(e)}`}}let n=Ow.safeParse(t);return n.success?{ok:!0,frame:n.data}:{ok:!1,error:`schema:${n.error.message}`}}function Aw(e){return JSON.stringify(e)}var jw=X({workerId:J().min(1),displayName:J().optional(),online:Fs(),deviceId:J().min(1).optional(),baseUrl:J().optional(),lastSeenAt:Ps().int().nullable().optional()});X({}).optional().default({}),X({workers:Y(jw)}),X({workerId:J().min(1)}),Is(),X({workerBaseUrl:J().min(1),bootstrapToken:J().min(1),displayName:J().optional()}),X({workerId:J().min(1),deviceToken:J().min(1)}),X({displayName:J().optional(),image:J().optional(),env:zs(J()).optional()}),X({workerId:J().min(1)}),X({stopped:Fs()}),X({workerId:J().min(1)}),X({removed:Fs()});var Mw=X({otp:J().min(1),workerId:J().min(1),displayName:J().min(1).optional(),submittedAt:Ps().int(),expiresAt:Ps().int()});X({}).optional().default({}),X({pending:Y(Mw)}),X({otp:J().min(1)}),X({workerId:J().min(1),deviceToken:J().min(1)}),X({otp:J().min(1)}),X({rejected:Fs()});var Nw=X({id:Ps().int().positive(),at:J().min(1),actor:J().min(1),action:J().min(1),workerId:J().min(1).nullable(),detail:zs(Is()).nullable()});X({limit:Ps().int().positive().max(200).optional(),before:Ps().int().positive().optional(),action:J().min(1).optional(),workerId:J().min(1).optional()}).optional().default({}),X({events:Y(Nw),hasMore:Fs()}),X({workerId:J().min(1),conversationId:J().min(1).optional(),content:J().min(1),metadata:zs(Is()).optional()}),X({conversationId:J().min(1),taskId:J().min(1).optional(),accepted:Fs()}),X({workerId:J().min(1)}),X({version:Ps().int().nonnegative(),config:Is()}),X({workerId:J().min(1),ifMatch:Ps().int().nonnegative(),config:Is()}),X({version:Ps().int().nonnegative(),appliedAt:Ps().int()}),X({workerId:J().min(1)}),X({deviceToken:J().min(1)}),X({workerId:J().min(1),follow:Fs().optional(),lines:Ps().int().positive().max(1e3).optional()}),X({subscribed:Fs()});var Pw=Vs([`allow`,`deny`]),Fw=X({workerId:J().min(1),taskId:J().min(1),toolCallId:J().min(1),toolName:J().min(1),params:zs(Is()),expiresAt:Ps().int()});X({workerId:J().min(1)}),X({approvals:Y(Fw)}),X({workerId:J().min(1),taskId:J().min(1),toolCallId:J().min(1),decision:Pw}),X({granted:Fs()});var Iw=Vs([`web`,`line`,`telegram`,`lark`,`whatsapp`]),Lw=J().regex(/^[\w.-]{1,128}$/);X({workerId:J().min(1)}),X({keys:Y(J())}),X({workerId:J().min(1),key:Lw,value:J().min(1)}),X({ok:Bs(!0)}),X({workerId:J().min(1),key:Lw}),X({ok:Bs(!0)}),X({workerId:J().min(1),refresh:Fs().optional()}),X({engines:Y(Is())}),X({workerId:J().min(1)}),Is();var Rw=Vs([`pending`,`approved`,`rejected`,`applied`,`failed`]),zw=Vs([`active`,`archived`,`removed`]),Bw=Vs([`public`,`internal`,`confidential`,`secret`]),Vw=Vs([`block`,`redact`,`raw`]);X({workerId:J().min(1)}),Is(),X({workerId:J().min(1),status:Rw.optional(),kind:J().min(1).optional(),scopeId:J().min(1).optional(),soulId:J().min(1).optional(),limit:Ps().int().min(1).max(500).optional(),showSensitive:Fs().optional()}),Is(),X({workerId:J().min(1),id:J().min(1),showSensitive:Fs().optional()}),Is(),X({workerId:J().min(1),id:J().min(1),decidedBy:J().min(1).max(200),reason:J().min(1).max(2e3).optional()}),Is(),Is(),X({workerId:J().min(1),id:J().min(1),decidedBy:J().min(1).max(200),commit:Fs().optional(),allowSecretBody:Vw.optional()}),Is(),X({workerId:J().min(1),scopeId:J().min(1).optional(),type:J().min(1).optional(),status:zw.optional(),minSensitivity:Bw.optional(),limit:Ps().int().min(1).max(500).optional(),showSensitive:Fs().optional()}),Is(),X({workerId:J().min(1),id:J().min(1),showSensitive:Fs().optional()}),Is(),X({workerId:J().min(1),probe:Fs().optional()}),Is(),X({workerId:J().min(1),channel:Iw,body:X({chatId:J().optional(),text:J().optional()}).optional()}),Is(),X({workerId:J().min(1)}),X({tasks:Y(Is())}),X({workerId:J().min(1),prompt:J().trim().min(1).max(8e3)}),X({task:Is()}),X({workerId:J().min(1)}),X({conversations:Y(Is())}),X({workerId:J().min(1),conversationId:J().min(1)}),X({messages:Y(Is())}),X({}).optional().default({}),X({now:Ps().int(),online:Y(jw)});var Hw=Iw,Uw=X({id:J().min(1),expression:J().min(1),prompt:J().min(1),channel:Hw,chatId:J().min(1),accountId:J().min(1),enabled:Fs(),lastRunAt:J().nullable(),nextRunAt:J().nullable(),createdAt:J(),updatedAt:J()}),Ww=X({expression:J().min(1),prompt:J().min(1),channel:Hw,chatId:J().min(1),accountId:J().min(1).optional(),enabled:Fs().optional()}),Gw=X({expression:J().min(1).optional(),prompt:J().min(1).optional(),channel:Hw.optional(),chatId:J().min(1).optional(),accountId:J().min(1).optional(),enabled:Fs().optional()}).refine(e=>Object.keys(e).length>0,{message:`至少提供一个待更新字段`});X({workerId:J().min(1)}),X({jobs:Y(Uw)}),X({workerId:J().min(1),job:Ww}),X({job:Uw}),X({workerId:J().min(1),jobId:J().min(1)}),X({removed:Fs()}),X({workerId:J().min(1),jobId:J().min(1),patch:Gw}),X({job:Uw});var Kw=class extends Error{code;details;constructor(e,t,n){super(t),this.name=`GatewayApiError`,this.code=e,this.details=n}},qw=class extends Error{constructor(e){super(e),this.name=`GatewayConnectionError`}};function Jw(){return typeof window>`u`?`ws://127.0.0.1:9218/ws`:`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}/ws`}function Yw(){return`web-${crypto.randomUUID()}`}var Xw=class{url;token;requestTimeoutMs;reconnectBaseMs;agentId;deviceId;ws=null;handshakeDone=!1;pending=new Map;handlers=new Map;reconnectAttempt=0;reconnectTimer=null;readyPromise=null;readyResolve=null;constructor(e={}){this.url=e.url??Jw(),this.token=e.token??``,this.requestTimeoutMs=e.requestTimeoutMs??3e4,this.reconnectBaseMs=e.reconnectBaseMs??500,this.agentId=Yw(),this.deviceId=`browser-${crypto.randomUUID()}`,this.connect()}connect(){this.reconnectTimer&&=(clearTimeout(this.reconnectTimer),null),this.handshakeDone=!1,this.readyPromise=new Promise(e=>{this.readyResolve=e});try{this.ws=new WebSocket(this.url)}catch(e){this.scheduleReconnect(),console.warn(`[gateway-client] new WebSocket failed`,e);return}this.ws.onopen=()=>{let e={type:`connect`,role:`operator`,agentId:this.agentId,deviceId:this.deviceId,auth:{token:this.token}};try{this.ws.send(Aw(e)),this.handshakeDone=!0,this.reconnectAttempt=0,this.readyResolve?.()}catch(e){console.warn(`[gateway-client] 发送 connect 帧失败`,e)}},this.ws.onmessage=e=>{let t=typeof e.data==`string`?e.data:``;if(!t)return;let n=kw(t);if(!n.ok){console.warn(`[gateway-client] 解析 frame 失败`,n.error);return}this.handleFrame(n.frame)},this.ws.onerror=()=>{},this.ws.onclose=()=>{this.handshakeDone=!1,this.rejectAllPending(new qw(`gateway 连接已断开`)),this.scheduleReconnect()}}scheduleReconnect(){if(this.reconnectTimer)return;this.reconnectAttempt+=1;let e=Math.min(3e4,this.reconnectBaseMs*2**Math.min(6,this.reconnectAttempt));this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},e)}rejectAllPending(e){for(let[,t]of this.pending)t.timer&&clearTimeout(t.timer),t.reject(e);this.pending.clear()}handleFrame(e){if(e.type===`response`){let t=this.pending.get(e.id);if(!t)return;this.pending.delete(e.id),t.timer&&clearTimeout(t.timer),e.ok?t.resolve(e.result):t.reject(new Kw(e.error.code,e.error.message,e.error.details));return}if(e.type===`event`){let t=this.handlers.get(e.name);if(!t)return;for(let n of t)try{n(e.payload)}catch(t){console.warn(`[gateway-client] event handler for ${e.name} threw`,t)}}}async ensureReady(){this.handshakeDone||(this.readyPromise||=Promise.resolve(),await Promise.race([this.readyPromise,new Promise((e,t)=>{setTimeout(()=>t(new qw(`gateway 连接就绪超时`)),this.requestTimeoutMs)})]))}async request(e,t={}){await this.ensureReady();let n=crypto.randomUUID(),r=Aw({type:`request`,id:n,method:e,params:t});return await new Promise((t,i)=>{let a=setTimeout(()=>{this.pending.delete(n),i(new Kw(`timeout`,`${e} 等待 gateway 响应超时 (${this.requestTimeoutMs}ms)`))},this.requestTimeoutMs);this.pending.set(n,{resolve:e=>{t(e)},reject:i,timer:a});try{this.ws.send(r)}catch(e){this.pending.delete(n),clearTimeout(a),i(new qw(`gateway 连接不可用: ${e instanceof Error?e.message:String(e)}`))}})}onEvent(e,t){let n=this.handlers.get(e);return n||(n=new Set,this.handlers.set(e,n)),n.add(t),()=>{let n=this.handlers.get(e);n&&(n.delete(t),n.size===0&&this.handlers.delete(e))}}async close(){this.reconnectTimer&&=(clearTimeout(this.reconnectTimer),null);try{this.ws?.close(1e3,`client_close`)}catch{}this.rejectAllPending(new qw(`gateway client closed`))}},Zw=null;function Qw(){return Zw||=new Xw,Zw}var $w={not_found:`not-found`,already_registered:`already-registered`,auth_failed:`auth-failed`,worker_unreachable:`worker-unreachable`,invalid_worker_info:`invalid-worker-info`,invalid_params:`invalid-body`,quota_exceeded:`quota-exceeded`,launch_timeout:`launch-timeout`,launch_failed:`launch-failed`,feature_disabled:`feature-disabled`,node_offline:`worker-unreachable`,master_key_missing:`launch-failed`,forward_failed:`worker-unreachable`,node_gone:`worker-unreachable`,forward_timeout:`worker-unreachable`},eT=class extends Error{code;details;workerId;quotaLimit;quotaCurrent;constructor(e,t,n){super(t),this.name=`WorkerApiError`,this.code=e,this.details=n;let r=n&&typeof n==`object`?n:{};this.workerId=r.workerId,this.quotaLimit=r.limit,this.quotaCurrent=r.current}};function tT(e){return e instanceof Kw?new eT($w[e.code]??`unknown`,e.message,e.details):e instanceof eT?e:new eT(`unknown`,e instanceof Error?e.message:String(e))}async function nT(e,t){try{return await Qw().request(e,t)}catch(e){throw tT(e)}}function rT(e){return{id:e.workerId,baseUrl:e.baseUrl??``,displayName:e.displayName??e.workerId,addedAt:``,addedBy:`manual`,lastSeenAt:e.lastSeenAt?new Date(e.lastSeenAt).toISOString():void 0,lastSeenState:e.online?`online`:`offline`,lastConfigVersion:void 0}}async function iT(){let{workers:e}=await nT(`workers.list`,{});return e.map(rT)}async function aT(e){let t=(await iT()).find(t=>t.id===e);if(!t)throw new eT(`not-found`,`worker ${e} 不在 fleet 中`);return t}async function oT(e){let t=await nT(`workers.pair`,{workerBaseUrl:e.baseUrl,bootstrapToken:e.bootstrapToken,displayName:e.displayName});return{worker:await aT(t.workerId).catch(()=>({id:t.workerId,baseUrl:e.baseUrl,displayName:e.displayName,addedAt:new Date().toISOString(),addedBy:`manual`,lastSeenAt:new Date().toISOString(),lastSeenState:`online`})),deviceToken:t.deviceToken}}async function sT(e){let t=await nT(`workers.launch`,{displayName:e.displayName,...e.forceId===void 0?{}:{forceId:e.forceId}});return{worker:await aT(t.workerId).catch(()=>({id:t.workerId,baseUrl:``,displayName:e.displayName,addedAt:new Date().toISOString(),addedBy:`launch-local`,lastSeenAt:new Date().toISOString(),lastSeenState:`online`})),deviceToken:t.deviceToken}}async function cT(e){await nT(`workers.remove`,{workerId:e})}async function lT(e){return await nT(`workers.stop`,{workerId:e})}async function uT(e){let t=await nT(`token.rotate`,{workerId:e});return{rotatedAt:new Date().toISOString(),deviceToken:t.deviceToken}}async function dT(){return(await nT(`enroll.list`,{})).pending}async function fT(e){return await nT(`enroll.approve`,{otp:e})}async function pT(e){return await nT(`enroll.reject`,{otp:e})}async function mT(e={}){return await nT(`audit.list`,e)}async function hT(){return await nT(`system.presence`,{})}var gT=Va(e=>({currentWorkerId:null,registered:[],setCurrentWorkerId:t=>e({currentWorkerId:t}),setRegistered:t=>e({registered:t})})),_T=[`fleet`,`workers`],vT=e=>[`fleet`,`workers`,e],yT=[`fleet`,`presence`];function bT(){let e=gT(e=>e.setRegistered),t=Qe({queryKey:_T,queryFn:iT,staleTime:1e4});return(0,B.useEffect)(()=>{t.data&&e(t.data)},[t.data,e]),t}function xT(e){return Qe({queryKey:e?vT(e):[`fleet`,`workers`,`__missing__`],queryFn:()=>aT(e),enabled:!!e,staleTime:1e4})}function ST(){let e=Le();return $e({mutationFn:oT,onSuccess:({worker:t})=>{e.invalidateQueries({queryKey:_T}),e.setQueryData(vT(t.id),t)}})}function CT(){let e=Le();return $e({mutationFn:sT,onSuccess:({worker:t})=>{e.invalidateQueries({queryKey:_T}),e.setQueryData(vT(t.id),t)}})}function wT(){let e=Le();return $e({mutationFn:cT,onSuccess:(t,n)=>{e.invalidateQueries({queryKey:_T}),e.removeQueries({queryKey:vT(n)})}})}function TT(){let e=Le();return $e({mutationFn:lT,onSuccess:()=>{e.invalidateQueries({queryKey:_T})}})}function ET(){let e=Le();return $e({mutationFn:uT,onSuccess:()=>{e.invalidateQueries({queryKey:_T})}})}function DT(){return Qe({queryKey:yT,queryFn:hT,refetchInterval:3e4,staleTime:15e3})}function OT({className:e,...t}){return(0,V.jsx)(`div`,{className:_g(`rounded-sm border border-card-border bg-card text-card-foreground shadow-card`,e),...t})}function kT({className:e,...t}){return(0,V.jsx)(`div`,{className:_g(`flex flex-col gap-2 p-6`,e),...t})}function AT({className:e,...t}){return(0,V.jsx)(`h3`,{className:_g(`text-feature font-normal leading-tight`,e),...t})}function jT({className:e,...t}){return(0,V.jsx)(`p`,{className:_g(`text-sm text-muted-foreground`,e),...t})}function MT({className:e,...t}){return(0,V.jsx)(`div`,{className:_g(`p-6 pt-0`,e),...t})}function NT({className:e,...t}){return(0,V.jsx)(`div`,{className:_g(`animate-pulse rounded-sm bg-soft-stone`,e),...t})}function PT(){let e=DT(),t=bT(),n=IT(),r=e.data?.online.length??0,i=t.data?.length??0,a=Math.max(0,i-r);return(0,V.jsxs)(`div`,{className:`app-page`,children:[(0,V.jsxs)(`div`,{className:`app-page-header`,children:[(0,V.jsx)(`h1`,{className:`app-page-title`,children:`Presence`}),(0,V.jsxs)(`p`,{className:`app-page-copy break-words`,children:[`Live snapshot driven by`,` `,(0,V.jsx)(`code`,{className:`app-code`,children:`system.presence`}),` `,`(30s) and`,` `,(0,V.jsx)(`code`,{className:`app-code`,children:`workers.list`}),` `,`(10s).`]})]}),(0,V.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,V.jsxs)(OT,{className:`border-hairline`,children:[(0,V.jsx)(kT,{children:(0,V.jsxs)(AT,{className:`flex items-center gap-2 text-sm font-normal text-muted-foreground`,children:[(0,V.jsx)(pm,{className:`size-4`}),`Online workers`]})}),(0,V.jsxs)(MT,{children:[e.isLoading?(0,V.jsx)(NT,{className:`h-8 w-16`}):(0,V.jsxs)(`div`,{className:`font-display text-card-heading font-normal`,children:[r,(0,V.jsxs)(`span`,{className:`text-sm font-normal text-muted-foreground`,children:[` `,`/`,` `,i]})]}),(0,V.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[a,` `,`offline`]})]})]}),(0,V.jsxs)(OT,{className:`border-hairline`,children:[(0,V.jsx)(kT,{children:(0,V.jsxs)(AT,{className:`flex items-center gap-2 text-sm font-normal text-muted-foreground`,children:[(0,V.jsx)(Sm,{className:`size-4`}),`Heartbeat distribution`]})}),(0,V.jsx)(MT,{children:t.isLoading?(0,V.jsx)(NT,{className:`h-16 w-full`}):(0,V.jsx)(FT,{lastSeen:(t.data??[]).map(e=>e.lastSeenAt)})})]}),(0,V.jsxs)(OT,{className:`border-hairline`,children:[(0,V.jsx)(kT,{children:(0,V.jsxs)(AT,{className:`flex items-center gap-2 text-sm font-normal text-muted-foreground`,children:[(0,V.jsx)(Um,{className:`size-4`}),`Enrollments today`]})}),(0,V.jsxs)(MT,{children:[n.isLoading?(0,V.jsx)(NT,{className:`h-8 w-16`}):(0,V.jsx)(`div`,{className:`font-display text-card-heading font-normal`,children:n.data??0}),(0,V.jsx)(`p`,{className:`mt-1 break-words text-xs text-muted-foreground`,children:`gateway.worker.paired + gateway.enrollment.approved since 00:00 local`})]})]})]})]})}function FT({lastSeen:e}){let t=Date.now(),n={recent:0,hour:0,day:0,stale:0,never:0};for(let r of e){if(!r){n.never+=1;continue}let e=Date.parse(r);if(Number.isNaN(e)){n.never+=1;continue}let i=t-e;i<=5*6e4?n.recent+=1:i<=60*6e4?n.hour+=1:i<=1440*6e4?n.day+=1:n.stale+=1}let r=[{label:`< 5 min`,count:n.recent},{label:`< 1 hour`,count:n.hour},{label:`< 1 day`,count:n.day},{label:`> 1 day`,count:n.stale},{label:`never`,count:n.never}],i=r.reduce((e,t)=>e+t.count,0);return(0,V.jsx)(`div`,{className:`space-y-1.5`,children:r.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e.label}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`font-mono`,children:e.count}),(0,V.jsx)(`div`,{className:`h-1.5 w-24 overflow-hidden rounded-full bg-soft-stone`,children:(0,V.jsx)(`div`,{className:`h-full bg-deep-green`,style:{width:i===0?`0`:`${e.count/i*100}%`}})})]})]},e.label))})}function IT(){return Qe({queryKey:[`fleet`,`presence`,`enrollments-today`],queryFn:async()=>{let e=LT(),[t,n]=await Promise.all([mT({action:`gateway.worker.paired`,limit:200}),mT({action:`gateway.enrollment.approved`,limit:200})]),r=t=>t.filter(t=>t.at>=e).length;return r(t.events)+r(n.events)},refetchInterval:6e4,staleTime:3e4})}function LT(){let e=new Date;return e.setHours(0,0,0,0),e.toISOString()}function RT(){return(0,V.jsx)(PT,{})}var zT=Ri(`/presence`)({component:RT}),BT=bg(`inline-flex items-center rounded-full border px-2.5 py-1 text-xs font-normal leading-tight transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-primary bg-primary text-primary-foreground`,secondary:`border-hairline bg-soft-stone text-secondary-foreground`,destructive:`border-destructive bg-transparent text-destructive`,outline:`border-border bg-transparent text-foreground`,success:`border-success bg-success-soft text-success`,warning:`border-warning bg-warning-soft text-warning`}},defaultVariants:{variant:`default`}});function VT({className:e,variant:t,...n}){return(0,V.jsx)(`span`,{className:_g(BT({variant:t}),e),...n})}var HT=B.createContext(void 0);function UT(e){let t=B.useContext(HT);if(e===!1&&t===void 0)throw Error(wg(27));return t}var WT={...kC,...xC},GT=B.forwardRef(function(e,t){let{render:n,className:r,forceRender:i=!1,...a}=e,{store:o}=UT(),s=o.useState(`open`),c=o.useState(`nested`),l=o.useState(`mounted`),u=o.useState(`transitionStatus`);return xb(`div`,e,{state:B.useMemo(()=>({open:s,transitionStatus:u}),[s,u]),ref:[o.context.backdropRef,t],stateAttributesMapping:WT,props:[{role:`presentation`,hidden:!l,style:{userSelect:`none`,WebkitUserSelect:`none`}},a],enabled:i||!c})}),KT=B.createContext(void 0);function qT(e=!1){let t=B.useContext(KT);if(t===void 0&&!e)throw Error(wg(16));return t}function JT(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:B.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function YT(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,a=B.useRef(null),o=qT(!0)!==void 0,s=l_(()=>{let e=a.current;return!!(e?.tagName===`A`&&e?.href)}),{props:c}=JT({focusableWhenDisabled:n,disabled:t,composite:o,tabIndex:r,isNativeButton:i}),l=B.useCallback(()=>{let e=a.current;XT(e)&&o&&t&&c.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,c.disabled,o]);return Cg(l,[l]),{getButtonProps:B.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:l,...u}=e;return ub({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(vb(e),o?.(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!i&&!s()&&!t,a=e.key===`Enter`,c=e.key===` `;r&&((c||a)&&e.preventDefault(),a&&n?.(e))},onKeyUp(e){t||(vb(e),a?.(e)),!e.baseUIHandlerPrevented&&e.target===e.currentTarget&&!i&&!t&&e.key===` `&&n?.(e)},onPointerDown(e){if(t){e.preventDefault();return}l?.(e)}},i?void 0:{role:`button`},c,u)},[t,c,i,s]),buttonRef:l_(e=>{a.current=e,l()})}}function XT(e){return Bg(e)&&e.tagName===`BUTTON`}var ZT=B.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,...o}=e,{store:s}=UT(),c=s.useState(`open`);function l(e){c&&s.setOpen(!1,Ey(xy,e.nativeEvent))}let{getButtonProps:u,buttonRef:d}=YT({disabled:i,native:a});return xb(`button`,e,{state:B.useMemo(()=>({disabled:i}),[i]),ref:[t,d],props:[{onClick:l},o,u]})}),QT=B.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=UT(),s=AC(i);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),xb(`p`,e,{ref:t,props:[{id:s},a]})}),$T=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),eE=function(e){return e[e.open=SC.open]=`open`,e[e.closed=SC.closed]=`closed`,e[e.startingStyle=SC.startingStyle]=`startingStyle`,e[e.endingStyle=SC.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),tE=B.createContext(void 0);function nE(){let e=B.useContext(tE);if(e===void 0)throw Error(wg(26));return e}var rE=`ArrowUp`,iE=`ArrowDown`,aE=`ArrowLeft`,oE=`ArrowRight`,sE=`Home`,cE=new Set([aE,oE]),lE=new Set([rE,iE]),uE=new Set([...cE,...lE]);new Set([...uE,sE,`End`]);var dE=new Set([rE,iE,aE,oE,sE,`End`]),fE={...kC,...xC,nestedDialogOpen(e){return e?{[eE.nestedDialogOpen]:``}:null}},pE=B.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,...o}=e,{store:s}=UT(),c=s.useState(`descriptionElementId`),l=s.useState(`disablePointerDismissal`),u=s.useState(`floatingRootContext`),d=s.useState(`popupProps`),f=s.useState(`modal`),p=s.useState(`mounted`),m=s.useState(`nested`),h=s.useState(`nestedOpenDialogCount`),g=s.useState(`open`),_=s.useState(`openMethod`),v=s.useState(`titleElementId`),y=s.useState(`transitionStatus`),b=s.useState(`role`);nE(),FS({open:g,ref:s.context.popupRef,onComplete(){g&&s.context.onOpenChangeComplete?.(!0)}});function x(e){return e===`touch`?s.context.popupRef.current:!0}let S=i===void 0?x:i,C=h>0,w=xb(`div`,e,{state:B.useMemo(()=>({open:g,nested:m,transitionStatus:y,nestedDialogOpen:C}),[g,m,y,C]),props:[d,{"aria-labelledby":v??void 0,"aria-describedby":c??void 0,role:b,tabIndex:-1,hidden:!p,onKeyDown(e){dE.has(e.key)&&e.stopPropagation()},style:{[$T.nestedDialogs]:h}},o],ref:[t,s.context.popupRef,s.useStateSetter(`popupElement`)],stateAttributesMapping:fE});return(0,V.jsx)(Bb,{context:u,openInteractionType:_,disabled:!p,closeOnFocusOut:!l,initialFocus:S,returnFocus:r,modal:f!==!1,restoreFocus:`popup`,children:w})}),mE=B.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n?.getBoundingClientRect();i=`polygon(
|
|
1476
|
-
0% 0%,
|
|
1477
|
-
100% 0%,
|
|
1478
|
-
100% 100%,
|
|
1479
|
-
0% 100%,
|
|
1480
|
-
0% 0%,
|
|
1481
|
-
${e.left}px ${e.top}px,
|
|
1482
|
-
${e.left}px ${e.bottom}px,
|
|
1483
|
-
${e.right}px ${e.bottom}px,
|
|
1484
|
-
${e.right}px ${e.top}px,
|
|
1485
|
-
${e.left}px ${e.top}px
|
|
1486
|
-
)`}return(0,V.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),hE=B.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=UT(),a=i.useState(`mounted`),o=i.useState(`modal`);return a||n?(0,V.jsx)(tE.Provider,{value:n,children:(0,V.jsxs)(kb,{ref:t,...r,children:[a&&o===!0&&(0,V.jsx)(mE,{ref:i.context.internalBackdropRef,inert:sw(!open)}),e.children]})}):null}),gE={},_E={},vE=``;function yE(e){if(typeof document>`u`)return!1;let t=Uy(e);return Ig(t).innerWidth-t.documentElement.clientWidth>0}function bE(e){let t=Uy(e),n=t.documentElement,r=t.body,i=Hg(n)?n:r,a=i.style.overflow;return i.style.overflow=`hidden`,()=>{i.style.overflow=a}}function xE(e){let t=Uy(e),n=t.documentElement,r=t.body,i=Ig(n),a=0,o=0,s=Vy.create(),c=typeof CSS<`u`&&CSS.supports?.(`scrollbar-gutter`,`stable`);if(g_&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let e=i.getComputedStyle(n),t=i.getComputedStyle(r),s=(e.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,gE={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},vE=n.style.scrollBehavior,_E={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let l=n.scrollHeight>n.clientHeight,u=n.scrollWidth>n.clientWidth,d=e.overflowY===`scroll`||t.overflowY===`scroll`,f=e.overflowX===`scroll`||t.overflowX===`scroll`,p=Math.max(0,i.innerWidth-n.clientWidth),m=Math.max(0,i.innerHeight-n.clientHeight),h=parseFloat(t.marginTop)+parseFloat(t.marginBottom),g=parseFloat(t.marginLeft)+parseFloat(t.marginRight),_=Hg(n)?n:r;if(c){n.style.scrollbarGutter=s,_.style.overflowY=`hidden`,_.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:s,overflowY:`hidden`,overflowX:`hidden`}),(l||d)&&(n.style.overflowY=`scroll`),(u||f)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:h||m?`calc(100dvh - ${h+m}px)`:`100dvh`,width:g||p?`calc(100vw - ${g+p}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,gE),Object.assign(r.style,_E),c||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=vE)}function d(){u(),s.request(l)}return l(),i.addEventListener(`resize`,d),()=>{s.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var SE=new class{lockCount=0;restore=null;timeoutLock=Mg.create();timeoutUnlock=Mg.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Uy(e).documentElement,n=Ig(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=fy;return}let r=__||!yE(e);this.restore=r?bE(e):xE(e)}};function CE(e=!0,t=null){Cg(()=>{if(e)return SE.acquire(t)},[e,t])}function wE(e){let t=B.useRef(``),n=B.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:B.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n&&e(n,n.pointerType),e(n,t.current),t.current=``},[e]),onPointerDown:n}}function TE(e){let[t,n]=B.useState(null),r=l_((t,r)=>{e||n(r)}),i=B.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:o}=wE(r);return B.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:o}}),[t,i,a,o])}function EE(e){let{store:t,parentContext:n,actionsRef:r}=e,i=t.useState(`open`),a=t.useState(`disablePointerDismissal`),o=t.useState(`modal`),s=t.useState(`popupElement`),{openMethod:c,triggerProps:l,reset:u}=TE(i);RS(t);let{forceUnmount:d}=zS(i,t,()=>{u()}),f=l_(e=>{let n=Ey(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),p=B.useCallback(()=>{t.setOpen(!1,f(Ty))},[t,f]);B.useImperativeHandle(r,()=>({unmount:d,close:p}),[d,p]);let m=KS({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[h,g]=B.useState(0),_=h===0,v=lC(m),y=tS(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=k_(e);if(_&&!a){let e=n;return o&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||O_(e,s)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:_});CE(i&&o===!0,s);let{getReferenceProps:b,getFloatingProps:x,getTriggerProps:S}=aC([v,y]);t.useContextCallback(`onNestedDialogOpen`,e=>{g(e+1)}),t.useContextCallback(`onNestedDialogClose`,()=>{g(0)}),B.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(h),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,h]);let C=B.useMemo(()=>b(l),[b,l]),w=B.useMemo(()=>S(l),[S,l]),T=B.useMemo(()=>x(),[x]);t.useSyncedValues({openMethod:c,activeTriggerProps:C,inactiveTriggerProps:w,popupProps:T,floatingRootContext:m,nestedOpenDialogCount:h})}var DE={...US,modal:CS(e=>e.modal),nested:CS(e=>e.nested),nestedOpenDialogCount:CS(e=>e.nestedOpenDialogCount),disablePointerDismissal:CS(e=>e.disablePointerDismissal),openMethod:CS(e=>e.openMethod),descriptionElementId:CS(e=>e.descriptionElementId),titleElementId:CS(e=>e.titleElementId),viewportElement:CS(e=>e.viewportElement),role:CS(e=>e.role)},OE=class extends AS{constructor(e){super(kE(e),{popupRef:B.createRef(),backdropRef:B.createRef(),internalBackdropRef:B.createRef(),triggerElements:new BS,onOpenChange:void 0,onOpenChangeComplete:void 0},DE)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit(`openchange`,n);let r={open:e},i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)}};function kE(e={}){return{...HS(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function AE(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=UT(!0),p=!!f,m=Og(()=>l?.store??new OE({open:n??r,activeTriggerId:u===void 0?d:u,modal:s,disablePointerDismissal:o,nested:p})).current;m.useControlledProp(`open`,n,r),m.useControlledProp(`activeTriggerId`,u,d),m.useSyncedValues({disablePointerDismissal:o,nested:p,modal:s}),m.useContextCallback(`onOpenChange`,i),m.useContextCallback(`onOpenChangeComplete`,a);let h=m.useState(`payload`);EE({store:m,actionsRef:c,parentContext:f?.store.context,onOpenChange:i,triggerIdProp:u});let g=B.useMemo(()=>({store:m}),[m]);return(0,V.jsx)(HT.Provider,{value:g,children:typeof t==`function`?t({payload:h}):t})}var jE=B.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=UT(),s=AC(i);return o.useSyncedValueWithCleanup(`titleElementId`,s),xb(`h2`,e,{ref:t,props:[{id:s},a]})}),ME=AE,NE=ZT,PE=hE;function FE({className:e,...t}){return(0,V.jsx)(GT,{className:_g(`fixed inset-0 z-50 bg-cohere-black/70 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 transition-opacity duration-150`,e),...t})}function IE({className:e,children:t,showCloseButton:n=!0,...r}){return(0,V.jsxs)(PE,{children:[(0,V.jsx)(FE,{}),(0,V.jsxs)(pE,{className:_g(`fixed left-1/2 top-1/2 z-50 grid w-[calc(100vw-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 gap-5 rounded-lg border border-card-border bg-background p-6 shadow-popover outline-none sm:p-8`,`data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 data-[ending-style]:scale-95 data-[starting-style]:scale-95 transition-[opacity,transform] duration-150`,e),...r,children:[t,n&&(0,V.jsx)(NE,{className:`absolute right-4 top-4 rounded-full p-1 opacity-70 ring-offset-background transition-opacity hover:bg-soft-stone hover:text-primary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,"aria-label":`Close dialog`,children:(0,V.jsx)(Wm,{className:`size-4`})})]})]})}function LE({className:e,...t}){return(0,V.jsx)(`div`,{className:_g(`flex flex-col space-y-1.5 text-left`,e),...t})}function RE({className:e,...t}){return(0,V.jsx)(`div`,{className:_g(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function zE({className:e,...t}){return(0,V.jsx)(jE,{className:_g(`text-card-heading font-normal leading-tight`,e),...t})}function BE({className:e,...t}){return(0,V.jsx)(QT,{className:_g(`text-sm text-muted-foreground`,e),...t})}function VE({className:e,containerClassName:t,...n}){return(0,V.jsx)(`div`,{className:_g(`relative w-full overflow-auto rounded-sm border border-hairline bg-card`,t),children:(0,V.jsx)(`table`,{className:_g(`w-full caption-bottom text-sm`,e),...n})})}function HE({className:e,...t}){return(0,V.jsx)(`thead`,{className:_g(`[&_tr]:border-b`,e),...t})}function UE({className:e,...t}){return(0,V.jsx)(`tbody`,{className:_g(`[&_tr:last-child]:border-0`,e),...t})}function WE({className:e,...t}){return(0,V.jsx)(`tr`,{className:_g(`border-b border-hairline transition-colors hover:bg-soft-stone/60 data-[state=selected]:bg-soft-stone`,e),...t})}function GE({className:e,...t}){return(0,V.jsx)(`th`,{className:_g(`h-11 bg-background px-4 text-left align-middle text-xs font-normal uppercase text-muted-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function KE({className:e,...t}){return(0,V.jsx)(`td`,{className:_g(`px-4 py-4 align-middle [&:has([role=checkbox])]:pr-0`,e),...t})}var qE=[`fleet`,`enroll`,`pending`];function JE(){let e=Le(),t=Qe({queryKey:qE,queryFn:dT,refetchInterval:3e4,staleTime:5e3});return(0,B.useEffect)(()=>Qw().onEvent(`enrollment.pending`,t=>{e.invalidateQueries({queryKey:qE})}),[e]),t}function YE(){let e=Le();return $e({mutationFn:fT,onSuccess:()=>{e.invalidateQueries({queryKey:qE}),e.invalidateQueries({queryKey:[`fleet`,`workers`]})}})}function XE(){let e=Le();return $e({mutationFn:pT,onSuccess:()=>{e.invalidateQueries({queryKey:qE})}})}function ZE(){let e=JE(),t=YE(),n=XE(),[r,i]=(0,B.useState)(null),[a,o]=(0,B.useState)(null);return(0,V.jsxs)(`div`,{className:`app-page`,children:[(0,V.jsxs)(`div`,{className:`app-page-header`,children:[(0,V.jsx)(`h1`,{className:`app-page-title`,children:`Pending enrollments`}),(0,V.jsxs)(`p`,{className:`app-page-copy`,children:[`Workers awaiting OTP approval. Issued OTPs are`,` `,(0,V.jsx)(`strong`,{children:`not displayed`}),` `,`here for shoulder-surfing safety — operators read the OTP from the worker's own logs / CLI before approving.`]})]}),a&&(0,V.jsx)(`p`,{role:`alert`,className:`app-alert-error`,children:a}),e.isLoading?(0,V.jsx)(NT,{className:`h-32 w-full`}):(e.data??[]).length===0?(0,V.jsx)($E,{}):(0,V.jsx)(`div`,{className:`overflow-hidden rounded-sm border border-hairline bg-card`,children:(0,V.jsxs)(VE,{children:[(0,V.jsx)(HE,{children:(0,V.jsxs)(WE,{children:[(0,V.jsx)(GE,{children:`Worker id`}),(0,V.jsx)(GE,{children:`Display name`}),(0,V.jsx)(GE,{children:`Submitted`}),(0,V.jsx)(GE,{children:`Expires`}),(0,V.jsx)(GE,{className:`text-right`,children:`Actions`})]})}),(0,V.jsx)(UE,{children:(e.data??[]).map(e=>(0,V.jsx)(QE,{entry:e,busy:t.isPending||n.isPending,onApprove:async()=>{o(null);try{i(await t.mutateAsync(e.otp))}catch(e){o(e instanceof eT||e instanceof Error?e.message:String(e))}},onReject:async()=>{o(null);try{await n.mutateAsync(e.otp)}catch(e){o(e instanceof eT||e instanceof Error?e.message:String(e))}}},e.otp))})]})}),r&&(0,V.jsx)(eD,{payload:r,onClose:()=>i(null)})]})}function QE({entry:e,busy:t,onApprove:n,onReject:r}){let i=new Date(e.submittedAt),a=new Date(e.expiresAt),o=Math.max(0,a.getTime()-Date.now()),s=Math.floor(o/6e4),c=Math.floor(o%6e4/1e3);return(0,V.jsxs)(WE,{children:[(0,V.jsx)(KE,{children:(0,V.jsx)(`code`,{className:`app-code`,children:e.workerId})}),(0,V.jsx)(KE,{children:e.displayName??`—`}),(0,V.jsx)(KE,{className:`text-xs text-muted-foreground`,children:i.toLocaleString()}),(0,V.jsx)(KE,{className:`text-xs text-muted-foreground`,children:(0,V.jsx)(VT,{variant:o===0?`destructive`:`outline`,children:o===0?`expired`:`${s}m ${c.toString().padStart(2,`0`)}s`})}),(0,V.jsx)(KE,{className:`text-right`,children:(0,V.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,V.jsxs)(Sg,{variant:`outline`,size:`sm`,disabled:t,onClick:r,children:[(0,V.jsx)(Wm,{className:`size-3.5`}),`Reject`]}),(0,V.jsxs)(Sg,{size:`sm`,disabled:t,onClick:n,children:[(0,V.jsx)(_m,{className:`size-3.5`}),`Approve`]})]})})]})}function $E(){return(0,V.jsxs)(`div`,{className:`app-empty flex flex-col items-center justify-center gap-3`,children:[(0,V.jsx)(jm,{className:`size-10 text-muted-foreground`}),(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`h2`,{className:`text-feature font-normal text-foreground`,children:`No pending enrollments`}),(0,V.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Workers started with`,` `,(0,V.jsx)(`code`,{className:`app-code`,children:`aiworker serve`}),` `,`and`,` `,(0,V.jsx)(`code`,{className:`app-code`,children:`AIWORKER_GATEWAY_URL`}),` `,`set will request an OTP here. Use`,` `,(0,V.jsx)(`code`,{className:`app-code`,children:`aiworker enroll list`}),` `,`and`,` `,(0,V.jsx)(`code`,{className:`app-code`,children:`aiworker enroll approve <otp>`}),` `,`to review and approve them.`]})]})]})}function eD({payload:e,onClose:t}){let[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(!1);async function o(){try{await navigator.clipboard.writeText(e.deviceToken),a(!0),setTimeout(()=>a(!1),1500)}catch{}}return(0,V.jsx)(ME,{open:!0,onOpenChange:e=>!e&&t(),children:(0,V.jsxs)(IE,{className:`sm:max-w-lg`,children:[(0,V.jsxs)(LE,{children:[(0,V.jsx)(zE,{children:`Enrollment approved`}),(0,V.jsxs)(BE,{children:[`Fleet has issued a fresh`,` `,(0,V.jsx)(`code`,{className:`app-code`,children:`deviceToken`}),` `,`for`,` `,(0,V.jsx)(`code`,{className:`app-code`,children:e.workerId}),`. Shown`,` `,(0,V.jsx)(`strong`,{children:`once`}),`; copy it before closing.`]})]}),(0,V.jsxs)(`div`,{className:`app-panel text-xs`,children:[(0,V.jsxs)(`p`,{className:`mb-2 flex items-center gap-1.5 font-medium text-foreground`,children:[(0,V.jsx)(Nm,{className:`size-3.5`}),`One-time deviceToken`]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 rounded-sm bg-soft-stone px-2 py-1.5 font-mono text-micro`,children:[(0,V.jsx)(`code`,{className:`flex-1 break-all`,children:n?e.deviceToken:e.deviceToken.replace(/./g,`•`)}),(0,V.jsx)(Sg,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6`,onClick:()=>r(e=>!e),"aria-label":n?`Hide token`:`Show token`,children:n?(0,V.jsx)(Em,{className:`size-3`}):(0,V.jsx)(Dm,{className:`size-3`})}),(0,V.jsx)(Sg,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6`,onClick:o,"aria-label":`Copy token`,children:(0,V.jsx)(Cm,{className:`size-3`})})]}),i&&(0,V.jsx)(`p`,{role:`status`,className:`mt-1 text-success`,children:`Copied.`}),(0,V.jsxs)(`p`,{className:`mt-2 flex items-start gap-1.5 text-muted-foreground`,children:[(0,V.jsx)(Hm,{className:`mt-0.5 size-3.5 shrink-0`}),(0,V.jsx)(`span`,{children:`Worker has already received this token via its WS connection. Use this dialog only if you need to forward it elsewhere.`})]})]}),(0,V.jsx)(RE,{children:(0,V.jsx)(Sg,{onClick:t,children:`Close`})})]})})}function tD(){return(0,V.jsx)(ZE,{})}var nD=Ri(`/enroll`)({component:tD});function rD({className:e,type:t,...n}){return(0,V.jsx)(`input`,{type:t,className:_g(`flex min-h-11 w-full rounded-xs border border-input bg-background px-4 py-2 text-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-form-focus focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,e),...n})}function iD({className:e,...t}){return(0,V.jsx)(`label`,{className:_g(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,e),...t})}function aD(e,t=300){let[n,r]=(0,B.useState)(e);return(0,B.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var oD=[`fleet`,`audit`];function sD(e){return Qe({queryKey:[...oD,e],queryFn:()=>mT(e),staleTime:5e3})}var cD=50;function lD(){let[e,t]=(0,B.useState)(``),[n,r]=(0,B.useState)(``),[i,a]=(0,B.useState)([]),o=aD(e.trim(),300),s=aD(n.trim(),300),c=i[i.length-1],l=sD({limit:cD,...c===void 0?{}:{before:c},...o.length>0?{action:o}:{},...s.length>0?{workerId:s}:{}});return(0,V.jsxs)(`div`,{className:`app-page h-full min-h-0`,children:[(0,V.jsxs)(`div`,{className:`app-page-header`,children:[(0,V.jsx)(`h1`,{className:`app-page-title`,children:`Audit log`}),(0,V.jsxs)(`p`,{className:`app-page-copy break-words`,children:[`fleet.db`,` `,(0,V.jsx)(`code`,{className:`app-code`,children:`audit_events`}),` `,`— gateway-side activity. Worker-side audit lives in each worker's own database.`]})]}),(0,V.jsx)(uD,{action:e,workerId:n,onActionChange:e=>{t(e),a([])},onWorkerIdChange:e=>{r(e),a([])}}),l.isLoading?(0,V.jsx)(NT,{className:`h-64 w-full`}):l.isError?(0,V.jsxs)(`p`,{className:`app-alert-error`,children:[`Failed to load audit events:`,` `,l.error?.message??`unknown error`]}):(l.data?.events??[]).length===0?(0,V.jsx)(fD,{}):(0,V.jsxs)(VE,{className:`min-w-[60rem]`,containerClassName:`min-h-0 flex-1 bg-card`,"data-testid":`audit-table-scroll`,children:[(0,V.jsx)(HE,{children:(0,V.jsxs)(WE,{children:[(0,V.jsx)(GE,{className:`sticky top-0 z-10 w-[7rem]`,children:`id`}),(0,V.jsx)(GE,{className:`sticky top-0 z-10 w-[12rem]`,children:`When`}),(0,V.jsx)(GE,{className:`sticky top-0 z-10 w-[10rem]`,children:`Actor`}),(0,V.jsx)(GE,{className:`sticky top-0 z-10`,children:`Action`}),(0,V.jsx)(GE,{className:`sticky top-0 z-10 w-[14rem]`,children:`Worker`}),(0,V.jsx)(GE,{className:`sticky top-0 z-10`,children:`Detail`})]})}),(0,V.jsx)(UE,{children:(l.data?.events??[]).map(e=>(0,V.jsx)(dD,{event:e},e.id))})]}),(0,V.jsx)(pD,{canBack:i.length>0,canForward:l.data?.hasMore??!1,onBack:()=>a(e=>e.slice(0,-1)),onForward:()=>{let e=l.data?.events??[],t=e[e.length-1];t&&a(e=>[...e,t.id])}})]})}function uD({action:e,workerId:t,onActionChange:n,onWorkerIdChange:r}){return(0,V.jsxs)(`div`,{className:`grid gap-3 sm:flex sm:flex-wrap sm:items-end`,children:[(0,V.jsxs)(`div`,{className:`grid w-full gap-1 sm:w-64`,children:[(0,V.jsx)(iD,{htmlFor:`audit-action`,children:`Action prefix`}),(0,V.jsx)(rD,{id:`audit-action`,placeholder:`gateway.connect.`,value:e,onChange:e=>n(e.target.value),spellCheck:!1,autoComplete:`off`,className:`w-full`})]}),(0,V.jsxs)(`div`,{className:`grid w-full gap-1 sm:w-64`,children:[(0,V.jsx)(iD,{htmlFor:`audit-worker`,children:`Worker id (exact)`}),(0,V.jsx)(rD,{id:`audit-worker`,placeholder:`w_…`,value:t,onChange:e=>r(e.target.value),spellCheck:!1,autoComplete:`off`,className:`w-full`})]}),(0,V.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5 pb-1.5 text-xs text-muted-foreground sm:items-center`,children:[(0,V.jsx)(Am,{className:`mt-0.5 size-3.5 shrink-0 sm:mt-0`}),(0,V.jsxs)(`span`,{className:`min-w-0 break-words`,children:[`Filters apply on debounce. Action prefix is a SQL`,` `,(0,V.jsx)(`code`,{className:`app-code`,children:`LIKE`}),`;`,` `,`non-alphanumeric characters fall back to exact match.`]})]})]})}function dD({event:e}){let[t,n]=(0,B.useState)(!1),r=e.detail?JSON.stringify(e.detail,null,2):null,i=r?.replace(/\s+/g,` `).trim()??`—`;return(0,V.jsxs)(WE,{className:`align-top`,children:[(0,V.jsx)(KE,{className:`font-mono text-xs`,children:e.id}),(0,V.jsx)(KE,{className:`text-xs text-muted-foreground`,children:new Date(e.at).toLocaleString()}),(0,V.jsx)(KE,{className:`text-xs`,children:e.actor}),(0,V.jsx)(KE,{children:(0,V.jsx)(`code`,{className:`app-code`,children:e.action})}),(0,V.jsx)(KE,{className:`font-mono text-xs`,children:e.workerId??`—`}),(0,V.jsx)(KE,{className:`text-xs`,children:r===null?(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):(0,V.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,V.jsx)(`button`,{type:`button`,className:`text-left text-xs text-action-blue underline decoration-hairline underline-offset-2 hover:decoration-action-blue`,onClick:()=>n(e=>!e),children:t?`Hide JSON`:`Show JSON`}),t?(0,V.jsx)(`pre`,{className:`max-h-64 overflow-auto rounded-sm bg-soft-stone p-2 font-mono text-micro`,children:r}):(0,V.jsx)(`span`,{className:`line-clamp-1 break-all text-muted-foreground`,children:i})]})})]})}function fD(){return(0,V.jsxs)(`div`,{className:`app-empty flex flex-col items-center justify-center gap-3`,children:[(0,V.jsx)(km,{className:`size-10 text-muted-foreground`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No audit events match the current filters.`})]})}function pD({canBack:e,canForward:t,onBack:n,onForward:r}){return(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[(0,V.jsxs)(Sg,{variant:`outline`,size:`sm`,disabled:!e,onClick:n,children:[(0,V.jsx)(vm,{className:`size-3.5`}),`Newer`]}),(0,V.jsxs)(Sg,{variant:`outline`,size:`sm`,disabled:!t,onClick:r,children:[`Older`,(0,V.jsx)(ym,{className:`size-3.5`})]})]})}function mD(){return(0,V.jsx)(lD,{})}var hD=Ri(`/audit`)({component:mD}),gD=Ri(`/`)({beforeLoad:()=>{throw On({to:`/workers`})}});function _D(e){switch(e){case`online`:return`success`;case`offline`:return`secondary`;case`auth-failed`:return`destructive`;case`config-version-mismatch`:return`warning`;default:return`outline`}}function vD(e){return e??`unknown`}var yD=new Intl.RelativeTimeFormat(void 0,{numeric:`auto`}),bD=[{unit:`year`,ms:365*24*3600*1e3},{unit:`month`,ms:720*3600*1e3},{unit:`day`,ms:24*3600*1e3},{unit:`hour`,ms:3600*1e3},{unit:`minute`,ms:60*1e3},{unit:`second`,ms:1e3}];function xD(e,t=Date.now()){if(!e)return`—`;let n=Date.parse(e);if(Number.isNaN(n))return`—`;let r=n-t,i=Math.abs(r);for(let{unit:e,ms:t}of bD)if(i>=t||e===`second`)return yD.format(Math.round(r/t),e);return yD.format(0,`second`)}function SD(e){return e.length<=12?e:`${e.slice(0,6)}…${e.slice(-4)}`}function CD({open:e,onOpenChange:t}){let[n,r]=(0,B.useState)(0);function i(e){e&&r(e=>e+1),t(e)}return(0,V.jsx)(ME,{open:e,onOpenChange:i,children:(0,V.jsx)(IE,{className:`sm:max-w-xl`,children:(0,V.jsx)(wD,{onClose:()=>t(!1)},n)})})}function wD({onClose:e}){let[t,n]=(0,B.useState)(null),r=gi();return t?(0,V.jsx)(OD,{payload:t,onClose:e,onGoToWorker:()=>{e(),r({to:`/workers/$workerId`,params:{workerId:t.id}})}}):(0,V.jsx)(TD,{onCancel:e,onSuccess:n})}function TD({onCancel:e,onSuccess:t}){let n=(0,B.useId)(),r=(0,B.useId)(),[i,a]=(0,B.useState)(``),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)({}),[u,d]=(0,B.useState)(!1),f=CT();function p(){let e={},t=i.trim();return t.length===0?e.displayName=`Display name is required`:t.length>80&&(e.displayName=`Display name must be 80 characters or fewer`),o.trim().length>0&&!Kf.test(o.trim())&&(e.forceId=`Worker id must match w_<12 chars> (base32 crockford)`),Object.keys(e).length>0?e:null}async function m(e){e.preventDefault();let n=p();if(n){l(n);return}l({});try{let e=await f.mutateAsync({displayName:i.trim(),...o.trim().length>0?{forceId:o.trim()}:{}});t({id:e.worker.id,displayName:e.worker.displayName,baseUrl:e.worker.baseUrl,lastSeenState:e.worker.lastSeenState,deviceToken:e.deviceToken})}catch(e){l(ED(e))}}return(0,V.jsxs)(`form`,{onSubmit:m,noValidate:!0,children:[(0,V.jsxs)(LE,{children:[(0,V.jsx)(zE,{children:`Create worker`}),(0,V.jsx)(BE,{children:`The manager spawns a fresh worker container on the local docker engine, scrapes its bootstrap token, and registers it in one step. Takes 10–30 seconds.`})]}),(0,V.jsxs)(`div`,{className:`grid gap-4 py-4`,children:[(0,V.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,V.jsx)(iD,{htmlFor:n,children:`Display name`}),(0,V.jsx)(rD,{id:n,placeholder:`prod-edge-1`,value:i,onChange:e=>a(e.target.value),maxLength:80,autoFocus:!0,"aria-invalid":c.displayName?`true`:void 0}),(0,V.jsx)(DD,{message:c.displayName})]}),(0,V.jsx)(`div`,{children:(0,V.jsxs)(`button`,{type:`button`,className:`text-xs text-muted-foreground underline-offset-2 hover:underline`,onClick:()=>d(e=>!e),children:[u?`Hide`:`Show`,` `,`advanced options`]})}),u&&(0,V.jsxs)(`div`,{className:`grid gap-1.5 rounded-sm border border-dashed border-hairline bg-card p-3`,children:[(0,V.jsx)(iD,{htmlFor:r,children:`Force workerId (optional)`}),(0,V.jsx)(rD,{id:r,placeholder:`w_abcdef123456`,value:o,onChange:e=>s(e.target.value),spellCheck:!1,autoComplete:`off`,"aria-invalid":c.forceId?`true`:void 0}),(0,V.jsxs)(`p`,{className:`flex items-start gap-1.5 text-xs text-muted-foreground`,children:[(0,V.jsx)(Mm,{className:`mt-0.5 size-3.5 shrink-0`}),(0,V.jsx)(`span`,{children:`Pins the container's future workerId. Only useful for deterministic replay / test scenarios — leave empty to let the worker mint its own.`})]}),(0,V.jsx)(DD,{message:c.forceId})]}),c.form&&(0,V.jsx)(`p`,{className:`app-alert-error text-xs`,children:c.form})]}),(0,V.jsxs)(RE,{children:[(0,V.jsx)(Sg,{type:`button`,variant:`outline`,onClick:e,children:`Cancel`}),(0,V.jsx)(Sg,{type:`submit`,disabled:f.isPending,children:f.isPending?`Launching…`:`Launch`})]})]})}function ED(e){if(e instanceof eT){let t=e;switch(t.code){case`quota-exceeded`:return{form:typeof t.quotaLimit==`number`?`Worker quota reached (${t.quotaCurrent??`?`} / ${t.quotaLimit}). Delete an existing worker or raise MANAGER_MAX_WORKERS.`:`Worker quota reached. Delete an existing worker or raise MANAGER_MAX_WORKERS.`};case`launch-timeout`:return{form:"The worker container took too long to emit its bootstrap token. Check `docker logs` on the host."};case`launch-failed`:return{form:t.message||`Launch failed. Check the dashboard logs and the supervisor prerequisites in docs/deployment.md.`};case`auth-failed`:return{form:`The launched worker rejected its own bootstrap token. This is a bug — file an issue.`};case`worker-unreachable`:return{form:t.message||`The launched worker could not be reached at its baseUrl. Check the docker network membership of the dashboard.`};case`invalid-worker-info`:return{form:`Reached the worker but its /info response was malformed.`};case`already-registered`:return{form:`The worker reported an id that is already in the registry.`};case`invalid-body`:return{form:`The manager rejected the payload. Re-check the fields.`};case`auth-required`:return{form:`Dashboard authentication required. Reload the page and sign in.`};default:return{form:t.message||`Launch failed. Try again.`}}}return{form:`Launch failed. Try again.`}}function DD({message:e}){return e?(0,V.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:e}):null}function OD({payload:e,onClose:t,onGoToWorker:n}){let[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(!1);async function s(){try{await navigator.clipboard.writeText(e.deviceToken),o(!0),setTimeout(()=>o(!1),1500)}catch{}}return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(LE,{children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-success`,children:[(0,V.jsx)(bm,{className:`size-5`}),(0,V.jsx)(zE,{children:`Worker created`})]}),(0,V.jsxs)(BE,{children:[`The bearer token is shown`,` `,(0,V.jsx)(`strong`,{children:`once`}),` `,`— copy it before closing if you need it outside the dashboard. The manager retains an encrypted copy; the plaintext is not recoverable.`]})]}),(0,V.jsxs)(`dl`,{className:`grid grid-cols-[120px_1fr] gap-x-4 gap-y-2 py-4 text-sm`,children:[(0,V.jsx)(`dt`,{className:`text-muted-foreground`,children:`Worker id`}),(0,V.jsx)(`dd`,{className:`font-mono text-xs`,children:e.id}),(0,V.jsx)(`dt`,{className:`text-muted-foreground`,children:`Display name`}),(0,V.jsx)(`dd`,{children:e.displayName}),(0,V.jsx)(`dt`,{className:`text-muted-foreground`,children:`Base URL`}),(0,V.jsx)(`dd`,{className:`break-all font-mono text-xs`,children:e.baseUrl}),e.lastSeenState&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{className:`text-muted-foreground`,children:`State`}),(0,V.jsx)(`dd`,{children:(0,V.jsx)(VT,{variant:_D(e.lastSeenState),children:vD(e.lastSeenState)})})]})]}),(0,V.jsxs)(`div`,{className:`app-panel text-xs`,children:[(0,V.jsxs)(`p`,{className:`mb-2 flex items-center gap-1.5 font-medium text-foreground`,children:[(0,V.jsx)(Nm,{className:`size-3.5`}),`One-time bearer token`]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 rounded-sm bg-soft-stone px-2 py-1.5 font-mono text-micro`,children:[(0,V.jsx)(`code`,{className:`flex-1 break-all`,children:r?e.deviceToken:e.deviceToken.replace(/./g,`•`)}),(0,V.jsx)(Sg,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6`,onClick:()=>i(e=>!e),"aria-label":r?`Hide token`:`Show token`,children:r?(0,V.jsx)(Em,{className:`size-3`}):(0,V.jsx)(Dm,{className:`size-3`})}),(0,V.jsx)(Sg,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6`,onClick:s,"aria-label":`Copy token`,children:(0,V.jsx)(Cm,{className:`size-3`})})]}),a&&(0,V.jsx)(`p`,{role:`status`,className:`mt-1 text-success`,children:`Copied.`}),(0,V.jsxs)(`p`,{className:`mt-2 flex items-start gap-1.5 text-muted-foreground`,children:[(0,V.jsx)(Hm,{className:`mt-0.5 size-3.5 shrink-0`}),(0,V.jsx)(`span`,{children:`This value is not shown again. If you lose it, rotate the token from the worker's detail page.`})]})]}),(0,V.jsxs)(RE,{children:[(0,V.jsx)(Sg,{variant:`outline`,onClick:t,children:`Close`}),(0,V.jsx)(Sg,{onClick:n,children:`Go to worker`})]})]})}function kD({open:e,onOpenChange:t}){let[n,r]=(0,B.useState)(0);function i(e){e&&r(e=>e+1),t(e)}return(0,V.jsx)(ME,{open:e,onOpenChange:i,children:(0,V.jsx)(IE,{className:`sm:max-w-xl`,children:(0,V.jsx)(AD,{onClose:()=>t(!1)},n)})})}function AD({onClose:e}){let[t,n]=(0,B.useState)(null),r=gi();return t?(0,V.jsx)(FD,{worker:t.worker,deviceToken:t.deviceToken,onClose:e,onGoToWorker:()=>{e(),r({to:`/workers/$workerId`,params:{workerId:t.worker.id}})}}):(0,V.jsx)(jD,{onCancel:e,onSuccess:n})}function jD({onCancel:e,onSuccess:t}){let n=(0,B.useId)(),r=(0,B.useId)(),i=(0,B.useId)(),a=(0,B.useId)(),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(``),[u,d]=(0,B.useState)(``),[f,p]=(0,B.useState)(!1),[m,h]=(0,B.useState)(null),[g,_]=(0,B.useState)(!1),[v,y]=(0,B.useState)({}),b=ST();function x(){let e=Yf();l(e),h(e),p(!0),_(!1),y(e=>({...e,apiToken:void 0}))}async function S(){if(m)try{await navigator.clipboard.writeText(m),_(!0),setTimeout(()=>_(!1),1500)}catch{}}function C(){let e={};try{let t=new URL(o);t.protocol!==`http:`&&t.protocol!==`https:`&&(e.baseUrl=`Base URL must use http(s)://`)}catch{e.baseUrl=`Enter a valid URL (e.g. https://worker.example.com)`}c.startsWith(`wtk_`)||(e.apiToken=`API token must start with ${qf}`);let t=u.trim();return t.length===0?e.displayName=`Display name is required`:t.length>80&&(e.displayName=`Display name must be 80 characters or fewer`),Object.keys(e).length>0?e:null}async function w(e){e.preventDefault();let n=C();if(n){y(n);return}y({});try{t(await b.mutateAsync({baseUrl:o.replace(/\/+$/,``),bootstrapToken:c,displayName:u.trim()}))}catch(e){y(ND(e))}}return(0,V.jsxs)(`form`,{onSubmit:w,noValidate:!0,children:[(0,V.jsxs)(LE,{children:[(0,V.jsx)(zE,{children:`Register a worker`}),(0,V.jsxs)(BE,{children:[`The manager calls`,` `,(0,V.jsx)(`code`,{className:`app-code`,children:`/api/worker/info`}),` `,`on the worker to verify the bearer token before storing it.`]})]}),(0,V.jsxs)(`div`,{className:`grid gap-4 py-4`,children:[(0,V.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,V.jsx)(iD,{htmlFor:n,children:`Base URL`}),(0,V.jsx)(rD,{id:n,placeholder:`http://aiworker-worker:9217`,value:o,onChange:e=>s(e.target.value),autoComplete:`off`,autoFocus:!0,"data-invalid":v.baseUrl?`true`:void 0,"aria-invalid":v.baseUrl?`true`:void 0,"aria-describedby":a}),(0,V.jsxs)(`p`,{id:a,className:`flex items-start gap-1.5 text-xs text-muted-foreground`,children:[(0,V.jsx)(Mm,{className:`mt-0.5 size-3.5 shrink-0`}),(0,V.jsxs)(`span`,{children:[`Worker's HTTP root — scheme + host/port, no trailing path. Typical shapes:`,(0,V.jsx)(`code`,{className:`app-code mx-1`,children:`http://aiworker-worker:9217`}),`(same compose),`,(0,V.jsx)(`code`,{className:`app-code mx-1`,children:`https://worker-1.example.com`}),`(reverse proxy),`,(0,V.jsx)(`code`,{className:`app-code mx-1`,children:`http://203.0.113.10:9217`}),`(direct port).`]})]}),(0,V.jsx)(PD,{message:v.baseUrl})]}),(0,V.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,V.jsx)(iD,{htmlFor:r,children:`Bootstrap API token`}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(rD,{id:r,placeholder:`wtk_…`,value:c,onChange:e=>{l(e.target.value),m&&e.target.value!==m&&h(null)},type:f?`text`:`password`,autoComplete:`off`,spellCheck:!1,"aria-invalid":v.apiToken?`true`:void 0}),(0,V.jsx)(Sg,{type:`button`,variant:`outline`,size:`icon`,"aria-label":f?`Hide API token`:`Show API token`,onClick:()=>p(e=>!e),children:f?(0,V.jsx)(Em,{className:`size-4`}):(0,V.jsx)(Dm,{className:`size-4`})}),(0,V.jsxs)(Sg,{type:`button`,variant:`outline`,onClick:x,"aria-label":`Generate API token`,children:[(0,V.jsx)(zm,{className:`size-4`}),`Generate`]})]}),(0,V.jsx)(PD,{message:v.apiToken}),m&&(0,V.jsxs)(`div`,{className:`app-panel text-xs`,children:[(0,V.jsx)(`p`,{className:`mb-2 font-medium text-foreground`,children:`Token minted in this browser.`}),(0,V.jsxs)(`p`,{className:`mb-2 text-muted-foreground`,children:[`Set it as an env var on the worker container before first boot — only honoured on a fresh worker (no`,` `,(0,V.jsx)(`code`,{className:`app-code`,children:`worker_identity`}),` `,`row yet):`]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 rounded-sm bg-soft-stone px-2 py-1.5 font-mono text-micro`,children:[(0,V.jsxs)(`code`,{className:`flex-1 break-all`,children:[`AIWORKER_FORCE_TOKEN=`,m]}),(0,V.jsx)(Sg,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6`,onClick:S,"aria-label":`Copy env assignment`,children:(0,V.jsx)(Cm,{className:`size-3`})})]}),g&&(0,V.jsx)(`p`,{role:`status`,className:`mt-1 text-success`,children:`Copied.`}),(0,V.jsx)(`p`,{className:`mt-2 text-muted-foreground`,children:`If the worker already minted its own token on a previous boot, this env var is ignored and registration will fail — use the token from its startup logs instead.`})]}),(0,V.jsx)(MD,{})]}),(0,V.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,V.jsx)(iD,{htmlFor:i,children:`Display name`}),(0,V.jsx)(rD,{id:i,placeholder:`prod-edge-1`,value:u,onChange:e=>d(e.target.value),maxLength:80,"aria-invalid":v.displayName?`true`:void 0}),(0,V.jsx)(PD,{message:v.displayName})]}),v.form&&(0,V.jsx)(`p`,{className:`app-alert-error text-xs`,children:v.form})]}),(0,V.jsxs)(RE,{children:[(0,V.jsx)(Sg,{type:`button`,variant:`outline`,onClick:e,children:`Cancel`}),(0,V.jsx)(Sg,{type:`submit`,disabled:b.isPending,children:b.isPending?`Pairing…`:`Pair worker`})]})]})}function MD(){return(0,V.jsxs)(`details`,{className:`rounded-sm border border-dashed border-hairline bg-card px-3 py-2 text-xs`,children:[(0,V.jsx)(`summary`,{className:`cursor-pointer select-none font-medium text-muted-foreground`,children:`Using an agentic engine? You'll also need to seed CLI auth on the worker.`}),(0,V.jsxs)(`p`,{className:`mt-2 text-muted-foreground`,children:[`The bearer token above only authorises dashboard → worker calls.`,` `,"claude-code / codex / gemini / qwen / cursor each need their own login state (`~/.claude.json`, `~/.codex/auth.json`, etc.) inside the worker container. Two recipes:"]}),(0,V.jsxs)(`ul`,{className:`mt-1.5 ml-4 list-disc text-muted-foreground`,children:[(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`strong`,{children:`Mount the host's auth dir`}),` `,`into the container (read-only), or`]}),(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`strong`,{children:`docker exec <worker> <cli> login`}),` `,`once inside a fresh container.`]})]}),(0,V.jsxs)(`p`,{className:`mt-2 text-muted-foreground`,children:[`Full walkthrough:`,` `,(0,V.jsx)(`a`,{className:`underline decoration-dotted underline-offset-2 hover:text-foreground`,href:`/docs/executor-engines.md#auth-recipes`,target:`_blank`,rel:`noreferrer`,children:`docs/executor-engines.md#auth-recipes`}),` `,`· starter compose:`,` `,(0,V.jsx)(`code`,{className:`app-code`,children:`ops/compose/docker-compose.worker.example.yml`})]})]})}function ND(e){if(e instanceof eT)switch(e.code){case`auth-failed`:return{apiToken:`Worker rejected this token (HTTP 401). Double-check the value.`};case`already-registered`:return{displayName:e.workerId?`This worker is already registered as ${e.workerId}.`:`This worker is already registered.`};case`worker-unreachable`:return{baseUrl:e.message||`Could not reach this worker (HTTP 502).`};case`invalid-worker-info`:return{baseUrl:`Reached the worker but its /info response was malformed.`};case`invalid-body`:return{form:`The manager rejected the payload. Re-check each field.`};default:return{form:e.message||`Registration failed. Try again.`}}return{form:`Registration failed. Try again.`}}function PD({message:e}){return e?(0,V.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:e}):null}function FD({worker:e,deviceToken:t,onClose:n,onGoToWorker:r}){let[i,a]=(0,B.useState)(!1),[o,s]=(0,B.useState)(!1);async function c(){try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),1500)}catch{}}return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(LE,{children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-success`,children:[(0,V.jsx)(bm,{className:`size-5`}),(0,V.jsx)(zE,{children:`Worker paired`})]}),(0,V.jsxs)(BE,{children:[`The fleet has issued a fresh`,` `,(0,V.jsx)(`code`,{className:`app-code`,children:`deviceToken`}),` `,`for this worker. It is shown`,` `,(0,V.jsx)(`strong`,{children:`once`}),` `,`and not stored in browser storage — copy it before closing if needed.`]})]}),(0,V.jsxs)(`dl`,{className:`grid grid-cols-[120px_1fr] gap-x-4 gap-y-2 py-4 text-sm`,children:[(0,V.jsx)(`dt`,{className:`text-muted-foreground`,children:`Worker id`}),(0,V.jsx)(`dd`,{className:`font-mono text-xs`,children:e.id}),(0,V.jsx)(`dt`,{className:`text-muted-foreground`,children:`Display name`}),(0,V.jsx)(`dd`,{children:e.displayName}),(0,V.jsx)(`dt`,{className:`text-muted-foreground`,children:`Base URL`}),(0,V.jsx)(`dd`,{className:`break-all font-mono text-xs`,children:e.baseUrl||`—`}),(0,V.jsx)(`dt`,{className:`text-muted-foreground`,children:`State`}),(0,V.jsx)(`dd`,{children:(0,V.jsx)(VT,{variant:_D(e.lastSeenState),children:vD(e.lastSeenState)})})]}),(0,V.jsxs)(`div`,{className:`app-panel text-xs`,children:[(0,V.jsxs)(`p`,{className:`mb-2 flex items-center gap-1.5 font-medium text-foreground`,children:[(0,V.jsx)(Nm,{className:`size-3.5`}),`One-time deviceToken`]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 rounded-sm bg-soft-stone px-2 py-1.5 font-mono text-micro`,children:[(0,V.jsx)(`code`,{className:`flex-1 break-all`,children:i?t:t.replace(/./g,`•`)}),(0,V.jsx)(Sg,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6`,onClick:()=>a(e=>!e),"aria-label":i?`Hide token`:`Show token`,children:i?(0,V.jsx)(Em,{className:`size-3`}):(0,V.jsx)(Dm,{className:`size-3`})}),(0,V.jsx)(Sg,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6`,onClick:c,"aria-label":`Copy token`,children:(0,V.jsx)(Cm,{className:`size-3`})})]}),o&&(0,V.jsx)(`p`,{role:`status`,className:`mt-1 text-success`,children:`Copied.`}),(0,V.jsxs)(`p`,{className:`mt-2 flex items-start gap-1.5 text-muted-foreground`,children:[(0,V.jsx)(Hm,{className:`mt-0.5 size-3.5 shrink-0`}),(0,V.jsx)(`span`,{children:`This value is not shown again. If lost, rotate the token from the worker's detail page.`})]})]}),(0,V.jsxs)(RE,{children:[(0,V.jsx)(Sg,{variant:`outline`,onClick:n,children:`Close`}),(0,V.jsx)(Sg,{onClick:r,children:`Go to worker`})]})]})}function ID({worker:e,open:t,onOpenChange:n}){let[r,i]=(0,B.useState)(``),[a,o]=(0,B.useState)(null),s=wT(),c=e.displayName;function l(){i(``),o(null)}return(0,V.jsx)(ME,{open:t,onOpenChange:e=>{e||l(),n(e)},children:(0,V.jsxs)(IE,{className:`sm:max-w-lg`,children:[(0,V.jsxs)(LE,{children:[(0,V.jsx)(zE,{children:`Remove worker`}),(0,V.jsxs)(BE,{children:[`Removing`,` `,(0,V.jsx)(`strong`,{children:e.displayName}),` `,`invalidates its`,` `,(0,V.jsx)(`code`,{className:`app-code`,children:`deviceToken`}),` `,`and deletes its fleet.db row. The worker container itself is not stopped — use the`,` `,(0,V.jsx)(`em`,{children:`Stop runtime`}),` `,`action first if you also want to halt it.`]})]}),(0,V.jsxs)(`div`,{className:`grid gap-2 py-4 text-sm`,children:[(0,V.jsxs)(iD,{htmlFor:`remove-confirm`,children:[`Type`,` `,(0,V.jsx)(`code`,{className:`app-code`,children:c}),` `,`to confirm`]}),(0,V.jsx)(rD,{id:`remove-confirm`,value:r,autoFocus:!0,autoComplete:`off`,spellCheck:!1,onChange:e=>i(e.target.value)})]}),a&&(0,V.jsx)(`p`,{role:`alert`,className:`app-alert-error text-xs`,children:a}),(0,V.jsxs)(RE,{children:[(0,V.jsx)(Sg,{variant:`outline`,onClick:()=>n(!1),disabled:s.isPending,children:`Cancel`}),(0,V.jsxs)(Sg,{variant:`destructive`,disabled:s.isPending||r!==c,onClick:async()=>{o(null);try{await s.mutateAsync(e.id),n(!1)}catch(e){o(e instanceof eT||e instanceof Error?e.message:String(e))}},children:[(0,V.jsx)(Vm,{className:`size-4`}),s.isPending?`Removing…`:`Remove worker`]})]})]})})}function LD({worker:e,open:t,onOpenChange:n}){let[r,i]=(0,B.useState)(0);function a(e){e&&i(e=>e+1),n(e)}return(0,V.jsx)(ME,{open:t,onOpenChange:a,children:(0,V.jsx)(IE,{className:`sm:max-w-lg`,children:(0,V.jsx)(RD,{worker:e,onClose:()=>n(!1)},r)})})}function RD({worker:e,onClose:t}){let[n,r]=(0,B.useState)(null),[i,a]=(0,B.useState)(null),o=ET();return n?(0,V.jsx)(zD,{worker:e,deviceToken:n,onClose:t}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(LE,{children:[(0,V.jsx)(zE,{children:`Rotate device token`}),(0,V.jsxs)(BE,{children:[`Issuing a new`,` `,(0,V.jsx)(`code`,{className:`app-code`,children:`deviceToken`}),` `,`immediately invalidates the previous one. The worker must re-pair (or auto-reconnect with the new token) before it can talk to the fleet again.`]})]}),(0,V.jsxs)(`dl`,{className:`grid grid-cols-[100px_1fr] gap-x-4 gap-y-2 py-4 text-sm`,children:[(0,V.jsx)(`dt`,{className:`text-muted-foreground`,children:`Worker`}),(0,V.jsx)(`dd`,{className:`font-medium`,children:e.displayName}),(0,V.jsx)(`dt`,{className:`text-muted-foreground`,children:`Worker id`}),(0,V.jsx)(`dd`,{className:`font-mono text-xs`,children:e.id})]}),i&&(0,V.jsx)(`p`,{role:`alert`,className:`app-alert-error text-xs`,children:i}),(0,V.jsxs)(RE,{children:[(0,V.jsx)(Sg,{variant:`outline`,onClick:t,disabled:o.isPending,children:`Cancel`}),(0,V.jsxs)(Sg,{disabled:o.isPending,onClick:async()=>{a(null);try{r((await o.mutateAsync(e.id)).deviceToken)}catch(e){a(e instanceof eT||e instanceof Error?e.message:String(e))}},children:[(0,V.jsx)(Lm,{className:`size-4`}),o.isPending?`Rotating…`:`Rotate token`]})]})]})}function zD({worker:e,deviceToken:t,onClose:n}){let[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(!1);async function s(){try{await navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),1500)}catch{}}return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(LE,{children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-success`,children:[(0,V.jsx)(bm,{className:`size-5`}),(0,V.jsx)(zE,{children:`Token rotated`})]}),(0,V.jsxs)(BE,{children:[`New deviceToken for`,` `,(0,V.jsx)(`strong`,{children:e.displayName}),` `,`shown`,` `,(0,V.jsx)(`strong`,{children:`once`}),`. Copy it before closing — the fleet retains only an encrypted copy.`]})]}),(0,V.jsxs)(`div`,{className:`app-panel text-xs`,children:[(0,V.jsxs)(`p`,{className:`mb-2 flex items-center gap-1.5 font-medium text-foreground`,children:[(0,V.jsx)(Nm,{className:`size-3.5`}),`One-time deviceToken`]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 rounded-sm bg-soft-stone px-2 py-1.5 font-mono text-micro`,children:[(0,V.jsx)(`code`,{className:`flex-1 break-all`,children:r?t:t.replace(/./g,`•`)}),(0,V.jsx)(Sg,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6`,onClick:()=>i(e=>!e),"aria-label":r?`Hide token`:`Show token`,children:r?(0,V.jsx)(Em,{className:`size-3`}):(0,V.jsx)(Dm,{className:`size-3`})}),(0,V.jsx)(Sg,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6`,onClick:s,"aria-label":`Copy token`,children:(0,V.jsx)(Cm,{className:`size-3`})})]}),a&&(0,V.jsx)(`p`,{role:`status`,className:`mt-1 text-success`,children:`Copied.`}),(0,V.jsxs)(`p`,{className:`mt-2 flex items-start gap-1.5 text-muted-foreground`,children:[(0,V.jsx)(Hm,{className:`mt-0.5 size-3.5 shrink-0`}),(0,V.jsx)(`span`,{children:`This value is not shown again. Lost tokens require another rotation.`})]})]}),(0,V.jsx)(RE,{children:(0,V.jsx)(Sg,{onClick:n,children:`Close`})})]})}function BD({worker:e,open:t,onOpenChange:n}){let[r,i]=(0,B.useState)(null),a=TT();return(0,V.jsx)(ME,{open:t,onOpenChange:n,children:(0,V.jsxs)(IE,{className:`sm:max-w-lg`,children:[(0,V.jsxs)(LE,{children:[(0,V.jsx)(zE,{children:`Stop worker runtime`}),(0,V.jsxs)(BE,{children:[`Sends`,` `,(0,V.jsx)(`code`,{className:`app-code`,children:`workers.stop`}),` `,`to`,` `,(0,V.jsx)(`strong`,{children:e.displayName}),`. The fleet.db row is kept so the worker can reconnect later. Use`,` `,(0,V.jsx)(`em`,{children:`Remove from fleet`}),` `,`if you also want to invalidate its deviceToken.`]})]}),r&&(0,V.jsx)(`p`,{role:`alert`,className:`app-alert-error my-2 text-xs`,children:r}),(0,V.jsxs)(RE,{children:[(0,V.jsx)(Sg,{variant:`outline`,onClick:()=>n(!1),disabled:a.isPending,children:`Cancel`}),(0,V.jsxs)(Sg,{disabled:a.isPending,onClick:async()=>{i(null);try{await a.mutateAsync(e.id),n(!1)}catch(e){i(e instanceof eT||e instanceof Error?e.message:String(e))}},children:[(0,V.jsx)(Im,{className:`size-4`}),a.isPending?`Stopping…`:`Stop runtime`]})]})]})})}function VD({value:e,label:t}){let[n,r]=(0,B.useState)(!1);return(0,V.jsx)(Sg,{variant:`ghost`,size:`icon`,"aria-label":`Copy ${t}`,className:`size-6`,onClick:t=>{t.stopPropagation(),navigator.clipboard?.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1200)})},children:n?(0,V.jsx)(_m,{className:`size-3.5`}):(0,V.jsx)(Cm,{className:`size-3.5`})})}function HD({workers:e}={}){let t=gi(),n=bT(),[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(null),l=e??n.data,u=e===void 0&&n.isLoading;return(0,V.jsxs)(`div`,{className:`app-page`,children:[(0,V.jsxs)(`div`,{className:`app-page-header sm:flex-row sm:items-end sm:justify-between`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`h1`,{className:`app-page-title`,children:`Workers`}),(0,V.jsx)(`p`,{className:`app-page-copy`,children:`Registered AIWorker runtimes the fleet can drive.`})]}),(0,V.jsxs)(`div`,{className:`flex w-full flex-col gap-2 sm:w-auto sm:flex-row`,children:[(0,V.jsxs)(Sg,{variant:`outline`,className:`w-full sm:w-auto`,onClick:()=>i(!0),children:[(0,V.jsx)(xm,{className:`size-4`}),`Pair worker`]}),(0,V.jsxs)(Sg,{className:`w-full sm:w-auto`,onClick:()=>o(!0),children:[(0,V.jsx)(zm,{className:`size-4`}),`Launch worker`]})]})]}),u?(0,V.jsx)(GD,{}):l&&l.length>0?(0,V.jsx)(`div`,{className:`overflow-hidden rounded-sm border border-hairline bg-card`,children:(0,V.jsxs)(VE,{children:[(0,V.jsx)(HE,{children:(0,V.jsxs)(WE,{children:[(0,V.jsx)(GE,{children:`Display name`}),(0,V.jsx)(GE,{children:`Worker id`}),(0,V.jsx)(GE,{children:`Base URL`}),(0,V.jsx)(GE,{children:`Last seen`}),(0,V.jsx)(GE,{children:`State`}),(0,V.jsx)(GE,{className:`w-[1%] text-right`,children:`Actions`})]})}),(0,V.jsx)(UE,{children:l.map(e=>(0,V.jsxs)(WE,{className:`cursor-pointer`,onClick:()=>void t({to:`/workers/$workerId`,params:{workerId:e.id}}),children:[(0,V.jsx)(KE,{className:`font-medium`,children:e.displayName}),(0,V.jsx)(KE,{children:(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`code`,{className:`app-code`,children:SD(e.id)}),(0,V.jsx)(VD,{value:e.id,label:`worker id`})]})}),(0,V.jsx)(KE,{children:e.baseUrl?(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsxs)(`a`,{href:e.baseUrl,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-xs text-action-blue underline decoration-hairline underline-offset-2 hover:decoration-action-blue`,onClick:e=>e.stopPropagation(),children:[e.baseUrl,(0,V.jsx)(Tm,{className:`size-3`})]}),(0,V.jsx)(VD,{value:e.baseUrl,label:`base URL`})]}):(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`—`})}),(0,V.jsx)(KE,{className:`text-xs text-muted-foreground`,children:xD(e.lastSeenAt)}),(0,V.jsx)(KE,{children:(0,V.jsx)(VT,{variant:_D(e.lastSeenState),children:vD(e.lastSeenState)})}),(0,V.jsx)(KE,{className:`text-right`,onClick:e=>e.stopPropagation(),children:(0,V.jsx)(UD,{worker:e,onRotate:()=>c({kind:`rotate`,worker:e}),onRemove:()=>c({kind:`remove`,worker:e}),onStop:()=>c({kind:`stop`,worker:e})})})]},e.id))})]})}):(0,V.jsx)(KD,{onRegister:()=>i(!0)}),(0,V.jsx)(kD,{open:r,onOpenChange:i}),(0,V.jsx)(CD,{open:a,onOpenChange:o}),s?.kind===`rotate`&&(0,V.jsx)(LD,{worker:s.worker,open:!0,onOpenChange:e=>!e&&c(null)}),s?.kind===`remove`&&(0,V.jsx)(ID,{worker:s.worker,open:!0,onOpenChange:e=>!e&&c(null)}),s?.kind===`stop`&&(0,V.jsx)(BD,{worker:s.worker,open:!0,onOpenChange:e=>!e&&c(null)})]})}function UD({worker:e,onRotate:t,onRemove:n,onStop:r}){let[i,a]=(0,B.useState)(!1),o=e.lastSeenState===`online`;return(0,V.jsxs)(`div`,{className:`relative inline-block text-left`,children:[(0,V.jsx)(Sg,{variant:`ghost`,size:`icon`,"aria-label":`Worker actions`,"aria-haspopup":`menu`,"aria-expanded":i,className:`size-8`,onClick:()=>a(e=>!e),children:(0,V.jsx)(wm,{className:`size-4`})}),i&&(0,V.jsxs)(`div`,{role:`menu`,className:`absolute right-0 z-20 mt-1 w-48 rounded-sm border border-hairline bg-popover p-1 text-sm shadow-popover`,onMouseLeave:()=>a(!1),children:[(0,V.jsxs)(`a`,{role:`menuitem`,href:WD(e.id),target:`_blank`,rel:`noreferrer`,className:`flex items-center gap-2 rounded-xs px-2 py-1.5 hover:bg-soft-stone`,onClick:()=>a(!1),children:[(0,V.jsx)(Tm,{className:`size-3.5`}),`Open worker UI`]}),(0,V.jsx)(`button`,{role:`menuitem`,type:`button`,className:`flex w-full items-center gap-2 rounded-xs px-2 py-1.5 text-left hover:bg-soft-stone`,onClick:()=>{a(!1),t()},children:`Rotate token`}),(0,V.jsx)(`button`,{role:`menuitem`,type:`button`,disabled:!o,title:o?void 0:`Stop is only available while the worker is online.`,className:`flex w-full items-center gap-2 rounded-xs px-2 py-1.5 text-left hover:bg-soft-stone disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent`,onClick:()=>{a(!1),r()},children:`Stop runtime`}),(0,V.jsx)(`button`,{role:`menuitem`,type:`button`,className:`flex w-full items-center gap-2 rounded-xs px-2 py-1.5 text-left text-destructive hover:bg-destructive/10`,onClick:()=>{a(!1),n()},children:`Remove from fleet`})]})]})}function WD(e){return`/w/${e}/`}function GD(){return(0,V.jsx)(`div`,{className:`overflow-hidden rounded-sm border border-hairline bg-card`,children:(0,V.jsx)(`div`,{className:`space-y-3 p-4 sm:p-6`,children:[0,1,2].map(e=>(0,V.jsx)(NT,{className:`h-10 w-full`},e))})})}function KD({onRegister:e}){return(0,V.jsxs)(`div`,{className:`app-empty flex flex-col items-center justify-center gap-3`,children:[(0,V.jsx)(Rm,{className:`size-10 text-muted-foreground`}),(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`h2`,{className:`text-feature font-normal text-foreground`,children:`No workers registered yet`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Click Pair to attach a worker that has already started — it just needs the worker's base URL and bootstrap API token.`})]}),(0,V.jsxs)(Sg,{className:`w-full sm:w-auto`,onClick:e,children:[(0,V.jsx)(xm,{className:`size-4`}),`Register a worker`]})]})}function qD(){return(0,V.jsx)(HD,{})}var JD=Ri(`/workers/`)({component:qD});function YD(){let{workerId:e}=mi({from:`/workers/$workerId`}),t=gT(e=>e.setCurrentWorkerId),n=xT(e),[r,i]=(0,B.useState)(null);if((0,B.useEffect)(()=>(t(e),()=>t(null)),[e,t]),n.isLoading)return(0,V.jsxs)(`div`,{className:`space-y-3 p-2`,children:[(0,V.jsx)(NT,{className:`h-8 w-64`}),(0,V.jsx)(NT,{className:`h-40 w-full max-w-3xl`})]});if(n.isError&&n.error instanceof eT&&n.error.code===`not-found`)return(0,V.jsx)(tO,{id:e});if(!n.data)return(0,V.jsxs)(`div`,{className:`app-alert-error`,children:[`Failed to load worker`,` `,e,`:`,` `,n.error?.message??`unknown error`]});let a=n.data,o=QD(a.id),s=a.lastSeenState===`online`;return(0,V.jsxs)(`div`,{className:`app-page`,children:[(0,V.jsxs)(`div`,{className:`app-page-header lg:flex-row lg:items-end lg:justify-between`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(Mi,{to:`/workers`,className:`mb-2 inline-flex items-center gap-1 text-xs text-muted-foreground underline decoration-hairline underline-offset-2 hover:text-foreground`,children:[(0,V.jsx)(mm,{className:`size-3.5`}),`Back to workers`]}),(0,V.jsx)(`h1`,{className:`app-page-title`,children:a.displayName}),(0,V.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[(0,V.jsx)(`code`,{className:`app-code`,children:SD(a.id)}),` · `,(0,V.jsx)(VT,{variant:_D(a.lastSeenState),children:vD(a.lastSeenState)})]})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(`a`,{href:o,target:`_blank`,rel:`noreferrer`,className:xg({variant:`default`}),children:[(0,V.jsx)(Tm,{className:`size-4`}),`Open worker UI`]}),(0,V.jsxs)(Sg,{variant:`outline`,onClick:()=>i(`rotate`),children:[(0,V.jsx)(Lm,{className:`size-4`}),`Rotate token`]}),(0,V.jsxs)(Sg,{variant:`outline`,disabled:!s,title:s?void 0:`Stop is only available while the worker is online.`,onClick:()=>i(`stop`),children:[(0,V.jsx)(Im,{className:`size-4`}),`Stop runtime`]}),(0,V.jsxs)(Sg,{variant:`destructive`,onClick:()=>i(`remove`),children:[(0,V.jsx)(Vm,{className:`size-4`}),`Remove`]})]})]}),(0,V.jsx)(XD,{worker:a}),(0,V.jsx)(eO,{worker:a}),(0,V.jsx)(ZD,{worker:a}),r===`rotate`&&(0,V.jsx)(LD,{worker:a,open:!0,onOpenChange:e=>!e&&i(null)}),r===`remove`&&(0,V.jsx)(ID,{worker:a,open:!0,onOpenChange:e=>!e&&i(null)}),r===`stop`&&(0,V.jsx)(BD,{worker:a,open:!0,onOpenChange:e=>!e&&i(null)})]})}function XD({worker:e}){return(0,V.jsxs)(OT,{children:[(0,V.jsxs)(kT,{children:[(0,V.jsx)(AT,{children:`Fleet record`}),(0,V.jsx)(jT,{children:`fleet.db pointer for this worker. Config / secrets / cron / approvals live in the worker's own database; fleet opens a same-origin worker UI bridge for those.`})]}),(0,V.jsx)(MT,{children:(0,V.jsxs)(`dl`,{className:`grid grid-cols-1 gap-x-6 gap-y-3 text-sm sm:grid-cols-[140px_1fr]`,children:[(0,V.jsx)(`dt`,{className:`text-muted-foreground`,children:`Worker id`}),(0,V.jsx)(`dd`,{className:`break-all font-mono text-xs`,children:e.id}),(0,V.jsx)(`dt`,{className:`text-muted-foreground`,children:`Display name`}),(0,V.jsx)(`dd`,{children:e.displayName}),(0,V.jsx)(`dt`,{className:`text-muted-foreground`,children:`Base URL`}),(0,V.jsx)(`dd`,{className:`break-all font-mono text-xs`,children:e.baseUrl||`—`}),(0,V.jsx)(`dt`,{className:`text-muted-foreground`,children:`Origin`}),(0,V.jsx)(`dd`,{className:`font-mono text-xs`,children:e.addedBy}),(0,V.jsx)(`dt`,{className:`text-muted-foreground`,children:`Last seen`}),(0,V.jsx)(`dd`,{children:xD(e.lastSeenAt)}),(0,V.jsx)(`dt`,{className:`text-muted-foreground`,children:`Last config version`}),(0,V.jsx)(`dd`,{className:`font-mono text-xs`,children:e.lastConfigVersion??`—`})]})})]})}function ZD({worker:e}){let t=QD(e.id);return(0,V.jsxs)(OT,{children:[(0,V.jsxs)(kT,{children:[(0,V.jsx)(AT,{children:`Fleet-hosted worker UI`}),(0,V.jsx)(jT,{children:`Config / secrets / cron / approvals / chat for this worker live in its own database. The fleet path opens the worker bundle through the gateway bridge.`})]}),(0,V.jsx)(MT,{children:(0,V.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:xg({variant:`outline`}),children:[(0,V.jsx)(Tm,{className:`size-4`}),t]})})]})}function QD(e){return`/w/${e}/`}function $D(e){return`/w/${e}/#/brain`}function eO({worker:e}){let t=$D(e.id);return(0,V.jsxs)(OT,{children:[(0,V.jsxs)(kT,{children:[(0,V.jsx)(AT,{children:`Brain (PLAN-103)`}),(0,V.jsx)(jT,{children:`scope manifest、Soul、artifact 注册表与 admission 审批由 worker 数据面拥有;fleet 控制面只持有 fleet.db 指针 + audit,不复制 proposal 全文、artifact 内容或 canonical brain。请打开 worker UI 的 Brain 视图进行审批。`})]}),(0,V.jsx)(MT,{children:(0,V.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:xg({variant:`outline`}),children:[(0,V.jsx)(gm,{className:`size-4`}),`Open worker Brain admin`]})})]})}function tO({id:e}){return(0,V.jsxs)(`div`,{className:`app-empty flex flex-col items-center justify-center gap-3`,children:[(0,V.jsx)(`h1`,{className:`text-feature font-normal text-foreground`,children:`Worker not found`}),(0,V.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No registered worker with id`,` `,(0,V.jsx)(`code`,{className:`app-code`,children:e}),`.`]}),(0,V.jsx)(Mi,{to:`/workers`,className:xg({variant:`default`}),children:`Back to workers`})]})}var nO=Ri(`/workers/$workerId`)({component:YD}),rO=zT.update({id:`/presence`,path:`/presence`,getParentRoute:()=>bw}),iO=nD.update({id:`/enroll`,path:`/enroll`,getParentRoute:()=>bw}),aO=hD.update({id:`/audit`,path:`/audit`,getParentRoute:()=>bw}),oO=gD.update({id:`/`,path:`/`,getParentRoute:()=>bw}),sO=JD.update({id:`/workers/`,path:`/workers/`,getParentRoute:()=>bw}),cO={IndexRoute:oO,AuditRoute:aO,EnrollRoute:iO,PresenceRoute:rO,WorkersWorkerIdRoute:nO.update({id:`/workers/$workerId`,path:`/workers/$workerId`,getParentRoute:()=>bw}),WorkersIndexRoute:sO},lO=bw._addFileChildren(cO)._addFileTypes();Za(`fleet`);var uO=$i({routeTree:lO,basepath:nm(`fleet`),defaultPreload:`intent`,defaultPreloadStaleTime:0,scrollRestoration:!0}),dO=document.getElementById(`root`);if(!dO)throw Error(`Root element not found`);(0,oa.createRoot)(dO).render((0,V.jsx)(B.StrictMode,{children:(0,V.jsxs)(Re,{client:eo,children:[(0,V.jsx)(Qa,{scope:`fleet`}),(0,V.jsx)(na,{router:uO}),(0,V.jsx)($a,{})]})}));
|