@fungi.computer/prints 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -3
- package/dist/assets/index-7_6t_G_r.js +91 -0
- package/dist/assets/index-DEn6uVuz.css +2 -0
- package/dist/index.html +2 -2
- package/package.json +8 -8
- package/dist/assets/index-BqGc0fci.js +0 -91
- package/dist/assets/index-DmgM95V3.js +0 -91
- package/dist/assets/index-ghHnoWMF.css +0 -2
- package/dist/assets/index-hMYDjtKK.css +0 -2
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.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.provider`),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.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): 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`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(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`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+A(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+A(s,l);c+=j(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+A(s,l++),c+=j(s,r,i,u,o);else if(s===`object`)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 M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(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 P={current:null},F={transition:null},I={ReactCurrentDispatcher:P,ReactCurrentBatchConfig:F,ReactCurrentOwner:C};function L(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,e.act=L,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=F.transition;F.transition={};try{e()}finally{F.transition=t}},e.unstable_act=L,e.useCallback=function(e,t){return P.current.useCallback(e,t)},e.useContext=function(e){return P.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return P.current.useDeferredValue(e)},e.useEffect=function(e,t){return P.current.useEffect(e,t)},e.useId=function(){return P.current.useId()},e.useImperativeHandle=function(e,t,n){return P.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return P.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return P.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return P.current.useMemo(e,t)},e.useReducer=function(e,t,n){return P.current.useReducer(e,t,n)},e.useRef=function(e){return P.current.useRef(e)},e.useState=function(e){return P.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return P.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return P.current.useTransition()},e.version=`18.3.1`})),d=o(((e,t)=>{t.exports=u()})),f;function p(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var m=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},h=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(f=globalThis).__zod_globalConfig??(f.__zod_globalConfig={});var g=globalThis.__zod_globalConfig;function _(e){return e&&Object.assign(g,e),g}function v(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function y(e,t){return typeof t==`bigint`?t.toString():t}function b(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function x(e){return e==null}function S(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function C(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var w=Symbol(`evaluating`);function T(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==w)return r===void 0&&(r=w,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function E(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function D(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function O(e){return JSON.stringify(e)}function k(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var A=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function j(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var M=b(()=>{if(g.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function N(e){if(j(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return j(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function P(e){return N(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var F=new Set([`string`,`number`,`symbol`]),I=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function L(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function R(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function z(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ee(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var te={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},B={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function ne(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return R(e,D(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return E(this,`shape`,e),e},checks:[]}))}function re(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return R(e,D(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return E(this,`shape`,r),r},checks:[]}))}function V(e,t){if(!N(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return R(e,D(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return E(this,`shape`,n),n}}))}function ie(e,t){if(!N(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return R(e,D(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return E(this,`shape`,n),n}}))}function ae(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return R(e,D(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return E(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function oe(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return R(t,D(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return E(this,`shape`,i),i},checks:[]}))}function H(e,t,n){return R(t,D(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return E(this,`shape`,i),i}}))}function se(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ce(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function le(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function U(e){return typeof e==`string`?e:e?.message}function ue(e,t,n){let r=e.message?e.message:U(e.inst?._zod.def?.error?.(e))??U(t?.error?.(e))??U(n.customError?.(e))??U(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function de(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function fe(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function pe(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var me=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,y,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},he=p(`$ZodError`,me),ge=p(`$ZodError`,me,{Parent:Error});function _e(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function ve(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var ye=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new m;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>ue(e,a,_())));throw A(t,i?.callee),t}return o.value},be=ye(ge),xe=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>ue(e,a,_())));throw A(t,i?.callee),t}return o.value},Se=xe(ge),Ce=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new m;return a.issues.length?{success:!1,error:new(e??he)(a.issues.map(e=>ue(e,i,_())))}:{success:!0,data:a.value}},we=Ce(ge),Te=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>ue(e,i,_())))}:{success:!0,data:a.value}},Ee=Te(ge),De=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ye(e)(t,n,i)},Oe=e=>(t,n,r)=>ye(e)(t,n,r),ke=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return xe(e)(t,n,i)},Ae=e=>async(t,n,r)=>xe(e)(t,n,r),je=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ce(e)(t,n,i)},Me=e=>(t,n,r)=>Ce(e)(t,n,r),Ne=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Te(e)(t,n,i)},Pe=e=>async(t,n,r)=>Te(e)(t,n,r),Fe=s({base64:()=>ct,base64url:()=>lt,bigint:()=>bt,boolean:()=>Ct,browserEmail:()=>et,cidrv4:()=>ot,cidrv6:()=>st,cuid:()=>Ie,cuid2:()=>Le,date:()=>ht,datetime:()=>vt,domain:()=>dt,duration:()=>He,e164:()=>pt,email:()=>Ye,emoji:()=>nt,extendedDuration:()=>Ue,guid:()=>We,hex:()=>Ot,hostname:()=>ut,html5Email:()=>Xe,httpProtocol:()=>ft,idnEmail:()=>$e,integer:()=>xt,ipv4:()=>rt,ipv6:()=>it,ksuid:()=>Be,lowercase:()=>Et,mac:()=>at,md5_base64:()=>Mt,md5_base64url:()=>Nt,md5_hex:()=>jt,nanoid:()=>Ve,null:()=>wt,number:()=>St,rfc5322Email:()=>Ze,sha1_base64:()=>Ft,sha1_base64url:()=>It,sha1_hex:()=>Pt,sha256_base64:()=>Rt,sha256_base64url:()=>zt,sha256_hex:()=>Lt,sha384_base64:()=>Vt,sha384_base64url:()=>Ht,sha384_hex:()=>Bt,sha512_base64:()=>Wt,sha512_base64url:()=>Gt,sha512_hex:()=>Ut,string:()=>yt,time:()=>_t,ulid:()=>Re,undefined:()=>Tt,unicodeEmail:()=>Qe,uppercase:()=>Dt,uuid:()=>Ge,uuid4:()=>Ke,uuid6:()=>qe,uuid7:()=>Je,xid:()=>ze}),Ie=/^[cC][0-9a-z]{6,}$/,Le=/^[0-9a-z]+$/,Re=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ze=/^[0-9a-vA-V]{20}$/,Be=/^[A-Za-z0-9]{27}$/,Ve=/^[a-zA-Z0-9_-]{21}$/,He=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ue=/^[-+]?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)?)??$/,We=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ge=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ke=Ge(4),qe=Ge(6),Je=Ge(7),Ye=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Xe=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ze=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Qe=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,$e=Qe,et=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,tt=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function nt(){return new RegExp(tt,`u`)}var rt=/^(?:(?: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])$/,it=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,at=e=>{let t=L(e??`:`);return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},ot=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,st=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ct=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,lt=/^[A-Za-z0-9_-]*$/,ut=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,dt=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,ft=/^https?$/,pt=/^\+[1-9]\d{6,14}$/,mt=`(?:(?:\\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])))`,ht=RegExp(`^${mt}$`);function gt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function _t(e){return RegExp(`^${gt(e)}$`)}function vt(e){let t=gt({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${mt}T(?:${r})$`)}var yt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},bt=/^-?\d+n?$/,xt=/^-?\d+$/,St=/^-?\d+(?:\.\d+)?$/,Ct=/^(?:true|false)$/i,wt=/^null$/i,Tt=/^undefined$/i,Et=/^[^A-Z]*$/,Dt=/^[^a-z]*$/,Ot=/^[0-9a-fA-F]*$/;function kt(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function At(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var jt=/^[0-9a-fA-F]{32}$/,Mt=kt(22,`==`),Nt=At(22),Pt=/^[0-9a-fA-F]{40}$/,Ft=kt(27,`=`),It=At(27),Lt=/^[0-9a-fA-F]{64}$/,Rt=kt(43,`=`),zt=At(43),Bt=/^[0-9a-fA-F]{96}$/,Vt=kt(64,``),Ht=At(64),Ut=/^[0-9a-fA-F]{128}$/,Wt=kt(86,`==`),Gt=At(86),Kt=p(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),qt={number:`number`,bigint:`bigint`,object:`date`},Jt=p(`$ZodCheckLessThan`,(e,t)=>{Kt.init(e,t);let n=qt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Yt=p(`$ZodCheckGreaterThan`,(e,t)=>{Kt.init(e,t);let n=qt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Xt=p(`$ZodCheckMultipleOf`,(e,t)=>{Kt.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):C(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Zt=p(`$ZodCheckNumberFormat`,(e,t)=>{Kt.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=te[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=xt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Qt=p(`$ZodCheckBigIntFormat`,(e,t)=>{Kt.init(e,t);let[n,r]=B[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),$t=p(`$ZodCheckMaxSize`,(e,t)=>{var n;Kt.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!x(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:de(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),en=p(`$ZodCheckMinSize`,(e,t)=>{var n;Kt.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!x(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:de(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),tn=p(`$ZodCheckSizeEquals`,(e,t)=>{var n;Kt.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!x(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:de(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),nn=p(`$ZodCheckMaxLength`,(e,t)=>{var n;Kt.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!x(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=fe(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),rn=p(`$ZodCheckMinLength`,(e,t)=>{var n;Kt.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!x(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=fe(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),an=p(`$ZodCheckLengthEquals`,(e,t)=>{var n;Kt.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!x(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=fe(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),on=p(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Kt.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),sn=p(`$ZodCheckRegex`,(e,t)=>{on.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),cn=p(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Et,on.init(e,t)}),ln=p(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Dt,on.init(e,t)}),un=p(`$ZodCheckIncludes`,(e,t)=>{Kt.init(e,t);let n=L(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),dn=p(`$ZodCheckStartsWith`,(e,t)=>{Kt.init(e,t);let n=RegExp(`^${L(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),fn=p(`$ZodCheckEndsWith`,(e,t)=>{Kt.init(e,t);let n=RegExp(`.*${L(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function pn(e,t,n){e.issues.length&&t.issues.push(...le(n,e.issues))}var mn=p(`$ZodCheckProperty`,(e,t)=>{Kt.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>pn(n,e,t.property));pn(n,e,t.property)}}),hn=p(`$ZodCheckMimeType`,(e,t)=>{Kt.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),gn=p(`$ZodCheckOverwrite`,(e,t)=>{Kt.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),_n=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
2
|
-
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
3
|
-
`))}},vn={major:4,minor:4,patch:3},yn=p(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=vn;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=se(e),i;for(let a of t){if(a._zod.def.when){if(ce(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new m;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=se(e,t))});else{if(e.issues.length===t)continue;r||=se(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(se(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new m;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new m;return o.then(e=>t(e,r,a))}return t(o,r,a)}}T(e,`~standard`,()=>({validate:t=>{try{let n=we(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Ee(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),bn=p(`$ZodString`,(e,t)=>{yn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??yt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),xn=p(`$ZodStringFormat`,(e,t)=>{on.init(e,t),bn.init(e,t)}),Sn=p(`$ZodGUID`,(e,t)=>{t.pattern??=We,xn.init(e,t)}),Cn=p(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Ge(e)}else t.pattern??=Ge();xn.init(e,t)}),wn=p(`$ZodEmail`,(e,t)=>{t.pattern??=Ye,xn.init(e,t)}),Tn=p(`$ZodURL`,(e,t)=>{xn.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===ft.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=t.normalize?i.href:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),En=p(`$ZodEmoji`,(e,t)=>{t.pattern??=nt(),xn.init(e,t)}),Dn=p(`$ZodNanoID`,(e,t)=>{t.pattern??=Ve,xn.init(e,t)}),On=p(`$ZodCUID`,(e,t)=>{t.pattern??=Ie,xn.init(e,t)}),kn=p(`$ZodCUID2`,(e,t)=>{t.pattern??=Le,xn.init(e,t)}),An=p(`$ZodULID`,(e,t)=>{t.pattern??=Re,xn.init(e,t)}),jn=p(`$ZodXID`,(e,t)=>{t.pattern??=ze,xn.init(e,t)}),Mn=p(`$ZodKSUID`,(e,t)=>{t.pattern??=Be,xn.init(e,t)}),Nn=p(`$ZodISODateTime`,(e,t)=>{t.pattern??=vt(t),xn.init(e,t)}),Pn=p(`$ZodISODate`,(e,t)=>{t.pattern??=ht,xn.init(e,t)}),Fn=p(`$ZodISOTime`,(e,t)=>{t.pattern??=_t(t),xn.init(e,t)}),In=p(`$ZodISODuration`,(e,t)=>{t.pattern??=He,xn.init(e,t)}),Ln=p(`$ZodIPv4`,(e,t)=>{t.pattern??=rt,xn.init(e,t),e._zod.bag.format=`ipv4`}),Rn=p(`$ZodIPv6`,(e,t)=>{t.pattern??=it,xn.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),zn=p(`$ZodMAC`,(e,t)=>{t.pattern??=at(t.delimiter),xn.init(e,t),e._zod.bag.format=`mac`}),Bn=p(`$ZodCIDRv4`,(e,t)=>{t.pattern??=ot,xn.init(e,t)}),Vn=p(`$ZodCIDRv6`,(e,t)=>{t.pattern??=st,xn.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Hn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Un=p(`$ZodBase64`,(e,t)=>{t.pattern??=ct,xn.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Hn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Wn(e){if(!lt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Hn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Gn=p(`$ZodBase64URL`,(e,t)=>{t.pattern??=lt,xn.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Wn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Kn=p(`$ZodE164`,(e,t)=>{t.pattern??=pt,xn.init(e,t)});function qn(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Jn=p(`$ZodJWT`,(e,t)=>{xn.init(e,t),e._zod.check=n=>{qn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Yn=p(`$ZodCustomStringFormat`,(e,t)=>{xn.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:`invalid_format`,format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Xn=p(`$ZodNumber`,(e,t)=>{yn.init(e,t),e._zod.pattern=e._zod.bag.pattern??St,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Zn=p(`$ZodNumberFormat`,(e,t)=>{Zt.init(e,t),Xn.init(e,t)}),Qn=p(`$ZodBoolean`,(e,t)=>{yn.init(e,t),e._zod.pattern=Ct,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),$n=p(`$ZodBigInt`,(e,t)=>{yn.init(e,t),e._zod.pattern=bt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:n.value,inst:e}),n}}),er=p(`$ZodBigIntFormat`,(e,t)=>{Qt.init(e,t),$n.init(e,t)}),tr=p(`$ZodSymbol`,(e,t)=>{yn.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),nr=p(`$ZodUndefined`,(e,t)=>{yn.init(e,t),e._zod.pattern=Tt,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),rr=p(`$ZodNull`,(e,t)=>{yn.init(e,t),e._zod.pattern=wt,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),ir=p(`$ZodAny`,(e,t)=>{yn.init(e,t),e._zod.parse=e=>e}),ar=p(`$ZodUnknown`,(e,t)=>{yn.init(e,t),e._zod.parse=e=>e}),or=p(`$ZodNever`,(e,t)=>{yn.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),sr=p(`$ZodVoid`,(e,t)=>{yn.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),cr=p(`$ZodDate`,(e,t)=>{yn.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}});function lr(e,t,n){e.issues.length&&t.issues.push(...le(n,e.issues)),t.value[n]=e.value}var ur=p(`$ZodArray`,(e,t)=>{yn.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>lr(t,n,e))):lr(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function dr(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...le(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function fr(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=ee(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function pr(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>dr(e,n,i,t,u,d))):dr(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var mr=p(`$ZodObject`,(e,t)=>{if(yn.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=b(()=>fr(t));T(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=j,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>dr(n,t,e,s,r,i))):dr(a,t,e,s,r,i)}return i?pr(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),hr=p(`$ZodObjectJIT`,(e,t)=>{mr.init(e,t);let n=e._zod.parse,r=b(()=>fr(t)),i=e=>{let t=new _n([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=O(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=O(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
4
|
-
if (${n}.issues.length) {
|
|
5
|
-
if (${o} in input) {
|
|
6
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
7
|
-
...iss,
|
|
8
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
9
|
-
})));
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (${n}.value === undefined) {
|
|
14
|
-
if (${o} in input) {
|
|
15
|
-
newResult[${o}] = undefined;
|
|
16
|
-
}
|
|
17
|
-
} else {
|
|
18
|
-
newResult[${o}] = ${n}.value;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
`):c?t.write(`
|
|
22
|
-
if (${n}.issues.length) {
|
|
23
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
24
|
-
...iss,
|
|
25
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
26
|
-
})));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (${n}.value === undefined) {
|
|
30
|
-
if (${o} in input) {
|
|
31
|
-
newResult[${o}] = undefined;
|
|
32
|
-
}
|
|
33
|
-
} else {
|
|
34
|
-
newResult[${o}] = ${n}.value;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
`):t.write(`
|
|
38
|
-
const ${n}_present = ${o} in input;
|
|
39
|
-
if (${n}.issues.length) {
|
|
40
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
41
|
-
...iss,
|
|
42
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
43
|
-
})));
|
|
44
|
-
}
|
|
45
|
-
if (!${n}_present && !${n}.issues.length) {
|
|
46
|
-
payload.issues.push({
|
|
47
|
-
code: "invalid_type",
|
|
48
|
-
expected: "nonoptional",
|
|
49
|
-
input: undefined,
|
|
50
|
-
path: [${o}]
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (${n}_present) {
|
|
55
|
-
if (${n}.value === undefined) {
|
|
56
|
-
newResult[${o}] = undefined;
|
|
57
|
-
} else {
|
|
58
|
-
newResult[${o}] = ${n}.value;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=j,s=!g.jitless,c=s&&M.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?pr([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function gr(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!se(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ue(e,r,_())))}),t)}var _r=p(`$ZodUnion`,(e,t)=>{yn.init(e,t),T(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),T(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),T(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),T(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>S(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>gr(t,r,e,i)):gr(o,r,e,i)}});function vr(e,t,n,r){let i=e.filter(e=>e.issues.length===0);return i.length===1?(t.value=i[0].value,t):(i.length===0?t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ue(e,r,_())))}):t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:[],inclusive:!1}),t)}var yr=p(`$ZodXor`,(e,t)=>{_r.init(e,t),t.inclusive=!1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);t instanceof Promise?(o.push(t),a=!0):o.push(t)}return a?Promise.all(o).then(t=>vr(t,r,e,i)):vr(o,r,e,i)}}),br=p(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,_r.init(e,t);let n=e._zod.parse;T(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=b(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!j(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),xr=p(`$ZodIntersection`,(e,t)=>{yn.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Cr(e,t,n)):Cr(e,i,a)}});function Sr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(N(e)&&N(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Sr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Sr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Cr(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),se(e))return e;let o=Sr(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var wr=p(`$ZodTuple`,(e,t)=>{yn.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=Tr(n,`optin`),c=Tr(n,`optout`);if(!t.rest){if(a.length<s)return r.issues.push({code:`too_small`,minimum:s,inclusive:!0,input:a,inst:e,origin:`array`}),r;a.length>n.length&&r.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:a,inst:e,origin:`array`})}let l=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:a[e],issues:[]},i);t instanceof Promise?o.push(t.then(t=>{l[e]=t})):l[e]=t}if(t.rest){let e=n.length-1,s=a.slice(n.length);for(let n of s){e++;let a=t.rest._zod.run({value:n,issues:[]},i);a instanceof Promise?o.push(a.then(t=>Er(t,r,e))):Er(a,r,e)}}return o.length?Promise.all(o).then(()=>Dr(l,r,n,a,c)):Dr(l,r,n,a,c)}});function Tr(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!==`optional`)return n+1;return 0}function Er(e,t,n){e.issues.length&&t.issues.push(...le(n,e.issues)),t.value[n]=e.value}function Dr(e,t,n,r,i){for(let a=0;a<n.length;a++){let n=e[a],o=a<r.length;if(n.issues.length){if(!o&&a>=i){t.value.length=a;break}t.issues.push(...le(a,n.issues))}t.value[a]=n.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}var Or=p(`$ZodRecord`,(e,t)=>{yn.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!N(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>ue(e,r,_())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...le(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...le(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&St.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>ue(e,r,_())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...le(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...le(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),kr=p(`$ZodMap`,(e,t)=>{yn.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:`map`,code:`invalid_type`,input:i,inst:e}),n;let a=[];n.value=new Map;for(let[o,s]of i){let c=t.keyType._zod.run({value:o,issues:[]},r),l=t.valueType._zod.run({value:s,issues:[]},r);c instanceof Promise||l instanceof Promise?a.push(Promise.all([c,l]).then(([t,a])=>{Ar(t,a,n,o,i,e,r)})):Ar(c,l,n,o,i,e,r)}return a.length?Promise.all(a).then(()=>n):n}});function Ar(e,t,n,r,i,a,o){e.issues.length&&(F.has(typeof r)?n.issues.push(...le(r,e.issues)):n.issues.push({code:`invalid_key`,origin:`map`,input:i,inst:a,issues:e.issues.map(e=>ue(e,o,_()))})),t.issues.length&&(F.has(typeof r)?n.issues.push(...le(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:a,key:r,issues:t.issues.map(e=>ue(e,o,_()))})),n.value.set(e.value,t.value)}var jr=p(`$ZodSet`,(e,t)=>{yn.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:`set`,code:`invalid_type`}),n;let a=[];n.value=new Set;for(let e of i){let i=t.valueType._zod.run({value:e,issues:[]},r);i instanceof Promise?a.push(i.then(e=>Mr(e,n))):Mr(i,n)}return a.length?Promise.all(a).then(()=>n):n}});function Mr(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Nr=p(`$ZodEnum`,(e,t)=>{yn.init(e,t);let n=v(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>F.has(typeof e)).map(e=>typeof e==`string`?L(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Pr=p(`$ZodLiteral`,(e,t)=>{if(yn.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?L(e):e?L(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Fr=p(`$ZodFile`,(e,t)=>{yn.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:`file`,code:`invalid_type`,input:r,inst:e}),t}}),Ir=p(`$ZodTransform`,(e,t)=>{yn.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new h(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new m;return n.value=i,n.fallback=!0,n}});function Lr(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Rr=p(`$ZodOptional`,(e,t)=>{yn.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,T(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),T(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${S(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Lr(e,r)):Lr(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),zr=p(`$ZodExactOptional`,(e,t)=>{Rr.init(e,t),T(e._zod,`values`,()=>t.innerType._zod.values),T(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Br=p(`$ZodNullable`,(e,t)=>{yn.init(e,t),T(e._zod,`optin`,()=>t.innerType._zod.optin),T(e._zod,`optout`,()=>t.innerType._zod.optout),T(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${S(e.source)}|null)$`):void 0}),T(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Vr=p(`$ZodDefault`,(e,t)=>{yn.init(e,t),e._zod.optin=`optional`,T(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Hr(e,t)):Hr(r,t)}});function Hr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Ur=p(`$ZodPrefault`,(e,t)=>{yn.init(e,t),e._zod.optin=`optional`,T(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Wr=p(`$ZodNonOptional`,(e,t)=>{yn.init(e,t),T(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Gr(t,e)):Gr(i,e)}});function Gr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Kr=p(`$ZodSuccess`,(e,t)=>{yn.init(e,t),e._zod.parse=(e,n)=>{if(n.direction===`backward`)throw new h(`ZodSuccess`);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=t.issues.length===0,e)):(e.value=r.issues.length===0,e)}}),qr=p(`$ZodCatch`,(e,t)=>{yn.init(e,t),e._zod.optin=`optional`,T(e._zod,`optout`,()=>t.innerType._zod.optout),T(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ue(e,n,_()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ue(e,n,_()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Jr=p(`$ZodNaN`,(e,t)=>{yn.init(e,t),e._zod.parse=(t,n)=>((typeof t.value!=`number`||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:e,expected:`nan`,code:`invalid_type`}),t)}),Yr=p(`$ZodPipe`,(e,t)=>{yn.init(e,t),T(e._zod,`values`,()=>t.in._zod.values),T(e._zod,`optin`,()=>t.in._zod.optin),T(e._zod,`optout`,()=>t.out._zod.optout),T(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Xr(e,t.in,n)):Xr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Xr(e,t.out,n)):Xr(r,t.out,n)}});function Xr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Zr=p(`$ZodCodec`,(e,t)=>{yn.init(e,t),T(e._zod,`values`,()=>t.in._zod.values),T(e._zod,`optin`,()=>t.in._zod.optin),T(e._zod,`optout`,()=>t.out._zod.optout),T(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if((n.direction||`forward`)===`forward`){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Qr(e,t,n)):Qr(r,t,n)}{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Qr(e,t,n)):Qr(r,t,n)}}});function Qr(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||`forward`)===`forward`){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>$r(e,r,t.out,n)):$r(e,r,t.out,n)}{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>$r(e,r,t.in,n)):$r(e,r,t.in,n)}}function $r(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}var ei=p(`$ZodPreprocess`,(e,t)=>{Yr.init(e,t)}),ti=p(`$ZodReadonly`,(e,t)=>{yn.init(e,t),T(e._zod,`propValues`,()=>t.innerType._zod.propValues),T(e._zod,`values`,()=>t.innerType._zod.values),T(e._zod,`optin`,()=>t.innerType?._zod?.optin),T(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(ni):ni(r)}});function ni(e){return e.value=Object.freeze(e.value),e}var ri=p(`$ZodTemplateLiteral`,(e,t)=>{yn.init(e,t);let n=[];for(let e of t.parts)if(typeof e==`object`&&e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=+!!t.startsWith(`^`),i=t.endsWith(`$`)?t.length-1:t.length;n.push(t.slice(r,i))}else if(e===null||I.has(typeof e))n.push(L(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(n,r)=>typeof n.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:`invalid_format`,format:t.format??`template_literal`,pattern:e._zod.pattern.source}),n):(n.issues.push({input:n.value,inst:e,expected:`string`,code:`invalid_type`}),n)}),ii=p(`$ZodFunction`,(e,t)=>(yn.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return function(...n){let r=e._def.input?be(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?be(e._def.output,i):i}},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return async function(...n){let r=e._def.input?await Se(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await Se(e._def.output,i):i}},e._zod.parse=(t,n)=>typeof t.value==`function`?(t.value=e._def.output&&e._def.output._zod.def.type===`promise`?e.implementAsync(t.value):e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new wr({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),ai=p(`$ZodPromise`,(e,t)=>{yn.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),oi=p(`$ZodLazy`,(e,t)=>{yn.init(e,t),T(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),T(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),T(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),T(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),T(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),si=p(`$ZodCustom`,(e,t)=>{Kt.init(e,t),yn.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>ci(t,n,r,e));ci(i,n,r,e)}});function ci(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(pe(e))}}var li,ui=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function di(){return new ui}(li=globalThis).__zod_globalRegistry??(li.__zod_globalRegistry=di());var fi=globalThis.__zod_globalRegistry;function pi(e,t){return new e({type:`string`,...z(t)})}function mi(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...z(t)})}function hi(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...z(t)})}function gi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...z(t)})}function _i(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...z(t)})}function vi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...z(t)})}function yi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...z(t)})}function bi(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...z(t)})}function xi(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...z(t)})}function Si(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...z(t)})}function Ci(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...z(t)})}function wi(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...z(t)})}function Ti(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...z(t)})}function Ei(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...z(t)})}function Di(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...z(t)})}function Oi(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...z(t)})}function ki(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...z(t)})}function Ai(e,t){return new e({type:`string`,format:`mac`,check:`string_format`,abort:!1,...z(t)})}function ji(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...z(t)})}function Mi(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...z(t)})}function Ni(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...z(t)})}function Pi(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...z(t)})}function Fi(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...z(t)})}function Ii(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...z(t)})}function Li(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...z(t)})}function Ri(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...z(t)})}function zi(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...z(t)})}function Bi(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...z(t)})}function Vi(e,t){return new e({type:`number`,checks:[],...z(t)})}function Hi(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...z(t)})}function Ui(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float32`,...z(t)})}function Wi(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float64`,...z(t)})}function Gi(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`int32`,...z(t)})}function Ki(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`uint32`,...z(t)})}function qi(e,t){return new e({type:`boolean`,...z(t)})}function Ji(e,t){return new e({type:`bigint`,...z(t)})}function Yi(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`int64`,...z(t)})}function Xi(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`uint64`,...z(t)})}function Zi(e,t){return new e({type:`symbol`,...z(t)})}function Qi(e,t){return new e({type:`undefined`,...z(t)})}function $i(e,t){return new e({type:`null`,...z(t)})}function ea(e){return new e({type:`any`})}function ta(e){return new e({type:`unknown`})}function na(e,t){return new e({type:`never`,...z(t)})}function ra(e,t){return new e({type:`void`,...z(t)})}function ia(e,t){return new e({type:`date`,...z(t)})}function aa(e,t){return new e({type:`nan`,...z(t)})}function oa(e,t){return new Jt({check:`less_than`,...z(t),value:e,inclusive:!1})}function sa(e,t){return new Jt({check:`less_than`,...z(t),value:e,inclusive:!0})}function ca(e,t){return new Yt({check:`greater_than`,...z(t),value:e,inclusive:!1})}function la(e,t){return new Yt({check:`greater_than`,...z(t),value:e,inclusive:!0})}function ua(e){return ca(0,e)}function da(e){return oa(0,e)}function fa(e){return sa(0,e)}function pa(e){return la(0,e)}function ma(e,t){return new Xt({check:`multiple_of`,...z(t),value:e})}function ha(e,t){return new $t({check:`max_size`,...z(t),maximum:e})}function ga(e,t){return new en({check:`min_size`,...z(t),minimum:e})}function _a(e,t){return new tn({check:`size_equals`,...z(t),size:e})}function va(e,t){return new nn({check:`max_length`,...z(t),maximum:e})}function ya(e,t){return new rn({check:`min_length`,...z(t),minimum:e})}function ba(e,t){return new an({check:`length_equals`,...z(t),length:e})}function xa(e,t){return new sn({check:`string_format`,format:`regex`,...z(t),pattern:e})}function Sa(e){return new cn({check:`string_format`,format:`lowercase`,...z(e)})}function Ca(e){return new ln({check:`string_format`,format:`uppercase`,...z(e)})}function wa(e,t){return new un({check:`string_format`,format:`includes`,...z(t),includes:e})}function Ta(e,t){return new dn({check:`string_format`,format:`starts_with`,...z(t),prefix:e})}function Ea(e,t){return new fn({check:`string_format`,format:`ends_with`,...z(t),suffix:e})}function Da(e,t,n){return new mn({check:`property`,property:e,schema:t,...z(n)})}function Oa(e,t){return new hn({check:`mime_type`,mime:e,...z(t)})}function ka(e){return new gn({check:`overwrite`,tx:e})}function Aa(e){return ka(t=>t.normalize(e))}function ja(){return ka(e=>e.trim())}function Ma(){return ka(e=>e.toLowerCase())}function Na(){return ka(e=>e.toUpperCase())}function Pa(){return ka(e=>k(e))}function Fa(e,t,n){return new e({type:`array`,element:t,...z(n)})}function Ia(e,t){return new e({type:`file`,...z(t)})}function La(e,t,n){let r=z(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Ra(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...z(n)})}function za(e,t){let n=Ba(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(pe(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(pe(r))}},e(t.value,t)),t);return n}function Ba(e,t){let n=new Kt({check:`custom`,...z(t)});return n._zod.check=e,n}function Va(e){let t=new Kt({check:`describe`});return t._zod.onattach=[t=>{let n=fi.get(t)??{};fi.add(t,{...n,description:e})}],t._zod.check=()=>{},t}function Ha(e){let t=new Kt({check:`meta`});return t._zod.onattach=[t=>{let n=fi.get(t)??{};fi.add(t,{...n,...e})}],t._zod.check=()=>{},t}function Ua(e,t){let n=z(t),r=n.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],i=n.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];n.case!==`sensitive`&&(r=r.map(e=>typeof e==`string`?e.toLowerCase():e),i=i.map(e=>typeof e==`string`?e.toLowerCase():e));let a=new Set(r),o=new Set(i),s=e.Codec??Zr,c=e.Boolean??Qn,l=new s({type:`pipe`,in:new(e.String??bn)({type:`string`,error:n.error}),out:new c({type:`boolean`,error:n.error}),transform:((e,t)=>{let r=e;return n.case!==`sensitive`&&(r=r.toLowerCase()),a.has(r)?!0:!o.has(r)&&(t.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...a,...o],input:t.value,inst:l,continue:!1}),{})}),reverseTransform:((e,t)=>e===!0?r[0]||`true`:i[0]||`false`),error:n.error});return l}function Wa(e,t,n,r={}){let i=z(r),a={...z(r),check:`string_format`,type:`string`,format:t,fn:typeof n==`function`?n:e=>n.test(e),...i};return n instanceof RegExp&&(a.pattern=n),new e(a)}function Ga(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??fi,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function Ka(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Ka(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&Ya(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function qa(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
63
|
-
|
|
64
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Ja(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Za(t,`input`,e.processors),output:Za(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Ya(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Ya(r.element,n);if(r.type===`set`)return Ya(r.valueType,n);if(r.type===`lazy`)return Ya(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return Ya(r.innerType,n);if(r.type===`intersection`)return Ya(r.left,n)||Ya(r.right,n);if(r.type===`record`||r.type===`map`)return Ya(r.keyType,n)||Ya(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Ya(r.in,n)||Ya(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Ya(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Ya(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Ya(e,n))return!0;return!!(r.rest&&Ya(r.rest,n))}return!1}var Xa=(e,t={})=>n=>{let r=Ga({...n,processors:t});return Ka(e,r),qa(r,e),Ja(r,e)},Za=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ga({...i??{},target:a,io:t,processors:n});return Ka(e,o),qa(o,e),Ja(o,e)},Qa={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},$a=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Qa[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},eo=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},to=(e,t,n,r)=>{n.type=`boolean`},no=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},ro=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},io=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},ao=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},oo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},so=(e,t,n,r)=>{n.not={}},co=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},lo=(e,t,n,r)=>{let i=e._zod.def,a=v(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},uo=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},fo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},po=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},mo=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},ho=(e,t,n,r)=>{n.type=`boolean`},go=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},_o=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},vo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},yo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},bo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},xo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Ka(a.element,t,{...r,path:[...r.path,`items`]})},So=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=Ka(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Ka(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Co=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Ka(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},wo=(e,t,n,r)=>{let i=e._zod.def,a=Ka(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Ka(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},To=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>Ka(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?Ka(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},Eo=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=Ka(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=Ka(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=Ka(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Do=(e,t,n,r)=>{let i=e._zod.def,a=Ka(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Oo=(e,t,n,r)=>{let i=e._zod.def;Ka(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ko=(e,t,n,r)=>{let i=e._zod.def;Ka(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Ao=(e,t,n,r)=>{let i=e._zod.def;Ka(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},jo=(e,t,n,r)=>{let i=e._zod.def;Ka(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Mo=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Ka(o,t,r);let s=t.seen.get(e);s.ref=o},No=(e,t,n,r)=>{let i=e._zod.def;Ka(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Po=(e,t,n,r)=>{let i=e._zod.def;Ka(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Fo=(e,t,n,r)=>{let i=e._zod.def;Ka(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Io=(e,t,n,r)=>{let i=e._zod.innerType;Ka(i,t,r);let a=t.seen.get(e);a.ref=i},Lo=s({endsWith:()=>Ea,gt:()=>ca,gte:()=>la,includes:()=>wa,length:()=>ba,lowercase:()=>Sa,lt:()=>oa,lte:()=>sa,maxLength:()=>va,maxSize:()=>ha,mime:()=>Oa,minLength:()=>ya,minSize:()=>ga,multipleOf:()=>ma,negative:()=>da,nonnegative:()=>pa,nonpositive:()=>fa,normalize:()=>Aa,overwrite:()=>ka,positive:()=>ua,property:()=>Da,regex:()=>xa,size:()=>_a,slugify:()=>Pa,startsWith:()=>Ta,toLowerCase:()=>Ma,toUpperCase:()=>Na,trim:()=>ja,uppercase:()=>Ca}),Ro=s({ZodISODate:()=>Vo,ZodISODateTime:()=>zo,ZodISODuration:()=>Go,ZodISOTime:()=>Uo,date:()=>Ho,datetime:()=>Bo,duration:()=>Ko,time:()=>Wo}),zo=p(`ZodISODateTime`,(e,t)=>{Nn.init(e,t),ps.init(e,t)});function Bo(e){return Li(zo,e)}var Vo=p(`ZodISODate`,(e,t)=>{Pn.init(e,t),ps.init(e,t)});function Ho(e){return Ri(Vo,e)}var Uo=p(`ZodISOTime`,(e,t)=>{Fn.init(e,t),ps.init(e,t)});function Wo(e){return zi(Uo,e)}var Go=p(`ZodISODuration`,(e,t)=>{In.init(e,t),ps.init(e,t)});function Ko(e){return Bi(Go,e)}var qo=p(`ZodError`,(e,t)=>{he.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>ve(e,t)},flatten:{value:t=>_e(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,y,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,y,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Jo=ye(qo),Yo=xe(qo),Xo=Ce(qo),Zo=Te(qo),Qo=De(qo),$o=Oe(qo),es=ke(qo),ts=Ae(qo),ns=je(qo),rs=Me(qo),is=Ne(qo),as=Pe(qo),os=s({ZodAny:()=>kc,ZodArray:()=>zc,ZodBase64:()=>Xs,ZodBase64URL:()=>Qs,ZodBigInt:()=>W,ZodBigIntFormat:()=>bc,ZodBoolean:()=>_c,ZodCIDRv4:()=>Ks,ZodCIDRv6:()=>Js,ZodCUID:()=>As,ZodCUID2:()=>Ms,ZodCatch:()=>Pl,ZodCodec:()=>Bl,ZodCustom:()=>eu,ZodCustomStringFormat:()=>ic,ZodDate:()=>Lc,ZodDefault:()=>El,ZodDiscriminatedUnion:()=>Xc,ZodE164:()=>ec,ZodEmail:()=>ms,ZodEmoji:()=>Es,ZodEnum:()=>ul,ZodExactOptional:()=>xl,ZodFile:()=>hl,ZodFunction:()=>Ql,ZodGUID:()=>gs,ZodIPv4:()=>Bs,ZodIPv6:()=>Ws,ZodIntersection:()=>Qc,ZodJWT:()=>nc,ZodKSUID:()=>Rs,ZodLazy:()=>Jl,ZodLiteral:()=>pl,ZodMAC:()=>Hs,ZodMap:()=>ol,ZodNaN:()=>Il,ZodNanoID:()=>Os,ZodNever:()=>Nc,ZodNonOptional:()=>Al,ZodNull:()=>Dc,ZodNullable:()=>Cl,ZodNumber:()=>lc,ZodNumberFormat:()=>dc,ZodObject:()=>Hc,ZodOptional:()=>yl,ZodPipe:()=>Rl,ZodPrefault:()=>Ol,ZodPreprocess:()=>Ul,ZodPromise:()=>Xl,ZodReadonly:()=>Wl,ZodRecord:()=>nl,ZodSet:()=>cl,ZodString:()=>ds,ZodStringFormat:()=>ps,ZodSuccess:()=>Ml,ZodSymbol:()=>Cc,ZodTemplateLiteral:()=>Kl,ZodTransform:()=>_l,ZodTuple:()=>el,ZodType:()=>ls,ZodULID:()=>Ps,ZodURL:()=>Cs,ZodUUID:()=>vs,ZodUndefined:()=>Tc,ZodUnion:()=>Kc,ZodUnknown:()=>jc,ZodVoid:()=>Fc,ZodXID:()=>Is,ZodXor:()=>Jc,_ZodString:()=>us,_default:()=>Dl,_function:()=>$l,any:()=>Ac,array:()=>Bc,base64:()=>Zs,base64url:()=>$s,bigint:()=>yc,boolean:()=>vc,catch:()=>Fl,check:()=>tu,cidrv4:()=>qs,cidrv6:()=>Ys,codec:()=>Vl,cuid:()=>js,cuid2:()=>Ns,custom:()=>nu,date:()=>Rc,describe:()=>au,discriminatedUnion:()=>Zc,e164:()=>tc,email:()=>hs,emoji:()=>Ds,enum:()=>dl,exactOptional:()=>Sl,file:()=>gl,float32:()=>pc,float64:()=>mc,function:()=>$l,guid:()=>_s,hash:()=>cc,hex:()=>sc,hostname:()=>oc,httpUrl:()=>Ts,instanceof:()=>su,int:()=>fc,int32:()=>hc,int64:()=>xc,intersection:()=>$c,invertCodec:()=>Hl,ipv4:()=>Vs,ipv6:()=>Gs,json:()=>lu,jwt:()=>rc,keyof:()=>Vc,ksuid:()=>zs,lazy:()=>Yl,literal:()=>ml,looseObject:()=>Gc,looseRecord:()=>al,mac:()=>Us,map:()=>sl,meta:()=>ou,nan:()=>Ll,nanoid:()=>ks,nativeEnum:()=>fl,never:()=>Pc,nonoptional:()=>jl,null:()=>Oc,nullable:()=>wl,nullish:()=>Tl,number:()=>uc,object:()=>Uc,optional:()=>bl,partialRecord:()=>il,pipe:()=>zl,prefault:()=>kl,preprocess:()=>uu,promise:()=>Zl,readonly:()=>Gl,record:()=>rl,refine:()=>ru,set:()=>ll,strictObject:()=>Wc,string:()=>fs,stringFormat:()=>ac,stringbool:()=>cu,success:()=>Nl,superRefine:()=>iu,symbol:()=>wc,templateLiteral:()=>ql,transform:()=>vl,tuple:()=>tl,uint32:()=>gc,uint64:()=>Sc,ulid:()=>Fs,undefined:()=>Ec,union:()=>qc,unknown:()=>Mc,url:()=>ws,uuid:()=>ys,uuidv4:()=>bs,uuidv6:()=>xs,uuidv7:()=>Ss,void:()=>Ic,xid:()=>Ls,xor:()=>Yc}),ss=new WeakMap;function cs(e,t,n){let r=Object.getPrototypeOf(e),i=ss.get(r);if(i||(i=new Set,ss.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var ls=p(`ZodType`,(e,t)=>(yn.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Za(e,`input`),output:Za(e,`output`)}}),e.toJSONSchema=Xa(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Jo(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Xo(e,t,n),e.parseAsync=async(t,n)=>Yo(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Zo(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Qo(e,t,n),e.decode=(t,n)=>$o(e,t,n),e.encodeAsync=async(t,n)=>es(e,t,n),e.decodeAsync=async(t,n)=>ts(e,t,n),e.safeEncode=(t,n)=>ns(e,t,n),e.safeDecode=(t,n)=>rs(e,t,n),e.safeEncodeAsync=async(t,n)=>is(e,t,n),e.safeDecodeAsync=async(t,n)=>as(e,t,n),cs(e,`ZodType`,{check(...e){let t=this.def;return this.clone(D(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return R(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(ru(e,t))},superRefine(e,t){return this.check(iu(e,t))},overwrite(e){return this.check(ka(e))},optional(){return bl(this)},exactOptional(){return Sl(this)},nullable(){return wl(this)},nullish(){return bl(wl(this))},nonoptional(e){return jl(this,e)},array(){return Bc(this)},or(e){return qc([this,e])},and(e){return $c(this,e)},transform(e){return zl(this,vl(e))},default(e){return Dl(this,e)},prefault(e){return kl(this,e)},catch(e){return Fl(this,e)},pipe(e){return zl(this,e)},readonly(){return Gl(this)},describe(e){let t=this.clone();return fi.add(t,{description:e}),t},meta(...e){if(e.length===0)return fi.get(this);let t=this.clone();return fi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return fi.get(e)?.description},configurable:!0}),e)),us=p(`_ZodString`,(e,t)=>{bn.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$a(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,cs(e,`_ZodString`,{regex(...e){return this.check(xa(...e))},includes(...e){return this.check(wa(...e))},startsWith(...e){return this.check(Ta(...e))},endsWith(...e){return this.check(Ea(...e))},min(...e){return this.check(ya(...e))},max(...e){return this.check(va(...e))},length(...e){return this.check(ba(...e))},nonempty(...e){return this.check(ya(1,...e))},lowercase(e){return this.check(Sa(e))},uppercase(e){return this.check(Ca(e))},trim(){return this.check(ja())},normalize(...e){return this.check(Aa(...e))},toLowerCase(){return this.check(Ma())},toUpperCase(){return this.check(Na())},slugify(){return this.check(Pa())}})}),ds=p(`ZodString`,(e,t)=>{bn.init(e,t),us.init(e,t),e.email=t=>e.check(mi(ms,t)),e.url=t=>e.check(bi(Cs,t)),e.jwt=t=>e.check(Ii(nc,t)),e.emoji=t=>e.check(xi(Es,t)),e.guid=t=>e.check(hi(gs,t)),e.uuid=t=>e.check(gi(vs,t)),e.uuidv4=t=>e.check(_i(vs,t)),e.uuidv6=t=>e.check(vi(vs,t)),e.uuidv7=t=>e.check(yi(vs,t)),e.nanoid=t=>e.check(Si(Os,t)),e.guid=t=>e.check(hi(gs,t)),e.cuid=t=>e.check(Ci(As,t)),e.cuid2=t=>e.check(wi(Ms,t)),e.ulid=t=>e.check(Ti(Ps,t)),e.base64=t=>e.check(Ni(Xs,t)),e.base64url=t=>e.check(Pi(Qs,t)),e.xid=t=>e.check(Ei(Is,t)),e.ksuid=t=>e.check(Di(Rs,t)),e.ipv4=t=>e.check(Oi(Bs,t)),e.ipv6=t=>e.check(ki(Ws,t)),e.cidrv4=t=>e.check(ji(Ks,t)),e.cidrv6=t=>e.check(Mi(Js,t)),e.e164=t=>e.check(Fi(ec,t)),e.datetime=t=>e.check(Bo(t)),e.date=t=>e.check(Ho(t)),e.time=t=>e.check(Wo(t)),e.duration=t=>e.check(Ko(t))});function fs(e){return pi(ds,e)}var ps=p(`ZodStringFormat`,(e,t)=>{xn.init(e,t),us.init(e,t)}),ms=p(`ZodEmail`,(e,t)=>{wn.init(e,t),ps.init(e,t)});function hs(e){return mi(ms,e)}var gs=p(`ZodGUID`,(e,t)=>{Sn.init(e,t),ps.init(e,t)});function _s(e){return hi(gs,e)}var vs=p(`ZodUUID`,(e,t)=>{Cn.init(e,t),ps.init(e,t)});function ys(e){return gi(vs,e)}function bs(e){return _i(vs,e)}function xs(e){return vi(vs,e)}function Ss(e){return yi(vs,e)}var Cs=p(`ZodURL`,(e,t)=>{Tn.init(e,t),ps.init(e,t)});function ws(e){return bi(Cs,e)}function Ts(e){return bi(Cs,{protocol:ft,hostname:dt,...z(e)})}var Es=p(`ZodEmoji`,(e,t)=>{En.init(e,t),ps.init(e,t)});function Ds(e){return xi(Es,e)}var Os=p(`ZodNanoID`,(e,t)=>{Dn.init(e,t),ps.init(e,t)});function ks(e){return Si(Os,e)}var As=p(`ZodCUID`,(e,t)=>{On.init(e,t),ps.init(e,t)});function js(e){return Ci(As,e)}var Ms=p(`ZodCUID2`,(e,t)=>{kn.init(e,t),ps.init(e,t)});function Ns(e){return wi(Ms,e)}var Ps=p(`ZodULID`,(e,t)=>{An.init(e,t),ps.init(e,t)});function Fs(e){return Ti(Ps,e)}var Is=p(`ZodXID`,(e,t)=>{jn.init(e,t),ps.init(e,t)});function Ls(e){return Ei(Is,e)}var Rs=p(`ZodKSUID`,(e,t)=>{Mn.init(e,t),ps.init(e,t)});function zs(e){return Di(Rs,e)}var Bs=p(`ZodIPv4`,(e,t)=>{Ln.init(e,t),ps.init(e,t)});function Vs(e){return Oi(Bs,e)}var Hs=p(`ZodMAC`,(e,t)=>{zn.init(e,t),ps.init(e,t)});function Us(e){return Ai(Hs,e)}var Ws=p(`ZodIPv6`,(e,t)=>{Rn.init(e,t),ps.init(e,t)});function Gs(e){return ki(Ws,e)}var Ks=p(`ZodCIDRv4`,(e,t)=>{Bn.init(e,t),ps.init(e,t)});function qs(e){return ji(Ks,e)}var Js=p(`ZodCIDRv6`,(e,t)=>{Vn.init(e,t),ps.init(e,t)});function Ys(e){return Mi(Js,e)}var Xs=p(`ZodBase64`,(e,t)=>{Un.init(e,t),ps.init(e,t)});function Zs(e){return Ni(Xs,e)}var Qs=p(`ZodBase64URL`,(e,t)=>{Gn.init(e,t),ps.init(e,t)});function $s(e){return Pi(Qs,e)}var ec=p(`ZodE164`,(e,t)=>{Kn.init(e,t),ps.init(e,t)});function tc(e){return Fi(ec,e)}var nc=p(`ZodJWT`,(e,t)=>{Jn.init(e,t),ps.init(e,t)});function rc(e){return Ii(nc,e)}var ic=p(`ZodCustomStringFormat`,(e,t)=>{Yn.init(e,t),ps.init(e,t)});function ac(e,t,n={}){return Wa(ic,e,t,n)}function oc(e){return Wa(ic,`hostname`,ut,e)}function sc(e){return Wa(ic,`hex`,Ot,e)}function cc(e,t){let n=`${e}_${t?.enc??`hex`}`,r=Fe[n];if(!r)throw Error(`Unrecognized hash format: ${n}`);return Wa(ic,n,r,t)}var lc=p(`ZodNumber`,(e,t)=>{Xn.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eo(e,t,n,r),cs(e,`ZodNumber`,{gt(e,t){return this.check(ca(e,t))},gte(e,t){return this.check(la(e,t))},min(e,t){return this.check(la(e,t))},lt(e,t){return this.check(oa(e,t))},lte(e,t){return this.check(sa(e,t))},max(e,t){return this.check(sa(e,t))},int(e){return this.check(fc(e))},safe(e){return this.check(fc(e))},positive(e){return this.check(ca(0,e))},nonnegative(e){return this.check(la(0,e))},negative(e){return this.check(oa(0,e))},nonpositive(e){return this.check(sa(0,e))},multipleOf(e,t){return this.check(ma(e,t))},step(e,t){return this.check(ma(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function uc(e){return Vi(lc,e)}var dc=p(`ZodNumberFormat`,(e,t)=>{Zn.init(e,t),lc.init(e,t)});function fc(e){return Hi(dc,e)}function pc(e){return Ui(dc,e)}function mc(e){return Wi(dc,e)}function hc(e){return Gi(dc,e)}function gc(e){return Ki(dc,e)}var _c=p(`ZodBoolean`,(e,t)=>{Qn.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r)});function vc(e){return qi(_c,e)}var W=p(`ZodBigInt`,(e,t)=>{$n.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r),e.gte=(t,n)=>e.check(la(t,n)),e.min=(t,n)=>e.check(la(t,n)),e.gt=(t,n)=>e.check(ca(t,n)),e.gte=(t,n)=>e.check(la(t,n)),e.min=(t,n)=>e.check(la(t,n)),e.lt=(t,n)=>e.check(oa(t,n)),e.lte=(t,n)=>e.check(sa(t,n)),e.max=(t,n)=>e.check(sa(t,n)),e.positive=t=>e.check(ca(BigInt(0),t)),e.negative=t=>e.check(oa(BigInt(0),t)),e.nonpositive=t=>e.check(sa(BigInt(0),t)),e.nonnegative=t=>e.check(la(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(ma(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function yc(e){return Ji(W,e)}var bc=p(`ZodBigIntFormat`,(e,t)=>{er.init(e,t),W.init(e,t)});function xc(e){return Yi(bc,e)}function Sc(e){return Xi(bc,e)}var Cc=p(`ZodSymbol`,(e,t)=>{tr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(e,t,n,r)});function wc(e){return Zi(Cc,e)}var Tc=p(`ZodUndefined`,(e,t)=>{nr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ao(e,t,n,r)});function Ec(e){return Qi(Tc,e)}var Dc=p(`ZodNull`,(e,t)=>{rr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>io(e,t,n,r)});function Oc(e){return $i(Dc,e)}var kc=p(`ZodAny`,(e,t)=>{ir.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ac(){return ea(kc)}var jc=p(`ZodUnknown`,(e,t)=>{ar.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Mc(){return ta(jc)}var Nc=p(`ZodNever`,(e,t)=>{or.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r)});function Pc(e){return na(Nc,e)}var Fc=p(`ZodVoid`,(e,t)=>{sr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r)});function Ic(e){return ra(Fc,e)}var Lc=p(`ZodDate`,(e,t)=>{cr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r),e.min=(t,n)=>e.check(la(t,n)),e.max=(t,n)=>e.check(sa(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function Rc(e){return ia(Lc,e)}var zc=p(`ZodArray`,(e,t)=>{ur.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xo(e,t,n,r),e.element=t.element,cs(e,`ZodArray`,{min(e,t){return this.check(ya(e,t))},nonempty(e){return this.check(ya(1,e))},max(e,t){return this.check(va(e,t))},length(e,t){return this.check(ba(e,t))},unwrap(){return this.element}})});function Bc(e,t){return Fa(zc,e,t)}function Vc(e){let t=e._zod.def.shape;return dl(Object.keys(t))}var Hc=p(`ZodObject`,(e,t)=>{hr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>So(e,t,n,r),T(e,`shape`,()=>t.shape),cs(e,`ZodObject`,{keyof(){return dl(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Mc()})},loose(){return this.clone({...this._zod.def,catchall:Mc()})},strict(){return this.clone({...this._zod.def,catchall:Pc()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return V(this,e)},safeExtend(e){return ie(this,e)},merge(e){return ae(this,e)},pick(e){return ne(this,e)},omit(e){return re(this,e)},partial(...e){return oe(yl,this,e[0])},required(...e){return H(Al,this,e[0])}})});function Uc(e,t){return new Hc({type:`object`,shape:e??{},...z(t)})}function Wc(e,t){return new Hc({type:`object`,shape:e,catchall:Pc(),...z(t)})}function Gc(e,t){return new Hc({type:`object`,shape:e,catchall:Mc(),...z(t)})}var Kc=p(`ZodUnion`,(e,t)=>{_r.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Co(e,t,n,r),e.options=t.options});function qc(e,t){return new Kc({type:`union`,options:e,...z(t)})}var Jc=p(`ZodXor`,(e,t)=>{Kc.init(e,t),yr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Co(e,t,n,r),e.options=t.options});function Yc(e,t){return new Jc({type:`union`,options:e,inclusive:!1,...z(t)})}var Xc=p(`ZodDiscriminatedUnion`,(e,t)=>{Kc.init(e,t),br.init(e,t)});function Zc(e,t,n){return new Xc({type:`union`,options:t,discriminator:e,...z(n)})}var Qc=p(`ZodIntersection`,(e,t)=>{xr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wo(e,t,n,r)});function $c(e,t){return new Qc({type:`intersection`,left:e,right:t})}var el=p(`ZodTuple`,(e,t)=>{wr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>To(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function tl(e,t,n){let r=t instanceof yn;return new el({type:`tuple`,items:e,rest:r?t:null,...z(r?n:t)})}var nl=p(`ZodRecord`,(e,t)=>{Or.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eo(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function rl(e,t,n){return!t||!t._zod?new nl({type:`record`,keyType:fs(),valueType:e,...z(t)}):new nl({type:`record`,keyType:e,valueType:t,...z(n)})}function il(e,t,n){let r=R(e);return r._zod.values=void 0,new nl({type:`record`,keyType:r,valueType:t,...z(n)})}function al(e,t,n){return new nl({type:`record`,keyType:e,valueType:t,mode:`loose`,...z(n)})}var ol=p(`ZodMap`,(e,t)=>{kr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(ga(...t)),e.nonempty=t=>e.check(ga(1,t)),e.max=(...t)=>e.check(ha(...t)),e.size=(...t)=>e.check(_a(...t))});function sl(e,t,n){return new ol({type:`map`,keyType:e,valueType:t,...z(n)})}var cl=p(`ZodSet`,(e,t)=>{jr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bo(e,t,n,r),e.min=(...t)=>e.check(ga(...t)),e.nonempty=t=>e.check(ga(1,t)),e.max=(...t)=>e.check(ha(...t)),e.size=(...t)=>e.check(_a(...t))});function ll(e,t){return new cl({type:`set`,valueType:e,...z(t)})}var ul=p(`ZodEnum`,(e,t)=>{Nr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new ul({...t,checks:[],...z(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new ul({...t,checks:[],...z(r),entries:i})}});function dl(e,t){return new ul({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...z(t)})}function fl(e,t){return new ul({type:`enum`,entries:e,...z(t)})}var pl=p(`ZodLiteral`,(e,t)=>{Pr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ml(e,t){return new pl({type:`literal`,values:Array.isArray(e)?e:[e],...z(t)})}var hl=p(`ZodFile`,(e,t)=>{Fr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r),e.min=(t,n)=>e.check(ga(t,n)),e.max=(t,n)=>e.check(ha(t,n)),e.mime=(t,n)=>e.check(Oa(Array.isArray(t)?t:[t],n))});function gl(e){return Ia(hl,e)}var _l=p(`ZodTransform`,(e,t)=>{Ir.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new h(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(pe(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(pe(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function vl(e){return new _l({type:`transform`,transform:e})}var yl=p(`ZodOptional`,(e,t)=>{Rr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bl(e){return new yl({type:`optional`,innerType:e})}var xl=p(`ZodExactOptional`,(e,t)=>{zr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Sl(e){return new xl({type:`optional`,innerType:e})}var Cl=p(`ZodNullable`,(e,t)=>{Br.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Do(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wl(e){return new Cl({type:`nullable`,innerType:e})}function Tl(e){return bl(wl(e))}var El=p(`ZodDefault`,(e,t)=>{Vr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Dl(e,t){return new El({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():P(t)}})}var Ol=p(`ZodPrefault`,(e,t)=>{Ur.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kl(e,t){return new Ol({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():P(t)}})}var Al=p(`ZodNonOptional`,(e,t)=>{Wr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function jl(e,t){return new Al({type:`nonoptional`,innerType:e,...z(t)})}var Ml=p(`ZodSuccess`,(e,t)=>{Kr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ho(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Nl(e){return new Ml({type:`success`,innerType:e})}var Pl=p(`ZodCatch`,(e,t)=>{qr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Fl(e,t){return new Pl({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Il=p(`ZodNaN`,(e,t)=>{Jr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r)});function Ll(e){return aa(Il,e)}var Rl=p(`ZodPipe`,(e,t)=>{Yr.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mo(e,t,n,r),e.in=t.in,e.out=t.out});function zl(e,t){return new Rl({type:`pipe`,in:e,out:t})}var Bl=p(`ZodCodec`,(e,t)=>{Rl.init(e,t),Zr.init(e,t)});function Vl(e,t,n){return new Bl({type:`pipe`,in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function Hl(e){let t=e._zod.def;return new Bl({type:`pipe`,in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var Ul=p(`ZodPreprocess`,(e,t)=>{Rl.init(e,t),ei.init(e,t)}),Wl=p(`ZodReadonly`,(e,t)=>{ti.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>No(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Gl(e){return new Wl({type:`readonly`,innerType:e})}var Kl=p(`ZodTemplateLiteral`,(e,t)=>{ri.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r)});function ql(e,t){return new Kl({type:`template_literal`,parts:e,...z(t)})}var Jl=p(`ZodLazy`,(e,t)=>{oi.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Io(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Yl(e){return new Jl({type:`lazy`,getter:e})}var Xl=p(`ZodPromise`,(e,t)=>{ai.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Zl(e){return new Xl({type:`promise`,innerType:e})}var Ql=p(`ZodFunction`,(e,t)=>{ii.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_o(e,t,n,r)});function $l(e){return new Ql({type:`function`,input:Array.isArray(e?.input)?tl(e?.input):e?.input??Bc(Mc()),output:e?.output??Mc()})}var eu=p(`ZodCustom`,(e,t)=>{si.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(t,n,r)=>go(e,t,n,r)});function tu(e){let t=new Kt({check:`custom`});return t._zod.check=e,t}function nu(e,t){return La(eu,e??(()=>!0),t)}function ru(e,t={}){return Ra(eu,e,t)}function iu(e,t){return za(e,t)}var au=Va,ou=Ha;function su(e,t={}){let n=new eu({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...z(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}var cu=(...e)=>Ua({Codec:Bl,Boolean:_c,String:ds},...e);function lu(e){let t=Yl(()=>qc([fs(e),uc(),vc(),Oc(),Bc(t),rl(fs(),t)]));return t}function uu(e,t){return new Ul({type:`pipe`,in:vl(e),out:t})}var G={...os,...Lo,iso:Ro},du=new Set(`$schema.$ref.$defs.definitions.$id.id.$comment.$anchor.$vocabulary.$dynamicRef.$dynamicAnchor.type.enum.const.anyOf.oneOf.allOf.not.properties.required.additionalProperties.patternProperties.propertyNames.minProperties.maxProperties.items.prefixItems.additionalItems.minItems.maxItems.uniqueItems.contains.minContains.maxContains.minLength.maxLength.pattern.format.minimum.maximum.exclusiveMinimum.exclusiveMaximum.multipleOf.description.default.contentEncoding.contentMediaType.contentSchema.unevaluatedItems.unevaluatedProperties.if.then.else.dependentSchemas.dependentRequired.nullable.readOnly`.split(`.`));function fu(e,t){let n=e.$schema;return n===`https://json-schema.org/draft/2020-12/schema`?`draft-2020-12`:n===`http://json-schema.org/draft-07/schema#`?`draft-7`:n===`http://json-schema.org/draft-04/schema#`?`draft-4`:t??`draft-2020-12`}function pu(e,t){if(!e.startsWith(`#`))throw Error(`External $ref is not supported, only local refs (#/...) are allowed`);let n=e.slice(1).split(`/`).filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version===`draft-2020-12`?`$defs`:`definitions`;if(n[0]===r){let r=n[1];if(!r||!t.defs[r])throw Error(`Reference not found: ${e}`);return t.defs[r]}throw Error(`Reference not found: ${e}`)}function mu(e,t){if(e.not!==void 0){if(typeof e.not==`object`&&Object.keys(e.not).length===0)return G.never();throw Error(`not is not supported in Zod (except { not: {} } for never)`)}if(e.unevaluatedItems!==void 0)throw Error(`unevaluatedItems is not supported`);if(e.unevaluatedProperties!==void 0)throw Error(`unevaluatedProperties is not supported`);if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error(`Conditional schemas (if/then/else) are not supported`);if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error(`dependentSchemas and dependentRequired are not supported`);if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return G.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let r=hu(pu(n,t),t);return t.refs.set(n,r),t.processing.delete(n),r}if(e.enum!==void 0){let n=e.enum;if(t.version===`openapi-3.0`&&e.nullable===!0&&n.length===1&&n[0]===null)return G.null();if(n.length===0)return G.never();if(n.length===1)return G.literal(n[0]);if(n.every(e=>typeof e==`string`))return G.enum(n);let r=n.map(e=>G.literal(e));return r.length<2?r[0]:G.union([r[0],r[1],...r.slice(2)])}if(e.const!==void 0)return G.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(n=>mu({...e,type:n},t));return r.length===0?G.never():r.length===1?r[0]:G.union(r)}if(!n)return G.any();let r;switch(n){case`string`:{let t=G.string();if(e.format){let n=e.format;n===`email`?t=t.check(G.email()):n===`uri`||n===`uri-reference`?t=t.check(G.url()):n===`uuid`||n===`guid`?t=t.check(G.uuid()):n===`date-time`?t=t.check(G.iso.datetime()):n===`date`?t=t.check(G.iso.date()):n===`time`?t=t.check(G.iso.time()):n===`duration`?t=t.check(G.iso.duration()):n===`ipv4`?t=t.check(G.ipv4()):n===`ipv6`?t=t.check(G.ipv6()):n===`mac`?t=t.check(G.mac()):n===`cidr`?t=t.check(G.cidrv4()):n===`cidr-v6`?t=t.check(G.cidrv6()):n===`base64`?t=t.check(G.base64()):n===`base64url`?t=t.check(G.base64url()):n===`e164`?t=t.check(G.e164()):n===`jwt`?t=t.check(G.jwt()):n===`emoji`?t=t.check(G.emoji()):n===`nanoid`?t=t.check(G.nanoid()):n===`cuid`?t=t.check(G.cuid()):n===`cuid2`?t=t.check(G.cuid2()):n===`ulid`?t=t.check(G.ulid()):n===`xid`?t=t.check(G.xid()):n===`ksuid`&&(t=t.check(G.ksuid()))}typeof e.minLength==`number`&&(t=t.min(e.minLength)),typeof e.maxLength==`number`&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),r=t;break}case`number`:case`integer`:{let t=n===`integer`?G.number().int():G.number();typeof e.minimum==`number`&&(t=t.min(e.minimum)),typeof e.maximum==`number`&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum==`number`?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum==`number`&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum==`number`?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum==`number`&&(t=t.lt(e.maximum)),typeof e.multipleOf==`number`&&(t=t.multipleOf(e.multipleOf)),r=t;break}case`boolean`:r=G.boolean();break;case`null`:r=G.null();break;case`object`:{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[e,r]of Object.entries(i)){let i=hu(r,t);n[e]=a.has(e)?i:i.optional()}if(e.propertyNames){let i=hu(e.propertyNames,t),a=e.additionalProperties&&typeof e.additionalProperties==`object`?hu(e.additionalProperties,t):G.any();if(Object.keys(n).length===0){r=G.record(i,a);break}let o=G.object(n).passthrough(),s=G.looseRecord(i,a);r=G.intersection(o,s);break}if(e.patternProperties){let i=e.patternProperties,a=Object.keys(i),o=[];for(let e of a){let n=hu(i[e],t),r=G.string().regex(new RegExp(e));o.push(G.looseRecord(r,n))}let s=[];if(Object.keys(n).length>0&&s.push(G.object(n).passthrough()),s.push(...o),s.length===0)r=G.object({}).passthrough();else if(s.length===1)r=s[0];else{let e=G.intersection(s[0],s[1]);for(let t=2;t<s.length;t++)e=G.intersection(e,s[t]);r=e}break}let o=G.object(n);r=e.additionalProperties===!1?o.strict():typeof e.additionalProperties==`object`?o.catchall(hu(e.additionalProperties,t)):o.passthrough();break}case`array`:{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(e=>hu(e,t)),o=i&&typeof i==`object`&&!Array.isArray(i)?hu(i,t):void 0;r=o?G.tuple(a).rest(o):G.tuple(a),typeof e.minItems==`number`&&(r=r.check(G.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(G.maxLength(e.maxItems)))}else if(Array.isArray(i)){let n=i.map(e=>hu(e,t)),a=e.additionalItems&&typeof e.additionalItems==`object`?hu(e.additionalItems,t):void 0;r=a?G.tuple(n).rest(a):G.tuple(n),typeof e.minItems==`number`&&(r=r.check(G.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(G.maxLength(e.maxItems)))}else if(i!==void 0){let n=hu(i,t),a=G.array(n);typeof e.minItems==`number`&&(a=a.min(e.minItems)),typeof e.maxItems==`number`&&(a=a.max(e.maxItems)),r=a}else r=G.array(G.any());break}default:throw Error(`Unsupported type: ${n}`)}return r}function hu(e,t){if(typeof e==`boolean`)return e?G.any():G.never();let n=mu(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let i=e.anyOf.map(e=>hu(e,t)),a=G.union(i);n=r?G.intersection(n,a):a}if(e.oneOf&&Array.isArray(e.oneOf)){let i=e.oneOf.map(e=>hu(e,t)),a=G.xor(i);n=r?G.intersection(n,a):a}if(e.allOf&&Array.isArray(e.allOf)){if(e.allOf.length===0)n=r?n:G.any();else{let i=r?n:hu(e.allOf[0],t),a=+!r;for(let n=a;n<e.allOf.length;n++)i=G.intersection(i,hu(e.allOf[n],t));n=i}}e.nullable===!0&&t.version===`openapi-3.0`&&(n=G.nullable(n)),e.readOnly===!0&&(n=G.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let i={};for(let t of[`$id`,`id`,`$comment`,`$anchor`,`$vocabulary`,`$dynamicRef`,`$dynamicAnchor`])t in e&&(i[t]=e[t]);for(let t of[`contentEncoding`,`contentMediaType`,`contentSchema`])t in e&&(i[t]=e[t]);for(let t of Object.keys(e))du.has(t)||(i[t]=e[t]);return Object.keys(i).length>0&&t.registry.add(n,i),e.description&&(n=n.describe(e.description)),n}function gu(e,t){if(typeof e==`boolean`)return e?G.any():G.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw Error(`fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas`)}let r={version:fu(n,t?.defaultTarget),defs:n.$defs||n.definitions||{},refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??fi};return hu(n,r)}var K=l(d(),1),_u=lu(),vu=Yl(()=>Zc(`status`,[Uc({status:ml(`available`)}).strict(),Uc({status:ml(`unavailable`),reason:fs()}).strict()])),yu=_u,bu=Yl(()=>rl(fs(),yu)),xu=e=>yu.parse(e),Su=Yl(()=>Uc({code:fs().min(1).max(160),message:fs().min(1).max(512),details:yu.optional()}).strict()),Cu=e=>Su.parse(e),wu=bu,Tu=Yl(()=>fs().refine(e=>e.trim().length>0)),Eu=vu,Du=Yl(()=>qc([Uc({type:ml(`action`)}).strict(),Uc({type:ml(`custom`),data:bu}).strict(),Uc({type:ml(`choice`),options:Bc(Uc({value:yu,label:Tu,description:Tu.optional()}))}).strict(),Uc({type:ml(`form`),submitLabel:Tu.optional()}).strict(),Uc({type:ml(`confirmation`),message:Tu,confirmLabel:Tu.optional(),cancelLabel:Tu.optional()}).strict()])),Ou=Yl(()=>Uc({inputSchema:wu.optional(),outputSchema:wu.optional(),presentation:Du.optional()}).strict()),ku=Yl(()=>uc().int().refine(e=>Number.isSafeInteger(e))),Au=Yl(()=>Uc({hint:Tu.pipe(fs().max(120)),words:Bc(Uc({word:fs().regex(/^\S{1,64}$/u),description:Tu.pipe(fs().max(512)).optional(),arguments:bu}).strict()).max(32).optional(),text:Uc({field:Tu.pipe(fs().max(120)),arguments:bu,requestIdField:Tu.pipe(fs().max(120)).optional()}).strict().optional()}).strict().refine(e=>e.words!==void 0||e.text!==void 0,`slash arguments need words or text`)),ju=Yl(()=>Uc({order:ku.optional()}).strict()),eee=Yl(()=>Uc({bindings:Uc({order:ku.optional(),values:Bc(Tu).max(16)}).strict().optional(),agent:Uc({keybind:Tu.optional(),order:ku.optional()}).strict().optional(),help:ju.optional(),menu:ju.optional(),palette:ju.optional(),slash:Uc({aliases:Bc(Tu).max(16),consumesDraft:vc().optional(),order:ku.optional(),arguments:Au.optional()}).strict().optional()}).strict()),tee=Yl(()=>Uc({id:Tu.refine(e=>!e.includes(`:`)),title:Tu,category:Tu,description:Tu.optional(),projections:eee.optional(),action:Ou.optional(),availability:Eu.optional()}).strict()),nee=e=>tee.parse(e),ree=Yl(()=>Uc({inputSchema:wu.optional(),outputSchema:wu.optional()}).strict()),Mu=fs().min(1).brand();Yl(()=>Uc({commandId:Mu,command:Uc({namespace:fs(),id:fs()}).strict(),sourceId:fs(),scope:fs().optional(),title:fs(),category:fs(),description:fs().optional(),order:uc(),availability:vu,action:ree.optional(),keybind:fs().optional()}).strict());var Nu=8192,Pu=Tu.pipe(fs().max(Nu)),Fu=Tu.pipe(fs().max(60)),Iu=ws({protocol:/^https?$/u}),Lu=Uc({label:Pu,value:Pu}).strict(),Ru={summary:Pu.optional(),facts:Bc(Lu).max(4).optional(),body:Pu.optional(),bodyLabel:Pu.optional(),details:Bc(Lu).max(24).optional()};Zc(`type`,[Uc({type:ml(`choice`),message:Fu,...Ru,current:Pu.optional(),collapsedGroup:Pu.optional(),options:Bc(Uc({value:Pu,label:Pu,description:Pu.optional(),group:Pu.optional(),destructive:ml(!0).optional()}).strict()).min(1).max(256)}).strict(),Uc({type:ml(`text`),message:Fu,...Ru,placeholder:Pu.optional(),secret:vc().optional()}).strict(),Uc({type:ml(`confirmation`),message:Fu,...Ru,confirmLabel:Pu.optional(),cancelLabel:Pu.optional(),destructive:ml(!0).optional()}).strict(),Uc({type:ml(`decision`),message:Fu,...Ru,options:Bc(Uc({value:Pu,label:Pu,description:Pu.optional(),destructive:ml(!0).optional()}).strict()).min(1).max(8).refine(e=>new Set(e.map(e=>e.value)).size===e.length,`Decision option values must be unique`),multiple:vc().optional(),other:Uc({label:Pu,placeholder:Pu.optional(),maxLength:uc().int().min(1).max(Nu),blank:Pu.optional()}).strict().optional(),escape:Pu.optional()}).strict().refine(e=>[e.escape,e.other?.blank].every(t=>t===void 0||e.options.some(e=>e.value===t)),`A decision's escape and blank answers must be offered options`)]),Yl(()=>Zc(`type`,[Uc({type:ml(`info`),message:Pu,links:Bc(Uc({url:Iu,label:Pu.optional()}).strict()).max(16).optional()}).strict(),Uc({type:ml(`progress`),message:Pu}).strict(),Uc({type:ml(`handoff`),url:Iu,code:Pu.optional(),message:Pu.optional()}).strict(),Uc({type:ml(`success`),message:Pu}).strict()]));var zu=class extends Error{code;details;constructor(e,t,n){super(t),this.code=e,this.details=n,this.name=`WhistleActionError`}},iee=class extends Error{constructor(){super(`Whistle runtime is closed`),this.name=`WhistleClosedError`}};function Bu(){let e=!1,t=yd,n=[],r=[],i=!1,a=[],o=new Set,s=()=>{for(let e of o)e()};return Object.freeze({close:()=>{e||(e=!0,n=[],a=[],r=[],t=yd,s(),o.clear())},contribute:t=>{if(Yu(t),e)throw new iee;Xu(t,n),Zu(t,n);let r=Symbol(`whistle-contribution`);Ju(t)||(n=[...n,{contribution:Qu(t),generation:r}],i=!0,s());let a=!0;return _d(o=>{if(!a||e)return;let c={...t,commands:o};Yu(c);let l=n.findIndex(e=>e.generation===r),u=n.filter(e=>e.generation!==r);Xu(c,u),Zu(c,u);let d=Qu(c);if(Ju(c)){if(l<0)return;n=u}else n=l<0?[...n,{contribution:d,generation:r}]:n.map(e=>e.generation===r?{contribution:d,generation:r}:e);i=!0,s()},()=>{a&&(a=!1,n.find(e=>e.generation===r)!==void 0&&(n=n.filter(e=>e.generation!==r),i=!0,s()))})},execute:async(t,r)=>{if(t.namespace.trim().length===0||t.id.trim().length===0)return{status:`invalid`};if(e)return{status:`closed`};let i=qu(t,n);if(i===void 0)return{status:`missing`};let o;try{let e=xd(i);if(e.status===`unavailable`)return e;let n=a.at(-1)?.presenter;r.interaction===void 0&&n!==void 0&&Vu.has(r.origin)&&(o=n({commandId:Ku(t.namespace,t.id),title:i.title}));let s={...r,signal:r.signal??new AbortController().signal};o!==void 0&&(s.interaction=o.interaction,s.signal=AbortSignal.any([s.signal,o.interaction.signal]));let c=await i.handler(s);return o?.settle({status:`handled`}),c===void 0?{status:`handled`}:{status:`handled`,result:c}}catch(e){let t=Cd(e instanceof Error?e:Error(`Command handler threw a non-Error value`));return o?.settle(o.interaction.signal.aborted?{status:`cancelled`}:{status:`failed`,message:t.message}),{status:`failed`,error:t}}},present:t=>{let n={presenter:t};return e||(a=[...a,n]),()=>{a=a.filter(e=>e!==n)}},snapshot:()=>{if(e)return yd;let a=n.flatMap(e=>e.contribution.commands.map(xd));return(i||a.some((e,t)=>!Sd(e,r[t])))&&(t=wd(n,a),r=a,i=!1),t},subscribe:t=>e?()=>void 0:(o.add(t),()=>{o.delete(t)})})}var Vu=new Set([`browser`,`keyboard`,`menu`,`palette`,`slash`,`terminal`]),Hu=16,Uu=32,Wu=64,Gu=256;function Ku(e,t){return Mu.parse(`${e}:${t}`)}function qu(e,t){for(let n of t)if(n.contribution.namespace===e.namespace){for(let t of n.contribution.commands)if(t.id===e.id)return t}}function Ju(e){return e.commands.length===0}function Yu(e){hd(e.sourceId,`source ID`),hd(e.namespace,`namespace`),e.scope!==void 0&&hd(e.scope,`scope`);for(let t of e.commands)ud(t)}function Xu(e,t){t.find(t=>t.contribution.namespace===e.namespace&&t.contribution.sourceId!==e.sourceId)!==void 0&&vd(`Namespace is already owned by another source`);let n=new Set,r=new Set;for(let i of t){let t=i.contribution.scope===e.scope;for(let e of i.contribution.commands)if(n.add(Ku(i.contribution.namespace,e.id)),t)for(let t of e.projections?.slash?.aliases??[])r.add(t)}for(let t of e.commands){let i=Ku(e.namespace,t.id);n.has(i)&&vd(`Canonical command ID is already registered`),n.add(i);for(let e of t.projections?.slash?.aliases??[])r.has(e)&&vd(`Slash alias is already registered`),r.add(e)}}function Zu(e,t){t.length>=Wu&&vd(`Live contribution capacity exceeded`),t.reduce((e,t)=>e+t.contribution.commands.length,0)+e.commands.length>Gu&&vd(`Live command capacity exceeded`)}function Qu(e){let t={sourceId:e.sourceId,namespace:e.namespace,commands:e.commands.map($u)};return e.scope===void 0?t:{...t,scope:e.scope}}function $u(e){let t={id:e.id,title:e.title,category:e.category,handler:e.handler};return e.description!==void 0&&(t.description=e.description),e.action!==void 0&&(t.action=ed(e.action)),e.availability!==void 0&&(t.availability=e.availability),e.projections!==void 0&&(t.projections=id(e.projections)),t}function ed(e){let t={};return e.inputSchema!==void 0&&(t.inputSchema=td(e.inputSchema)),e.outputSchema!==void 0&&(t.outputSchema=td(e.outputSchema)),e.presentation!==void 0&&(t.presentation=rd(e.presentation)),Object.freeze(t)}function td(e){return Object.freeze(Object.fromEntries(Object.entries(e).map(([e,t])=>[e,nd(t)])))}function nd(e){return Array.isArray(e)?Object.freeze(e.map(nd)):e!==null&&e instanceof Object?Object.freeze(Object.fromEntries(Object.entries(e).map(([e,t])=>[e,nd(t)]))):e}function rd(e){switch(e.type){case`action`:return Object.freeze({type:`action`});case`custom`:return Object.freeze({type:`custom`,data:td(e.data)});case`choice`:return Object.freeze({type:`choice`,options:Object.freeze(e.options.map(e=>Object.freeze({...e,value:nd(e.value)})))});case`form`:return Object.freeze({...e});case`confirmation`:return Object.freeze({...e})}}function id(e){let t={};return e.bindings!==void 0&&(t.bindings=ad(e.bindings)),e.agent!==void 0&&(t.agent=od(e.agent)),e.help!==void 0&&(t.help=sd(e.help.order)),e.menu!==void 0&&(t.menu=sd(e.menu.order)),e.palette!==void 0&&(t.palette=sd(e.palette.order)),e.slash!==void 0&&(t.slash=cd(e.slash)),t}function ad(e){let t={values:[...e.values]};return e.order!==void 0&&(t.order=e.order),t}function od(e){let t={};return e.keybind!==void 0&&(t.keybind=e.keybind),e.order!==void 0&&(t.order=e.order),t}function sd(e){let t={};return e!==void 0&&(t.order=e),t}function cd(e){let t={aliases:[...e.aliases]};return e.order!==void 0&&(t.order=e.order),e.consumesDraft!==void 0&&(t.consumesDraft=e.consumesDraft),e.arguments!==void 0&&(t.arguments=ld(e.arguments)),t}function ld(e){let t={hint:e.hint};return e.words!==void 0&&(t.words=Object.freeze(e.words.map(e=>Object.freeze({...e,arguments:td(e.arguments)})))),e.text!==void 0&&(t.text=Object.freeze({...e.text,arguments:td(e.text.arguments)})),Object.freeze(t)}function ud(e){hd(e.id,`command ID`,!0),hd(e.title,`title`),hd(e.category,`category`),dd(e.action),fd(e.projections)}function dd(e){if(e?.presentation!==void 0)switch(e.presentation.type){case`action`:case`custom`:return;case`choice`:for(let t of e.presentation.options)hd(t.label,`choice label`),t.description!==void 0&&hd(t.description,`choice description`);return;case`form`:e.presentation.submitLabel!==void 0&&hd(e.presentation.submitLabel,`submit label`);return;case`confirmation`:hd(e.presentation.message,`confirmation message`),e.presentation.confirmLabel!==void 0&&hd(e.presentation.confirmLabel,`confirmation label`),e.presentation.cancelLabel!==void 0&&hd(e.presentation.cancelLabel,`cancellation label`)}}function fd(e){if(e!==void 0){for(let t of[e.bindings,e.palette,e.slash,e.help,e.menu,e.agent])t!==void 0&&gd(t.order);if(e.bindings!==void 0&&md(e.bindings.values,`binding`),e.slash!==void 0){md(e.slash.aliases,`slash alias`);for(let t of e.slash.aliases)/\s/u.test(t)&&vd(`slash alias must not contain whitespace`);pd(e.slash.arguments)}e.agent?.keybind!==void 0&&hd(e.agent.keybind,`agent keybind`)}}function pd(e){if(e===void 0)return;hd(e.hint,`argument hint`),e.words===void 0&&e.text===void 0&&vd(`slash arguments need words or text`);let t=new Set;for(let n of e.words??[])hd(n.word,`argument word`),/\s/u.test(n.word)&&vd(`argument word must not contain whitespace`),t.has(n.word)&&vd(`argument word is repeated`),t.add(n.word),n.description!==void 0&&hd(n.description,`argument word description`);t.size>Uu&&vd(`argument word count exceeds 32`),e.text!==void 0&&(hd(e.text.field,`argument text field`),e.text.requestIdField!==void 0&&hd(e.text.requestIdField,`request id field`))}function md(e,t){e.length>Hu&&vd(`${t} count exceeds 16`);for(let n of e)hd(n,t)}function hd(e,t,n=!1){e.trim().length===0&&vd(`${t} must not be blank`),n&&e.includes(`:`)&&vd(`${t} must not contain a colon`)}function gd(e){e!==void 0&&!Number.isSafeInteger(e)&&vd(`order must be a safe integer`)}function _d(e=()=>void 0,t=()=>void 0){return Object.freeze({update:e,dispose:t})}function vd(e){throw Error(e)}var yd=Object.freeze({bindings:Object.freeze([]),palette:Object.freeze([]),slash:Object.freeze([]),help:Object.freeze([]),menu:Object.freeze([]),agent:Object.freeze([])}),bd=Object.freeze({status:`available`});function xd(e){let t=e.availability?.()??bd;return t.status===`available`?bd:Object.freeze({status:`unavailable`,reason:t.reason})}function Sd(e,t){return e.status===`available`?t?.status===`available`:t?.status===`unavailable`&&e.reason===t.reason}function Cd(e){if(e instanceof zu){let t={code:e.code,message:e.message};return Object.freeze(e.details===void 0?t:{...t,details:nd(e.details)})}return Object.freeze({code:`command_failed`,message:e.message})}function wd(e,t){let n=[],r=[],i=[],a=[],o=[],s=[],c=0;for(let l of e){let e=l.contribution;for(let l of e.commands){let u=l.projections,d=t[c++]??bd;if(u?.bindings!==void 0)for(let t of u.bindings.values)n.push({...kd(e,l,u.bindings.order,d),binding:t});if(u?.palette!==void 0&&r.push({...kd(e,l,u.palette.order,d)}),u?.slash!==void 0)for(let t of u.slash.aliases){let n={...kd(e,l,u.slash.order,d),alias:t};u.slash.consumesDraft!==void 0&&(n={...n,consumesDraft:u.slash.consumesDraft}),u.slash.arguments!==void 0&&(n={...n,arguments:u.slash.arguments}),i.push(n)}u?.help!==void 0&&a.push({...kd(e,l,u.help.order,d)}),u?.menu!==void 0&&o.push({...kd(e,l,u.menu.order,d)}),u?.agent!==void 0&&s.push(cee(e,l,u.agent,d))}}return aee(n),oee(i),Dd(r),Dd(a),Dd(o),Dd(s),Object.freeze({bindings:Od(n),palette:Od(r),slash:Od(i),help:Od(a),menu:Od(o),agent:Od(s)})}var Td=new TextEncoder;function Ed(e,t){let n=Td.encode(e),r=Td.encode(t),i=Math.min(n.length,r.length);for(let e=0;e<i;e+=1){let t=n[e]??0,i=r[e]??0;if(t!==i)return t<i?-1:1}return n.length<r.length?-1:+(n.length>r.length)}function Dd(e){e.sort((e,t)=>e.order-t.order||Ed(e.commandId,t.commandId))}function aee(e){e.sort((e,t)=>e.order-t.order||Ed(e.commandId,t.commandId)||Ed(e.binding,t.binding))}function oee(e){e.sort((e,t)=>e.order-t.order||Ed(e.commandId,t.commandId)||Ed(e.alias,t.alias))}function Od(e){return Object.freeze(e.map(e=>Object.freeze(e)))}function kd(e,t,n,r){let i=see(e,t,n,r);return e.scope===void 0?i:{...i,scope:e.scope}}function see(e,t,n,r){let i={commandId:Ku(e.namespace,t.id),command:Object.freeze({namespace:e.namespace,id:t.id}),sourceId:e.sourceId,title:t.title,category:t.category,order:n??0,availability:r},a=t.description===void 0?i:{...i,description:t.description};return t.action===void 0?a:{...a,action:t.action}}function cee(e,t,n,r){let i=kd(e,t,n.order,r),a=i.action===void 0?i:{...i,action:lee(i.action)};return n.keybind===void 0?a:{...a,keybind:n.keybind}}function lee(e){let t={};return e.inputSchema!==void 0&&(t.inputSchema=e.inputSchema),e.outputSchema!==void 0&&(t.outputSchema=e.outputSchema),Object.freeze(t)}function uee(e,t){let n=!1,r=[];for(let i of t){let{availability:t,handler:a,...o}=i,s=a,c=t===void 0?o:{...o,availability:t()};e.register(c,async({arguments:e,origin:t,signal:n})=>{let r=await s(e===void 0?{origin:t,signal:n}:{arguments:e,origin:t,signal:n});return r===void 0?void 0:xu(r)}).then(e=>{n?e():r.push(e)},e=>{console.warn(`App command ${i.id} was not registered`,e)})}return()=>{if(!n){n=!0;for(let e of r.splice(0))e()}}}var Ad=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let e=0,r=t.length;e<r;e++)n=t[e](n);return n}}},jd={pipe(){return Ad(this,arguments)}},Md=function(){function e(){}return e.prototype=jd,e}(),Nd=function(e,t){if(typeof e==`function`)return function(){return e(arguments)?t.apply(this,arguments):e=>t(e,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(e,n){return arguments.length>=2?t(e,n):function(n){return t(n,e)}};case 3:return function(e,n,r){return arguments.length>=3?t(e,n,r):function(r){return t(r,e,n)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(e){return t(e,...n)}}}},Pd=e=>e,Fd=e=>()=>e,dee=Fd(!0),fee=Fd(null),Id=Fd(void 0),Ld=Id;function Rd(e,t,n,r,i,a,o,s,c){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return a(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return o(a(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(o(a(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return c(s(o(a(i(r(n(t(e.apply(this,arguments)))))))))}}}function zd(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}function Bd(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i!==n&&t.set(i,i),i}}var Vd=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(`stack`);let n=Object.getPrototypeOf(e),r=n;for(;r!==null&&r!==Object.prototype;){let e=Reflect.ownKeys(r);for(let n=0;n<e.length;n++)t.add(e[n]);r=Object.getPrototypeOf(r)}return t.has(`constructor`)&&typeof e.constructor==`function`&&n===e.constructor.prototype&&t.delete(`constructor`),t},Hd=new WeakSet,Ud=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Wd=0,Gd=()=>{Wd++};function Kd(e){return typeof e==`string`}function qd(e){return typeof e==`number`}function Jd(e){return typeof e==`boolean`}function Yd(e){return typeof e==`symbol`}function Xd(e){return Kd(e)||qd(e)||Yd(e)}function Zd(e){return typeof e==`function`}function Qd(e){return e===void 0}function $d(e){return e!=null}function ef(e){return!0}function tf(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function nf(e){return typeof e==`object`&&!!e||Zd(e)}var rf=Nd(2,(e,t)=>nf(e)&&t in e),af=`~effect/Hash`,of=e=>{switch(typeof e){case`number`:return ff(e);case`bigint`:return pf(e.toString(10));case`string`:return pf(e);case`function`:case`object`:if(e===null)break;if(e instanceof Date)return Number.isNaN(e.getTime())?pf(`Invalid Date`):pf(e.toISOString());if(e instanceof RegExp)return pf(e.toString());{if(Hd.has(e))return sf(e);let t=yf.get(e);if(t!==void 0)return t;if(bf.has(e))return Gd(),pf(`[Circular]`);bf.add(e);let n=Wd,r;try{r=`~effect/Hash`in e?e[af]():typeof e==`function`?sf(e):e instanceof DataView?gf(Ud(e)):Array.isArray(e)||ArrayBuffer.isView(e)?gf(e):e instanceof Map?mee(e):e instanceof Set?hee(e):mf(e)}finally{bf.delete(e)}return n===Wd&&yf.set(e,r),r}}return uf(cf(pf(String(e))))},sf=e=>(vf.has(e)||vf.set(e,uf(Math.random()*4294967296|0)),vf.get(e)),cf=e=>(e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^e>>>16),lf=Nd(2,(e,t)=>cf(Math.imul(e,2654435761)+Math.imul(t,2246822507))),uf=e=>e&3221225471|e>>>1&1073741824,df=new DataView(new ArrayBuffer(8)),ff=e=>{let t=e|0;return t===e?uf(t):(df.setFloat64(0,e===e?e:NaN),uf(lf(df.getInt32(0),df.getInt32(4))))},pf=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return uf(t)},pee=(e,t)=>{let n=12289;for(let r of t)n^=lf(of(r),of(e[r]));return uf(n)},mf=e=>pee(e,Vd(e)),hf=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return uf(r)},gf=e=>{let t=6151;for(let n of e)t=lf(t,of(n));return uf(t)},mee=hf(pf(`Map`),([e,t])=>lf(of(e),of(t))),_f=pf(`Set`),hee=hf(_f,e=>lf(_f,of(e))),vf=new WeakMap,yf=new WeakMap,bf=new WeakSet,xf=`~effect/Equal`;function Sf(){return arguments.length===1?e=>Cf(e,arguments[0]):Cf(arguments[0],arguments[1])}function Cf(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=typeof e;return n===typeof t?n===`number`&&e!==e&&t!==t?!0:n!==`object`&&n!==`function`||Hd.has(e)||Hd.has(t)?!1:gee(e,t):!1}function gee(e,t){let n=Tf.length;for(let r=n;r-->0;)if(Tf[r]===e&&Ef[r]===t)return!0;if(n)return wf(e,t);let r=Df.get(e);r||Df.set(e,r=new WeakMap);let i=r.get(t);return i===void 0&&r.set(t,i=wf(e,t)),i}function wf(e,t){Tf.push(e),Ef.push(t);try{return _ee(e,t)}finally{Tf.pop(),Ef.pop()}}var Tf=[],Ef=[],Df=new WeakMap;function _ee(e,t){if(of(e)!==of(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let n=e.getTime(),r=t.getTime();return n===r||Number.isNaN(n)&&Number.isNaN(r)}if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let n=Pf(e);if(n!==Pf(t)||typeof e==`function`&&!n)return!1;if(n)return e[xf](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:Of(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;return!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView?!1:n?kf(Ud(e),Ud(t)):kf(e,t)}return e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:jf(e,t,Mf,Nf):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:jf(e,t,of,Cf):Af(e,t)}function Of(e,t){for(let n=0;n<e.length;n++)if(!Cf(e[n],t[n]))return!1;return!0}function kf(e,t){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 Af(e,t){let n=Vd(e),r=Vd(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!Cf(e[i],t[i]))return!1;return!0}function jf(e,t,n,r){let i=new Map,a=0;for(let e of t){let t=n(e),r=i.get(t);r?r.push(e):i.set(t,[e]),a++}outer:for(let t of e){let e=i.get(n(t));if(e){for(let n=0;n<e.length;n++)if(r(t,e[n])){e[n]=e[e.length-1],e.pop(),a--;continue outer}}return!1}return a===0}var Mf=e=>of(e[0]),Nf=(e,t)=>Cf(e[0],t[0])&&Cf(e[1],t[1]),Pf=e=>rf(e,xf),Ff=e=>e.length>0;function If(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function Lf(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&If(e,n,t[n])}var Rf=Symbol.for(`~effect/Redactable`),zf=e=>rf(e,Rf);function Bf(e){return zf(e)?Vf(e):e}function Vf(e){return e[Rf](globalThis[`~effect/Fiber/currentFiber`]?.context??Wf)}var Hf=`~effect/Fiber/currentFiber`,Uf=new Map,Wf={"~effect/Context":{},base:Uf,depth:0,mapUnsafe:Uf,pipe(){return Ad(this,arguments)}};function Gf(e,t){let n=t?.space??0,r=new WeakSet,i=n?typeof n==`number`?` `.repeat(n):n:``,a=e=>i.repeat(e),o=(e,t)=>{let n=e?.constructor;return n&&n!==Object.prototype.constructor&&n.name?`${n.name}(${t})`:t},s=e=>{try{return Reflect.ownKeys(e)}catch{return[`[ownKeys threw]`]}};function c(e,t=0){try{return l(e,t)}catch{return(typeof e==`object`&&e||typeof e==`function`)&&r.delete(e),`[inspection threw]`}}function l(e,n=0){if(typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`||e==null||typeof e==`boolean`||typeof e==`symbol`)return String(e);if(typeof e==`bigint`)return String(e)+`n`;if(typeof e==`object`||typeof e==`function`){if(r.has(e))return Kf;r.add(e);let l;if(Rf in e)l=c(Vf(e),n);else if(Array.isArray(e))l=!i||e.length<=1?`[${e.map(e=>c(e,n)).join(`,`)}]`:`[\n${a(n+1)}${e.map(e=>c(e,n+1)).join(`,
|
|
65
|
-
`+a(n+1))}\n${a(n)}]`;else if(e instanceof Date)l=Yf(e);else if(!t?.ignoreToString&&rf(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=Xf(e);l=e instanceof Error&&e.cause!==void 0?`${t} (cause: ${c(e.cause,n)})`:t}else if(Symbol.iterator in e)l=`${e.constructor.name}(${c(Array.from(e),n)})`;else{let t=s(e);if(!i||t.length<=1){let r=`{${t.map(t=>`${qf(t)}:${c(Zf(e,t),n)}`).join(`,`)}}`;l=o(e,r)}else{let r=`{\n${t.map(t=>`${a(n+1)}${qf(t)}: ${c(Zf(e,t),n+1)}`).join(`,
|
|
66
|
-
`)}\n${a(n)}}`;l=o(e,r)}}return r.delete(e),l}return String(e)}return c(e,0)}var Kf=`[Circular]`;function qf(e){return typeof e==`string`?JSON.stringify(e):String(e)}function Jf(e){return e.map(e=>`[${qf(e)}]`).join(``)}function Yf(e){try{return e.toISOString()}catch{return`Invalid Date`}}function Xf(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}function Zf(e,t){try{return e[t]}catch{return`[property access threw]`}}function Qf(e,t){let n=[];return JSON.stringify(e,function(e,t){let r=Object.getOwnPropertyDescriptor(this,e)?.value,i=rf(r,Rf)?Bf(r):Bf(t);if(typeof i==`bigint`)return Gf(i);if(typeof i!=`object`||!i)return i;let a=i instanceof Error&&!rf(i,`toJSON`)?{...i,name:i.name,message:i.message}:i;for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(i))return;if(n.push(i),a!==i&&n.push(a),!$f(a)||ep(a))return a;let o=new Proxy(a,{get(e,t){let n=Reflect.get(e,t,e);return Object.getOwnPropertyDescriptor(e,t)?.get===void 0?n:Bf(n)}});return n.push(o),o},t?.space)??`null`}function $f(e){for(let t of Object.getOwnPropertyNames(e))if(Object.getOwnPropertyDescriptor(e,t)?.get!==void 0)return!0;return!1}function ep(e){for(let t of[Number.prototype.valueOf,Boolean.prototype.valueOf,String.prototype.valueOf])try{return Reflect.apply(t,e,[]),!0}catch{}return!1}var tp=Symbol.for(`nodejs.util.inspect.custom`),np=e=>{try{return e=Bf(e),rf(e,`toJSON`)&&Zd(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(np):e}catch{return`[toJSON threw]`}},rp={toJSON(){return np(this)},[tp](){return this.toJSON()},toString(){return Gf(this.toJSON())}},ip=(()=>{let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.hasOwn(e,`writable`)?e.writable===!0:e.set!==void 0})(),ap=()=>Error.stackTraceLimit,op=e=>{ip&&(Error.stackTraceLimit=e)},sp=class{constructor(e){this.value=e,this.done=!1}next(e){return this.done?(this.value=e,this):(this.done=!0,{value:this.value,done:!1})}},cp=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}};return ap()!==0&&t[e](()=>Error().stack)?.includes(e)===!0?t[e]:n[e]})(),lp=`~effect/Effect`,up=`~effect/Exit`,dp={_A:Pd,_E:Pd,_R:Pd},fp=`${lp}/identifier`,pp=`${lp}/args`,mp=`${lp}/evaluate`,hp=`${lp}/successCont`,gp=`${lp}/failureCont`,_p=`${lp}/ensureCont`,vp=Symbol.for(`effect/Effect/Yield`),yp={pipe(){return Ad(this,arguments)},toJSON(){return{...this}},toString(){return Gf(this.toJSON(),{ignoreToString:!0,space:2})},[tp](){return this.toJSON()}},bp={[lp]:dp,...yp,[Symbol.iterator](){return new sp(this)},toJSON(){return{_id:`Effect`,op:this[fp],...pp in this?{args:this[pp]}:void 0}}},xp=e=>rf(e,up),Sp=`~effect/Cause`,Cp=`~effect/Cause/Reason`,wp=e=>rf(e,Sp),Tp=class{constructor(e){this[Sp]=Sp,this.reasons=e}pipe(){return Ad(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${Gf(this.reasons)})`}[tp](){return this.toJSON()}[xf](e){return wp(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>Sf(t,e.reasons[n]))}[af](){return gf(this.reasons)}},Ep=new WeakMap,Dp=class{[Cp];annotations;_tag;constructor(e,t,n){if(this[Cp]=Cp,this._tag=e,t!==Op&&typeof n==`object`&&n&&t.size>0){let e=Ep.get(n);e&&(t=new Map([...e,...t])),Ep.set(n,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let n=new Map(this.annotations);e.mapUnsafe.forEach((e,r)=>{t?.overwrite!==!0&&n.has(r)||n.set(r,e)});let r=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return r.annotations=n,r}pipe(){return Ad(this,arguments)}toString(){return Gf(this)}[tp](){return this.toString()}},Op=new Map,kp=class extends Dp{constructor(e,t=Op){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${Gf(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[xf](e){return Lp(e)&&Sf(this.error,e.error)&&Sf(this.annotations,e.annotations)}[af](){return lf(pf(this._tag))(lf(of(this.error))(of(this.annotations)))}},Ap=e=>new Tp(e),jp=(e,t)=>{let n=new Map,r=[];for(let i of e.concat(t)){let e=of(i),t=n.get(e);if(t===void 0)n.set(e,[i]);else if(t.some(e=>Sf(e,i)))continue;else t.push(i);r.push(i)}return r},Mp=Nd(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new Tp(jp(e.reasons,t.reasons));return Sf(e,n)?e:n}),Np=e=>new Tp([new kp(e)]),Pp=class extends Dp{constructor(e,t=Op){super(`Die`,t,e),this.defect=e}toString(){return`Die(${Gf(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[xf](e){return Rp(e)&&Sf(this.defect,e.defect)&&Sf(this.annotations,e.annotations)}[af](){return lf(pf(this._tag))(lf(of(this.defect))(of(this.annotations)))}},Fp=e=>new Tp([new Pp(e)]),Ip=Nd(e=>wp(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new Tp(e.reasons.map(e=>e.annotate(t,n)))),Lp=e=>e._tag===`Fail`,Rp=e=>e._tag===`Die`,zp=e=>e._tag===`Interrupt`;function Bp(e){return Yp(`Effect.evaluate: Not implemented`)}var Vp=e=>({...bp,[fp]:e.op,[mp]:e[mp]??Bp,[hp]:e[hp],[gp]:e[gp],[_p]:e[_p]}),Hp=e=>{let t=Vp(e),n=function(e){this[pp]=e};return n.prototype=t,function(e){return new n(e)}},Up=e=>{let t={[up]:up,_tag:e.op,get[e.prop](){return this[pp]},...Vp(e),toString(){return`${e.op}(${Gf(this[pp])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[pp]}},[xf](e){return xp(e)&&e._tag===this._tag&&Sf(this[pp],e[pp])},[af](){return lf(pf(e.op),of(this[pp]))}},n=function(e){this[pp]=e};return n.prototype=t,function(e){return new n(e)}},Wp=Up({op:`Success`,prop:`value`,[mp](e){let t=e.getCont(hp);return t?t[hp](this[pp],e,this):e.yieldWith(this)}}),Gp={key:`effect/Cause/StackTrace`},Kp={key:`effect/Cause/InterruptorStackTrace`},qp=Up({op:`Failure`,prop:`cause`,[mp](e){let t=this[pp],n=!1;e.cache.stackFrame&&(t=Ip(t,{mapUnsafe:new Map([[Gp.key,e.cache.stackFrame]])}),n=!0);let r=e.getCont(gp),i=e._interruptedCause;if(i&&e.interruptible){let a=!1;for(;r&&e.interruptible;)a||=fp in r,r=e.getCont(gp);a&&(t=Ap(t.reasons.filter(e=>e._tag!==`Fail`))),t=Mp(t,i),n=!0}return r?r[gp](t,e,n?void 0:this):e.yieldWith(n?qp(t):this)}}),Jp=e=>qp(Np(e)),Yp=e=>qp(Fp(e)),Xp=Hp({op:`WithFiber`,[mp](e){return this[pp](e)}}),Zp=function(){class e extends globalThis.Error{}let t=Vp({op:`YieldableError`,[mp](){return Jp(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),Qp=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends Zp{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(Lf(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),$p=e=>{class t extends Qp{_tag=e}return t.prototype.name=e,t};$p(`NoSuchElementError`);var em=`~effect/Option`,tm={[em]:{_A:e=>e},...yp,[Symbol.iterator](){return new sp(this)}},nm=Object.defineProperty(Object.assign(Object.create(tm),{_tag:`Some`,_op:`Some`,[xf](e){return am(e)&&sm(e)&&Sf(this.value,e.value)},[af](){return lf(of(this._tag))(of(this.value))},toString(){return`some(${Gf(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:np(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),rm=of(`None`),im=Object.assign(Object.create(tm),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[xf](e){return am(e)&&om(e)},[af](){return rm},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),am=e=>rf(e,em),om=e=>e._tag===`None`,sm=e=>e._tag===`Some`,cm=Object.create(im),lm=function(e){this.value=e};lm.prototype=nm;var um=e=>new lm(e),dm=`~effect/Result`,fm={[dm]:{_A:e=>e,_E:e=>e},...yp,[Symbol.iterator](){return new sp(this)}},pm=Object.assign(Object.create(fm),{_tag:`Success`,_op:`Success`,[xf](e){return hm(e)&&_m(e)&&Sf(this.success,e.success)},[af](){return lf(of(this._tag))(of(this.success))},toString(){return`success(${Gf(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:np(this.success)}}}),mm=Object.assign(Object.create(fm),{_tag:`Failure`,_op:`Failure`,[xf](e){return hm(e)&&gm(e)&&Sf(this.failure,e.failure)},[af](){return lf(of(this._tag))(of(this.failure))},toString(){return`failure(${Gf(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:np(this.failure)}}}),hm=e=>rf(e,dm),gm=e=>e._tag===`Failure`,_m=e=>e._tag===`Success`,vm=function(e){this.failure=e};vm.prototype=mm;var vee=e=>new vm(e),ym=function(e){this.success=e};ym.prototype=pm;var yee=e=>new ym(e);function bm(e){return(t,n)=>t===n?0:e(t,n)}var bee=bm((e,t)=>e<t?-1:1),xm=bm((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:e<t?-1:1),xee=e=>Nd(2,(t,n)=>e(t,n)===-1),Sm=e=>Nd(2,(t,n)=>e(t,n)===1),Cm=e=>Nd(2,(t,n)=>e(t,n)!==1),wm=e=>Nd(2,(t,n)=>e(t,n)!==-1),Tm=()=>cm,Em=um,Dm=om,See=sm,Cee=Nd(2,(e,{onNone:t,onSome:n})=>Dm(e)?t():n(e.value)),Om=Nd(2,(e,t)=>Dm(e)?t():e.value),wee=Nd(2,(e,t)=>Dm(e)?t():e),Tee=Om(fee),Eee=Om(Id),Dee=Nd(2,(e,t)=>Dm(e)?Tm():Em(t(e.value))),km=yee,Am=vee,jm=gm,Oee=_m,kee=Nd(2,(e,t)=>jm(e)?Am(t(e.failure)):e),Mm=Nd(2,(e,{onFailure:t,onSuccess:n})=>jm(e)?t(e.failure):n(e.success)),Aee=globalThis.Array,Nm=Nd(2,(e,t)=>[...e,t]);Aee.isArray;var jee=Ff,Mee=Ff,Pm=()=>[],Fm=Nd(2,(e,t)=>e.map(t)),Im=`~effect/BigDecimal`,Nee={[Im]:Im,[af](){let e=zm(this);return lf(pf(String(e.value)),ff(e.scale))},[xf](e){return Pee(e)&&Vee(this,e)===0},toString(){return`BigDecimal(${Hee(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[tp](){return this.toJSON()},pipe(){return Ad(this,arguments)}},Pee=e=>rf(e,Im),Fee=(e,t)=>{if(!Number.isSafeInteger(t))throw RangeError(`Scale must be a safe integer, got ${t}`);let n=Object.create(Nee);return n.value=e,n.scale=t,n},Lm=(e,t)=>{let n=Fee(e,t);return n.normalized=n,n},Rm=BigInt(0),Iee=BigInt(1),Lee=BigInt(10),Ree=Lm(Rm,0),zm=e=>{if(e.normalized===void 0){if(e.value===Rm)e.normalized=Ree;else{let t=`${e.value}`,n=t.length;for(;t[n-1]===`0`;)n--;e.normalized=Lm(BigInt(t.slice(0,n)),e.scale-(t.length-n))}}return e.normalized},zee=100,Bee=[Iee],Bm=(e,t)=>e===t?0:e<t?-1:1,Vm=(e,t)=>{let n=`${e.value<Rm?-e.value:e.value}`,r=`${t.value<Rm?-t.value:t.value}`,i=BigInt(n.length-r.length)-BigInt(e.scale)+BigInt(t.scale);if(i!==Rm)return i<Rm?-1:1;let a=Math.max(n.length,r.length);return bee(n.padEnd(a,`0`),r.padEnd(a,`0`))},Vee=(e,t)=>{if(e.scale===t.scale)return Bm(e.value,t.value);let n=Hm(e),r=Hm(t);if(n!==r)return n<r?-1:1;if(n===0)return 0;let i=e.scale-t.scale,a=Math.abs(i);if(a>zee)return n===-1?Vm(t,e):Vm(e,t);let o=Bee[a]??=Lee**BigInt(a);return i>0?Bm(e.value,t.value*o):Bm(e.value*o,t.value)},Hm=e=>e.value===Rm?0:e.value<Rm?-1:1,Hee=e=>{let t=zm(e);if(Math.abs(t.scale)>=16)return Uee(t);let n=t.value<Rm,r=`${n?-t.value:t.value}`,i=t.scale>0?r.padStart(t.scale+1,`0`):r.padEnd(r.length-t.scale,`0`),a=i.length-t.scale,o=t.scale>0?`${i.slice(0,a)}.${i.slice(a)}`:i;return n?`-${o}`:o},Uee=e=>{if(Wee(e))return`0e+0`;let t=zm(e),n=`${t.value}`,r=t.value<Rm?2:1,i=n.slice(0,r),a=n.slice(r),o=a.length-t.scale;return`${i}${a===``?``:`.${a}`}e${o>=0?`+`:``}${o}`},Wee=e=>e.value===Rm,Gee=e=>Vp({op:e.label,[mp]:e.evaluate}),Um=`~effect/Context/Service`,Wm=function(){function e(){}let t=e;Object.setPrototypeOf(t,Kee);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[Km]=Km,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&Gm.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},Kee={[Um]:Um,...Gee({label:`Service`,evaluate(e){return Wp(fh(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return ch(this,e)},use(e){return Xp(t=>e(fh(t.context,this)))},useSync(e){return Xp(t=>Wp(e(fh(t.context,this))))}},Gm=new Set,Km=`~effect/Context/Reference`,qm=`~effect/Context`,Jm=8,Ym=8,Xm=(e,t,n,r)=>{let i=Object.create(nh);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},Zm=(e,t)=>{t&&(Zm(e,t.parent),e.set(t.key,t.value))},Qm=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return Zm(t,e.overlay),e._flat=t},$m=Symbol(),eh=(e,t)=>{let n=e;for(let e=n.overlay;e;e=e.parent)if(e.key===t)return e.value;let r=n.base.get(t);return r===void 0&&!n.base.has(t)?$m:(n.overlay&&++n.baseHits>=n.base.size&&n.baseHits>=Ym&&(n.base=Qm(n),n.overlay=void 0,n.depth=0),r)},th=e=>Xm(void 0,e,void 0,0),nh={get mapUnsafe(){return Qm(this)},...yp,[qm]:{_Services:e=>e},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[xf](e){if(!ih(e))return!1;let t=this.mapUnsafe,n=e.mapUnsafe;if(t.size!==n.size)return!1;for(let[e,r]of t)if(!n.has(e)||!Sf(r,n.get(e)))return!1;return!0},[af](){return ff(this.mapUnsafe.size)}},rh=(e,t)=>e.cacheRoot===t.cacheRoot,ih=e=>rf(e,qm),ah=e=>!!e[Km],oh=()=>sh,sh=th(new Map),ch=(e,t)=>th(new Map([[e.key,t]])),lh=Nd(3,(e,t,n)=>uh(e,t.key,n)),uh=(e,t,n)=>{let r=e,i=Gm.has(t)?void 0:r.cacheRoot;if(r.depth>=Jm){let e=new Map(r.mapUnsafe);return e.set(t,n),Xm(i,e,void 0,0)}return Xm(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},dh=(e,t)=>{let n=eh(e,t);return n===$m?void 0:n},fh=Nd(2,(e,t)=>{let n=eh(e,t.key);if(n===$m){if(ah(t))return mh(t);throw hh(t)}return n}),ph=`~effect/Context/defaultValue`,mh=e=>ph in e?e[ph]:e[ph]=e.defaultValue(),hh=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(t.stack){let e=t.stack.split(`
|
|
67
|
-
`);e.splice(1,3),t.stack=e.join(`
|
|
68
|
-
`)}return t},gh=Wm,_h=`~effect/Duration`,vh=BigInt(0),yh=BigInt(1),qee=BigInt(2),Jee=BigInt(10),Yee=BigInt(1e3),bh=e=>BigInt(e<0?Math.ceil(e-.5):Math.floor(e+.5)),xh=e=>bh(e*1e6),Sh=(e,t)=>{let n=e.indexOf(`.`);if(n===-1)return BigInt(e)*t;let r=e[0]===`-`,i=e.slice(n+1),a=Jee**BigInt(i.length),o=(BigInt(e.slice(+!!r,n))*a+BigInt(i))*t,s=o/a+(o%a*qee>=a?yh:vh);return r?-s:s},Ch=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,wh=e=>{switch(typeof e){case`number`:return Ih(e);case`bigint`:return Fh(e);case`string`:{if(e===`Infinity`)return Nh;if(e===`-Infinity`)return Ph;let t=Ch.exec(e);if(!t)break;let[n,r,i]=t;if(i===`nano`||i===`nanos`)return Fh(Sh(r,yh));if(i===`micro`||i===`micros`)return Fh(Sh(r,Yee));let a=Number(r);switch(i){case`milli`:case`millis`:return Ih(a);case`second`:case`seconds`:return Lh(a);case`minute`:case`minutes`:return Rh(a);case`hour`:case`hours`:return zh(a);case`day`:case`days`:return Bh(a);case`week`:case`weeks`:return Vh(a)}break}case`object`:{if(e===null)break;if(_h in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(qd)?Th(e):Number.isNaN(e[0])||Number.isNaN(e[1])?Mh:e[0]===-1/0||e[1]===-1/0?Ph:e[0]===1/0||e[1]===1/0?Nh:Ah(bh(e[0]*1e9+e[1]));let t=e,n=0;return t.weeks&&(n+=t.weeks*6048e5),t.days&&(n+=t.days*864e5),t.hours&&(n+=t.hours*36e5),t.minutes&&(n+=t.minutes*6e4),t.seconds&&(n+=t.seconds*1e3),t.milliseconds&&(n+=t.milliseconds),!t.microseconds&&!t.nanoseconds?Ah(n):Ah(bh(n*1e6+(t.microseconds??0)*1e3+(t.nanoseconds??0)))}}return Th(e)},Th=e=>{throw Error(`Invalid Input: ${e}`)},Eh={_tag:`Millis`,millis:0},Dh={_tag:`Infinity`},Oh={_tag:`NegativeInfinity`},kh={[_h]:_h,[af](){switch(this.value._tag){case`Millis`:{let e=this.value.millis*1e6;return Number.isFinite(e)?of(bh(e)):ff(this.value.millis)}case`Nanos`:return of(this.value.nanos);default:return mf(this.value)}},[xf](e){return jh(e)&&Gh(this,e)},toString(){switch(this.value._tag){case`Infinity`:return`Infinity`;case`NegativeInfinity`:return`-Infinity`;case`Nanos`:return`${this.value.nanos} nanos`;case`Millis`:return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case`Millis`:return{_id:`Duration`,_tag:`Millis`,millis:this.value.millis};case`Nanos`:return{_id:`Duration`,_tag:`Nanos`,nanos:String(this.value.nanos)};case`Infinity`:return{_id:`Duration`,_tag:`Infinity`};case`NegativeInfinity`:return{_id:`Duration`,_tag:`NegativeInfinity`}}},[tp](){return this.toJSON()},pipe(){return Ad(this,arguments)}},Ah=e=>{let t=Object.create(kh);return t.value=typeof e==`number`?isNaN(e)||e===0||Object.is(e,-0)?Eh:Number.isFinite(e)?Number.isInteger(e)?{_tag:`Millis`,millis:e}:{_tag:`Nanos`,nanos:xh(e)}:e>0?Dh:Oh:e===vh?Eh:{_tag:`Nanos`,nanos:e},t},jh=e=>rf(e,_h),Mh=Ah(0),Nh=Ah(1/0),Ph=Ah(-1/0),Fh=e=>Ah(e),Ih=e=>Ah(e),Lh=e=>Ah(e*1e3),Rh=e=>Ah(e*6e4),zh=e=>Ah(e*36e5),Bh=e=>Ah(e*864e5),Vh=e=>Ah(e*6048e5),Hh=e=>{let t=wh(e);switch(t.value._tag){case`Infinity`:case`NegativeInfinity`:throw Error(`Cannot convert infinite duration to nanos`);case`Nanos`:return t.value.nanos;case`Millis`:return xh(t.value.millis)}},Uh=Nd(3,(e,t,n)=>e.value._tag===`Infinity`||e.value._tag===`NegativeInfinity`||t.value._tag===`Infinity`||t.value._tag===`NegativeInfinity`?n.onInfinity(e,t):e.value._tag===`Millis`?t.value._tag===`Millis`?n.onMillis(e.value.millis,t.value.millis):n.onNanos(Hh(e),t.value.nanos):n.onNanos(e.value.nanos,Hh(t))),Wh=(e,t)=>Uh(e,t,{onMillis:(e,t)=>e===t,onNanos:(e,t)=>e===t,onInfinity:(e,t)=>e.value._tag===t.value._tag}),Gh=Nd(2,(e,t)=>Wh(e,t)),Kh=gh(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new Zh}),qh=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},Jh=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},Yh=e=>{try{return Jh(e)}catch{return qh(e)}},Xh=class{buckets=[];scheduleTask(e,t){let n=this.buckets,r=n.length,i,a=0;for(;a<r&&!(n[a][0]>t);a++)i=n[a];i&&i[0]===t?i[1].push(e):a===r?n.push([t,[e]]):n.splice(a,0,[t,[e]])}drain(){let e=this.buckets;return this.buckets=[],e}},Zh=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?qh:Yh)}shouldYield(e){return e.currentOpCount>=e.cache.maxOpsBeforeYield}makeDispatcher(){return new Qh(this.setImmediate)}},Qh=class{tasks=new Xh;running=void 0;setImmediate;constructor(e=Yh){this.setImmediate=e}scheduleTask(e,t){this.tasks.scheduleTask(e,t),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let e=this.tasks.drain();for(let t=0;t<e.length;t++){let n=e[t][1];for(let e=0;e<n.length;e++)n[e]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},$h=gh(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),Xee=gh(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),eg=$p,tg=`~effect/encoding/EncodingError`,ng=class extends eg(`EncodingError`){[tg]=tg},rg=`effect/Tracer/ParentSpan`;Wm()(rg,{fiberCached:!0});var Zee=`effect/Tracer`,Qee=`effect/Metric/FiberRuntimeMetrics`,$ee=gh(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:Id}),ete=gh(`effect/References/TracerEnabled`,{fiberCached:!0,defaultValue:dee}),tte=gh(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),nte=gh(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),rte=class extends Dp{constructor(e,t=Op){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[xf](e){return zp(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[af](){return lf(pf(`${this._tag}:${this.fiberId}`))(sf(this.annotations))}},ite=e=>new Tp([new rte(e)]),ig=e=>{for(let t=0;t<e.reasons.length;t++){let n=e.reasons[t];if(n._tag===`Fail`)return km(n.error)}return Am(e)},ag=e=>e.reasons.some(zp),og=Nd(2,(e,t)=>{let n=!1,r=e.reasons.map(e=>Lp(e)?(n=!0,new kp(t(e.error),e.annotations)):e);return n?Ap(r):e}),sg=(e,t)=>{let n=[],r=[];if(e.reasons.length===0)return n;let i=ap();i!==0&&op(1);try{for(let i of e.reasons){if(i._tag===`Interrupt`){r.push(i);continue}n.push(cg(i._tag===`Die`?i.defect:i.error,i.annotations,t))}if(n.length===0){let e=Error(`The fiber was interrupted by:`);e.name=`InterruptCause`,e.stack=pg(e,r);let i=new globalThis.Error(`All fibers interrupted without error`,{cause:e});i.name=`InterruptError`,i.stack=`${i.name}: ${i.message}`,n.push(cg(i,r[0].annotations,t))}}finally{i!==0&&op(i)}return n},cg=(e,t,n)=>{let r=typeof e,i;if(e&&r===`object`){if(i=new globalThis.Error(lg(e),{cause:e.cause?cg(e.cause):void 0}),typeof e.name==`string`&&(i.name=e.name),typeof e.stack==`string`)i.stack=dg(e.stack,i,t);else{let e=`${i.name}: ${i.message}`;i.stack=t?fg(e,t):e}n?.includeCauseInStack&&(i.stack=gg(i));for(let t of Object.keys(e))t in i||(i[t]=e[t])}else{i=new globalThis.Error(e?r===`string`?e:Qf(e):`Unknown error: ${e}`);let n=`${i.name}: ${i.message}`;i.stack=t?fg(n,t):n}return i},lg=e=>{if(typeof e.message==`string`)return e.message;if(typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString)try{return e.toString()}catch{}return Qf(e)},ug=/\((.*)\)/g,dg=(e,t,n)=>{let r=`${t.name}: ${t.message}`,i=(e.startsWith(r)?e.slice(r.length):e).split(`
|
|
69
|
-
`),a=[r];for(let e=1;e<i.length&&!/Generator\.next|~effect\/(?:Effect|Utils)/.test(i[e]);e++)a.push(i[e]);return n?fg(a.join(`
|
|
70
|
-
`),n):a.join(`
|
|
71
|
-
`)},fg=(e,t)=>{let n=t?.get(Gp.key);return n&&(e=`${e}\n${mg(n)}`),e},pg=(e,t)=>{let n=[`${e.name}: ${e.message}`];for(let e of t){let t=e.fiberId===void 0?`unknown`:`#${e.fiberId}`,r=e.annotations.get(Kp.key);n.push(` at fiber (${t})`),r&&n.push(mg(r))}return n.join(`
|
|
72
|
-
`)},mg=e=>{let t=[],n=e,r=0;for(;n&&r<10;){let e=n.stack();if(e){let r=e.matchAll(ug),i=!1;for(let[,e]of r)i=!0,t.push(` at ${n.name} (${e})`);i||t.push(` at ${n.name} (${e.replace(/^at /,``)})`)}else t.push(` at ${n.name}`);n=n.parent,r++}return t.join(`
|
|
73
|
-
`)},hg=e=>sg(e).map(gg).join(`
|
|
74
|
-
`),gg=e=>e.cause?`${e.stack} {\n${_g(e.cause,` `)}\n}`:e.stack,_g=(e,t)=>{let n=e.stack.split(`
|
|
75
|
-
`),r=`${t}[cause]: ${n[0]}`;for(let e=1,i=n.length;e<i;e++)r+=`\n${t}${n[e]}`;return e.cause&&(r+=` {\n${_g(e.cause,`${t} `)}\n${t}}`),r},vg=`~effect/Fiber`,yg={_A:Pd,_E:Pd},bg={id:0},xg=(()=>{try{return globalThis.process?.getBuiltinModule?.(`node:async_hooks`)?.AsyncResource}catch{return}})(),Sg=()=>xg===void 0?void 0:new xg(`effect/Fiber`),Cg=()=>globalThis[Hf],wg=class{constructor(e,t=!0){this.setContext(e),this.id=++bg.id,this.currentOpCount=0,this.interruptible=t,this._stack=[],this._observers=void 0,this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this._parent=void 0,this._asyncContext=void 0,this.cache.runtimeMetrics?.recordFiberStart(this.context)}get[vg](){return yg}get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(e){return fh(this.context,e)}addObserver(e){return this._exit?(e(this._exit),Ld):(this._observers===void 0?this._observers=[e]:this._observers.push(e),()=>this.removeObserver(e))}removeObserver(e){if(this._exit||this._observers===void 0)return;let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)}interruptUnsafe(e,t){if(this._exit)return;let n=ite(e);this.cache.stackFrame&&(n=Ip(n,ch(Gp,this.cache.stackFrame))),t&&(n=Ip(n,t)),this._interruptedCause=this._interruptedCause?Mp(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(Ng(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;if(this._asyncContext!==void 0){let t=this._asyncContext;return this._asyncContext=void 0,t.runInAsyncScope(this.evaluate,this,e)}if(this._yielded!==void 0){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===vp){this._asyncContext=Sg();return}let n=Og.interruptChildren&&Og.interruptChildren(this);if(n!==void 0)return this.evaluate(a_(n,()=>t));if(this._exit=t,this.cache.runtimeMetrics?.recordFiberEnd(this.context,this._exit),this._parent&&=(this._parent._children?.delete(this),void 0),this._observers!==void 0){let e=this._observers;this._observers=void 0;for(let n=0;n<e.length;n++)e[n](t)}this._stack.length=0,this._children=void 0,this.context=oh()}runLoop(e){let t=globalThis[Hf];globalThis[Hf]=this;let n=this._running;this._running=!0;let r=!1,i=e;this.currentOpCount=0;try{for(;;)try{this._deferredInterrupt&&(this._deferredInterrupt=!1,i=Ng(this._interruptedCause)),this.currentOpCount++;let e=this.cache;if(!r&&!e.preventYield&&e.scheduler.shouldYield(this)){r=!0;let e=i;i=a_(Rg,()=>e)}if(i=e.tracerContext?e.tracerContext(i,this):i[mp](this),i===vp){let e=this._yielded;if(up in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return vp}}catch(e){if(!rf(i,mp))return Yp(`Fiber.runLoop: Not a valid effect: ${String(i)}`);i=Yp(e)}}finally{this._running=n,globalThis[Hf]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,Eg;for(;;){let t=this._stack.pop();if(!t)return;let n=t[_p];if(n!==void 0){let r=n.call(t,this);if(r)return r[e]=r,r}if(t[e])return t}}succeedWith(e){if(!(++this.currentOpCount&Dg-1))return Wp(e);let t=this.getCont(hp);return t?t[hp](e,this):this.yieldWith(Wp(e))}yieldWith(e){return this._yielded=e,vp}children(){return this._children??=new Set}pipe(){return Ad(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&rh(t,e))return;let n=e.cacheRoot,r=n._fiberCache??=Tg(e);this.cache?.scheduler!==r.scheduler&&(this._dispatcher=void 0),this.cache=r}get currentSpanLocal(){let e=this.cache.span;return e?._tag===`Span`?e:void 0}},Tg=e=>{let t=dh(e,Zee);return{scheduler:fh(e,Kh),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:fh(e,ete),span:dh(e,rg),logLevel:fh(e,tte),minimumLogLevel:fh(e,nte),stackFrame:fh(e,$ee),runtimeMetrics:dh(e,Qee),maxOpsBeforeYield:fh(e,$h),preventYield:fh(e,Xee)}},Eg={[hp](e,t){return Ng(t._interruptedCause)},[gp](e,t){return Ng(t._interruptedCause)}},Dg=32,Og={interruptChildren:void 0},kg=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(Kp.key,e.cache.stackFrame),th(t)},Ag=e=>Kg(t=>{let n=e[Symbol.iterator](),r=[],i;function a(){let e=n.next();for(;!e.done;){if(e.value._exit){r.push(e.value._exit),e=n.next();continue}i=e.value.addObserver(e=>{r.push(e),a()});return}t(Mg(r))}return a(),Fg(()=>i?.())}),jg=e=>Xp(t=>{let n=kg(t),r=Pm();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return i_(Ag(r))}),Mg=Wp,Ng=qp,Pg=Jp,Fg=Hp({op:`Sync`,[mp](e){let t=this[pp](),n=e.getCont(hp);return n?n[hp](t,e):e.yieldWith(Wp(t))}}),Ig=Hp({op:`Suspend`,[mp](e){return this[pp]()}}),Lg=Mm({onFailure:Pg,onSuccess:Mg}),Rg=Hp({op:`Yield`,[mp](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(f_)},this[pp]??0),e.yieldWith(()=>{t=!0})}})(0),zg=e=>Ig(()=>Ng(e())),Bg=e=>Yp(e),Vg=e=>Ig(()=>Pg(e())),Hg=Mg(void 0),Ug=e=>{let t=typeof e==`function`?e:e.try,n=typeof e==`function`?e=>new ute(e,`An error occurred in Effect.try`):e.catch;return Ig(()=>{try{return Mg(t())}catch(e){return Pg(n(e))}})},Wg=function(){let e=Vp({op:`Async`,[mp](e){let t=!1,n=!1,r=this.withSignal?new AbortController:void 0,i=this.register.call(e.cache.scheduler,r=>{t||(t=!0,n?e.evaluate(r):n=r)},r?.signal);return n===!1?(n=!0,e._yielded=()=>{t=!0},r===void 0&&i===void 0||e._stack.push(Gg(()=>(t=!0,r?.abort(),i??f_))),vp):n}}),t=function(e,t){this.register=e,this.withSignal=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),Gg=Hp({op:`AsyncFinalizer`,[_p](e){e.interruptible&&(e.interruptible=!1,e._stack.push(O_))},[gp](e,t){return ag(e)?a_(E_(qp(e),this[pp]()),()=>Ng(e)):Ng(e)}}),Kg=e=>Wg(e,e.length>=2),qg=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),Jg=(e,...t)=>qg(e.length,t.length===0?function(){return Yg(()=>e.apply(this,arguments))}:function(){let n=Yg(()=>e.apply(this,arguments));for(let e of t)n=e(n,...arguments);return n}),Yg=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return Mg(r.value);let i=r.value;if(i&&i._tag===`Success`){n=i.value;continue}if(i&&i._tag===`Failure`)return r.value;{let n=!0;return Ig(()=>n?(n=!1,a_(r.value,e=>Xg(t,e))):Ig(()=>Xg(e())))}}}catch(e){return Bg(e)}},Xg=function(){let e=Vp({op:`Iterator`,[hp](e,t){let n=this.iterator;for(;;){let r=n.next(e);if(r.done)return Mg(r.value);if(!o_(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[mp](e){return this[hp](this.initial,e)}}),t=function(e,t){this.iterator=e,this.initial=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),Zg=function(e){return e._stack.push(this),this[pp]},Qg=Vp({op:`OnSuccess`,[mp]:Zg}),$g=function(e,t,n){this[pp]=e,this[hp]=t,this.payload=n};$g.prototype=Qg;var e_=function(){return this.payload},t_=(()=>{let e=`~effect/Effect/stackProbe`;return{[e]:function(){return Error().stack}}[e]()?.includes(`[as `+e+`]`)===!0})(),n_=function(e,t){let n=this.payload;return t.succeedWith(t_?n(e):cp(()=>n(e)))},r_=function(e){let t=this.payload;return t(e)},i_=e=>new $g(e,e_,f_),a_=Nd(2,(e,t)=>new $g(e,r_,t)),o_=e=>e[up]!==void 0,s_=Nd(2,(e,t)=>o_(e)?e._tag===`Success`?t(e.value):e:a_(e,t)),c_=Nd(2,(e,t)=>new $g(e,n_,t)),l_=Nd(2,(e,t)=>o_(e)?p_(e,t):c_(e,t)),u_=Nd(2,(e,t)=>o_(e)?m_(e,t):b_(e,t)),d_=e=>e._tag===`Success`,f_=Wp(void 0),p_=Nd(2,(e,t)=>e._tag===`Success`?Wp(t(e.value)):e),m_=Nd(2,(e,t)=>{if(e._tag===`Success`)return e;let n=ig(e.cause);return jm(n)?e:Jp(t(n.success))}),h_=Nd(2,(e,t)=>new __(e,t.length===1?t:e=>t(e))),g_=Vp({op:`OnFailure`,[mp]:Zg}),__=function(e,t){this[pp]=e,this[gp]=t};__.prototype=g_;var v_=Nd(3,(e,t,n)=>h_(e,e=>{let r=t(e);return jm(r)?Ng(r.failure):n(r.success,e)})),y_=Nd(2,(e,t)=>v_(e,ig,e=>t(e))),b_=Nd(2,(e,t)=>y_(e,e=>Vg(()=>t(e)))),x_=function(e,t){let n=this.payload;return t.succeedWith(t_?n.onSuccess(e):cp(()=>n.onSuccess(e)))},S_=((e,t)=>{let n=Vp({op:e,[mp]:Zg,[hp]:x_,[gp]:t}),r=function(e,t){this[pp]=e,this.payload=t};return r.prototype=n,r})(`Match`,function(e,t){let n=e.reasons.find(Lp);if(n===void 0)return Ng(e);let r=this.payload;return t.succeedWith(t_?r.onFailure(n.error):cp(()=>r.onFailure(n.error)))}),C_=Nd(2,(e,t)=>new S_(e,t)),w_=e=>o_(e)?Wp(e):T_(e),T_=Hp({op:`Exit`,[mp](e){return e._stack.push(this),this[pp]},[hp](e,t,n){return t.succeedWith(n??Wp(e))},[gp](e,t,n){return t.succeedWith(n??qp(e))}}),E_=(e,t)=>d_(e)?t:h_(t,t=>Ng(Mp(e.cause,t))),D_=e=>Xp(t=>t.interruptible?(t.interruptible=!1,t._stack.push(O_),e):e),O_=Hp({op:`SetInterruptible`,[_p](e){if(e.interruptible=this[pp],e._interruptedCause&&e.interruptible)return()=>Ng(e._interruptedCause)}})(!0),k_=e=>e===`unbounded`?1/0:Math.max(1,e??1),A_=()=>e=>{let t=e.onItem,n=e.step,r=(e,t,r,a,o)=>a_(w_(o),o=>n(e,t[r],o,r)??i(e,t,r+1,a)??Hg),i=(e,i,a=0,o=i.length)=>{for(;a<o;a++){let s=i[a],c=t(e,s,a);if(!o_(c))return r(e,i,a,o,c);let l=n(e,s,c,a);if(l)return l._tag===`Failure`?l:void 0}};return i},ate=e=>{let t=e.onItem,n=e.step;return(e,r,i)=>{let a=0,o=i.end??r.length,s=i.concurrency,c=!1,l,u,d,f,p,m=e=>{let t=Yp(e);return f=t,c=!0,u&&u.size>0?a_(D_(jg(Array.from(u))),()=>f??t):t},h=()=>{let i=!1;for(;!f&&a<o;a++){let o=r[a],g=p??t(e,o,a);if(o_(g)){if(f=n(e,o,g,a),f)break}else if(l){p=void 0;let t=ote(l,g,!0,!0,`inherit`);if(t._exit){if(f=n(e,o,t._exit,a),f)break;continue}u.add(t);let r=a;if(t.addObserver(a=>{u.delete(t);try{if(f){if(a._tag===`Failure`){let e=a.cause.reasons.filter(e=>e._tag!==`Interrupt`);if(e.length>0){let t=Ap(e);f=qp(f._tag===`Failure`?Mp(f.cause,t):t)}}}else{let t=n(e,o,a,r);t&&(f=t,h())}if(i){let e=h();e&&d(e)}else c&&u.size===0&&d(f??Hg)}catch(e){d(m(e))}}),u.size<s)continue;i=!0,a++;return}else return Kg(e=>{l=Cg(),u=new Set,p=g,d=e;let t;try{t=h()}catch(t){return e(m(t))}return t?e(t):Ig(()=>(f??=f_,a_(u?jg(u):Hg,()=>f?._tag===`Failure`?f:Hg)))})}if(c=!0,f){if(u&&u.size>0){let e=kg(l);u.forEach(t=>t.interruptUnsafe(l.id,e));return}if(d||f._tag===`Failure`)return f}else if(d){if(u)u.size===0&&d(Hg);else return f_}};return h()}},j_=()=>e=>ate(e),ote=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new wg(a.context,o);return r||(a.children().add(s),s._parent=a),n?s.evaluate(t):(s._asyncContext=Sg(),a.currentDispatcher.scheduleTask(()=>s.evaluate(t),0)),s},M_=e=>(t,n)=>{let r=new wg(n?.scheduler?lh(e,Kh,n.scheduler):e,n?.uninterruptible!==!0);if(r.evaluate(t),r._exit)return r;if(n?.signal){if(n.signal.aborted)r.interruptUnsafe();else{let e=()=>r.interruptUnsafe();n.signal.addEventListener(`abort`,e,{once:!0}),r.addObserver(()=>n.signal.removeEventListener(`abort`,e))}}return n?.onFiberStart&&n.onFiberStart(r),r},ste=M_(oh()),cte=(e=>{let t=M_(e);return e=>{if(o_(e))return e;let n=new Zh(`sync`),r=t(e,{scheduler:n});return r._dispatcher?.flush(),r._exit??Yp(new lte(r))}})(oh());$p(`TimeoutError`),$p(`IllegalArgumentError`),$p(`ExceededCapacityError`);var N_=`~effect/Cause/AsyncFiberError`,lte=class extends $p(`AsyncFiberError`){[N_]=N_;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}},P_=`~effect/Cause/UnknownError`,ute=class extends $p(`UnknownError`){[P_]=P_;constructor(e,t){super({message:t,cause:e})}},F_={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};F_.gray,F_.blue,F_.green,F_.yellow,F_.red,F_.bgBrightRed,F_.black;var I_=Lp,dte=Fp,L_=og,fte=hg;Wm()(`effect/Cause/StackTrace`),Wm()(`effect/Cause/InterruptorStackTrace`);var pte=Wp,R_=qp,z_=Jp,B_=f_,V_=d_,H_=`~effect/DateTime`,U_=`~effect/DateTime/TimeZone`,W_={[H_]:H_,pipe(){return Ad(this,arguments)},[tp](){return this.toString()},toJSON(){return mte(this).toJSON()}};({...W_}),{...W_};var G_={[U_]:U_,[tp](){return this.toString()}};({...G_}),{...G_};var mte=e=>new Date(e.epochMilliseconds);globalThis.String;var hte=e=>e.trim(),K_=Mg,q_=Ig,J_=Pg,Y_=zg,X_=Bg,Z_=Ug,gte=Lg,Q_=a_,$_=w_,ev=h_,_te=C_,vte=ste,tv=cte;Wm()(`effect/Effect/Transaction`);var yte=l_,bte=u_,nv=s_,xte=Jg;Wm()(`effect/DateTime/CurrentTimeZone`);var Ste=e=>wte(typeof e==`string`?Tte.encode(e):e),Cte=e=>{let t=Ete(e),n=t.length;if(n%4!=0)return Am(new ng({kind:`Decode`,module:`Base64`,input:t,message:`Length must be a multiple of 4, but is ${n}`}));let r=t.indexOf(`=`);if(r!==-1&&(r<n-2||r===n-2&&t[n-1]!==`=`))return Am(new ng({kind:`Decode`,module:`Base64`,input:t,message:`Found a '=' character, but it is not at the end`}));try{let e=t.endsWith(`==`)?2:+!!t.endsWith(`=`),r=new Uint8Array(n/4*3-e);for(let e=0,i=0;e<n;e+=4,i+=3){let n=av(t.charCodeAt(e))<<18|av(t.charCodeAt(e+1))<<12|av(t.charCodeAt(e+2))<<6|av(t.charCodeAt(e+3));r[i]=n>>16,r[i+1]=n>>8&255,r[i+2]=n&255}return km(r)}catch(e){return Am(new ng({kind:`Decode`,module:`Base64`,input:t,message:e instanceof Error?e.message:`Invalid input`}))}},wte=e=>{let t=e.length,n=``,r;for(r=2;r<t;r+=3)n+=rv[e[r-2]>>2],n+=rv[(e[r-2]&3)<<4|e[r-1]>>4],n+=rv[(e[r-1]&15)<<2|e[r]>>6],n+=rv[e[r]&63];return r===t+1&&(n+=rv[e[r-2]>>2],n+=rv[(e[r-2]&3)<<4],n+=`==`),r===t&&(n+=rv[e[r-2]>>2],n+=rv[(e[r-2]&3)<<4|e[r-1]>>4],n+=rv[(e[r-1]&15)<<2],n+=`=`),n},Tte=new TextEncoder,Ete=e=>e.replace(/[\n\r]/g,``),rv=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,iv=new Uint8Array(123).fill(255);for(let e=0;e<64;e++)iv[rv.charCodeAt(e)]=e;iv[61]=0;var av=e=>{if(e>=iv.length||iv[e]===255)throw TypeError(`Invalid character ${String.fromCharCode(e)}`);return iv[e]};eg(`CookiesError`),{...rp},{...rp};var ov=new WeakMap,sv=`~effect/Redacted`,Dte=e=>rf(e,sv),cv=(e,t)=>{let n=Object.create(Ote);return t?.label&&(n.label=t.label),ov.set(n,e),n},Ote={[sv]:{_A:e=>e},label:void 0,...yp,toJSON(){return this.toString()},toString(){return`<redacted${Kd(this.label)?`:`+this.label:``}>`},[af](){return of(ov.get(this))},[xf](e){return Dte(e)&&Sf(ov.get(this),ov.get(e))}};({...yp});function lv(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function uv(e){return t=>lv(t)?.[e]}var dv=`~structural`,fv=`~identifier`,pv=`~sentinels`,kte=`~constructor`,Ate=[`title`,`description`,`default`,`examples`,`readOnly`,`writeOnly`,`format`,`contentEncoding`,`contentMediaType`,`contentSchema`],mv=uv(`identifier`),hv=uv(fv),jte=uv(`title`),Mte=uv(`description`),gv=zd(e=>{let t=lv(e)?.identifier;return typeof t==`string`?t:e.getExpected(gv)}),_v=new Set([pv,dv,`representation`,`arbitraryConstraint`,`toJsonSchema`,`toCode`,`toEquivalence`,`toFormatter`,`toCodec`,`toCodecJson`,`toCodecStringTree`,`toCodecIso`,`toCodecArbitrary`]),vv=Symbol(),yv=pte,bv=yv(vv),xv=yv(vv),Sv=e=>e===vv?Tm():Em(e),Cv=e=>e._tag===`None`?bv:yv(e.value),wv=`~effect/SchemaIssue/Issue`;function Tv(e){return rf(e,wv)&&e[wv]===wv}function Ev(e){return Object.hasOwn(e,`input`)}var Dv=class{[wv]=wv;constructor(e,t){t?.reportInput===!0&&e!==vv&&(this.input=e)}},Ov=class extends Dv{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},kv=class extends Dv{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},Av=class extends Dv{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},jv=class extends Dv{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},Mv=class extends Dv{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},Nv=class extends Dv{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},Pv=class extends Dv{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},Fv=class extends Dv{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}},Iv=class extends Dv{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},Lv=class extends Dv{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function Rv(e,t,n){if(Tv(e))return e;if(typeof e==`string`)return new Fv({message:e},t,n);let r=typeof e.issue==`string`?new Fv({message:e.issue},t,n):e.issue;return new Av(e.path,r)}function zv(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new Fv(void 0,t,n):Rv(e,t,n)}function Bv(e,t,n,r){return Array.isArray(t)?Mee(t)?t.length===1?Rv(t[0],n,r):new Nv(e,Fm(t,e=>Rv(e,n,r)),n,r):void 0:zv(t,n,r)}var Vv=e=>{let t=Qv(e);if(t!==void 0)return t;switch(e._tag){case`InvalidType`:return Kv(gv(e.ast),e);case`InvalidValue`:{let t=Gv(e);if(t!==void 0)return Kv(t,e);let n=Wv(e);return n===void 0?`Expected a valid value`:`Invalid data ${n}`}case`MissingKey`:return`Missing key`;case`UnexpectedKey`:{let t=Wv(e);return t===void 0?`Expected no excess property`:`Unexpected key with value ${t}`}case`Forbidden`:return`Forbidden operation`;case`OneOf`:{let t=Wv(e);return t===void 0?`Expected exactly one member to match`:`Expected exactly one member to match the input ${t}`}}},Hv=e=>Qv(e.issue)??Qv(e);function Uv(e){return t=>({issues:qv(t,[],e?.leafHook??Vv,e?.checkHook??Hv)})}function Wv(e){return Ev(e)?Gf(e.input):void 0}function Gv(e){let t=e.annotations?.expected;return typeof t==`string`?t:void 0}function Kv(e,t){let n=Wv(t);return n===void 0?`Expected ${e}`:`Expected ${e}, got ${n}`}function qv(e,t,n,r){switch(e._tag){case`Filter`:{let i=r(e);if(i!==void 0)return[{path:t,message:i}];if(e.issue._tag!==`InvalidValue`)return qv(e.issue,t,n,r);let a=Gv(e.issue);return[{path:t,message:a===void 0?Kv(Jv(e.filter),e):Kv(a,e.issue)}]}case`Encoding`:return qv(e.issue,t,n,r);case`Pointer`:return qv(e.issue,[...t,...e.path],n,r);case`Composite`:return e.issues.flatMap(e=>qv(e,t,n,r));case`AnyOf`:return e.issues.length===0?[{path:t,message:Qv(e)??Kv(gv(e.ast),e)}]:e.issues.flatMap(e=>qv(e,t,n,r));default:return[{path:t,message:n(e)}]}}function Jv(e){let t=e.annotations?.expected;if(typeof t==`string`)return t;switch(e._tag){case`Filter`:return`<filter>`;case`FilterGroup`:return e.checks.map(e=>Jv(e)).join(` & `)}}function Yv(){return e=>Zv(e,``)}var Xv=Yv();function Zv(e,t){let n;switch(e._tag){case`Filter`:{let r=Hv(e);if(r!==void 0)n=r;else{if(e.issue._tag!==`InvalidValue`)return Zv(e.issue,t);let r=Gv(e.issue);n=r===void 0?Kv(Jv(e.filter),e):Kv(r,e.issue)}break}case`Encoding`:return Zv(e.issue,t);case`Pointer`:return Zv(e.issue,t+Jf(e.path));case`Composite`:case`AnyOf`:if(e._tag===`Composite`||e.issues.length>0)return e.issues.map(e=>Zv(e,t)).join(`
|
|
76
|
-
`);n=Qv(e)??Kv(gv(e.ast),e);break;default:n=Vv(e)}return t?`${n}\n at ${t}`:n}function Qv(e){if(e._tag===`Pointer`)return;if(e._tag===`Encoding`)return Qv(e.issue);let t=(e._tag===`Filter`?e.filter.annotations:`annotations`in e?e.annotations:e.ast.annotations)?.[e._tag===`MissingKey`?`messageMissingKey`:e._tag===`UnexpectedKey`?`messageUnexpectedKey`:`message`];if(typeof t==`string`)return t}function $v(e){let t;for(let n of e.reasons){if(!I_(n)||!Tv(n.error))return;t??=n.error}return t}function ey(e,t){let n=$v(e);if(n===void 0)throw Error(t,{cause:e});return n}var ty=e=>Object.assign(Object.create(jd),e),ny=ty({_tag:`Passthrough`});function ry(){return ny}function iy(e){return ty({_tag:`Transform`,transform:e})}function ay(e){return ty({_tag:`TransformEffect`,transform:e})}function oy(){return iy(globalThis.String)}function sy(){return iy(globalThis.Number)}function cy(){return iy(hte)}function ly(e){return ay((t,n)=>Z_({try:()=>JSON.parse(t,e?.reviver),catch:()=>new Fv({expected:`a valid JSON string`},t,n)}))}function uy(e){return ay((t,n)=>Z_({try:()=>{let n=JSON.stringify(t,e?.replacer,e?.space);if(n===void 0)throw TypeError(`Value cannot be represented as JSON`);return n},catch:()=>new Fv({expected:`a JSON-serializable value`},t,n)}))}function dy(){return iy(Ste)}function fy(){return ay((e,t)=>bte(gte(Cte(e)),()=>new Fv({expected:`a valid Base64 string`},e,t)))}var py=class extends Md{_tag=`Middleware`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new py(this.encode,this.decode)}},my=`~effect/SchemaTransformation/Transformation`,hy=class extends Md{[my]=my;_tag=`Transformation`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new hy(this.encode,this.decode)}};function gy(e){return rf(e,my)&&e[my]===my}var _y=e=>gy(e)?e:new hy(e.decode,e.encode);function vy(){return new hy(cy(),ry())}var yy=new hy(ry(),ry());function by(){return yy}var xy=new hy(sy(),oy()),Sy=new hy(fy(),dy());function Cy(e){return new hy(ly(e??{}),uy(e))}function wy(e){return t=>t._tag===e}var Ty=wy(`Declaration`),Ey=wy(`Null`),Dy=wy(`Undefined`),Oy=wy(`Never`),ky=wy(`String`),Ay=wy(`Number`),jy=wy(`Boolean`),My=wy(`Literal`),Ny=wy(`UniqueSymbol`),Py=wy(`Arrays`),Fy=wy(`Objects`),Iy=wy(`Union`),Ly=wy(`Suspend`),Ry=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},zy={},By=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,n=void 0,r=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=n,this.annotations=r}},Vy=`~effect/Schema`,Hy=class{[Vy]=Vy;annotations;checks;encoding;context;constructor(e=void 0,t=void 0,n=void 0,r=void 0){this.annotations=e,this.checks=t,this.encoding=n,this.context=r}toString(){return`<${this._tag}>`}},Uy=class extends Hy{_tag=`Declaration`;typeParameters;run;encodingChecks;encodingRun;constructor(e,t,n,r,i,a,o,s){super(n,r,i,a),this.typeParameters=e,this.run=t,this.encodingChecks=o,this.encodingRun=s}getParser(){let e;return(t,n)=>t===vv?bv:(e??=this.run(this.typeParameters))(t,this,n)}_rebuild(e,t,n,r,i){let a=lx(this.typeParameters,e);return a===this.typeParameters&&t===this.checks&&n===this.encodingChecks&&r===this.run&&i===this.encodingRun?this:new Uy(a,r,this.annotations,t,void 0,this.context,n,i)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks,this.run,this.encodingRun)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks,this.encodingRun??this.run,this.run)}getExpected(){let e=this.annotations?.expected;return typeof e==`string`?e:`<Declaration>`}},Wy=new class extends Hy{_tag=`Null`;getParser(){return Dx(this,null)}getExpected(){return`null`}},Gy=class extends Hy{_tag=`Undefined`;getParser(){return Dx(this,void 0)}toCodecJson(){return Zb(this,[Ky])}getExpected(){return`undefined`}},Ky=new Ry(Wy,new hy(iy(()=>void 0),iy(()=>null))),qy=new Gy,Jy=new class extends Hy{_tag=`Unknown`;getParser(){return Ox(this,ef)}getExpected(){return`unknown`}},Yy=class extends Hy{_tag=`Literal`;literal;constructor(e,t,n,r,i){if(super(t,n,r,i),typeof e==`number`&&!globalThis.Number.isFinite(e))throw Error(`A numeric literal must be finite, got ${Gf(e)}`);this.literal=e}getParser(){return Dx(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?Xy(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:Xy(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function Xy(e){let t=globalThis.String(e.literal);return Zb(e,[new Ry(new Yy(t),new hy(iy(()=>e.literal),iy(()=>t)))])}var Zy=new class extends Hy{_tag=`String`;getParser(){return Ox(this,Kd)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&Rx(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}},Qy=class extends Hy{_tag=`Number`;getParser(){return Ox(this,qd)}matchKey(e,t){return this._match(Nx,e,t)}matchPart(e,t){return this._match(Mx,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:Rx(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&($y(this.checks,`effect/schema/isFinite`)||$y(this.checks,`effect/schema/isInt`))?this:Zb(this,[Kb])}toCodecStringTree(){return this.toCodecJson()===this?Zb(this,[Ix]):Zb(this,[Lx])}getExpected(){return`number`}};function $y(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&$y(e.checks,t))}var eb=new Qy,tb=new class extends Hy{_tag=`Boolean`;getParser(){return Ox(this,Jd)}getExpected(){return`boolean`}},nb=class extends Hy{_tag=`Arrays`;isMutable;elements;rest;encodingChecks;constructor(e,t,n,r,i,a,o,s){super(r,i,a,o),this.isMutable=e,this.elements=t,this.rest=n,this.encodingChecks=s;let c=!1;for(let e=0;e<t.length;e++)if(_x(t[e]))c=!0;else if(c)throw Error(`A required element cannot follow an optional element. ts(1257)`);if(c&&n.length>1)throw Error(`A required element cannot follow an optional element. ts(1257)`);for(let e=1;e<n.length;e++)if(_x(n[e]))throw Error(`An optional element cannot follow a rest element. ts(1266)`)}getParser(e,t=e){let n=this,r,i,a=n.elements.length,o=Math.max(0,n.rest.length-1);function s(e,t){return t<a?r[t]:t>=e?i[t-e+1]:i[0]}let c=e=>{let{input:t,len:r,options:i}=e;if(n.rest.length===0&&r>a)for(let o=a;o<r;o++){let r=new Mv(n,t[o],i),a=new Av([o],r);if(i.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return J_(new Nv(n,[a],t,i))}return e.issues?J_(new Nv(n,e.issues,t,i)):yv(e.output)},l=(e,t)=>{let r=e.length,i={ast:n,getParser:s,input:e,len:r,tailThreshold:Math.max(a,r-o),output:new globalThis.Array(r),issues:void 0,options:t},u=n.rest.length===0?a:Math.max(r,a+o),d=t.concurrency===void 0?1:k_(t.concurrency),f=d===1?ab(i,e,0,u):ob(i,e,{concurrency:d,end:u});if(!f)return c(i);if(o_(f))return nv(f,()=>c(i));let p=!0;return q_(()=>p?(p=!1,Q_(f,()=>c(i))):l(e,t))};return(e,a)=>{if(e===vv)return bv;try{return Array.isArray(e)?(r||(r=n.elements.map(e=>({ast:e,parser:t(e)})),i=n.rest.map(e=>({ast:e,parser:t(e)}))),l(e,a)):J_(new Pv(n,e,a))}catch(e){return X_(e)}}}_rebuild(e,t,n){let r=lx(this.elements,e),i=lx(this.rest,e);return r===this.elements&&i===this.rest&&t===this.checks&&n===this.encodingChecks?this:new nb(this.isMutable,r,i,this.annotations,t,void 0,this.context,n)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return`array`}};function rb(e,t,n,r){if(n._tag===`Failure`)return sb(e,e.ast,r,n);let i=n===xv?t:n[pp];if(i!==vv)e.output[r]=i;else{let t=e.getParser(e.tailThreshold,r);if(_x(t.ast))return;let n=new Av([r],new jv(t.ast.context?.annotations));if(e.options.errors===`all`)e.issues?e.issues.push(n):e.issues=[n];else return z_(new Nv(e.ast,[n],e.input,e.options))}}var ib={onItem(e,t,n){let r=n<e.len?t:vv;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step:rb},ab=A_()(ib),ob=j_()(ib),sb=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=$v(r.cause);if(i===void 0)return R_(L_(r.cause,r=>new Nv(t,[new Av([n],r)],e.input,e.options)));let a=new Av([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return z_(new Nv(t,[a],e.input,e.options))},cb=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`;function lb(e,t,n=zy){let r,i;function a(t){switch(t._tag){case`String`:case`TemplateLiteral`:return(r??=Object.keys(e)).filter(e=>t.matchPart(e,n)!==void 0);case`Number`:return(r??=Object.keys(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Symbol`:return(i??=Object.getOwnPropertySymbols(e)).filter(r=>Object.prototype.propertyIsEnumerable.call(e,r)&&t.matchKey(r,n)!==void 0);case`Union`:return[...new Set(t.types.flatMap(a))];default:return[]}}return a(kx(Cx(t)))}var ub=class{name;type;constructor(e,t){this.name=e,this.type=t}};function db(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(db);default:return!1}}function fb(e){let t=$b(e);switch(t._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return t.types.every(fb);default:return!1}}function pb(e){return db(e)&&fb(e)}var mb=class{parameter;type;constructor(e,t){if(!pb(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,_x(t)&&!Ex(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},hb=class extends Hy{_tag=`Objects`;propertySignatures;indexSignatures;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=o}getParser(e,t=e){let n=this,r=n.propertySignatures.length,i=n.indexSignatures.length;if(!r&&!i)return Ox(n,$d);let a,o,s=()=>(a||(a=n.propertySignatures.map(e=>({parser:t(e.type),name:e.name,type:e.type})),o=i?n.indexSignatures.map(n=>({is:n,parserKey:e(kx(n.parameter)),parserValue:t(n.type)})):void 0),a),c=()=>{let e=new Set(n.propertySignatures.map(e=>typeof e.name==`number`?globalThis.String(e.name):e.name)),t=(t,i,a,o,s)=>{if(s._tag===`Failure`)return sb(t,n,i,s)??B_;let c=s===xv?o:s[pp];if(a!==vv&&c!==vv){if(r&&(e.has(i)||e.has(typeof a==`number`?globalThis.String(a):a)))return B_;If(t.out,a,c)}return B_},c=(e,r,i,a)=>{if(!a){let t=i.parserKey(r,e.options);if(!o_(t))return Q_($_(t),t=>c(e,r,i,t));a=t}if(a._tag===`Failure`)return sb(e,n,r,a)??B_;let o=a===xv?r:a[pp],s=e.input[r],l=i.parserValue(s,e.options);return o_(l)?t(e,r,o,s,l):Q_($_(l),n=>t(e,r,o,s,n))},l=(e,n,r)=>{let i=e.input[n],a=r.parserValue(i,e.options);return o_(a)?t(e,n,n,i,a):Q_($_(a),r=>t(e,n,n,i,r))},u=i?j_()({onItem:(e,[t,n])=>n.is.parameter===Zy?l(e,t,n):c(e,t,n),step:(e,t,n)=>n._tag===`Failure`?n:void 0}):void 0;return xte(function*(t,d){if(t===vv)return vv;if(!(typeof t==`object`&&t&&!Array.isArray(t)))return yield*J_(new Pv(n,t,d));s();let f=t,p={},m={ast:n,input:f,out:p,issues:void 0,options:d},h=d.errors===`all`,g=d.onExcessProperty===`error`,_=d.concurrency===void 0?1:k_(d.concurrency),v=i&&g?n.indexSignatures.map(e=>lb(f,e.parameter,d)):void 0;if(g){let r=v?new Set(e):e;if(v)for(let e of v)for(let t of e)r.add(t);let i=Reflect.ownKeys(f);for(let e=0;e<i.length;e++){let a=i[e];if(!r.has(a)&&Object.prototype.propertyIsEnumerable.call(f,a)){let e=new Mv(n,f[a],d),r=new Av([a],e);if(h){m.issues?m.issues.push(r):m.issues=[r];continue}return yield*J_(new Nv(n,[r],t,d))}}}if(r){let e=_===1?vb(m,a):yb(m,a,{concurrency:_});e&&(yield*e)}if(i&&_===1)for(let e=0;e<i;e++){let t=o[e],n=t.is.parameter===Zy?l:c,r=v?.[e]??(t.is.parameter===Zy?Object.keys(f):lb(f,t.is.parameter,d));for(let e=0;e<r.length;e++){let i=n(m,r[e],t);if(!o_(i))yield*i;else if(i._tag===`Failure`)return yield*i}}else if(u){let e=Pm();for(let t=0;t<i;t++){let n=o[t],r=v?.[t]??(n.is.parameter===Zy?Object.keys(f):lb(f,n.is.parameter,d));for(let t=0;t<r.length;t++)e.push([r[t],n])}let t=u(m,e,{concurrency:_});t&&(yield*t)}return m.issues?yield*J_(new Nv(n,m.issues,t,d)):p})};if(i)return c();let l,u=(e,t,n)=>{let r=a[t];return Q_($_(n),n=>{let i=gb(e,r,n);if(i)return i;let o=()=>yv(e.out),s=vb(e,a.slice(t+1));return s?nv(s,o):o()})};return(e,t)=>{if(e===vv)return bv;if(t.errors===`all`||t.onExcessProperty!==void 0||t.concurrency!==void 0&&k_(t.concurrency)!==1)return(l??=c())(e,t);if(!(typeof e==`object`&&e&&!Array.isArray(e)))return J_(new Pv(n,e,t));let r=s(),i=e,a={},o={ast:n,input:i,out:a,issues:void 0,options:t};try{for(let e=0;e<r.length;e++){let n=r[e],s=n.name,c=Ab(i,s),l=c?i[s]:vv,d=n.parser(l,t);if(!o_(d))return u(o,e,d);if(d===xv){c&&If(a,s,l);continue}let f=gb(o,n,d);if(f)return f}}catch(e){return X_(e)}return yv(a)}}_rebuild(e,t,n,r){let i=lx(this.propertySignatures,t=>{let n=e(t.type);return n===t.type?t:new ub(t.name,n)}),a=lx(this.indexSignatures,n=>{let r=t(n.parameter),i=e(n.type);return r===n.parameter&&i===n.type?n:new mb(r,i)});return i===this.propertySignatures&&a===this.indexSignatures&&n===this.checks&&r===this.encodingChecks?this:new hb(i,a,this.annotations,n,void 0,this.context,r)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?`object | array`:`object`}};function gb(e,t,n){if(n._tag===`Failure`)return sb(e,e.ast,t.name,n);if(n===xv)return;let r=n[pp];if(r!==vv){If(e.out,t.name,r);return}if(delete e.out[t.name],!_x(t.type)){let n=new Av([t.name],new jv(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}return z_(new Nv(e.ast,[n],e.input,e.options))}}var _b={onItem(e,t){if(!Ab(e.input,t.name))return t.parser(vv,e.options);let n=e.input[t.name];return If(e.out,t.name,n),t.parser(n,e.options)},step:gb},vb=A_()(_b),yb=j_()(_b);function bb(e,t){return e?t?[...e,...t]:e:t}function xb(e,t,n){return new hb(Reflect.ownKeys(e).map(t=>new ub(t,e[t].ast)),[],n,t)}function Sb(e){return e.ast}function Cb(e,t,n){return new Mb(e.map(Sb),t,void 0,n)}var wb=Bd(e=>{for(;;){if(Ly(e))return Jy;let t=e.encoding;if(!t)return e.recur?.(wb,Pd)??e;if(t.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==Pd))return Jy;e=t[t.length-1].to}});function Tb(e){switch(e._tag){case`Null`:return[`null`];case`Undefined`:return[`undefined`];case`String`:case`TemplateLiteral`:return[`string`];case`Number`:return[`number`];case`Boolean`:return[`boolean`];case`Symbol`:case`UniqueSymbol`:return[`symbol`];case`BigInt`:return[`bigint`];case`Arrays`:return[`array`];case`ObjectKeyword`:return[`object`,`array`,`function`];case`Objects`:return e.propertySignatures.length||e.indexSignatures.length?[`object`]:[`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`];case`Enum`:return Array.from(new Set(e.enums.map(([,e])=>typeof e)));case`Literal`:return[typeof e.literal];case`Union`:return Array.from(new Set(e.types.flatMap(Tb)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function Eb(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[pv];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!_x(t)){if(My(t))return[{key:e.name,literal:t.literal}];if(Ny(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!_x(e)){if(My(e))return[{key:t,literal:e.literal}];if(Ny(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>Eb(wb(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return Eb(e.thunk())}}var Db=new WeakMap,Ob=Object.freeze([]),kb=e=>e===null?`null`:Array.isArray(e)?`array`:typeof e,Ab=(e,t)=>t===`__proto__`?Object.hasOwn(e,t):t in e;function jb(e){let t=Db.get(e);if(t)return t;let n,r=0,i,a,o=!0,s=[];for(let t=0;t<e.length;t++){let c=e[t],l=wb(c);if(Oy(l))continue;if(My(l)||Ny(l)){a??=new Map;let e=My(l)?l.literal:l.symbol;s[t]=e;let n=a.get(e);n||a.set(e,n=[]),n.push(t)}else o=!1;let u=Eb(l);if(u.length){n??=new Map,r++;for(let{key:e,literal:r}of u){let i=n.get(e);i||n.set(e,i=[new Map,new Set]),i[1].add(t);let a=i[0].get(r);a||i[0].set(r,a=new Set),a.add(t)}}else{i??={};let e=Tb(l);for(let n of e)(i[n]??=[]).push(t)}}let c={},l=e=>c[e]??=Object.freeze(i?.[e]??Ob);if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??Ob;else if(n?.size===1&&!i){let[r,[i]]=n.entries().next().value,a=new Map;for(let[e,t]of i)a.set(e,Object.freeze(Array.from(t)));let o=Object.freeze(e.map((e,t)=>t));t=(e,t)=>{if(nf(e)){let n=Ab(e,r)?e[r]:void 0;if(n!==void 0)return a.get(n)??Ob;if(t)return o}return Ob}}else if(n){let e;for(let t of n)(!e||t[1][0].size>e[1][0].size)&&t[1][1].size===r&&(e=t);t=(t,r)=>{let a=kb(t);if(!nf(t))return l(a);let o=new Set(i?.[a]),s;if(e){let[n,[i]]=e,c=Ab(t,n),u=c?t[n]:void 0;if(c&&(!r||u!==void 0)){let e=i.get(u);if(!e)return l(a);for(let t of e)o.add(t);s=n}}if(s===void 0)for(let[e,[i,a]]of n){let n=Ab(t,e),s=n?t[e]:void 0;if(n&&(!r||s!==void 0)){let e=i.get(s);if(e)for(let t of e)o.add(t)}else if(r)for(let e of a)o.add(e)}for(let[e,[i,a]]of n){if(e===s)continue;let n=Ab(t,e),c=n?t[e]:void 0;if(n&&(!r||c!==void 0)){let e=i.get(c);for(let t of o)a.has(t)&&!e?.has(t)&&o.delete(t)}}return Array.from(o).sort((e,t)=>e-t)}}else t=e=>{let t=l(kb(e));return a?t.filter(t=>s[t]===void 0||s[t]===e):t};return Db.set(e,t),t}var Mb=class extends Hy{_tag=`Union`;types;options;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.types=e,this.options=t,this.encodingChecks=o}getParser(e,t){let n=this,r=t!==void 0,i=[],a=t=>i[t]??=e(n.types[t]),o;return(e,t)=>{if(e===vv)return bv;let i=(o??=jb(n.types))(e,r);if(i.length===0)return J_(new Iv(n,[],e,t));if(i.length===1){let r=a(i[0])(e,t);return r._tag===`Success`?r:o_(r)?Nb(n,r.cause,e,t):Pb(n,r,e,t)}return Fb(n,a,i,e,t)}}_rebuild(e,t,n){let r=lx(this.types,e);return r===this.types&&t===this.checks&&n===this.encodingChecks?this:new Mb(r,this.options,this.annotations,t,void 0,this.context,n)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let n of this.types){let r=n.matchPart(e,t);if(r!==void 0)return r}}getExpected(e){let t=this.annotations?.expected;if(typeof t==`string`)return t;if(this.types.length===0)return`never`;let n=this.types.map(t=>{let n=Cx(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter(My);if(t.length>0)return`${zb(n.isMutable)}[ ${t.map(t=>e(t)+Bb(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>My(e.type));if(t.length>0)return`{ ${t.map(t=>`${zb(t.type.context?.isMutable)}${qf(t.name)}${Bb(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function Nb(e,t,n,r){let i=$v(t);return i?z_(new Iv(e,[i],n,r)):R_(t)}function Pb(e,t,n,r){return ev(t,t=>Nb(e,t,n,r))}function Fb(e,t,n,r,i){let a={ast:e,parser:t,input:r,out:void 0,successes:e.options?.mode===`oneOf`?[]:void 0,issues:void 0,options:i},o=Lb(a,n);if(!o)return a.out?a.out:J_(new Iv(e,a.issues??[],r,i));if(o_(o))return Ib(o,a);let s=!0;return q_(()=>s?(s=!1,Ib(o,a)):Fb(e,t,n,r,i))}function Ib(e,t){return nv(e,e=>t.out===xv?K_(t.input):t.out?t.out:J_(new Iv(t.ast,t.issues??[],t.input,t.options)))}var Lb=A_()({onItem(e,t){return e.parser(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=$v(n.cause);if(t===void 0)return n;e.issues?e.issues.push(t):e.issues=[t]}else{if(e.out&&e.successes)return e.successes.push(e.ast.types[t]),z_(new Lv(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(e.ast.types[t]);else return B_}}}),Rb=new Mb([new Yy(`Infinity`),new Yy(`-Infinity`),new Yy(`NaN`)]);function zb(e){return e?``:`readonly `}function Bb(e){return e?`?`:``}var Vb=class extends Md{_tag=`Filter`;run;annotations;aborted;constructor(e,t=void 0,n=!1){super(),this.run=e,this.annotations=t,this.aborted=n}annotate(e){return new Vb(this.run,{...this.annotations,...e},this.aborted)}abort(){return new Vb(this.run,this.annotations,!0)}and(e,t){return new Hb([this,e],t)}},Hb=class extends Md{_tag=`FilterGroup`;checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(e){return new Hb(this.checks,{...this.annotations,...e})}and(e,t){return new Hb([this,e],t)}};function Ub(e,t,n=!1){return new Vb((t,n,r)=>Bv(n,e(t,n,r),t,r),t,n)}function Wb(e){return Ub(e=>globalThis.Number.isFinite(e),{expected:`a finite number`,representation:{id:`effect/schema/isFinite`,payload:null},toJsonSchema:()=>({type:`number`}),toCode:()=>({runtime:`Schema.isFinite()`}),arbitraryConstraint:{number:`finite`},...e})}var Gb=nx(eb,[Wb()]),Kb=new Ry(new Mb([Gb,Rb]),new hy(sy(),iy(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function qb(e,t){let n=new globalThis.RegExp(e),r={source:n.source,flags:n.flags};return Ub(e=>(n.lastIndex=0,n.test(e)),{expected:`a string matching the RegExp ${r.source}`,representation:{id:`effect/schema/isPattern`,payload:r},toJsonSchema:()=>[{},!0],arbitraryConstraint:{patterns:[r]},...t})}var Jb=new WeakMap;function Yb(e,t){let n=Object.assign(Object.create(Object.getPrototypeOf(e)),e,t);return Reflect.ownKeys(t).every(e=>e===`context`||e===`encoding`)&&Jb.set(n,Xb(e)),n}function Xb(e){let t=Jb.get(e);if(t!==void 0)return t;if(e.encoding===void 0)return e;let n=Object.assign(Object.create(Object.getPrototypeOf(e)),e,{encoding:void 0});return Jb.set(e,n),n}function Zb(e,t){return e.encoding===t?e:Yb(e,{encoding:t})}function Qb(e,t){if(e.context===t)return e;let n=Xb(e);return n.context===t&&n.encoding===e.encoding?n:Yb(e,{context:t})}function $b(e){return e.encoding?$b(e.encoding[e.encoding.length-1].to):e}function ex(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return tx(e,Nm(e.checks.slice(0,-1),n.annotate(t)))}return Yb(e,{annotations:{...e.annotations,...t}})}function tx(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);return e.checks===t?e:Yb(e,{checks:t})}function nx(e,t){return tx(e,bb(e.checks,t))}function rx(e,t){let n=t(e.to);return n===e.to?e:new Ry(n,e.transformation)}function ix(e,t){let n=e,r=n[n.length-1],i=rx(r,t);return i===r?e:Nm(e.slice(0,e.length-1),i)}function ax(e){return t=>t.encoding?Zb(t,ix(t.encoding,e)):t}function ox(e,t){return ax(e=>Qb(e,t))(e)}function sx(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:Zb(r,ix(r.encoding,n))}return e(r)}return Bd(n)}function cx(e,t,n){let r=new Ry(e,t);return Zb(n,n.encoding?[...n.encoding,r]:[r])}function lx(e,t){let n;for(let r=0;r<e.length;r++){let i=e[r],a=t(i);if(n)n[r]=a;else if(a!==i){n=Array(e.length);for(let t=0;t<r;t++)n[t]=e[t];n[r]=a}}return n??e}function ux(e,t){return Qb(e,e.context?new By(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new By(!1,!1,void 0,t))}var dx=Bd(e=>fx(Qb(e,e.context?e.context.isOptional===!1?new By(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new By(!0,!1)))),fx=ax(dx),px=zd(e=>dx(new Mb([e,qy])));function mx(e,t,n){return cx(e,n,t)}function hx(e){let t=[],n=[];function r(e){switch(e._tag){case`Literal`:Xd(e.literal)&&!t.includes(e.literal)&&t.push(e.literal);return;case`UniqueSymbol`:t.includes(e.symbol)||t.push(e.symbol);return;case`Never`:return;case`Union`:for(let t=0;t<e.types.length;t++)r(e.types[t]);return;default:n.push(e)}}return r(e),{literals:t,parameters:n}}function gx(e,t){let{literals:n,parameters:r}=hx(e);return new hb(n.map(e=>new ub(e,t)),r.map(e=>new mb(e,t)))}function _x(e){return e.context?.isOptional??!1}function vx(e){return e.context?.isMutable??!1}function yx(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(yx)}function bx(e){function t(e){return yx(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return jee(n)?n:void 0}function xx(e){let t=!0;function n(e){return t=t&&!e.encoding&&!Ly(e),t&&`recur`in e&&e.recur(n),e}return`recur`in e&&e.recur(n),t}var Sx=Bd(e=>{let t=Xb(e);if(t!==e){let n=Sx(t);return n===t&&e.encoding===void 0?e:Qb(n,e.context)}let n=`recur`in e?e.recur(Sx):e;if(`encodingChecks`in n&&n.encodingChecks){let t=xx(e)?n.encodingChecks:Py(n)||Fy(n)||Ty(n)&&n.typeParameters.length>0?bx(n.encodingChecks):void 0;return Yb(n,{encodingChecks:void 0,checks:bb(n.checks,t)})}return n}),Cx=Bd(e=>Sx(Tx(e)));function wx(e,t){let n=t,r=n.length,i=n[r-1],a=[new Ry(Tx(Zb(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new Ry(Tx(n[e-1].to),n[e].transformation.flip()));let o=Tx(i.to);return o.encoding?Zb(o,[...o.encoding,...a]):Zb(o,a)}var Tx=zd(e=>{if(e.encoding)return wx(e,e.encoding);let t=Xb(e);if(t!==e){let n=Tx(t);return n===t?e:Qb(n,e.context)}return`flip`in e?e.flip(Tx):`recur`in e?e.recur(Tx):e});function Ex(e){switch(e._tag){case`Undefined`:return!0;case`Union`:return e.types.some(Ex);default:return!1}}function Dx(e,t){let n=t===0?xv:yv(t);return(r,i)=>r===vv?bv:r===t?n:J_(new Pv(e,r,i))}function Ox(e,t){return(n,r)=>n===vv?bv:t(n)?xv:J_(new Pv(e,n,r))}var kx=sx(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur(kx)}}),Ax=sx(e=>{switch(e._tag){default:return e;case`Symbol`:case`UniqueSymbol`:return e.toCodecStringTree();case`Union`:return e.recur(Ax)}}),jx=`[\\s\\S]*?`,Mx=new globalThis.RegExp(`^${cb}$`),Nx=new globalThis.RegExp(`^(?:${cb}|Infinity|-Infinity|NaN)$`);function Px(e){return qb(Mx,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:Mx.source}),...e})}var Fx=nx(Zy,[Px()]),Ix=new Ry(Fx,xy),Lx=new Ry(new Mb([Fx,Rb]),xy);function Rx(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=Rx(o.checks,t,n,r,i),n&&(i.errors!==`all`||n[n.length-1].filter.aborted))return n}else{let e=o.run(t,r,i);if(e){let r=new Ov(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function zx(e){if(!Ty(e))return;let t=e.annotations?.[kte];return Zd(t)?t(e.typeParameters):void 0}var Bx=lv,Vx=jte,Hx=Mte;function Ux(e){return e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&globalThis.Number.isFinite(e)}function Wx(e){return e===void 0||typeof e==`string`}function Gx(e,t){let n=new WeakMap,r=[];outer:for(;;){if(typeof e!=`object`||!e){if(!t(e))return!1}else{let t=e,i=n.get(t);if(i===!1)return!1;if(i===void 0){let e=Array.isArray(t);if(!e){let e=Object.getPrototypeOf(t);if(e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null)return!1}n.set(t,!1),r.push({value:t,keys:e?t.length:Object.keys(t),index:0})}}for(;r.length>0;){let t=r[r.length-1],i=t.keys;if(typeof i==`number`){if(t.index<i){e=t.value[t.index++];continue outer}}else if(t.index<i.length){e=t.value[i[t.index++]];continue outer}n.set(t.value,!0),r.pop()}return!0}}function Kx(e){return Gx(e,Ux)}var qx=new Uy([],()=>(e,t,n)=>Kx(e)?xv:J_(new Pv(t,e,n)),{representation:{id:`effect/schema/Json`,payload:null},expected:`JSON value`,toCodecJson:()=>void 0,toCodecStringTree:()=>Zx}),Jx=new Ry(qx,by()),Yx=new Ry(new Mb([new nb(!1,[],[qx]),new hb([],[new mb(Zy,qx)])]),by());function Xx(e){return Gx(e,Wx)}var Zx=new Ry(new Uy([],()=>(e,t,n)=>Xx(e)?xv:J_(new Pv(t,e,n)),{expected:`StringTree`,toCodecStringTree:()=>void 0}),by()),Qx=(e,t,n)=>e===xv?n(t):nv(e,n);function $x(e){if(e._tag===`Middleware`)return(t,n,r)=>eS(t===xv?e.decode(yv(Sv(n)),r):e.decode(yte(t,Sv),r));let t=e.decode;switch(t._tag){case`Passthrough`:return(e,t)=>e===xv?yv(t):e;case`Transform`:{let e=e=>e===vv?bv:yv(t.transform(e));return(t,n)=>Qx(t,n,e)}case`TransformOptional`:{let e=e=>Cv(t.transform(Sv(e)));return(t,n)=>Qx(t,n,e)}case`TransformEffect`:return(e,n,r)=>Qx(e,n,e=>e===vv?bv:t.transform(e,r));case`TransformOptionalEffect`:return(e,n,r)=>Qx(e,n,e=>eS(t.transform(Sv(e),r)))}}var eS=e=>nv(e,Cv),tS=(e,t,n,r)=>ev(r,r=>Y_(()=>L_(r,r=>new kv(e,r,t,n))));function nS(e,t){let n=$x(e.link.transformation),r;return(i,a)=>{if(i===vv)return bv;if(e.isConstructed(i))return xv;let o=(r??=t(e.link.to))(i,a);return n(o,i,a)}}function rS(e,t){let n=e.context.constructorDefault;return(r,i)=>{if(r!==vv&&r!==void 0)return t(r,i);let a=n;if(o_(a)&&a._tag===`Success`){let e=t(a[pp],i);return e===xv?a:e}return nv(tS(e,r,i,a),e=>{let n=t(e,i);return n===xv?yv(e):n})}}function iS(e,t){let n=t(e);return e.context?.constructorDefault===void 0?n:rS(e,n)}function aS(e,t,n,r,i){if(e._tag===`Declaration`)for(let n of e.typeParameters)t(n);let a=n?zx(e):void 0,o=a?nS(a,t):r??e.getParser(t,n),s=e.checks,c=e.encoding,l=c?.map(e=>$x(e.transformation)),u=e.encodingChecks;if(!c&&!s&&!u)return o;let d,f=(t,n)=>{let r=o(t,n);if(u&&!n.disableChecks){if(o_(r)){if(r._tag===`Success`){let i=r===xv?t:r[pp];if(t!==vv&&i!==vv){let i=Rx(u,t,void 0,e,n);i&&(r=J_(new Nv(e,i,t,n)))}}}else r=Q_(r,r=>{if(t!==vv&&r!==vv){let r=Rx(u,t,void 0,e,n);if(r)return J_(new Nv(e,r,t,n))}return K_(r)})}if(s&&!n.disableChecks){if(o_(r)){if(r._tag===`Success`){let i=r===xv?t:r[pp];if(i===vv)return r;let a=Rx(s,i,void 0,e,n);a&&(r=J_(new Nv(e,a,i,n)))}}else r=Q_(r,t=>{if(t!==vv){let r=Rx(s,t,void 0,e,n);if(r)return J_(new Nv(e,r,t,n))}return K_(t)})}return r},p=i===void 0?f:i(f);return c?(n,r)=>{let i=d??=c.map(e=>t(e.to)),a=n,o=i[i.length-1](n,r);for(let e=c.length-1;e>=0;e--)if(o=l[e](o,a,r),e!==0){let t=i[e-1];o._tag===`Success`?(a=o[pp],o=t(a,r)):o=nv(o,e=>{let n=t(e,r);return n===xv?yv(e):n})}if(o._tag===`Success`){let e=o[pp],t=p(e,r);return t===xv?o:t}return o=tS(e,n,r,o),nv(o,e=>{let t=p(e,r);return t===xv?yv(e):t})}:p}var oS=Symbol(),sS=new WeakMap,cS=e=>fS(e).parser,lS=e=>fS(e).makeEffect,uS=e=>iS(e,lS),dS=class{ast;constructor(e){this.ast=e}get decodeEffect(){return this.cachedDecodeEffect??=aS(this.ast,cS)}get parser(){return this.decodeEffect}get makeEffect(){return this.cachedMakeEffect??=aS(this.ast,lS,uS)}};function fS(e){let t=sS.get(e);if(t!==void 0)return t;let n=new dS(e);return sS.set(e,n),n}function pS(e){let t=e.ast,n;return(e,r)=>(n??=ES(NS,Sx(t)))(e,r?.disableChecks?r?.parseOptions?{...r.parseOptions,disableChecks:!0}:{disableChecks:!0}:r?.parseOptions)}function mS(e){let t=pS(e);return(e,n)=>{let r=tv(t(e,n));return V_(r)?Em(r.value):(ey(r.cause,`Option adapter can only return none for schema issues`),Tm())}}function hS(e){return jS(Sx(e.ast))}function gS(e){return vS(e.ast)}function _S(e){{let t=DS(wS(e));return e=>{let n=t(e,zy);return V_(n)?!0:(ey(n.cause,`Type guard adapter can only return false for schema issues`),!1)}}}function vS(e){let t=Sx(e),n=e=>(n=_S(t),n(e));return e=>n(e)}function yS(e,t){let n=wS(e.ast);return t===void 0?n:(e,r)=>n(e,SS(t,r))}function bS(e,t){return OS(yS(e,t))}function xS(e,t){return kS(yS(e,t))}var SS=(e,t)=>t?{...e,...t}:e,CS=e=>e===vv?J_(new Fv):K_(e);function wS(e){return ES(MS,e)}function TS(e,t){return e===xv?K_(t):o_(e)?e[pp]===vv?CS(vv):e:nv(e,CS)}function ES(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??zy);return a===xv?K_(r):o_(a)?a[pp]===vv?CS(vv):a:nv(a,CS)}}function DS(e){return(t,n)=>tv(e(t,n))}function OS(e){let t=DS(e);return(e,n)=>{let r=t(e,n);return V_(r)?Em(r.value):(ey(r.cause,`Option adapter can only return none for schema issues`),Tm())}}function kS(e){let t=DS(e);return(e,n)=>{let r=t(e,n);return V_(r)?km(r.value):Am(ey(r.cause,`Result adapter can only return schema issues`))}}function AS(e,t){let n=tv(e);if(V_(n))return n.value;let r=ey(n.cause,t);throw Error(`Schema validation failed`,{cause:r})}function jS(e){let t,n;return(r,i)=>{t??=fS(e);let a=i?.disableChecks?i.parseOptions?{...i.parseOptions,disableChecks:!0}:{disableChecks:!0}:i?.parseOptions??zy,o=t.make;if(o!==void 0&&r!==vv){let e;try{e=o(r,a)}catch(e){throw ey(dte(e),`Constructor adapter can only throw schema issues`),e}if(e!==oS&&e!==vv)return e}return AS(TS((n??=t.makeEffect)(r,a),r),`Constructor adapter can only throw schema issues`)}}var MS=e=>fS(e).parser,NS=e=>fS(e).makeEffect,PS=`~effect/Schema/Schema`,FS=Symbol(),IS={[PS]:PS,get make(){let e=hS(this);return Object.defineProperty(this,"make",{value:e,enumerable:!0}),e},get makeEffect(){let e=pS(this);return Object.defineProperty(this,"makeEffect",{value:e,enumerable:!0}),e},get makeOption(){let e=mS(this);return Object.defineProperty(this,"makeOption",{value:e,enumerable:!0}),e},pipe(){return Ad(this,arguments)},annotate(e){return this.rebuild(ex(this.ast,e))},annotateKey(e){return this.rebuild(ux(this.ast,e))},check(...e){return this.rebuild(nx(this.ast,e))},rebuild(e){return LS(e,this[FS])}};function LS(e,t){function n(){}let r=Object.setPrototypeOf(n,IS);return t&&(Object.hasOwn(t,`name`)||Object.hasOwn(t,`length`)||Object.hasOwn(t,`__proto__`))?Object.defineProperties(r,Object.getOwnPropertyDescriptors({...t})):Object.assign(r,t),r[FS]=t,r.ast=e,r}function RS(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function zS(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function BS(e){return encodeURI(RS(e)).replace(/#/g,`%23`)}function VS(e){if(e.length===0||e===`#`)return``;if(!e.startsWith(`#`))return;let t=e.slice(1);try{if(encodeURI(t).replace(/%25/g,`%`).replace(/#/g,`%23`)!==t)return;let e=decodeURIComponent(t);return e.startsWith(`/`)&&!/~(?:[^01]|$)/.test(e)?e:void 0}catch{return}}function HS(e,t){return n(e,!1,!0);function n(e,r,i=!1){if(!tf(e))return e;let a=r||!i&&KS(e.$id),o={};for(let t of Object.keys(e)){let r=e[t],i=r;switch(t){case`$defs`:case`properties`:case`patternProperties`:case`dependentSchemas`:i=GS(r,e=>n(e,a))??r;break;case`allOf`:case`anyOf`:case`oneOf`:case`prefixItems`:i=Array.isArray(r)?r.map(e=>n(e,a)):r;break;case`not`:case`additionalProperties`:case`propertyNames`:case`unevaluatedProperties`:case`items`:case`contains`:case`unevaluatedItems`:case`if`:case`then`:case`else`:case`contentSchema`:i=n(r,a)}If(o,t,i)}return t(o,a),o}}function US(e,t){return HS(e,e=>{WS(e,t)})}function WS(e,t){typeof e.$ref==`string`&&If(e,`$ref`,t(e.$ref,`$ref`)),typeof e.$dynamicRef==`string`&&If(e,`$dynamicRef`,t(e.$dynamicRef,`$dynamicRef`))}function GS(e,t){if(!tf(e))return;let n={};for(let r of Object.keys(e))If(n,r,t(e[r],r));return n}function KS(e){return typeof e==`string`&&e.length>0&&e[0]!==`#`}var qS=[`$anchor`,`$defs`,`$dynamicAnchor`,`$dynamicRef`,`$vocabulary`,`contentSchema`,`dependentRequired`,`dependentSchemas`,`maxContains`,`minContains`,`prefixItems`,`unevaluatedItems`,`unevaluatedProperties`];[...qS],[...qS];var JS=sx(e=>{let t=$S(e,JS),n=e.context;return t===e||n===void 0?t:ox(t,YS(n))});function YS(e){return e.constructorDefault===void 0?e:new By(e.isOptional,e.isMutable,void 0,e.annotations)}function XS(e){if(e.propertySignatures.some(e=>typeof e.name!=`string`))throw new globalThis.Error(`Objects property names must be strings`,{cause:e})}function ZS(e){return t=>{let n=[...t].sort((t,n)=>e(Cx(t))-e(Cx(n)));return n.some((e,n)=>e!==t[n])?n:t}}var QS=ZS(e=>{switch(e._tag){case`BigInt`:case`Symbol`:case`UniqueSymbol`:return 0;default:return 1}});function $S(e,t){switch(e._tag){case`Declaration`:{let n=e.annotations?.toCodecJson??e.annotations?.toCodec;if(!Zd(n))return Zb(e,[Jx]);let r=n(e.typeParameters.map(e=>LS(Cx(e))));return r===void 0?e:Zb(e,[rx(r,t)])}case`Unknown`:return Zb(e,[Jx]);case`ObjectKeyword`:return Zb(e,[Yx]);case`Undefined`:case`Void`:case`Literal`:case`Number`:return e.toCodecJson();case`UniqueSymbol`:case`Symbol`:case`BigInt`:return e.toCodecStringTree();case`Objects`:return XS(e),e.recur(t,Ax);case`Union`:{let n=QS(e.types);return n===e.types?e.recur(t):new Mb(n,e.options,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t)}case`Arrays`:case`Suspend`:return e.recur(t)}return e}globalThis.RegExp;var eC=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,`\\$&`);function tC(e,t){return t.length>0&&(e+=`\n at ${Jf(t)}`),Error(e)}function nC(e){return`#/$defs/${BS(e)}`}var rC=new Set([..._v,fv,...Ate]);function iC(e,t){if(e===void 0)return;let n={},r=e.title;typeof r==`string`&&(n.title=r);let i=e.description,a=e.expected;typeof i==`string`?n.description=i:t?.generateDescriptions===!0&&typeof a==`string`&&(n.description=a);let o=e.default;Kx(o)&&(n.default=o);let s=e.examples;Array.isArray(s)&&Kx(s)&&(n.examples=s);let c=e.readOnly;typeof c==`boolean`&&(n.readOnly=c);let l=e.writeOnly;typeof l==`boolean`&&(n.writeOnly=l);let u=e.format;typeof u==`string`&&(n.format=u);let d=e.contentEncoding;typeof d==`string`&&(n.contentEncoding=d);let f=e.contentMediaType;typeof f==`string`&&(n.contentMediaType=f);let p=e.contentSchema;if(Kx(p)&&(n.contentSchema=p),t?.includeAnnotationKey!==void 0)for(let[r,i]of Object.entries(e))rC.has(r)||!t.includeAnnotationKey(r)||Kx(i)&&If(n,r,i);return Object.keys(n).length===0?void 0:n}function aC(e){let t=e.type===`number`||e.type===`integer`?e.type:void 0,n=e;if(t!==void 0&&(n={...e},delete n.type),Array.isArray(n.allOf)){let e=[],r=!1;for(let i of n.allOf){let n=aC(i);n.type!==void 0&&(r=!0,(t===void 0||n.type===`integer`)&&(t=n.type)),Object.keys(n.schema).length>0&&e.push(n.schema)}if(r){let{allOf:t,...r}=n;n=e.length===0?r:{...r,allOf:e}}}return{type:t,schema:n}}function oC(e){if(!Array.isArray(e.anyOf)||e.anyOf.length!==2||e.anyOf[0]?.type!==`number`)return!1;let t=e.anyOf[1];return t?.type===`string`&&Array.isArray(t.enum)&&t.enum.length===3&&t.enum.includes(`NaN`)&&t.enum.includes(`Infinity`)&&t.enum.includes(`-Infinity`)}var sC=`|type|format|pattern|multipleOf|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength|minItems|maxItems|uniqueItems|minProperties|maxProperties|propertyNames|`;function cC(e,t){return Object.keys(e).every(e=>t.includes(`|${e}|`))}function lC(e,t){return typeof e.$ref!=`string`&&t.every(t=>!Object.hasOwn(e,t))}var uC=`|title|description|default|examples|readOnly|writeOnly|`,dC=sC+uC;function fC(e,t,n){if(Object.keys(e).length===0)return t;let r=Object.keys(t);if(r.length===0)return e;let i=e.type===`number`||e.type===`integer`?e.type:void 0,a=oC(e);if(i!==void 0||a){let r=aC(t);if(r.type!==void 0){let t=i===`integer`||r.type===`integer`?`integer`:`number`,o={...e,type:t};a&&delete o.anyOf;let s=Object.keys(r.schema);return s.length===0?o:cC(r.schema,uC)&&lC(o,s)?{...o,...r.schema}:fC(o,r.schema,n)}}if(n&&lC(e,r))return{...e,...t};let o=Array.isArray(t.allOf)&&r.length===1?t.allOf:[t];return Array.isArray(e.allOf)?{...e,allOf:[...e.allOf,...o]}:typeof e.$ref==`string`?{allOf:[e,...o]}:{...e,allOf:o}}function pC(e,t=new Set){return typeof e==`boolean`?e:t.has(e)?!0:(t.add(e),e.every(e=>pC(e,t)))}function mC(e){return Array.isArray(e)}function hC(e,t,n,r){let i=new Map,a=new Map,o=new WeakMap,s=new Map,c=new Map,l=Object.keys(n);for(let e of l)m(e,[`references`,e]);let u=Fm(e,(e,n)=>v(e,t[n],[]));for(let[e,t]of s.values())if(!pC(e))for(let e of t)Array.isArray(e.oneOf)&&(e.anyOf=e.oneOf,delete e.oneOf);for(let e of l){let t=n[e],r=g(t);if(r===void 0)continue;let o=i.get(e)[0],s=c.get(r),l=s?.find(e=>Sf(i.get(e)[0],o));l===void 0?s===void 0?c.set(r,[e]):s.push(e):a.set(e,l)}let d=Fm(u,h),f={};for(let e of l)a.has(e)||If(f,e,h(i.get(e)[0]));return{dialect:`draft-2020-12`,schemas:d,definitions:f};function p(e){return Array.isArray(e.oneOf)&&s.get(e.oneOf)?.[1].push(e),e}function m(e,t){if(!Object.hasOwn(n,e))throw tC(`Invalid reference ${e}`,[...t,`$ref`]);let r=i.get(e);if(r!==void 0)return r;let a=[{},[]];return i.set(e,a),a[0]=v(n[e],[`references`,e],a[1]),a}function h(e){return US(e,e=>{let t=VS(e);if(t===void 0){if(/^#(?:\/|%2f)/i.test(e))throw Error(`Invalid JSON Pointer URI fragment ${JSON.stringify(e)}`);return e}if(!t.startsWith(`/$defs/`))return e;let n=t.indexOf(`/`,7),r=a.get(zS(t.slice(7,n<0?void 0:n)));return r===void 0?e:e.replace(/^#(?:\/|%2f).*?(?:\/|%2f).*?(?=\/|%2f|$)/i,nC(r))})}function g(e){if(e._tag===`Reference`)return;let t=e.checks.length===0?e.annotations:e.checks[e.checks.length-1].annotations;return typeof t?.identifier!=`string`&&typeof t?.[`~identifier`]==`string`?t[fv]:void 0}function _(e,t,n,i){let a=e.annotations,o=a?.toJsonSchema;if(o!==void 0){let s=o({type:t,schemas:e.representation?.schemas?.map((e,t)=>v(e,[...n,`representation`,`schemas`,t],i))??[]}),c=mC(s);c&&i.push(!1);let l=c?s[0]:s,u=iC(a,r),d=u===void 0?l:{...l,...u},f=u===void 0?sC:dC;return[d,e._tag===`Filter`&&cC(d,f)&&(u===void 0||cC(u,uC))?!0:void 0]}if(e._tag===`Filter`){i.push(!1);return}let s=e.checks.flatMap((e,r)=>{let a=_(e,t,[...n,`checks`,r],i);return a===void 0?[]:[a[0]]});if(s.length===0)return;let c=iC(a,r),l={allOf:s};return[c===void 0?l:{...l,...c}]}function v(e,t,n){if(e._tag===`Reference`)return n.push(m(e.$ref,t)[1]),{$ref:nC(e.$ref)};let i=o.get(e);if(i!==void 0)return n.push(i[1]),i[0];let a=[];n.push(a);let s=y(e,t,a),c=iC(e.annotations,r);c!==void 0&&(s={...s,...c});for(let n=0;n<e.checks.length;n++){let r=typeof s.type==`string`&&gC(s.type)?s.type:void 0,i=_(e.checks[n],r,[...t,`checks`,n],a);i!==void 0&&(s=fC(s,...i))}return o.set(e,[s,a]),p(s)}function y(e,t,n){switch(e._tag){case`Any`:case`Unknown`:return{};case`ObjectKeyword`:return{anyOf:[{type:`object`},{type:`array`}]};case`Void`:case`Undefined`:case`Null`:return{type:`null`};case`BigInt`:return{type:`string`,allOf:[{pattern:`^-?\\d+$`}]};case`Symbol`:return{type:`string`,allOf:[{pattern:`^Symbol\\(([\\s\\S]*)\\)$`}]};case`UniqueSymbol`:return globalThis.Symbol.keyFor(e.symbol)===void 0?{not:{}}:{type:`string`,enum:[globalThis.String(e.symbol)]};case`Declaration`:return n.push(!1),{};case`Suspend`:return v(e.thunk,[...t,`thunk`],n);case`Never`:return{not:{}};case`String`:return{type:`string`};case`Number`:return{anyOf:[{type:`number`},{type:`string`,enum:[`NaN`,`Infinity`,`-Infinity`]}]};case`Boolean`:return{type:`boolean`};case`Literal`:{let t=e.literal;return typeof t==`bigint`?{type:`string`,enum:[globalThis.String(t)]}:{type:typeof t,enum:[t]}}case`Enum`:{let n=e.enums.map(([e,n],r)=>{if(typeof n==`number`&&!globalThis.Number.isFinite(n))throw tC(`Invalid numeric enum value ${globalThis.String(n)}`,[...t,`enums`,r,1]);return{type:typeof n,enum:[n],title:e}});return n.length===0?{not:{}}:{anyOf:n}}case`TemplateLiteral`:return{type:`string`,pattern:`^${e.parts.map(vC).join(``)}$`};case`Arrays`:{if(e.rest.length>1)throw tC(`Invalid schema representation document`,[...t,`rest`]);let i={type:`array`},a=e.elements.length,o=e.elements.map((e,i)=>{e.isOptional&&a--;let o=v(e.type,[...t,`elements`,i,`type`],n),s=iC(e.annotations,r);return s===void 0?o:p(fC(o,s))});if(o.length>0?(i.prefixItems=o,i.maxItems=e.elements.length,a>0&&(i.minItems=a)):i.items=!1,e.rest.length===1){delete i.maxItems;let r=v(e.rest[0],[...t,`rest`,0],n);Object.keys(r).length>0?i.items=r:delete i.items}return i}case`Objects`:{if(e.propertySignatures.length===0&&e.indexSignatures.length===0)return{not:{type:`null`}};let i={type:`object`},a={},o=[];for(let i=0;i<e.propertySignatures.length;i++){let s=e.propertySignatures[i];if(typeof s.name!=`string`)throw tC(`Invalid schema representation document`,[...t,`propertySignatures`,i,`name`]);let c=s.name,l=v(s.type,[...t,`propertySignatures`,i,`type`],n),u=iC(s.annotations,r);If(a,c,u===void 0?l:p(fC(l,u))),s.isOptional||o.push(c)}e.propertySignatures.length>0&&(i.properties=a),o.length>0&&(i.required=o);let s={},c=[],l=[],u=!1;for(let r=0;r<e.indexSignatures.length;r++){let i=e.indexSignatures[r],a=v(i.type,[...t,`indexSignatures`,r,`type`],n);Sf(a,{not:{}})&&(a=!1),l.push(a);let o=b(i.parameter,[...t,`indexSignatures`,r,`parameter`],new Set);if(o===void 0){u=!0,n.push(!1);continue}if(o.length===0)c.push(a);else for(let e of o){let t=s[e];If(s,e,t===void 0?a:t===!1||a===!1?!1:p(fC(t,a)))}}let d=Object.keys(s).length>0;if(d&&(i.patternProperties=s),u&&r?.onExcessProperty===`error`){let r=[];e.propertySignatures.length>0&&r.push({enum:Object.keys(a)});for(let i=0;i<e.indexSignatures.length;i++)r.push(v(e.indexSignatures[i].parameter,[...t,`indexSignatures`,i,`parameter`],n));i.propertyNames=r.length===1?r[0]:{anyOf:r},i.additionalProperties=l.length===1?l[0]:{anyOf:l},c.length>0&&(i.allOf=c.map(e=>({type:`object`,additionalProperties:e})))}else c.length===0?i.additionalProperties=u||r?.onExcessProperty!==`error`:c.length===1&&e.propertySignatures.length===0&&!d?i.additionalProperties=c[0]:c.length>0&&(i.allOf=c.map(e=>({type:`object`,additionalProperties:e})));return typeof i.additionalProperties==`object`&&i.additionalProperties!==null&&Object.keys(i.additionalProperties).length===0&&delete i.additionalProperties,i}case`Union`:{let r=[],i=e.types.map((e,n)=>v(e,[...t,`types`,n],r));if(n.push(r),i.length===0)return{not:{}};let a=e.options?.mode??`anyOf`;if(a===`anyOf`&&i.length>1){let e=_C(i);if(e!==void 0)return e}return a===`oneOf`&&s.set(i,[r,[]]),{[a]:i}}}}function b(e,t,r){switch(e._tag){case`Reference`:{if(!Object.hasOwn(n,e.$ref))throw tC(`Invalid reference ${e.$ref}`,[...t,`$ref`]);if(m(e.$ref,t),r.has(e.$ref))return;let i=new Set(r).add(e.$ref);return b(n[e.$ref],[`references`,e.$ref],i)}case`String`:{if(e.checks.length===0)return[];if(e.checks.length!==1||e.checks[0]._tag!==`Filter`||e.checks[0].annotations?.toJsonSchema===void 0)return;let n=[],r=v(e,t,n);return pC(n)&&r.type===`string`&&typeof r.pattern==`string`&&cC(r,`|type|pattern|title|description|default|examples|readOnly|writeOnly|`)?[r.pattern]:void 0}case`TemplateLiteral`:return e.checks.length===0?[`^${e.parts.map(vC).join(``)}$`]:void 0;case`Union`:{if(e.types.length===0||e.checks.length>0||e.options?.mode===`oneOf`)return;let n=[];for(let i=0;i<e.types.length;i++){let a=b(e.types[i],[...t,`types`,i],r);if(a===void 0)return;if(a.length===0)return[];n.push(...a)}return n}default:throw tC(`Invalid schema representation document`,t)}}}function gC(e){return e===`string`||e===`number`||e===`boolean`||e===`array`||e===`object`||e===`null`||e===`integer`}function _C(e){let t,n=[];for(let r of e){if(Object.keys(r).length!==2||r.type===void 0||!Array.isArray(r.enum)||r.enum.length===0)return;if(t===void 0)t=r.type;else if(r.type!==t)return;for(let e of r.enum){if(n.includes(e))return;n.push(e)}}return{type:t,enum:n}}function vC(e){switch(e._tag){case`Literal`:return eC(globalThis.String(e.literal));case`String`:return jx;case`Number`:return cb;case`TemplateLiteral`:return e.parts.map(vC).join(``);case`Union`:return`(?:${e.types.map(vC).join(`|`)})`;default:throw tC(`Invalid schema representation document`,[])}}function yC(e,t){let n=hC([e.representation],[[`representation`]],e.references,t);return{dialect:n.dialect,schema:n.schemas[0],definitions:n.definitions}}var bC=({identifier:e})=>e;function xC(e){return e===void 0?void 0:{annotations:e}}function SC(e,t){let{references:n,representations:r}=CC([e],t);return{representation:r[0],references:n}}function CC(e,t){let n={},r=new Map,i=new Set,a=new Map,o=new Set;for(let t of e)f(t);let s=t?.referencePolicy??bC;for(let e of a.values())for(let t of e.values()){let e=s({ast:t.ast,occurrences:t.occurrences,identifier:t.identifier});e===void 0?t.isRecursive&&(t.reference=c(`${t.ast._tag}_`,t,``)):t.reference=c(e,t,e===t.identifier||!e.endsWith(`_`)?`_`:``)}return{representations:Fm(e,e=>m(e)),references:n};function c(e,t,n=`_`){let i=e,a=0;for(;r.has(i);){if(r.get(i)===t)return i;i=`${e}${n}${++a}`}return r.set(i,t),i}function l(e,t,n){let r=t.fallback;return r===void 0?n===t.identifier?e:ex(e,{identifier:n}):hv(e)===r?e:ex(e,{[fv]:r})}function u(e,t){if(!Object.hasOwn(n,e)&&!i.has(e)){i.add(e);let r=h(t);i.delete(e),If(n,e,r)}return{_tag:`Reference`,$ref:e}}function d(e){let t=$b(e),n=Xb(t),r=mv(t),i=r===void 0?(t===e?void 0:mv(e))??hv(t):void 0;i!==void 0&&(r=`${i}Encoded`);let o=a.get(n);o===void 0&&(o=new Map,a.set(n,o));let s=o.get(r);return s===void 0&&(s={ast:n,identifier:r,fallback:i,occurrences:0,isRecursive:!1,reference:void 0},o.set(r,s)),s}function f(e){let t=d(e),n=t.ast;if(t.occurrences++,o.has(t)){t.isRecursive=!0;return}if(!(t.occurrences>1)){switch(o.add(t),p(n.checks),n._tag){case`Declaration`:case`Arrays`:case`Objects`:case`Union`:n.recur(e=>(f(e),e));break;case`TemplateLiteral`:n.parts.forEach(f);break;case`Suspend`:f(n.thunk())}o.delete(t)}}function p(e){e?.forEach(e=>{e.annotations?.representation?.schemas?.forEach(e=>f(Sx(e))),e._tag===`FilterGroup`&&p(e.checks)})}function m(e){let t=d(e),n=t.ast,r=t.reference;return r===void 0?h(n):u(r,t.identifier===void 0?n:l(n,t,r))}function h(e){let t=g(e.checks);switch(e._tag){case`Declaration`:return{_tag:`Declaration`,typeParameters:e.typeParameters.map(e=>m(e)),checks:t,...v(e.annotations)};case`Null`:case`Undefined`:case`Void`:case`Never`:case`Unknown`:case`Any`:case`String`:case`Boolean`:case`Number`:case`BigInt`:case`Symbol`:case`ObjectKeyword`:return{_tag:e._tag,checks:t,...xC(e.annotations)};case`Literal`:return{_tag:`Literal`,literal:e.literal,checks:t,...xC(e.annotations)};case`UniqueSymbol`:return{_tag:`UniqueSymbol`,symbol:e.symbol,checks:t,...xC(e.annotations)};case`Enum`:return{_tag:`Enum`,enums:e.enums,checks:t,...xC(e.annotations)};case`TemplateLiteral`:return{_tag:`TemplateLiteral`,parts:e.parts.map(e=>m(e)),checks:t,...xC(e.annotations)};case`Arrays`:return{_tag:`Arrays`,elements:e.elements.map(e=>{let t=$b(e),n=t.context?.annotations;return{isOptional:_x(t),type:m(e),...xC(n)}}),rest:e.rest.map(e=>m(e)),checks:t,...xC(e.annotations)};case`Objects`:return{_tag:`Objects`,propertySignatures:e.propertySignatures.map(e=>{let t=$b(e.type),n=t.context?.annotations;return{name:e.name,type:m(e.type),isOptional:_x(t),isMutable:vx(t),...xC(n)}}),indexSignatures:e.indexSignatures.map(e=>({parameter:m(e.parameter),type:m(e.type)})),checks:t,...xC(e.annotations)};case`Union`:return{_tag:`Union`,types:e.types.map(e=>m(e)),...e.options===void 0?{}:{options:e.options},checks:t,...xC(e.annotations)};case`Suspend`:return{_tag:`Suspend`,checks:[],thunk:m(e.thunk()),...xC(e.annotations)}}}function g(e){return e?.map(_)??[]}function _(e){switch(e._tag){case`Filter`:return{_tag:`Filter`,aborted:e.aborted,...y(e.annotations)};case`FilterGroup`:return{_tag:`FilterGroup`,checks:Fm(e.checks,_),...y(e.annotations)}}}function v(e){if(e===void 0)return;let{representation:t,...n}=e;return{...t===void 0?void 0:{representation:t},...Object.keys(n).length===0?void 0:{annotations:n}}}function y(e){if(e===void 0)return;let{representation:t,...n}=e,r=t===void 0?void 0:t.schemas===void 0?t:{...t,schemas:t.schemas.map(e=>m(Sx(e)))};return{...r===void 0?void 0:{representation:r},...Object.keys(n).length===0?void 0:{annotations:n}}}}function wC(e){return V_(e)?e.value:{issues:[{message:fte(e.cause)}]}}function TC(e,t){let n=yS(e),r={errors:`all`,...t?.parseOptions},i=Uv(t),a=e=>{let t=new Zh(`sync`),a=vte(_te(n(e,r),{onFailure:i,onSuccess:e=>({value:e})}),{scheduler:t});a.currentDispatcher?.flush();let o=a.pollUnsafe();return o?wC(o):new Promise(e=>{a.addObserver(t=>{e(wC(t))})})};if(Object.hasOwn(e,`~standard`)){let t=e;return`validate`in t[`~standard`]||Object.assign(t[`~standard`],{validate:a}),t}return Object.assign(e,{"~standard":{version:1,vendor:`effect`,validate:a}})}var EC=e=>e,DC=`~effect/Schema/SchemaError`;function OC(e){return rf(e,`~effect/Schema/SchemaError`)&&e[`~effect/Schema/SchemaError`]===`~effect/Schema/SchemaError`}function kC(){return(e,t,n)=>UC(new Uy(e.map(Sb),e=>t(e.map(e=>UC(e))),n))}function AC(e,t){return kC()([],()=>(t,n,r)=>e(t)?K_(t):J_(new Pv(n,t,r)),t)}var jC=class extends eg(`SchemaError`){[DC]=DC;constructor(e){let t=ap();op(0);try{super({issue:e})}finally{op(t)}}get message(){return Xv(this.issue)}toString(){return`SchemaError(${this.message})`}};function MC(e){return OC(e)}function NC(e){return o_(e)?PC(e):ev(e,e=>Y_(()=>L_(e,e=>new jC(e))))}function PC(e){return V_(e)?e:R_(L_(e.cause,e=>new jC(e)))}function FC(e,t){let n;for(let r of e.reasons){if(!I_(r)||!MC(r.error))throw new globalThis.Error(t,{cause:e});n??=r.error}if(n===void 0)throw new globalThis.Error(t,{cause:e});return n}function IC(e){let t=tv(e);if(V_(t))return t.value;throw FC(t.cause,`Sync adapter can only throw schema errors`)}function LC(e,t){return TC(e,t)}var RC=gS;function zC(e,t){let n=yS(e,t);return(e,t)=>NC(n(e,t))}var BC=bS;function VC(e,t){let n=xS(e,t);return(e,t)=>kee(n(e,t),e=>new jC(e))}function HC(e,t){let n=zC(e,t);return(e,t)=>IC(n(e,t))}var UC=LS,WC=EC(e=>UC(dx(e.ast),{schema:e})),GC=EC(e=>{let t=aw(e);return UC(px(e.ast),{schema:t})});function KC(e){let t=UC(new Yy(e),{literal:e,transform(n){return t.pipe(ow(KC(n),{decode:iy(()=>n),encode:iy(()=>e)}))}});return t}var qC=UC(Jy),JC=UC(Wy),YC=UC(qy),XC=UC(Zy),ZC=UC(eb),QC=UC(tb);function $C(e,t){return UC(e,{fields:t,mapFields(e,t){let n=e(this.fields);return $C(xb(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function q(e){return $C(xb(e,void 0),e)}function Nte(e,t){return UC(gx(e.ast,t.ast),{key:e,value:t})}var ew=EC(e=>UC(new nb(!1,[],[e.ast]),{value:e}));function tw(e,t){return UC(e,{members:t,mapMembers(e,t){let n=e(this.members);return tw(Cb(n,this.ast.options,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function nw(e,t){return tw(Cb(e,t,void 0),e)}function rw(e){let t=e.map(KC);return UC(Cb(t,void 0,void 0),{literals:e,members:t,mapMembers(e){return nw(e(this.members))},pick(e){return rw(e)},transform(e){return nw(t.map((t,n)=>t.transform(e[n])))}})}var iw=EC(e=>nw([e,JC])),aw=EC(e=>nw([e,YC]));function J(...e){return t=>t.check(...e)}function Pte(e){return t=>UC(t.ast,{schema:t,identifier:e})}function ow(e,t){return n=>UC(mx(n.ast,e.ast,t?_y(t):by()),{from:n,to:e})}function sw(e,t){return AC(t=>t instanceof e,t)}function Fte(){return(e,t)=>new Ry(e.ast,_y(t))}var cw=Ub,lw=`^\\S[\\s\\S]*\\S$|^\\S$|^$`;function Ite(e){let t=new globalThis.RegExp(lw);return cw(e=>e.trim()===e,{expected:`a string with no leading or trailing whitespace`,representation:{id:`effect/schema/isTrimmed`,payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:`Schema.isTrimmed()`}),arbitraryConstraint:{patterns:[{source:lw,flags:``}]},...e})}function uw(e,t){let n=e.source,r=e.flags,i=/^[dg]*uy?$/.test(r),a=r===``?`new RegExp(${Gf(n)})`:`new RegExp(${Gf(n)}, ${Gf(r)})`;return qb(e,{toJsonSchema:()=>i?{pattern:r.endsWith(`y`)?`^(?:${n})`:n}:[{},!0],toCode:()=>({runtime:`Schema.isPattern(${a})`}),...t})}var dw=UC(Gb);function Lte(e){let t=Sm(e.order),n=e.formatter??Gf;return(r,i)=>cw(e=>t(e,r),{expected:`a value greater than ${n(r)}`,arbitraryConstraint:{order:e.order,minimum:r,exclusiveMinimum:!0},...e.annotate?.(r),...i})}function Rte(e){let t=wm(e.order),n=e.formatter??Gf;return(r,i)=>cw(e=>t(e,r),{expected:`a value greater than or equal to ${n(r)}`,arbitraryConstraint:{order:e.order,minimum:r},...e.annotate?.(r),...i})}function zte(e){let t=Cm(e.order),n=e.formatter??Gf;return(r,i)=>cw(e=>t(e,r),{expected:`a value less than or equal to ${n(r)}`,arbitraryConstraint:{order:e.order,maximum:r},...e.annotate?.(r),...i})}function Bte(e){let t=wm(e.order),n=Sm(e.order),r=Cm(e.order),i=xee(e.order),a=e.formatter??Gf;return(o,s)=>{let c=o.exclusiveMinimum?n:t,l=o.exclusiveMaximum?i:r;return cw(e=>c(e,o.minimum)&&l(e,o.maximum),{expected:`a value between ${a(o.minimum)}${o.exclusiveMinimum?` (excluded)`:``} and ${a(o.maximum)}${o.exclusiveMaximum?` (excluded)`:``}`,arbitraryConstraint:{order:e.order,minimum:o.minimum,maximum:o.maximum,...o.exclusiveMinimum&&{exclusiveMinimum:!0},...o.exclusiveMaximum&&{exclusiveMaximum:!0}},...e.annotate?.(o),...s})}}function fw(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${Gf(e)}`);return e}var pw=Lte({order:xm,annotate:e=>({representation:{id:`effect/schema/isGreaterThan`,payload:{exclusiveMinimum:fw(e)}},toJsonSchema:()=>({exclusiveMinimum:e}),toCode:()=>({runtime:`Schema.isGreaterThan(${Gf(e)})`})})}),mw=Rte({order:xm,annotate:e=>({representation:{id:`effect/schema/isGreaterThanOrEqualTo`,payload:{minimum:fw(e)}},toJsonSchema:()=>({minimum:e}),toCode:()=>({runtime:`Schema.isGreaterThanOrEqualTo(${Gf(e)})`})})}),hw=zte({order:xm,annotate:e=>({representation:{id:`effect/schema/isLessThanOrEqualTo`,payload:{maximum:fw(e)}},toJsonSchema:()=>({maximum:e}),toCode:()=>({runtime:`Schema.isLessThanOrEqualTo(${Gf(e)})`})})}),gw=Bte({order:xm,annotate:e=>{let t=e.exclusiveMinimum?!0:void 0,n=e.exclusiveMaximum?!0:void 0;return{representation:{id:`effect/schema/isBetween`,payload:{minimum:fw(e.minimum),maximum:fw(e.maximum),...t&&{exclusiveMinimum:t},...n&&{exclusiveMaximum:n}}},toJsonSchema:()=>({[t?`exclusiveMinimum`:`minimum`]:e.minimum,[n?`exclusiveMaximum`:`maximum`]:e.maximum}),toCode:()=>({runtime:`Schema.isBetween({ minimum: ${Gf(e.minimum)}, maximum: ${Gf(e.maximum)}, exclusiveMinimum: ${Gf(t)}, exclusiveMaximum: ${Gf(n)} })`})}}});function _w(e){return cw(e=>globalThis.Number.isSafeInteger(e),{expected:`an integer`,representation:{id:`effect/schema/isInt`,payload:null},toJsonSchema:()=>[{type:`integer`},!0],toCode:()=>({runtime:`Schema.isInt()`}),arbitraryConstraint:{number:`integer`},...e})}var vw=ZC.check(_w());function yw(e,t){return e=Sw(e),bw(e,Math.ceil(e/2),t)}function bw(e,t,n){return cw(t=>t.length>=e,{expected:`a value with a length of at least ${e}`,representation:{id:`effect/schema/isMinLength`,payload:{minLength:e}},toJsonSchema:({type:n})=>n===`string`?e<=1?{minLength:t}:[{minLength:t},!0]:n===`array`?{minItems:e}:n===void 0?[{minLength:t,minItems:e},!0]:[{},!0],toCode:()=>({runtime:`Schema.isMinLength(${e})`}),[dv]:!0,arbitraryConstraint:{minLength:e},...n})}function Vte(e){return bw(1,1,e)}function xw(e,t){return e=Sw(e),cw(t=>t.length<=e,{expected:`a value with a length of at most ${e}`,representation:{id:`effect/schema/isMaxLength`,payload:{maxLength:e}},toJsonSchema:({type:t})=>t===`string`?e===0?{maxLength:e}:[{maxLength:e},!0]:t===`array`?{maxItems:e}:t===void 0?[{maxLength:e,maxItems:e},!0]:[{},!0],toCode:()=>({runtime:`Schema.isMaxLength(${e})`}),[dv]:!0,arbitraryConstraint:{maxLength:e},...t})}function Sw(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${e}`);return Math.max(0,Math.floor(e))}var Cw=XC.check(Vte());globalThis.RegExp,globalThis.URL;var Hte=XC.annotate({expected:`a string that will be decoded as JSON`,contentMediaType:`application/json`});function Ute(e,t){return Hte.pipe(ow(e,Cy(t)))}globalThis.File,globalThis.FormData,globalThis.URLSearchParams;var Wte=XC.check(Ite()),Gte=XC.annotate({expected:`a string that will be decoded as a trimmed string`}).pipe(ow(Wte,vy())),Kte=XC.annotate({expected:`a base64 encoded string that will be decoded as Uint8Array`,format:`byte`,contentEncoding:`base64`}),qte=sw(globalThis.Uint8Array,{representation:{id:`effect/schema/Uint8Array`,payload:null},toCode:()=>({runtime:`Schema.Uint8Array`,Type:`globalThis.Uint8Array`}),expected:`Uint8Array`,toCodecJson:()=>Fte()(Kte,Sy)});function ww(e,t){return yC(SC(JS(e.ast),t),t)}var Tw=nw([q({category:rw([`InferenceUpstreamError`,`AiInternalError`,`TypeError`,`AbortError`,`TimeoutError`,`Error`]),code:iw(vw.check(gw({minimum:0,maximum:99999})))}),q({category:KC(`result_download`),status:vw.check(gw({minimum:0,maximum:599}))})]);function Jte(e){return HC(Tw,{onExcessProperty:`error`})(e)}gu(ww(Tw,{onExcessProperty:`error`}).schema).transform(Jte);var Ew=[`CANCELLED`,`CAPABILITY_DENIED`,`CAPABILITY_REVOKED`,`COMMAND_NOT_DECLARED`,`CONFLICT`,`DELIVERY_PENDING`,`DISCONNECTED`,`FILE_TOO_LARGE`,`HOST_FAILURE`,`IDENTITY`,`INSUFFICIENT_CREDIT`,`INVALID_ARGUMENT`,`PROTOCOL`,`SAFETY_FILTER_REFUSED`,`SELECTION_CHANGED`,`TIMEOUT`],Yte=q({name:KC(`AppError`),code:rw(Ew),retryable:QC}),Y=class extends Error{code;retryable;constructor(e,t){super(e,{cause:t.cause}),this.name=`AppError`,this.code=t.code,this.retryable=t.retryable}},Dw={CANCELLED:{title:`Request cancelled`,message:`This request was cancelled.`},CAPABILITY_DENIED:{title:`Access needed`,message:`This App needs permission to do that.`,action:`grant`},CAPABILITY_REVOKED:{title:`Access changed`,message:`This App no longer has permission to do that.`,action:`grant`},COMMAND_NOT_DECLARED:{title:`Action unavailable`,message:`This action isn't available in this App.`},CONFLICT:{title:`File changed`,message:`This file changed elsewhere. Review it before saving again.`},DELIVERY_PENDING:{title:`App delivery pending`,message:`The App hasn't finished getting ready. Try opening it again.`},DISCONNECTED:{title:`Connection lost`,message:`Reopen the App to connect again.`,action:`reconnect`},HOST_FAILURE:{title:`Couldn't complete the request`,message:`The service couldn't complete this request.`},FILE_TOO_LARGE:{title:`File too large`,message:`Choose a file within the supported size limit.`},IDENTITY:{title:`Couldn't connect`,message:`Reopen the App to connect again.`,action:`reconnect`},INSUFFICIENT_CREDIT:{title:`Something went wrong`,message:`The App couldn't complete this request.`,action:`billing`},INVALID_ARGUMENT:{title:`Request not accepted`,message:`The App couldn't use the details in this request.`},PROTOCOL:{title:`Couldn't read the response`,message:`The App received a response it couldn't use.`},SAFETY_FILTER_REFUSED:{title:`Safety filter refused this prompt`,message:`The model's safety filter refused this prompt — try rewording.`},SELECTION_CHANGED:{title:`Selection changed`,message:`The selection changed during this request. Reopen the App to continue.`,action:`reconnect`},TIMEOUT:{title:`Still waiting`,message:`The request didn't respond in time. Its outcome isn't known yet.`},UNKNOWN:{title:`Something went wrong`,message:`The App couldn't complete this request.`}};function Ow(e,t){let n=BC(Yte)(e);if(Dm(n))return{...Dw.UNKNOWN,retryable:!1};let r=n.value,i=Dw[r.code],a=t?.[r.code]??i,o=i.action??(r.retryable?`retry`:void 0),s={title:a.title,message:a.message,retryable:r.retryable};return o?{...s,action:o}:s}dl(`light.dark.latte.mocha.readout.readout-night.field-guide.field-guide-night.embed.embed-dark.phosphor.codec.paper.ember.tide.tape.sunrise.pirate-radio.pirate-radio-night.consulting.consulting-ink.consulting-night.consulting-night-ink.consulting-riso-latte.consulting-riso-latte-ink.consulting-riso-glomzy.consulting-riso-glomzy-ink.vishnu.coin.coin-night.chamfer`.split(`.`));var kw=`data-theme`;function Aw(e){return e||(globalThis.document?.documentElement??null)}function Xte(e){let t=e.trim();if(t.length===0)throw TypeError(`Theme must be a non-empty string`);return t}function jw(e,t){let n=Xte(e),r=Aw(t);r&&r.setAttribute(kw,n)}function Zte(e){return Aw(e)?.getAttribute(kw)??null}var Qte=o((e=>{var t=d(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),X=o(((e,t)=>{t.exports=Qte()}))(),Mw=K.createContext(void 0),Nw=e=>{let t=K.useContext(Mw);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},$te=({client:e,children:t})=>(K.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,X.jsx)(Mw.Provider,{value:e,children:t})),ene={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Pw=new class{#e=ene;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 tne(e){setTimeout(e,0)}var nne=typeof window>`u`||`Deno`in globalThis;function Fw(){}function rne(e,t){return typeof e==`function`?e(t):e}function Iw(e){return typeof e==`number`&&e>=0&&e!==1/0}function Lw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Rw(e,t){return typeof e==`function`?e(t):e}function zw(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Vw(o,t.options))return!1}else if(!Uw(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 Bw(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Hw(t.options.mutationKey)!==Hw(a))return!1}else if(!Uw(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Vw(e,t){return(t?.queryKeyHashFn||Hw)(e)}function Hw(e){return JSON.stringify(e,(e,t)=>qw(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Uw(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!Uw(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Uw(e[r],t[r]))return!1;return!0}return!1}var ine=Object.prototype.hasOwnProperty;function Ww(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Kw(e)&&Kw(t);if(!r&&!(qw(e)&&qw(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:ine.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Ww(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Gw(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 Kw(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function qw(e){if(!Jw(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Jw(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Jw(e){return Object.prototype.toString.call(e)===`[object Object]`}function ane(e){return new Promise(t=>{Pw.setTimeout(t,e)})}function Yw(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Ww(e,t)}function one(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function sne(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Xw=Symbol();function Zw(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Xw?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Qw(e,t){return typeof e==`function`?e(...t):!!e}function cne(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 lne=()=>nne,$w=()=>lne(),eT=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(){}},tT=new class extends eT{#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`}},une=tne;function dne(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=une,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 nT=dne(),rT=new class extends eT{#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 fne(e){return Math.min(1e3*2**e,3e4)}function iT(e){return(e??`online`)!==`online`||rT.isOnline()}var aT=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function oT(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Fw);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new aT(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>tT.isFocused()&&(e.networkMode===`always`||rT.isOnline())&&e.canRun(),p=()=>iT(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??($w()?0:3),a=e.retryDelay??fne,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),ane(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var sT=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Iw(this.gcTime)&&(this.#e=Pw.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??($w()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Pw.clearTimeout(this.#e),this.#e=void 0)}};function pne(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=>{cne(e,()=>t.signal,()=>n=!0)},u=Zw(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?sne:one;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?lT:cT,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:cT(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function cT(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 lT(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function mne(e,t){return t?cT(e,t)!=null:!1}function hne(e,t){return!t||!e.getPreviousPageParam?!1:lT(e,t)!=null}var gne=class extends sT{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=fT(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=fT(this.options);e.data!==void 0&&(this.setState(dT(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Yw(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Fw).catch(Fw):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Rw(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Xw||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Rw(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Lw(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Zw(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?pne(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=oT({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof aT&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof aT){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...uT(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...dT(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),nT.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function uT(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:iT(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function dT(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function fT(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 pT=class extends eT{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),mT(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return hT(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return hT(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 Rw(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&&!Gw(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&gT(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Rw(this.options.enabled,this.#t)!==Rw(t.enabled,this.#t)||Rw(this.options.staleTime,this.#t)!==Rw(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Rw(this.options.enabled,this.#t)!==Rw(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Gw(this.getCurrentResult(),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),Reflect.get(e,n))})}trackProp(e){this.#p.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),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Fw)),t}#h(e){return!$w()&&Rw(this.options.enabled,this.#t)!==!1&&Iw(e)}#g(){this.#b();let e=Rw(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Lw(this.#r.dataUpdatedAt,e)+1;this.#u=Pw.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.#f=e,!(this.#f===0||!this.#h(this.#f))&&(this.#d=Pw.setInterval(()=>{(this.options.refetchIntervalInBackground||tT.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(Pw.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(Pw.clearInterval(this.#d),this.#d=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&&mT(e,t),o=i&&gT(e,n,t,r);(a||o)&&(l={...l,...uT(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.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=Yw(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=Yw(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{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&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:_T(e,t),refetch:this.refetch,isEnabled:Rw(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),Gw(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);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)})})();nT.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#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()}};function _ne(e,t){return Rw(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Rw(t.retryOnMount,e)!==!1)}function mT(e,t){return _ne(e,t)||e.state.data!==void 0&&hT(e,t,t.refetchOnMount)}function hT(e,t,n){if(Rw(t.enabled,e)!==!1&&Rw(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&_T(e,t)}return!1}function gT(e,t,n,r){return(e!==t||Rw(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&_T(e,n)}function _T(e,t){return Rw(t.enabled,e)!==!1&&e.isStaleByTime(Rw(t.staleTime,e))}var vT=class extends pT{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:mne(t,n.data),hasPreviousPage:hne(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},yT=class extends sT{#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||bT(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=oT({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),nT.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function bT(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var xT=class extends eT{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new yT({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=ST(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=ST(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=ST(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=ST(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){nT.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=>Bw(t,e))}findAll(e={}){return this.getAll().filter(t=>Bw(e,t))}notify(e){nT.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return nT.batch(()=>Promise.all(e.map(e=>e.continue().catch(Fw))))}};function ST(e){return e.options.scope?.id}var CT=class extends eT{#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),Gw(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Hw(t.mutationKey)!==Hw(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}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??bT();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){nT.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)})})}};function wT(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var TT=class extends eT{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,nT.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!Gw(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(wT(e,n).forEach(e=>{e.destroy()}),wT(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=Ww(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new pT(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&nT.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},ET=class extends eT{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??Vw(r,t),a=this.get(i);return a||(a=new gne({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(){nT.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=>zw(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>zw(e,t)):t}notify(e){nT.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){nT.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){nT.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},DT=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ET,this.#t=e.mutationCache||new xT,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=tT.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=rT.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(Rw(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=rne(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return nT.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;nT.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return nT.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=nT.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Fw).catch(Fw)}invalidateQueries(e,t={}){return nT.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=nT.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(Fw)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Fw)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Rw(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Rw(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Fw).catch(Fw)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Fw).catch(Fw)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return rT.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(Hw(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Uw(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Hw(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Uw(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||=Vw(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===Xw&&(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()}},OT=K.createContext(!1),kT=()=>K.useContext(OT);OT.Provider;function vne(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var AT=K.createContext(vne()),jT=()=>K.useContext(AT),MT=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Qw(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},NT=e=>{K.useEffect(()=>{e.clearReset()},[e])},PT=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Qw(n,[e.error,r])),FT=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))}},IT=(e,t)=>e?.suspense&&t.isPending,LT=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function RT({queries:e,...t},n){let r=Nw(n),i=kT(),a=jT(),o=t.subscribed!==!1,s=K.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{FT(e);let t=r.getQueryCache().get(e.queryHash);MT(e,a,t)}),NT(a);let[c]=K.useState(()=>new TT(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),f=!i&&o;K.useSyncExternalStore(K.useCallback(e=>f?c.subscribe(nT.batchCalls(e)):Fw,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),K.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let p=l.some((e,t)=>IT(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&IT(n,e)?LT(n,new pT(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=s[t];return n&&PT({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m)throw m.error;return u(d())}function zT(e,t,n){let r=kT(),i=jT(),a=Nw(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,FT(o),MT(o,i,s),NT(i);let[l]=K.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(K.useSyncExternalStore(K.useCallback(e=>{let t=d?l.subscribe(nT.batchCalls(e)):Fw;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),K.useEffect(()=>{l.setOptions(o)},[o,l]),IT(o,u))throw LT(o,l,i);if(PT({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function BT(e,t){return zT(e,pT,t)}function yne(e){return e}function bne(e){return e}function VT(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function xne(e={},t){let n=Nw(t).getMutationCache(),r=K.useRef(e),i=K.useRef(null);return i.current===null&&(i.current=VT(n,e)),K.useEffect(()=>{r.current=e}),K.useSyncExternalStore(K.useCallback(e=>n.subscribe(()=>{let t=Ww(i.current,VT(n,r.current));i.current!==t&&(i.current=t,nT.schedule(e))}),[n]),()=>i.current,()=>i.current)}function HT(e,t){let n=Nw(t),[r]=K.useState(()=>new CT(n,e));K.useEffect(()=>{r.setOptions(e)},[r,e]);let i=K.useSyncExternalStore(K.useCallback(e=>r.subscribe(nT.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=K.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Fw)},[r]);if(i.error&&Qw(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function Sne(e){return e}function UT(e,t){return zT(e,vT,t)}var Cne=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(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=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(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 b(e){if(h=!1,y(e),!m){if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&N(b,t.startTime-e)}}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&N(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,j=A.port2;A.port1.onmessage=O,k=function(){j.postMessage(null)}}else k=function(){g(O,0)};function M(e){C=e,S||(S=!0,k())}function N(t,n){w=g(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_continueExecution=function(){m||p||(m=!0,M(x))},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`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},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_pauseExecution=function(){},e.unstable_requestPaint=function(){},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?(_(w),w=-1):h=!0,N(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),wne=o(((e,t)=>{t.exports=Cne()})),Tne=o((e=>{var t=d(),n=wne();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;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.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,u=/^[: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]*$/,f={},p={};function m(e){return l.call(p,e)?!0:l.call(f,e)?!1:u.test(e)?p[e]=!0:(f[e]=!0,!1)}function h(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function g(e,t,n,r){if(t==null||h(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function _(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var v={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){v[e]=new _(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];v[t]=new _(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){v[e]=new _(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){v[e]=new _(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){v[e]=new _(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){v[e]=new _(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){v[e]=new _(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){v[e]=new _(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){v[e]=new _(e,5,!1,e.toLowerCase(),null,!1,!1)});var y=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(y,b);v[t]=new _(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(y,b);v[t]=new _(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(y,b);v[t]=new _(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){v[e]=new _(e,1,!1,e.toLowerCase(),null,!1,!1)}),v.xlinkHref=new _(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){v[e]=new _(e,1,!1,e.toLowerCase(),null,!0,!0)});function x(e,t,n,r){var i=v.hasOwnProperty(t)?v[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(g(t,n,i,r)&&(n=null),r||i===null?m(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type!==3&&``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var S=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,C=Symbol.for(`react.element`),w=Symbol.for(`react.portal`),T=Symbol.for(`react.fragment`),E=Symbol.for(`react.strict_mode`),D=Symbol.for(`react.profiler`),O=Symbol.for(`react.provider`),k=Symbol.for(`react.context`),A=Symbol.for(`react.forward_ref`),j=Symbol.for(`react.suspense`),M=Symbol.for(`react.suspense_list`),N=Symbol.for(`react.memo`),P=Symbol.for(`react.lazy`),F=Symbol.for(`react.offscreen`),I=Symbol.iterator;function L(e){return typeof e!=`object`||!e?null:(e=I&&e[I]||e[`@@iterator`],typeof e==`function`?e:null)}var R=Object.assign,z;function ee(e){if(z===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);z=t&&t[1]||``}return`
|
|
77
|
-
`+z+e}var te=!1;function B(e,t){if(!e||te)return``;te=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t){if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
|
|
78
|
-
`),a=r.stack.split(`
|
|
79
|
-
`),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
|
|
80
|
-
`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{te=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?ee(e):``}function ne(e){switch(e.tag){case 5:return ee(e.type);case 16:return ee(`Lazy`);case 13:return ee(`Suspense`);case 19:return ee(`SuspenseList`);case 0:case 2:case 15:return e=B(e.type,!1),e;case 11:return e=B(e.type.render,!1),e;case 1:return e=B(e.type,!0),e;default:return``}}function re(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case T:return`Fragment`;case w:return`Portal`;case D:return`Profiler`;case E:return`StrictMode`;case j:return`Suspense`;case M:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case k:return(e.displayName||`Context`)+`.Consumer`;case O:return(e._context.displayName||`Context`)+`.Provider`;case A:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case N:return t=e.displayName||null,t===null?re(e.type)||`Memo`:t;case P:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}function V(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return re(t);case 8:return t===E?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function ie(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function ae(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function oe(e){var t=ae(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function H(e){e._valueTracker||=oe(e)}function se(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=ae(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function ce(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function le(e,t){var n=t.checked;return R({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function U(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=ie(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function ue(e,t){t=t.checked,t!=null&&x(e,`checked`,t,!1)}function de(e,t){ue(e,t);var n=ie(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?pe(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&pe(e,t.type,ie(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function fe(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function pe(e,t,n){(t!==`number`||ce(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var me=Array.isArray;function he(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=``+ie(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 ge(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return R({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function _e(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(r(92));if(me(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:ie(n)}}function ve(e,t){var n=ie(t.value),r=ie(t.defaultValue);n!=null&&(n=``+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=``+r)}function ye(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function be(e){switch(e){case`svg`:return`http://www.w3.org/2000/svg`;case`math`:return`http://www.w3.org/1998/Math/MathML`;default:return`http://www.w3.org/1999/xhtml`}}function xe(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?be(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var Se,Ce=function(e){return typeof MSApp<`u`&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==`http://www.w3.org/2000/svg`||`innerHTML`in e)e.innerHTML=t;else{for(Se||=document.createElement(`div`),Se.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=Se.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function we(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Te={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ee=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Te).forEach(function(e){Ee.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Te[t]=Te[e]})});function De(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Te.hasOwnProperty(e)&&Te[e]?(``+t).trim():t+`px`}function Oe(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=De(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var ke=R({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ae(e,t){if(t){if(ke[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function je(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;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 Me=null;function Ne(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Pe=null,Fe=null,Ie=null;function Le(e){if(e=Ri(e)){if(typeof Pe!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Bi(t),Pe(e.stateNode,e.type,t))}}function Re(e){Fe?Ie?Ie.push(e):Ie=[e]:Fe=e}function ze(){if(Fe){var e=Fe,t=Ie;if(Ie=Fe=null,Le(e),t)for(e=0;e<t.length;e++)Le(t[e])}}function Be(e,t){return e(t)}function Ve(){}var He=!1;function Ue(e,t,n){if(He)return e(t,n);He=!0;try{return Be(e,t,n)}finally{He=!1,(Fe!==null||Ie!==null)&&(Ve(),ze())}}function We(e,t){var n=e.stateNode;if(n===null)return null;var i=Bi(n);if(i===null)return null;n=i[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`:(i=!i.disabled)||(e=e.type,i=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!i;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(r(231,t,typeof n));return n}var Ge=!1;if(c)try{var Ke={};Object.defineProperty(Ke,"passive",{get:function(){Ge=!0}}),window.addEventListener(`test`,Ke,Ke),window.removeEventListener(`test`,Ke,Ke)}catch{Ge=!1}function qe(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var Je=!1,Ye=null,Xe=!1,Ze=null,Qe={onError:function(e){Je=!0,Ye=e}};function $e(e,t,n,r,i,a,o,s,c){Je=!1,Ye=null,qe.apply(Qe,arguments)}function et(e,t,n,i,a,o,s,c,l){if($e.apply(this,arguments),Je){if(Je){var u=Ye;Je=!1,Ye=null}else throw Error(r(198));Xe||(Xe=!0,Ze=u)}}function tt(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 nt(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 rt(e){if(tt(e)!==e)throw Error(r(188))}function it(e){var t=e.alternate;if(!t){if(t=tt(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return rt(a),e;if(o===i)return rt(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,i=o;break}if(c===i){s=!0,i=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,i=a;break}if(c===i){s=!0,i=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function at(e){return e=it(e),e===null?null:ot(e)}function ot(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ot(e);if(t!==null)return t;e=e.sibling}return null}var st=n.unstable_scheduleCallback,ct=n.unstable_cancelCallback,lt=n.unstable_shouldYield,ut=n.unstable_requestPaint,dt=n.unstable_now,ft=n.unstable_getCurrentPriorityLevel,pt=n.unstable_ImmediatePriority,mt=n.unstable_UserBlockingPriority,ht=n.unstable_NormalPriority,gt=n.unstable_LowPriority,_t=n.unstable_IdlePriority,vt=null,yt=null;function bt(e){if(yt&&typeof yt.onCommitFiberRoot==`function`)try{yt.onCommitFiberRoot(vt,e,void 0,(e.current.flags&128)==128)}catch{}}var xt=Math.clz32?Math.clz32:wt,St=Math.log,Ct=Math.LN2;function wt(e){return e>>>=0,e===0?32:31-(St(e)/Ct|0)|0}var Tt=64,Et=4194304;function Dt(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ot(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=Dt(a))):r=Dt(s)}else o=n&~i,o===0?a!==0&&(r=Dt(a)):r=Dt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-xt(t),i=1<<n,r|=e[n],t&=~i;return r}function kt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function At(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-xt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=kt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function jt(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function Mt(){var e=Tt;return Tt<<=1,!(Tt&4194240)&&(Tt=64),e}function Nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Pt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-xt(t),e[t]=n}function Ft(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-xt(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function It(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-xt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Lt=0;function Rt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var zt,Bt,Vt,Ht,Ut,Wt=!1,Gt=[],Kt=null,qt=null,Jt=null,Yt=new Map,Xt=new Map,Zt=[],Qt=`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 submit`.split(` `);function $t(e,t){switch(e){case`focusin`:case`focusout`:Kt=null;break;case`dragenter`:case`dragleave`:qt=null;break;case`mouseover`:case`mouseout`:Jt=null;break;case`pointerover`:case`pointerout`:Yt.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Xt.delete(t.pointerId)}}function en(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=Ri(t),t!==null&&Bt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function tn(e,t,n,r,i){switch(t){case`focusin`:return Kt=en(Kt,e,t,n,r,i),!0;case`dragenter`:return qt=en(qt,e,t,n,r,i),!0;case`mouseover`:return Jt=en(Jt,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Yt.set(a,en(Yt.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Xt.set(a,en(Xt.get(a)||null,e,t,n,r,i)),!0}return!1}function nn(e){var t=Li(e.target);if(t!==null){var n=tt(t);if(n!==null){if(t=n.tag,t===13){if(t=nt(n),t!==null){e.blockedOn=t,Ut(e.priority,function(){Vt(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 rn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=hn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Me=r,n.target.dispatchEvent(r),Me=null}else return t=Ri(n),t!==null&&Bt(t),e.blockedOn=n,!1;t.shift()}return!0}function an(e,t,n){rn(e)&&n.delete(t)}function on(){Wt=!1,Kt!==null&&rn(Kt)&&(Kt=null),qt!==null&&rn(qt)&&(qt=null),Jt!==null&&rn(Jt)&&(Jt=null),Yt.forEach(an),Xt.forEach(an)}function sn(e,t){e.blockedOn===t&&(e.blockedOn=null,Wt||(Wt=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,on)))}function cn(e){function t(t){return sn(t,e)}if(0<Gt.length){sn(Gt[0],e);for(var n=1;n<Gt.length;n++){var r=Gt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Kt!==null&&sn(Kt,e),qt!==null&&sn(qt,e),Jt!==null&&sn(Jt,e),Yt.forEach(t),Xt.forEach(t),n=0;n<Zt.length;n++)r=Zt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Zt.length&&(n=Zt[0],n.blockedOn===null);)nn(n),n.blockedOn===null&&Zt.shift()}var ln=S.ReactCurrentBatchConfig,un=!0;function dn(e,t,n,r){var i=Lt,a=ln.transition;ln.transition=null;try{Lt=1,pn(e,t,n,r)}finally{Lt=i,ln.transition=a}}function fn(e,t,n,r){var i=Lt,a=ln.transition;ln.transition=null;try{Lt=4,pn(e,t,n,r)}finally{Lt=i,ln.transition=a}}function pn(e,t,n,r){if(un){var i=hn(e,t,n,r);if(i===null)li(e,t,r,mn,n),$t(e,r);else if(tn(i,e,t,n,r))r.stopPropagation();else if($t(e,r),t&4&&-1<Qt.indexOf(e)){for(;i!==null;){var a=Ri(i);if(a!==null&&zt(a),a=hn(e,t,n,r),a===null&&li(e,t,r,mn,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else li(e,t,r,null,n)}}var mn=null;function hn(e,t,n,r){if(mn=null,e=Ne(r),e=Li(e),e!==null){if(t=tt(e),t===null)e=null;else if(n=t.tag,n===13){if(e=nt(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 mn=e,null}function gn(e){switch(e){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`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 1;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`toggle`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 4;case`message`:switch(ft()){case pt:return 1;case mt:return 4;case ht:case gt:return 16;case _t:return 536870912;default:return 16}default:return 16}}var _n=null,vn=null,yn=null;function bn(){if(yn)return yn;var e,t=vn,n=t.length,r,i=`value`in _n?_n.value:_n.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 yn=i.slice(e,1<r?1-r:void 0)}function xn(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 Sn(){return!0}function Cn(){return!1}function wn(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)?Sn:Cn,this.isPropagationStopped=Cn,this}return R(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=Sn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Sn)},persist:function(){},isPersistent:Sn}),t}var Tn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},En=wn(Tn),Dn=R({},Tn,{view:0,detail:0}),On=wn(Dn),kn,An,jn,Mn=R({},Dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Un,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!==jn&&(jn&&e.type===`mousemove`?(kn=e.screenX-jn.screenX,An=e.screenY-jn.screenY):An=kn=0,jn=e),kn)},movementY:function(e){return`movementY`in e?e.movementY:An}}),Nn=wn(Mn),Pn=wn(R({},Mn,{dataTransfer:0})),Fn=wn(R({},Dn,{relatedTarget:0})),In=wn(R({},Tn,{animationName:0,elapsedTime:0,pseudoElement:0})),Ln=wn(R({},Tn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Rn=wn(R({},Tn,{data:0})),zn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Bn={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`},Vn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Hn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vn[e])?!!t[e]:!1}function Un(){return Hn}var Wn=wn(R({},Dn,{key:function(e){if(e.key){var t=zn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=xn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Bn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Un,charCode:function(e){return e.type===`keypress`?xn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?xn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Gn=wn(R({},Mn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Kn=wn(R({},Dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Un})),qn=wn(R({},Tn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Jn=wn(R({},Mn,{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})),Yn=[9,13,27,32],Xn=c&&`CompositionEvent`in window,Zn=null;c&&`documentMode`in document&&(Zn=document.documentMode);var Qn=c&&`TextEvent`in window&&!Zn,$n=c&&(!Xn||Zn&&8<Zn&&11>=Zn),er=` `,tr=!1;function nr(e,t){switch(e){case`keyup`:return Yn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function rr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var ir=!1;function ar(e,t){switch(e){case`compositionend`:return rr(t);case`keypress`:return t.which===32?(tr=!0,er):null;case`textInput`:return e=t.data,e===er&&tr?null:e;default:return null}}function or(e,t){if(ir)return e===`compositionend`||!Xn&&nr(e,t)?(e=bn(),yn=vn=_n=null,ir=!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 $n&&t.locale!==`ko`?null:t.data;default:return null}}var sr={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 cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!sr[e.type]:t===`textarea`}function lr(e,t,n,r){Re(r),t=di(t,`onChange`),0<t.length&&(n=new En(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var ur=null,dr=null;function fr(e){ri(e,0)}function pr(e){if(se(zi(e)))return e}function mr(e,t){if(e===`change`)return t}var hr=!1;if(c){var gr;if(c){var _r=`oninput`in document;if(!_r){var vr=document.createElement(`div`);vr.setAttribute(`oninput`,`return;`),_r=typeof vr.oninput==`function`}gr=_r}else gr=!1;hr=gr&&(!document.documentMode||9<document.documentMode)}function yr(){ur&&(ur.detachEvent(`onpropertychange`,br),dr=ur=null)}function br(e){if(e.propertyName===`value`&&pr(dr)){var t=[];lr(t,dr,e,Ne(e)),Ue(fr,t)}}function xr(e,t,n){e===`focusin`?(yr(),ur=t,dr=n,ur.attachEvent(`onpropertychange`,br)):e===`focusout`&&yr()}function Sr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return pr(dr)}function Cr(e,t){if(e===`click`)return pr(t)}function wr(e,t){if(e===`input`||e===`change`)return pr(t)}function Tr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Er=typeof Object.is==`function`?Object.is:Tr;function Dr(e,t){if(Er(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(!l.call(t,i)||!Er(e[i],t[i]))return!1}return!0}function Or(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function kr(e,t){var n=Or(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=Or(n)}}function Ar(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ar(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jr(){for(var e=window,t=ce();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=ce(e.document)}return t}function Mr(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`)}function Nr(e){var t=jr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ar(n.ownerDocument.documentElement,n)){if(r!==null&&Mr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=kr(n,a);var o=kr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Pr=c&&`documentMode`in document&&11>=document.documentMode,Fr=null,Ir=null,Lr=null,Rr=!1;function zr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Rr||Fr==null||Fr!==ce(r)||(r=Fr,`selectionStart`in r&&Mr(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}),Lr&&Dr(Lr,r)||(Lr=r,r=di(Ir,`onSelect`),0<r.length&&(t=new En(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Fr)))}function Br(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Vr={animationend:Br(`Animation`,`AnimationEnd`),animationiteration:Br(`Animation`,`AnimationIteration`),animationstart:Br(`Animation`,`AnimationStart`),transitionend:Br(`Transition`,`TransitionEnd`)},Hr={},Ur={};c&&(Ur=document.createElement(`div`).style,`AnimationEvent`in window||(delete Vr.animationend.animation,delete Vr.animationiteration.animation,delete Vr.animationstart.animation),`TransitionEvent`in window||delete Vr.transitionend.transition);function Wr(e){if(Hr[e])return Hr[e];if(!Vr[e])return e;var t=Vr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ur)return Hr[e]=t[n];return e}var Gr=Wr(`animationend`),Kr=Wr(`animationiteration`),qr=Wr(`animationstart`),Jr=Wr(`transitionend`),Yr=new Map,Xr=`abort auxClick 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(` `);function Zr(e,t){Yr.set(e,t),o(t,[e])}for(var Qr=0;Qr<Xr.length;Qr++){var $r=Xr[Qr];Zr($r.toLowerCase(),`on`+($r[0].toUpperCase()+$r.slice(1)))}Zr(Gr,`onAnimationEnd`),Zr(Kr,`onAnimationIteration`),Zr(qr,`onAnimationStart`),Zr(`dblclick`,`onDoubleClick`),Zr(`focusin`,`onFocus`),Zr(`focusout`,`onBlur`),Zr(Jr,`onTransitionEnd`),s(`onMouseEnter`,[`mouseout`,`mouseover`]),s(`onMouseLeave`,[`mouseout`,`mouseover`]),s(`onPointerEnter`,[`pointerout`,`pointerover`]),s(`onPointerLeave`,[`pointerout`,`pointerover`]),o(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),o(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),o(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),o(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var ei=`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(` `),ti=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(ei));function ni(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,et(r,t,void 0,e),e.currentTarget=null}function ri(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;ni(i,s,l),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;ni(i,s,l),a=c}}}if(Xe)throw e=Ze,Xe=!1,Ze=null,e}function ii(e,t){var n=t[Pi];n===void 0&&(n=t[Pi]=new Set);var r=e+`__bubble`;n.has(r)||(ci(t,e,2,!1),n.add(r))}function ai(e,t,n){var r=0;t&&(r|=4),ci(n,e,r,t)}var oi=`_reactListening`+Math.random().toString(36).slice(2);function si(e){if(!e[oi]){e[oi]=!0,i.forEach(function(t){t!==`selectionchange`&&(ti.has(t)||ai(t,!1,e),ai(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[oi]||(t[oi]=!0,ai(`selectionchange`,!1,t))}}function ci(e,t,n,r){switch(gn(t)){case 1:var i=dn;break;case 4:i=fn;break;default:i=pn}n=i.bind(null,t,n,e),i=void 0,!Ge||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 li(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;s!==null;){if(o=Li(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}Ue(function(){var r=a,i=Ne(n),o=[];a:{var s=Yr.get(e);if(s!==void 0){var c=En,l=e;switch(e){case`keypress`:if(xn(n)===0)break a;case`keydown`:case`keyup`:c=Wn;break;case`focusin`:l=`focus`,c=Fn;break;case`focusout`:l=`blur`,c=Fn;break;case`beforeblur`:case`afterblur`:c=Fn;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`:c=Nn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Pn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Kn;break;case Gr:case Kr:case qr:c=In;break;case Jr:c=qn;break;case`scroll`:c=On;break;case`wheel`:c=Jn;break;case`copy`:case`cut`:case`paste`:c=Ln;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=Gn}var u=!!(t&4),d=!u&&e===`scroll`,f=u?s===null?null:s+`Capture`:s;u=[];for(var p=r,m;p!==null;){m=p;var h=m.stateNode;if(m.tag===5&&h!==null&&(m=h,f!==null&&(h=We(p,f),h!=null&&u.push(ui(p,h,m)))),d)break;p=p.return}0<u.length&&(s=new c(s,l,null,n,i),o.push({event:s,listeners:u}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==Me&&(l=n.relatedTarget||n.fromElement)&&(Li(l)||l[Ni]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Li(l):null,l!==null&&(d=tt(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=Nn,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=Gn,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:zi(c),m=l==null?s:zi(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,Li(i)===r&&(u=new u(f,p+`enter`,l,n,i),u.target=m,u.relatedTarget=d,h=u),d=h,c&&l)b:{for(u=c,f=l,p=0,m=u;m;m=fi(m))p++;for(m=0,h=f;h;h=fi(h))m++;for(;0<p-m;)u=fi(u),p--;for(;0<m-p;)f=fi(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=fi(u),f=fi(f)}u=null}else u=null;c!==null&&pi(o,s,c,u,!1),l!==null&&d!==null&&pi(o,d,l,u,!0)}}a:{if(s=r?zi(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=mr;else if(cr(s)){if(hr)g=wr;else{g=Sr;var _=xr}}else(c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=Cr);if(g&&=g(e,r)){lr(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&pe(s,`number`,s.value)}switch(_=r?zi(r):window,e){case`focusin`:(cr(_)||_.contentEditable===`true`)&&(Fr=_,Ir=r,Lr=null);break;case`focusout`:Lr=Ir=Fr=null;break;case`mousedown`:Rr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Rr=!1,zr(o,n,i);break;case`selectionchange`:if(Pr)break;case`keydown`:case`keyup`:zr(o,n,i)}var v;if(Xn)b:{switch(e){case`compositionstart`:var y=`onCompositionStart`;break b;case`compositionend`:y=`onCompositionEnd`;break b;case`compositionupdate`:y=`onCompositionUpdate`;break b}y=void 0}else ir?nr(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&($n&&n.locale!==`ko`&&(ir||y!==`onCompositionStart`?y===`onCompositionEnd`&&ir&&(v=bn()):(_n=i,vn=`value`in _n?_n.value:_n.textContent,ir=!0)),_=di(r,y),0<_.length&&(y=new Rn(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=rr(n),v!==null&&(y.data=v)))),(v=Qn?ar(e,n):or(e,n))&&(r=di(r,`onBeforeInput`),0<r.length&&(i=new Rn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}ri(o,t)})}function ui(e,t,n){return{instance:e,listener:t,currentTarget:n}}function di(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=We(e,n),a!=null&&r.unshift(ui(e,a,i)),a=We(e,t),a!=null&&r.push(ui(e,a,i))),e=e.return}return r}function fi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function pi(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(c!==null&&c===r)break;s.tag===5&&l!==null&&(s=l,i?(c=We(n,a),c!=null&&o.unshift(ui(n,c,s))):i||(c=We(n,a),c!=null&&o.push(ui(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var mi=/\r\n?/g,hi=/\u0000|\uFFFD/g;function gi(e){return(typeof e==`string`?e:``+e).replace(mi,`
|
|
81
|
-
`).replace(hi,``)}function _i(e,t,n){if(t=gi(t),gi(e)!==t&&n)throw Error(r(425))}function vi(){}var yi=null,bi=null;function xi(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Si=typeof setTimeout==`function`?setTimeout:void 0,Ci=typeof clearTimeout==`function`?clearTimeout:void 0,wi=typeof Promise==`function`?Promise:void 0,Ti=typeof queueMicrotask==`function`?queueMicrotask:wi===void 0?Si:function(e){return wi.resolve(null).then(e).catch(Ei)};function Ei(e){setTimeout(function(){throw e})}function Di(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===`/$`){if(r===0){e.removeChild(i),cn(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++}n=i}while(n);cn(t)}function Oi(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===`$?`)break;if(t===`/$`)return null}}return e}function ki(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var Ai=Math.random().toString(36).slice(2),ji=`__reactFiber$`+Ai,Mi=`__reactProps$`+Ai,Ni=`__reactContainer$`+Ai,Pi=`__reactEvents$`+Ai,Fi=`__reactListeners$`+Ai,Ii=`__reactHandles$`+Ai;function Li(e){var t=e[ji];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ni]||n[ji]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ki(e);e!==null;){if(n=e[ji])return n;e=ki(e)}return t}e=n,n=e.parentNode}return null}function Ri(e){return e=e[ji]||e[Ni],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function zi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Bi(e){return e[Mi]||null}var Vi=[],Hi=-1;function Ui(e){return{current:e}}function Wi(e){0>Hi||(e.current=Vi[Hi],Vi[Hi]=null,Hi--)}function Gi(e,t){Hi++,Vi[Hi]=e.current,e.current=t}var Ki={},qi=Ui(Ki),Ji=Ui(!1),Yi=Ki;function Xi(e,t){var n=e.type.contextTypes;if(!n)return Ki;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Zi(e){return e=e.childContextTypes,e!=null}function Qi(){Wi(Ji),Wi(qi)}function $i(e,t,n){if(qi.current!==Ki)throw Error(r(168));Gi(qi,t),Gi(Ji,n)}function ea(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,V(e)||`Unknown`,a));return R({},n,i)}function ta(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ki,Yi=qi.current,Gi(qi,e),Gi(Ji,Ji.current),!0}function na(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=ea(e,t,Yi),i.__reactInternalMemoizedMergedChildContext=e,Wi(Ji),Wi(qi),Gi(qi,e)):Wi(Ji),Gi(Ji,n)}var ra=null,ia=!1,aa=!1;function oa(e){ra===null?ra=[e]:ra.push(e)}function sa(e){ia=!0,oa(e)}function ca(){if(!aa&&ra!==null){aa=!0;var e=0,t=Lt;try{var n=ra;for(Lt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ra=null,ia=!1}catch(t){throw ra!==null&&(ra=ra.slice(e+1)),st(pt,ca),t}finally{Lt=t,aa=!1}}return null}var la=[],ua=0,da=null,fa=0,pa=[],ma=0,ha=null,ga=1,_a=``;function va(e,t){la[ua++]=fa,la[ua++]=da,da=e,fa=t}function ya(e,t,n){pa[ma++]=ga,pa[ma++]=_a,pa[ma++]=ha,ha=e;var r=ga;e=_a;var i=32-xt(r)-1;r&=~(1<<i),n+=1;var a=32-xt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ga=1<<32-xt(t)+i|n<<i|r,_a=a+e}else ga=1<<a|n<<i|r,_a=e}function ba(e){e.return!==null&&(va(e,1),ya(e,1,0))}function xa(e){for(;e===da;)da=la[--ua],la[ua]=null,fa=la[--ua],la[ua]=null;for(;e===ha;)ha=pa[--ma],pa[ma]=null,_a=pa[--ma],pa[ma]=null,ga=pa[--ma],pa[ma]=null}var Sa=null,Ca=null,wa=!1,Ta=null;function Ea(e,t){var n=eu(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Da(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null&&(e.stateNode=t,Sa=e,Ca=Oi(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t!==null&&(e.stateNode=t,Sa=e,Ca=null,!0);case 13:return t=t.nodeType===8?t:null,t!==null&&(n=ha===null?null:{id:ga,overflow:_a},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=eu(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Sa=e,Ca=null,!0);default:return!1}}function Oa(e){return!!(e.mode&1)&&!(e.flags&128)}function ka(e){if(wa){var t=Ca;if(t){var n=t;if(!Da(e,t)){if(Oa(e))throw Error(r(418));t=Oi(n.nextSibling);var i=Sa;t&&Da(e,t)?Ea(i,n):(e.flags=e.flags&-4097|2,wa=!1,Sa=e)}}else{if(Oa(e))throw Error(r(418));e.flags=e.flags&-4097|2,wa=!1,Sa=e}}}function Aa(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Sa=e}function ja(e){if(e!==Sa)return!1;if(!wa)return Aa(e),wa=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!xi(e.type,e.memoizedProps)),t&&=Ca){if(Oa(e))throw Ma(),Error(r(418));for(;t;)Ea(e,t),t=Oi(t.nextSibling)}if(Aa(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){Ca=Oi(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}Ca=null}}else Ca=Sa?Oi(e.stateNode.nextSibling):null;return!0}function Ma(){for(var e=Ca;e;)e=Oi(e.nextSibling)}function Na(){Ca=Sa=null,wa=!1}function Pa(e){Ta===null?Ta=[e]:Ta.push(e)}var Fa=S.ReactCurrentBatchConfig;function Ia(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var a=i,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function La(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function Ra(e){var t=e._init;return t(e._payload)}function za(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 i(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=ru(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|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=su(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===T?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===P&&Ra(i)===t.type)?(r=a(t,n.props),r.ref=Ia(e,t,n),r.return=e,r):(r=iu(n.type,n.key,n.props,null,e.mode,r),r.ref=Ia(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=cu(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=au(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`)return t=su(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case C:return n=iu(t.type,t.key,t.props,null,e.mode,n),n.ref=Ia(e,null,t),n.return=e,n;case w:return t=cu(t,e.mode,n),t.return=e,t;case P:var r=t._init;return f(e,r(t._payload),n)}if(me(t)||L(t))return t=au(t,e.mode,n,null),t.return=e,t;La(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`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case C:return n.key===i?l(e,t,n,r):null;case w:return n.key===i?u(e,t,n,r):null;case P:return i=n._init,p(e,t,i(n._payload),r)}if(me(n)||L(n))return i===null?d(e,t,n,r,null):null;La(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case C:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case w:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case P:var a=r._init;return m(e,t,n,a(r._payload),i)}if(me(r)||L(r))return e=e.get(n)||null,d(t,e,r,i,null);La(t,r)}return null}function h(r,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),wa&&va(r,h),l;if(d===null){for(;h<s.length;h++)d=f(r,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return wa&&va(r,h),l}for(d=i(r,d);h<s.length;h++)g=m(d,r,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(r,e)}),wa&&va(r,h),l}function g(a,s,c,l){var u=L(c);if(typeof u!=`function`)throw Error(r(150));if(c=u.call(c),c==null)throw Error(r(151));for(var d=u=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),wa&&va(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return wa&&va(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),wa&&va(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===T&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case C:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===T){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===P&&Ra(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=Ia(e,l,i),r.return=e,e=r;break a}n(e,l);break}t(e,l),l=l.sibling}i.type===T?(r=au(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=iu(i.type,i.key,i.props,null,e.mode,o),o.ref=Ia(e,r,i),o.return=e,e=o)}return s(e);case w:a:{for(l=i.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}n(e,r);break}t(e,r),r=r.sibling}r=cu(i,e.mode,o),r.return=e,e=r}return s(e);case P:return l=i._init,_(e,r,l(i._payload),o)}if(me(i))return h(e,r,i,o);if(L(i))return g(e,r,i,o);La(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=su(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Ba=za(!0),Va=za(!1),Ha=Ui(null),Ua=null,Wa=null,Ga=null;function Ka(){Ga=Wa=Ua=null}function qa(e){var t=Ha.current;Wi(Ha),e._currentValue=t}function Ja(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 Ya(e,t){Ua=e,Ga=Wa=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(zs=!0),e.firstContext=null)}function Xa(e){var t=e._currentValue;if(Ga!==e){if(e={context:e,memoizedValue:t,next:null},Wa===null){if(Ua===null)throw Error(r(308));Wa=e,Ua.dependencies={lanes:0,firstContext:e}}else Wa=Wa.next=e}return t}var Za=null;function Qa(e){Za===null?Za=[e]:Za.push(e)}function $a(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Qa(t)):(n.next=i.next,i.next=n),t.interleaved=n,eo(e,r)}function eo(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var to=!1;function no(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ro(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function io(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ao(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Jc&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,eo(e,n)}return i=r.interleaved,i===null?(t.next=t,Qa(r)):(t.next=i.next,i.next=t),r.interleaved=t,eo(e,n)}function oo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,It(e,n)}}function so(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={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,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,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function co(e,t,n,r){var i=e.updateQueue;to=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=R({},d,f);break a;case 2:to=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);nl|=o,e.lanes=o,e.memoizedState=d}}function lo(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!=`function`)throw Error(r(191,a));a.call(i)}}}var uo={},fo=Ui(uo),po=Ui(uo),mo=Ui(uo);function ho(e){if(e===uo)throw Error(r(174));return e}function go(e,t){switch(Gi(mo,t),Gi(po,e),Gi(fo,uo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:xe(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=xe(t,e)}Wi(fo),Gi(fo,t)}function _o(){Wi(fo),Wi(po),Wi(mo)}function vo(e){ho(mo.current);var t=ho(fo.current),n=xe(t,e.type);t!==n&&(Gi(po,e),Gi(fo,n))}function yo(e){po.current===e&&(Wi(fo),Wi(po))}var bo=Ui(0);function xo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||n.data===`$!`))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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 So=[];function Co(){for(var e=0;e<So.length;e++)So[e]._workInProgressVersionPrimary=null;So.length=0}var wo=S.ReactCurrentDispatcher,To=S.ReactCurrentBatchConfig,Eo=0,Do=null,Oo=null,ko=null,Ao=!1,jo=!1,Mo=0,No=0;function Po(){throw Error(r(321))}function Fo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Er(e[n],t[n]))return!1;return!0}function Io(e,t,n,i,a,o){if(Eo=o,Do=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,wo.current=e===null||e.memoizedState===null?ys:bs,e=n(i,a),jo){o=0;do{if(jo=!1,Mo=0,25<=o)throw Error(r(301));o+=1,ko=Oo=null,t.updateQueue=null,wo.current=xs,e=n(i,a)}while(jo)}if(wo.current=vs,t=Oo!==null&&Oo.next!==null,Eo=0,ko=Oo=Do=null,Ao=!1,t)throw Error(r(300));return e}function Lo(){var e=Mo!==0;return Mo=0,e}function Ro(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ko===null?Do.memoizedState=ko=e:ko=ko.next=e,ko}function zo(){if(Oo===null){var e=Do.alternate;e=e===null?null:e.memoizedState}else e=Oo.next;var t=ko===null?Do.memoizedState:ko.next;if(t!==null)ko=t,Oo=e;else{if(e===null)throw Error(r(310));Oo=e,e={memoizedState:Oo.memoizedState,baseState:Oo.baseState,baseQueue:Oo.baseQueue,queue:Oo.queue,next:null},ko===null?Do.memoizedState=ko=e:ko=ko.next=e}return ko}function Bo(e,t){return typeof t==`function`?t(e):t}function Vo(e){var t=zo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=Oo,a=i.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}i.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,i=i.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((Eo&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=i):l=l.next=f,Do.lanes|=d,nl|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,Er(i,t.memoizedState)||(zs=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do o=a.lane,Do.lanes|=o,nl|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ho(e){var t=zo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=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);Er(o,t.memoizedState)||(zs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function Uo(){}function Wo(e,t){var n=Do,i=zo(),a=t(),o=!Er(i.memoizedState,a);if(o&&(i.memoizedState=a,zs=!0),i=i.queue,ns(qo.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||ko!==null&&ko.memoizedState.tag&1){if(n.flags|=2048,Zo(9,Ko.bind(null,n,i,a,t),void 0,null),Yc===null)throw Error(r(349));Eo&30||Go(n,t,a)}return a}function Go(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Do.updateQueue,t===null?(t={lastEffect:null,stores:null},Do.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ko(e,t,n,r){t.value=n,t.getSnapshot=r,Jo(t)&&Yo(e)}function qo(e,t,n){return n(function(){Jo(t)&&Yo(e)})}function Jo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Er(e,n)}catch{return!0}}function Yo(e){var t=eo(e,1);t!==null&&Sl(t,e,1,-1)}function Xo(e){var t=Ro();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:e},t.queue=e,e=e.dispatch=ms.bind(null,Do,e),[t.memoizedState,e]}function Zo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Do.updateQueue,t===null?(t={lastEffect:null,stores:null},Do.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Qo(){return zo().memoizedState}function $o(e,t,n,r){var i=Ro();Do.flags|=e,i.memoizedState=Zo(1|t,n,void 0,r===void 0?null:r)}function es(e,t,n,r){var i=zo();r=r===void 0?null:r;var a=void 0;if(Oo!==null){var o=Oo.memoizedState;if(a=o.destroy,r!==null&&Fo(r,o.deps)){i.memoizedState=Zo(t,n,a,r);return}}Do.flags|=e,i.memoizedState=Zo(1|t,n,a,r)}function ts(e,t){return $o(8390656,8,e,t)}function ns(e,t){return es(2048,8,e,t)}function rs(e,t){return es(4,2,e,t)}function is(e,t){return es(4,4,e,t)}function as(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function os(e,t,n){return n=n==null?null:n.concat([e]),es(4,4,as.bind(null,t,e),n)}function ss(){}function cs(e,t){var n=zo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Fo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ls(e,t){var n=zo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Fo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function us(e,t,n){return Eo&21?(Er(n,t)||(n=Mt(),Do.lanes|=n,nl|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,zs=!0),e.memoizedState=n)}function ds(e,t){var n=Lt;Lt=n!==0&&4>n?n:4,e(!0);var r=To.transition;To.transition={};try{e(!1),t()}finally{Lt=n,To.transition=r}}function fs(){return zo().memoizedState}function ps(e,t,n){var r=xl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},hs(e))gs(t,n);else if(n=$a(e,t,n,r),n!==null){var i=bl();Sl(n,e,r,i),_s(n,t,r)}}function ms(e,t,n){var r=xl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(hs(e))gs(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,Er(s,o)){var c=t.interleaved;c===null?(i.next=i,Qa(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=$a(e,t,i,r),n!==null&&(i=bl(),Sl(n,e,r,i),_s(n,t,r))}}function hs(e){var t=e.alternate;return e===Do||t!==null&&t===Do}function gs(e,t){jo=Ao=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function _s(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,It(e,n)}}var vs={readContext:Xa,useCallback:Po,useContext:Po,useEffect:Po,useImperativeHandle:Po,useInsertionEffect:Po,useLayoutEffect:Po,useMemo:Po,useReducer:Po,useRef:Po,useState:Po,useDebugValue:Po,useDeferredValue:Po,useTransition:Po,useMutableSource:Po,useSyncExternalStore:Po,useId:Po,unstable_isNewReconciler:!1},ys={readContext:Xa,useCallback:function(e,t){return Ro().memoizedState=[e,t===void 0?null:t],e},useContext:Xa,useEffect:ts,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),$o(4194308,4,as.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $o(4194308,4,e,t)},useInsertionEffect:function(e,t){return $o(4,2,e,t)},useMemo:function(e,t){var n=Ro();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ro();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ps.bind(null,Do,e),[r.memoizedState,e]},useRef:function(e){var t=Ro();return e={current:e},t.memoizedState=e},useState:Xo,useDebugValue:ss,useDeferredValue:function(e){return Ro().memoizedState=e},useTransition:function(){var e=Xo(!1),t=e[0];return e=ds.bind(null,e[1]),Ro().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=Do,a=Ro();if(wa){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Yc===null)throw Error(r(349));Eo&30||Go(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ts(qo.bind(null,i,o,e),[e]),i.flags|=2048,Zo(9,Ko.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Ro(),t=Yc.identifierPrefix;if(wa){var n=_a,r=ga;n=(r&~(1<<32-xt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=Mo++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=No++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},bs={readContext:Xa,useCallback:cs,useContext:Xa,useEffect:ns,useImperativeHandle:os,useInsertionEffect:rs,useLayoutEffect:is,useMemo:ls,useReducer:Vo,useRef:Qo,useState:function(){return Vo(Bo)},useDebugValue:ss,useDeferredValue:function(e){return us(zo(),Oo.memoizedState,e)},useTransition:function(){return[Vo(Bo)[0],zo().memoizedState]},useMutableSource:Uo,useSyncExternalStore:Wo,useId:fs,unstable_isNewReconciler:!1},xs={readContext:Xa,useCallback:cs,useContext:Xa,useEffect:ns,useImperativeHandle:os,useInsertionEffect:rs,useLayoutEffect:is,useMemo:ls,useReducer:Ho,useRef:Qo,useState:function(){return Ho(Bo)},useDebugValue:ss,useDeferredValue:function(e){var t=zo();return Oo===null?t.memoizedState=e:us(t,Oo.memoizedState,e)},useTransition:function(){return[Ho(Bo)[0],zo().memoizedState]},useMutableSource:Uo,useSyncExternalStore:Wo,useId:fs,unstable_isNewReconciler:!1};function Ss(e,t){if(e&&e.defaultProps){for(var n in t=R({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Cs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:R({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ws={isMounted:function(e){return(e=e._reactInternals)?tt(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=bl(),i=xl(e),a=io(r,i);a.payload=t,n!=null&&(a.callback=n),t=ao(e,a,i),t!==null&&(Sl(t,e,i,r),oo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=bl(),i=xl(e),a=io(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=ao(e,a,i),t!==null&&(Sl(t,e,i,r),oo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=bl(),r=xl(e),i=io(n,r);i.tag=2,t!=null&&(i.callback=t),t=ao(e,i,r),t!==null&&(Sl(t,e,r,n),oo(t,e,r))}};function Ts(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?!Dr(n,r)||!Dr(i,a):!0}function Es(e,t,n){var r=!1,i=Ki,a=t.contextType;return typeof a==`object`&&a?a=Xa(a):(i=Zi(t)?Yi:qi.current,r=t.contextTypes,a=(r=r!=null)?Xi(e,i):Ki),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ws,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Ds(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&&ws.enqueueReplaceState(t,t.state,null)}function Os(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},no(e);var a=t.contextType;typeof a==`object`&&a?i.context=Xa(a):(a=Zi(t)?Yi:qi.current,i.context=Xi(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(Cs(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&ws.enqueueReplaceState(i,i.state,null),co(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function ks(e,t){try{var n=``,r=t;do n+=ne(r),r=r.return;while(r);var i=n}catch(e){i=`
|
|
82
|
-
Error generating stack: `+e.message+`
|
|
83
|
-
`+e.stack}return{value:e,source:t,stack:i,digest:null}}function As(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function js(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Ms=typeof WeakMap==`function`?WeakMap:Map;function Ns(e,t,n){n=io(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ul||(ul=!0,dl=r),js(e,t)},n}function Ps(e,t,n){n=io(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){js(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){js(e,t),typeof r!=`function`&&(fl===null?fl=new Set([this]):fl.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function Fs(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ms;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)||(i.add(n),e=ql.bind(null,e,t,n),t.then(e,e))}function Is(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null||t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Ls(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=io(-1,1),t.tag=2,ao(n,t,1))),n.lanes|=1),e)}var Rs=S.ReactCurrentOwner,zs=!1;function Bs(e,t,n,r){t.child=e===null?Va(t,null,n,r):Ba(t,e.child,n,r)}function Vs(e,t,n,r,i){n=n.render;var a=t.ref;return Ya(t,i),r=Io(e,t,n,r,a,i),n=Lo(),e!==null&&!zs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,sc(e,t,i)):(wa&&n&&ba(t),t.flags|=1,Bs(e,t,r,i),t.child)}function Hs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!tu(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Us(e,t,a,r,i)):(e=iu(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?Dr:n,n(o,r)&&e.ref===t.ref)return sc(e,t,i)}return t.flags|=1,e=ru(a,r),e.ref=t.ref,e.return=t,t.child=e}function Us(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Dr(a,r)&&e.ref===t.ref){if(zs=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(zs=!0);else return t.lanes=e.lanes,sc(e,t,i)}}return Ks(e,t,n,r,i)}function Ws(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`){if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Gi($c,Qc),Qc|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Gi($c,Qc),Qc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,Gi($c,Qc),Qc|=r}}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),Gi($c,Qc),Qc|=r;return Bs(e,t,i,n),t.child}function Gs(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ks(e,t,n,r,i){var a=Zi(n)?Yi:qi.current;return a=Xi(t,a),Ya(t,i),n=Io(e,t,n,r,a,i),r=Lo(),e!==null&&!zs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,sc(e,t,i)):(wa&&r&&ba(t),t.flags|=1,Bs(e,t,n,i),t.child)}function qs(e,t,n,r,i){if(Zi(n)){var a=!0;ta(t)}else a=!1;if(Ya(t,i),t.stateNode===null)oc(e,t),Es(t,n,r),Os(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=Xa(l):(l=Zi(n)?Yi:qi.current,l=Xi(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&Ds(t,o,r,l),to=!1;var f=t.memoizedState;o.state=f,co(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Ji.current||to?(typeof u==`function`&&(Cs(t,n,u,r),c=t.memoizedState),(s=to||Ts(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,ro(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:Ss(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=Xa(c):(c=Zi(n)?Yi:qi.current,c=Xi(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&Ds(t,o,r,c),to=!1,f=t.memoizedState,o.state=f,co(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Ji.current||to?(typeof p==`function`&&(Cs(t,n,p,r),m=t.memoizedState),(l=to||Ts(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Js(e,t,n,r,a,i)}function Js(e,t,n,r,i,a){Gs(e,t);var o=!!(t.flags&128);if(!r&&!o)return i&&na(t,n,!1),sc(e,t,a);r=t.stateNode,Rs.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ba(t,e.child,null,a),t.child=Ba(t,null,s,a)):Bs(e,t,s,a),t.memoizedState=r.state,i&&na(t,n,!0),t.child}function Ys(e){var t=e.stateNode;t.pendingContext?$i(e,t.pendingContext,t.pendingContext!==t.context):t.context&&$i(e,t.context,!1),go(e,t.containerInfo)}function Xs(e,t,n,r,i){return Na(),Pa(i),t.flags|=256,Bs(e,t,n,r),t.child}var Zs={dehydrated:null,treeContext:null,retryLane:0};function Qs(e){return{baseLanes:e,cachePool:null,transitions:null}}function $s(e,t,n){var r=t.pendingProps,i=bo.current,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(i&2)),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Gi(bo,i&1),e===null)return ka(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.lanes=t.mode&1?e.data===`$!`?8:1073741824:1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=ou(o,r,0,null),e=au(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Qs(n),t.memoizedState=Zs,e):ec(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return nc(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=ru(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=au(a,o,n,null),a.flags|=2):a=ru(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?Qs(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Zs,r}return a=e.child,e=a.sibling,r=ru(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function ec(e,t){return t=ou({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function tc(e,t,n,r){return r!==null&&Pa(r),Ba(t,e.child,null,n),e=ec(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nc(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=As(Error(r(422))),tc(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=ou({mode:`visible`,children:i.children},a,0,null),o=au(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&Ba(t,e.child,null,s),t.child.memoizedState=Qs(s),t.memoizedState=Zs,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return tc(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=As(o,i,void 0),tc(e,t,s,i)}if(c=(s&e.childLanes)!==0,zs||c){if(i=Yc,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,eo(e,a),Sl(i,e,a,-1))}return Il(),i=As(Error(r(421))),tc(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=Yl.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,Ca=Oi(a.nextSibling),Sa=t,wa=!0,Ta=null,e!==null&&(pa[ma++]=ga,pa[ma++]=_a,pa[ma++]=ha,ga=e.id,_a=e.overflow,ha=t),t=ec(t,i.children),t.flags|=4096,t)}function rc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ja(e.return,t,n)}function ic(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function ac(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Bs(e,t,r.children,n),r=bo.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rc(e,n,t);else if(e.tag===19)rc(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}r&=1}if(Gi(bo,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&xo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ic(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&xo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ic(t,!0,n,null,a);break;case`together`:ic(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function oc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function sc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),nl|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=ru(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ru(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function cc(e,t,n){switch(t.tag){case 3:Ys(t),Na();break;case 5:vo(t);break;case 1:Zi(t.type)&&ta(t);break;case 4:go(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Gi(Ha,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Gi(bo,bo.current&1),e=sc(e,t,n),e===null?null:e.sibling):$s(e,t,n):(Gi(bo,bo.current&1),t.flags|=128,null);Gi(bo,bo.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ac(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Gi(bo,bo.current),r)break;return null;case 22:case 23:return t.lanes=0,Ws(e,t,n)}return sc(e,t,n)}var lc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},uc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,ho(fo.current);var o=null;switch(n){case`input`:i=le(e,i),r=le(e,r),o=[];break;case`select`:i=R({},i,{value:void 0}),r=R({},r,{value:void 0}),o=[];break;case`textarea`:i=ge(e,i),r=ge(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=vi)}Ae(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null){if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null))}for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null)){if(u===`style`){if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l}else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&ii(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},dc=function(e,t,n,r){n!==r&&(t.flags|=4)};function fc(e,t){if(!wa)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 pc(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&14680064,r|=i.flags&14680064,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 i=t.pendingProps;switch(xa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pc(t),null;case 1:return Zi(t.type)&&Qi(),pc(t),null;case 3:return i=t.stateNode,_o(),Wi(Ji),Wi(qi),Co(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ja(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ta!==null&&(El(Ta),Ta=null))),pc(t),null;case 5:yo(t);var o=ho(mo.current);if(n=t.type,e!==null&&t.stateNode!=null)uc(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return pc(t),null}if(e=ho(fo.current),ja(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[ji]=t,i[Mi]=s,e=!!(t.mode&1),n){case`dialog`:ii(`cancel`,i),ii(`close`,i);break;case`iframe`:case`object`:case`embed`:ii(`load`,i);break;case`video`:case`audio`:for(o=0;o<ei.length;o++)ii(ei[o],i);break;case`source`:ii(`error`,i);break;case`img`:case`image`:case`link`:ii(`error`,i),ii(`load`,i);break;case`details`:ii(`toggle`,i);break;case`input`:U(i,s),ii(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},ii(`invalid`,i);break;case`textarea`:_e(i,s),ii(`invalid`,i)}for(var c in Ae(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&_i(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&_i(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&ii(`scroll`,i)}switch(n){case`input`:H(i),fe(i,s,!0);break;case`textarea`:H(i),ye(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=vi)}i=o,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=be(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[ji]=t,e[Mi]=i,lc(e,t,!1,!1),t.stateNode=e;a:{switch(c=je(n,i),n){case`dialog`:ii(`cancel`,e),ii(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:ii(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<ei.length;o++)ii(ei[o],e);o=i;break;case`source`:ii(`error`,e),o=i;break;case`img`:case`image`:case`link`:ii(`error`,e),ii(`load`,e),o=i;break;case`details`:ii(`toggle`,e),o=i;break;case`input`:U(e,i),o=le(e,i),ii(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=R({},i,{value:void 0}),ii(`invalid`,e);break;case`textarea`:_e(e,i),o=ge(e,i),ii(`invalid`,e);break;default:o=i}for(s in Ae(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?Oe(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&Ce(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&we(e,u):typeof u==`number`&&we(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&ii(`scroll`,e):u!=null&&x(e,s,u,c))}switch(n){case`input`:H(e),fe(e,i,!1);break;case`textarea`:H(e),ye(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+ie(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&he(e,!!i.multiple,i.defaultValue,!0):he(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=vi)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return pc(t),null;case 6:if(e&&t.stateNode!=null)dc(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=ho(mo.current),ho(fo.current),ja(t)){if(i=t.stateNode,n=t.memoizedProps,i[ji]=t,(s=i.nodeValue!==n)&&(e=Sa,e!==null))switch(e.tag){case 3:_i(i.nodeValue,n,!!(e.mode&1));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&_i(i.nodeValue,n,!!(e.mode&1))}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[ji]=t,t.stateNode=i}return pc(t),null;case 13:if(Wi(bo),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(wa&&Ca!==null&&t.mode&1&&!(t.flags&128))Ma(),Na(),t.flags|=98560,s=!1;else if(s=ja(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s===null?null:s.dehydrated,!s)throw Error(r(317));s[ji]=t}else Na(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pc(t),s=!1}else Ta!==null&&(El(Ta),Ta=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||bo.current&1?el===0&&(el=3):Il())),t.updateQueue!==null&&(t.flags|=4),pc(t),null);case 4:return _o(),e===null&&si(t.stateNode.containerInfo),pc(t),null;case 10:return qa(t.type._context),pc(t),null;case 17:return Zi(t.type)&&Qi(),pc(t),null;case 19:if(Wi(bo),s=t.memoizedState,s===null)return pc(t),null;if(i=!!(t.flags&128),c=s.rendering,c===null){if(i)fc(s,!1);else{if(el!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=xo(e),c!==null){for(t.flags|=128,fc(s,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)s=n,e=i,s.flags&=14680066,c=s.alternate,c===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Gi(bo,bo.current&1|2),t.child}e=e.sibling}s.tail!==null&&dt()>cl&&(t.flags|=128,i=!0,fc(s,!1),t.lanes=4194304)}}else{if(!i){if(e=xo(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),fc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!wa)return pc(t),null}else 2*dt()-s.renderingStartTime>cl&&n!==1073741824&&(t.flags|=128,i=!0,fc(s,!1),t.lanes=4194304)}s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(pc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=dt(),t.sibling=null,n=bo.current,Gi(bo,i?n&1|2:n&1),t);case 22:case 23:return Ml(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Qc&1073741824&&(pc(t),t.subtreeFlags&6&&(t.flags|=8192)):pc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function hc(e,t){switch(xa(t),t.tag){case 1:return Zi(t.type)&&Qi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _o(),Wi(Ji),Wi(qi),Co(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return yo(t),null;case 13:if(Wi(bo),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Na()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Wi(bo),null;case 4:return _o(),null;case 10:return qa(t.type._context),null;case 22:case 23:return Ml(),null;case 24:return null;default:return null}}var gc=!1,_c=!1,vc=typeof WeakSet==`function`?WeakSet:Set,W=null;function yc(e,t){var n=e.ref;if(n!==null){if(typeof n==`function`)try{n(null)}catch(n){Kl(e,t,n)}else n.current=null}}function bc(e,t,n){try{n()}catch(n){Kl(e,t,n)}}var xc=!1;function Sc(e,t){if(yi=un,e=jr(),Mr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.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||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(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(bi={focusedElem:e,selectionRange:n},un=!1,W=t;W!==null;)if(t=W,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Ss(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Kl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return h=xc,xc=!1,h}function Cc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&bc(t,n,a)}i=i.next}while(i!==r)}}function wc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Tc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function Ec(e){var t=e.alternate;t!==null&&(e.alternate=null,Ec(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ji],delete t[Mi],delete t[Pi],delete t[Fi],delete t[Ii])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Dc(e){return e.tag===5||e.tag===3||e.tag===4}function Oc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Dc(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.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 kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=vi));else if(r!==4&&(e=e.child,e!==null))for(kc(e,t,n),e=e.sibling;e!==null;)kc(e,t,n),e=e.sibling}function Ac(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&&(e=e.child,e!==null))for(Ac(e,t,n),e=e.sibling;e!==null;)Ac(e,t,n),e=e.sibling}var jc=null,Mc=!1;function Nc(e,t,n){for(n=n.child;n!==null;)Pc(e,t,n),n=n.sibling}function Pc(e,t,n){if(yt&&typeof yt.onCommitFiberUnmount==`function`)try{yt.onCommitFiberUnmount(vt,n)}catch{}switch(n.tag){case 5:_c||yc(n,t);case 6:var r=jc,i=Mc;jc=null,Nc(e,t,n),jc=r,Mc=i,jc!==null&&(Mc?(e=jc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):jc.removeChild(n.stateNode));break;case 18:jc!==null&&(Mc?(e=jc,n=n.stateNode,e.nodeType===8?Di(e.parentNode,n):e.nodeType===1&&Di(e,n),cn(e)):Di(jc,n.stateNode));break;case 4:r=jc,i=Mc,jc=n.stateNode.containerInfo,Mc=!0,Nc(e,t,n),jc=r,Mc=i;break;case 0:case 11:case 14:case 15:if(!_c&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&bc(n,t,o),i=i.next}while(i!==r)}Nc(e,t,n);break;case 1:if(!_c&&(yc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Kl(n,t,e)}Nc(e,t,n);break;case 21:Nc(e,t,n);break;case 22:n.mode&1?(_c=(r=_c)||n.memoizedState!==null,Nc(e,t,n),_c=r):Nc(e,t,n);break;default:Nc(e,t,n)}}function Fc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new vc),t.forEach(function(t){var r=Xl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Ic(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:jc=c.stateNode,Mc=!1;break a;case 3:jc=c.stateNode.containerInfo,Mc=!0;break a;case 4:jc=c.stateNode.containerInfo,Mc=!0;break a}c=c.return}if(jc===null)throw Error(r(160));Pc(o,s,a),jc=null,Mc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){Kl(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Lc(t,e),t=t.sibling}function Lc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ic(t,e),Rc(e),i&4){try{Cc(3,e,e.return),wc(3,e)}catch(t){Kl(e,e.return,t)}try{Cc(5,e,e.return)}catch(t){Kl(e,e.return,t)}}break;case 1:Ic(t,e),Rc(e),i&512&&n!==null&&yc(n,n.return);break;case 5:if(Ic(t,e),Rc(e),i&512&&n!==null&&yc(n,n.return),e.flags&32){var a=e.stateNode;try{we(a,``)}catch(t){Kl(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&ue(a,o),je(c,s);var u=je(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?Oe(a,f):d===`dangerouslySetInnerHTML`?Ce(a,f):d===`children`?we(a,f):x(a,d,f,u)}switch(c){case`input`:de(a,o);break;case`textarea`:ve(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?he(a,!!o.multiple,o.multiple?[]:``,!1):he(a,!!o.multiple,o.defaultValue,!0)):he(a,!!o.multiple,m,!1)}a[Mi]=o}catch(t){Kl(e,e.return,t)}}break;case 6:if(Ic(t,e),Rc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){Kl(e,e.return,t)}}break;case 3:if(Ic(t,e),Rc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{cn(t.containerInfo)}catch(t){Kl(e,e.return,t)}break;case 4:Ic(t,e),Rc(e);break;case 13:Ic(t,e),Rc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(sl=dt())),i&4&&Fc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(_c=(u=_c)||d,Ic(t,e),_c=u):Ic(t,e),Rc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(W=e,d=e.child;d!==null;){for(f=W=d;W!==null;){switch(p=W,m=p.child,p.tag){case 0:case 11:case 14:case 15:Cc(4,p,p.return);break;case 1:yc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){Kl(i,n,e)}}break;case 5:yc(p,p.return);break;case 22:if(p.memoizedState!==null){Hc(f);continue}}m===null?Hc(f):(m.return=p,W=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=De(`display`,s))}catch(t){Kl(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){Kl(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Ic(t,e),Rc(e),i&4&&Fc(e);break;case 21:break;default:Ic(t,e),Rc(e)}}function Rc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(Dc(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(we(a,``),i.flags&=-33),Ac(e,Oc(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;kc(e,Oc(e),o);break;default:throw Error(r(161))}}catch(t){Kl(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zc(e,t,n){W=e,Bc(e,t,n)}function Bc(e,t,n){for(var r=!!(e.mode&1);W!==null;){var i=W,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||gc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||_c;s=gc;var l=_c;if(gc=o,(_c=c)&&!l)for(W=i;W!==null;)o=W,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?Uc(i):(c.return=o,W=c);for(;a!==null;)W=a,Bc(a,t,n),a=a.sibling;W=i,gc=s,_c=l}Vc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,W=a):Vc(e,t,n)}}function Vc(e){for(;W!==null;){var t=W;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:_c||wc(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!_c){if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Ss(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}}var o=t.updateQueue;o!==null&&lo(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}lo(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&cn(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}_c||t.flags&512&&Tc(t)}catch(e){Kl(t,t.return,e)}}if(t===e){W=null;break}if(n=t.sibling,n!==null){n.return=t.return,W=n;break}W=t.return}}function Hc(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var n=t.sibling;if(n!==null){n.return=t.return,W=n;break}W=t.return}}function Uc(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{wc(4,t)}catch(e){Kl(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){Kl(t,i,e)}}var a=t.return;try{Tc(t)}catch(e){Kl(t,a,e)}break;case 5:var o=t.return;try{Tc(t)}catch(e){Kl(t,o,e)}}}catch(e){Kl(t,t.return,e)}if(t===e){W=null;break}var s=t.sibling;if(s!==null){s.return=t.return,W=s;break}W=t.return}}var Wc=Math.ceil,Gc=S.ReactCurrentDispatcher,Kc=S.ReactCurrentOwner,qc=S.ReactCurrentBatchConfig,Jc=0,Yc=null,Xc=null,Zc=0,Qc=0,$c=Ui(0),el=0,tl=null,nl=0,rl=0,il=0,al=null,ol=null,sl=0,cl=1/0,ll=null,ul=!1,dl=null,fl=null,pl=!1,ml=null,hl=0,gl=0,_l=null,vl=-1,yl=0;function bl(){return Jc&6?dt():vl===-1?vl=dt():vl}function xl(e){return e.mode&1?Jc&2&&Zc!==0?Zc&-Zc:Fa.transition===null?(e=Lt,e===0?(e=window.event,e=e===void 0?16:gn(e.type),e):e):(yl===0&&(yl=Mt()),yl):1}function Sl(e,t,n,i){if(50<gl)throw gl=0,_l=null,Error(r(185));Pt(e,n,i),(!(Jc&2)||e!==Yc)&&(e===Yc&&(!(Jc&2)&&(rl|=n),el===4&&Ol(e,Zc)),Cl(e,i),n===1&&Jc===0&&!(t.mode&1)&&(cl=dt()+500,ia&&ca()))}function Cl(e,t){var n=e.callbackNode;At(e,t);var r=Ot(e,e===Yc?Zc:0);if(r===0)n!==null&&ct(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&ct(n),t===1)e.tag===0?sa(kl.bind(null,e)):oa(kl.bind(null,e)),Ti(function(){!(Jc&6)&&ca()}),n=null;else{switch(Rt(r)){case 1:n=pt;break;case 4:n=mt;break;case 16:n=ht;break;case 536870912:n=_t;break;default:n=ht}n=Ql(n,wl.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function wl(e,t){if(vl=-1,yl=0,Jc&6)throw Error(r(327));var n=e.callbackNode;if(Wl()&&e.callbackNode!==n)return null;var i=Ot(e,e===Yc?Zc:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=Ll(e,i);else{t=i;var a=Jc;Jc|=2;var o=Fl();(Yc!==e||Zc!==t)&&(ll=null,cl=dt()+500,Nl(e,t));do try{zl();break}catch(t){Pl(e,t)}while(1);Ka(),Gc.current=o,Jc=a,Xc===null?(Yc=null,Zc=0,t=el):t=0}if(t!==0){if(t===2&&(a=jt(e),a!==0&&(i=a,t=Tl(e,a))),t===1)throw n=tl,Nl(e,0),Ol(e,i),Cl(e,dt()),n;if(t===6)Ol(e,i);else{if(a=e.current.alternate,!(i&30)&&!Dl(a)&&(t=Ll(e,i),t===2&&(o=jt(e),o!==0&&(i=o,t=Tl(e,o))),t===1))throw n=tl,Nl(e,0),Ol(e,i),Cl(e,dt()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:Hl(e,ol,ll);break;case 3:if(Ol(e,i),(i&130023424)===i&&(t=sl+500-dt(),10<t)){if(Ot(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){bl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Si(Hl.bind(null,e,ol,ll),t);break}Hl(e,ol,ll);break;case 4:if(Ol(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-xt(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=dt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Wc(i/1960))-i,10<i){e.timeoutHandle=Si(Hl.bind(null,e,ol,ll),i);break}Hl(e,ol,ll);break;case 5:Hl(e,ol,ll);break;default:throw Error(r(329))}}}return Cl(e,dt()),e.callbackNode===n?wl.bind(null,e):null}function Tl(e,t){var n=al;return e.current.memoizedState.isDehydrated&&(Nl(e,t).flags|=256),e=Ll(e,t),e!==2&&(t=ol,ol=n,t!==null&&El(t)),e}function El(e){ol===null?ol=e:ol.push.apply(ol,e)}function Dl(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(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(!Er(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 Ol(e,t){for(t&=~il,t&=~rl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-xt(t),r=1<<n;e[n]=-1,t&=~r}}function kl(e){if(Jc&6)throw Error(r(327));Wl();var t=Ot(e,0);if(!(t&1))return Cl(e,dt()),null;var n=Ll(e,t);if(e.tag!==0&&n===2){var i=jt(e);i!==0&&(t=i,n=Tl(e,i))}if(n===1)throw n=tl,Nl(e,0),Ol(e,t),Cl(e,dt()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Hl(e,ol,ll),Cl(e,dt()),null}function Al(e,t){var n=Jc;Jc|=1;try{return e(t)}finally{Jc=n,Jc===0&&(cl=dt()+500,ia&&ca())}}function jl(e){ml!==null&&ml.tag===0&&!(Jc&6)&&Wl();var t=Jc;Jc|=1;var n=qc.transition,r=Lt;try{if(qc.transition=null,Lt=1,e)return e()}finally{Lt=r,qc.transition=n,Jc=t,!(Jc&6)&&ca()}}function Ml(){Qc=$c.current,Wi($c)}function Nl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Ci(n)),Xc!==null)for(n=Xc.return;n!==null;){var r=n;switch(xa(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Qi();break;case 3:_o(),Wi(Ji),Wi(qi),Co();break;case 5:yo(r);break;case 4:_o();break;case 13:Wi(bo);break;case 19:Wi(bo);break;case 10:qa(r.type._context);break;case 22:case 23:Ml()}n=n.return}if(Yc=e,Xc=e=ru(e.current,null),Zc=Qc=t,el=0,tl=null,il=rl=nl=0,ol=al=null,Za!==null){for(t=0;t<Za.length;t++)if(n=Za[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}Za=null}return e}function Pl(e,t){do{var n=Xc;try{if(Ka(),wo.current=vs,Ao){for(var i=Do.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Ao=!1}if(Eo=0,ko=Oo=Do=null,jo=!1,Mo=0,Kc.current=null,n===null||n.return===null){el=1,tl=t,Xc=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=Zc,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Is(s);if(m!==null){m.flags&=-257,Ls(m,s,c,o,t),m.mode&1&&Fs(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}if(!(t&1)){Fs(o,u,t),Il();break a}l=Error(r(426))}else if(wa&&c.mode&1){var _=Is(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Ls(_,s,c,o,t),Pa(ks(l,c));break a}}o=l=ks(l,c),el!==4&&(el=2),al===null?al=[o]:al.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Ns(o,l,t);so(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(fl===null||!fl.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=Ps(o,c,t);so(o,x);break a}}o=o.return}while(o!==null)}Vl(n)}catch(e){t=e,Xc===n&&n!==null&&(Xc=n=n.return);continue}break}while(1)}function Fl(){var e=Gc.current;return Gc.current=vs,e===null?vs:e}function Il(){(el===0||el===3||el===2)&&(el=4),Yc===null||!(nl&268435455)&&!(rl&268435455)||Ol(Yc,Zc)}function Ll(e,t){var n=Jc;Jc|=2;var i=Fl();(Yc!==e||Zc!==t)&&(ll=null,Nl(e,t));do try{Rl();break}catch(t){Pl(e,t)}while(1);if(Ka(),Jc=n,Gc.current=i,Xc!==null)throw Error(r(261));return Yc=null,Zc=0,el}function Rl(){for(;Xc!==null;)Bl(Xc)}function zl(){for(;Xc!==null&&!lt();)Bl(Xc)}function Bl(e){var t=Zl(e.alternate,e,Qc);e.memoizedProps=e.pendingProps,t===null?Vl(e):Xc=t,Kc.current=null}function Vl(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=hc(n,t),n!==null){n.flags&=32767,Xc=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{el=6,Xc=null;return}}else if(n=mc(n,t,Qc),n!==null){Xc=n;return}if(t=t.sibling,t!==null){Xc=t;return}Xc=t=e}while(t!==null);el===0&&(el=5)}function Hl(e,t,n){var r=Lt,i=qc.transition;try{qc.transition=null,Lt=1,Ul(e,t,n,r)}finally{qc.transition=i,Lt=r}return null}function Ul(e,t,n,i){do Wl();while(ml!==null);if(Jc&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Ft(e,o),e===Yc&&(Xc=Yc=null,Zc=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||pl||(pl=!0,Ql(ht,function(){return Wl(),null})),o=!!(n.flags&15990),n.subtreeFlags&15990||o){o=qc.transition,qc.transition=null;var s=Lt;Lt=1;var c=Jc;Jc|=4,Kc.current=null,Sc(e,n),Lc(n,e),Nr(bi),un=!!yi,bi=yi=null,e.current=n,zc(n,e,a),ut(),Jc=c,Lt=s,qc.transition=o}else e.current=n;if(pl&&(pl=!1,ml=e,hl=a),o=e.pendingLanes,o===0&&(fl=null),bt(n.stateNode,i),Cl(e,dt()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(ul)throw ul=!1,e=dl,dl=null,e;return hl&1&&e.tag!==0&&Wl(),o=e.pendingLanes,o&1?e===_l?gl++:(gl=0,_l=e):gl=0,ca(),null}function Wl(){if(ml!==null){var e=Rt(hl),t=qc.transition,n=Lt;try{if(qc.transition=null,Lt=16>e?16:e,ml===null)var i=!1;else{if(e=ml,ml=null,hl=0,Jc&6)throw Error(r(331));var a=Jc;for(Jc|=4,W=e.current;W!==null;){var o=W,s=o.child;if(W.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(W=u;W!==null;){var d=W;switch(d.tag){case 0:case 11:case 15:Cc(8,d,o)}var f=d.child;if(f!==null)f.return=d,W=f;else for(;W!==null;){d=W;var p=d.sibling,m=d.return;if(Ec(d),d===u){W=null;break}if(p!==null){p.return=m,W=p;break}W=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}W=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,W=s;else b:for(;W!==null;){if(o=W,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Cc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,W=v;break b}W=o.return}}var y=e.current;for(W=y;W!==null;){s=W;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,W=b;else b:for(s=y;W!==null;){if(c=W,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:wc(9,c)}}catch(e){Kl(c,c.return,e)}if(c===s){W=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,W=x;break b}W=c.return}}if(Jc=a,ca(),yt&&typeof yt.onPostCommitFiberRoot==`function`)try{yt.onPostCommitFiberRoot(vt,e)}catch{}i=!0}return i}finally{Lt=n,qc.transition=t}}return!1}function Gl(e,t,n){t=ks(n,t),t=Ns(e,t,1),e=ao(e,t,1),t=bl(),e!==null&&(Pt(e,1,t),Cl(e,t))}function Kl(e,t,n){if(e.tag===3)Gl(e,e,n);else for(;t!==null;){if(t.tag===3){Gl(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(fl===null||!fl.has(r))){e=ks(n,e),e=Ps(t,e,1),t=ao(t,e,1),e=bl(),t!==null&&(Pt(t,1,e),Cl(t,e));break}}t=t.return}}function ql(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=bl(),e.pingedLanes|=e.suspendedLanes&n,Yc===e&&(Zc&n)===n&&(el===4||el===3&&(Zc&130023424)===Zc&&500>dt()-sl?Nl(e,0):il|=n),Cl(e,t)}function Jl(e,t){t===0&&(e.mode&1?(t=Et,Et<<=1,!(Et&130023424)&&(Et=4194304)):t=1);var n=bl();e=eo(e,t),e!==null&&(Pt(e,t,n),Cl(e,n))}function Yl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Jl(e,n)}function Xl(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Jl(e,n)}var Zl=function(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps||Ji.current)zs=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return zs=!1,cc(e,t,n);zs=!!(e.flags&131072)}}else zs=!1,wa&&t.flags&1048576&&ya(t,fa,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;oc(e,t),e=t.pendingProps;var a=Xi(t,qi.current);Ya(t,n),a=Io(null,t,i,e,a,n);var o=Lo();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Zi(i)?(o=!0,ta(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,no(t),a.updater=ws,t.stateNode=a,a._reactInternals=t,Os(t,i,e,n),t=Js(null,t,i,!0,o,n)):(t.tag=0,wa&&o&&ba(t),Bs(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(oc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=nu(i),e=Ss(i,e),a){case 0:t=Ks(null,t,i,e,n);break a;case 1:t=qs(null,t,i,e,n);break a;case 11:t=Vs(null,t,i,e,n);break a;case 14:t=Hs(null,t,i,Ss(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ss(i,a),Ks(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ss(i,a),qs(e,t,i,a,n);case 3:a:{if(Ys(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,ro(e,t),co(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated){if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=ks(Error(r(423)),t),t=Xs(e,t,i,n,a);break a}if(i!==a){a=ks(Error(r(424)),t),t=Xs(e,t,i,n,a);break a}for(Ca=Oi(t.stateNode.containerInfo.firstChild),Sa=t,wa=!0,Ta=null,n=Va(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Na(),i===a){t=sc(e,t,n);break a}Bs(e,t,i,n)}t=t.child}return t;case 5:return vo(t),e===null&&ka(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,xi(i,a)?s=null:o!==null&&xi(i,o)&&(t.flags|=32),Gs(e,t),Bs(e,t,s,n),t.child;case 6:return e===null&&ka(t),null;case 13:return $s(e,t,n);case 4:return go(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ba(t,null,i,n):Bs(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ss(i,a),Vs(e,t,i,a,n);case 7:return Bs(e,t,t.pendingProps,n),t.child;case 8:return Bs(e,t,t.pendingProps.children,n),t.child;case 12:return Bs(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Gi(Ha,i._currentValue),i._currentValue=s,o!==null){if(Er(o.value,s)){if(o.children===a.children&&!Ji.current){t=sc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=io(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Ja(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Ja(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}}Bs(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Ya(t,n),a=Xa(a),i=i(a),t.flags|=1,Bs(e,t,i,n),t.child;case 14:return i=t.type,a=Ss(i,t.pendingProps),a=Ss(i.type,a),Hs(e,t,i,a,n);case 15:return Us(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ss(i,a),oc(e,t),t.tag=1,Zi(i)?(e=!0,ta(t)):e=!1,Ya(t,n),Es(t,i,a),Os(t,i,a,n),Js(null,t,i,!0,e,n);case 19:return ac(e,t,n);case 22:return Ws(e,t,n)}throw Error(r(156,t.tag))};function Ql(e,t){return st(e,t)}function $l(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.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 eu(e,t,n,r){return new $l(e,t,n,r)}function tu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function nu(e){if(typeof e==`function`)return+!!tu(e);if(e!=null){if(e=e.$$typeof,e===A)return 11;if(e===N)return 14}return 2}function ru(e,t){var n=e.alternate;return n===null?(n=eu(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&14680064,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}function iu(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)tu(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case T:return au(n.children,a,o,t);case E:s=8,a|=8;break;case D:return e=eu(12,n,t,a|2),e.elementType=D,e.lanes=o,e;case j:return e=eu(13,n,t,a),e.elementType=j,e.lanes=o,e;case M:return e=eu(19,n,t,a),e.elementType=M,e.lanes=o,e;case F:return ou(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case O:s=10;break a;case k:s=9;break a;case A:s=11;break a;case N:s=14;break a;case P:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=eu(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function au(e,t,n,r){return e=eu(7,e,r,t),e.lanes=n,e}function ou(e,t,n,r){return e=eu(22,e,r,t),e.elementType=F,e.lanes=n,e.stateNode={isHidden:!1},e}function su(e,t,n){return e=eu(6,e,null,t),e.lanes=n,e}function cu(e,t,n){return t=eu(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function lu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Nt(0),this.expirationTimes=Nt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function uu(e,t,n,r,i,a,o,s,c){return e=new lu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=eu(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},no(a),e}function G(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:w,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function du(e){if(!e)return Ki;e=e._reactInternals;a:{if(tt(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(Zi(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if(Zi(n))return ea(e,n,t)}return t}function fu(e,t,n,r,i,a,o,s,c){return e=uu(n,r,!0,e,i,a,o,s,c),e.context=du(null),n=e.current,r=bl(),i=xl(n),a=io(r,i),a.callback=t??null,ao(n,a,i),e.current.lanes=i,Pt(e,i,r),Cl(e,r),e}function pu(e,t,n,r){var i=t.current,a=bl(),o=xl(i);return n=du(n),t.context===null?t.context=n:t.pendingContext=n,t=io(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ao(i,t,o),e!==null&&(Sl(e,i,o,a),oo(e,i,o)),o}function mu(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function hu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function gu(e,t){hu(e,t),(e=e.alternate)&&hu(e,t)}function K(){return null}var _u=typeof reportError==`function`?reportError:function(e){console.error(e)};function vu(e){this._internalRoot=e}yu.prototype.render=vu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));pu(e,t,null,null)},yu.prototype.unmount=vu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;jl(function(){pu(null,e,null,null)}),t[Ni]=null}};function yu(e){this._internalRoot=e}yu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ht();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Zt.length&&t!==0&&t<Zt[n].priority;n++);Zt.splice(n,0,e),n===0&&nn(e)}};function bu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function xu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function Su(){}function Cu(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=mu(o);a.call(e)}}var o=fu(t,r,e,0,null,!1,!1,``,Su);return e._reactRootContainer=o,e[Ni]=o.current,si(e.nodeType===8?e.parentNode:e),jl(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=mu(c);s.call(e)}}var c=uu(e,0,!1,null,null,!1,!1,``,Su);return e._reactRootContainer=c,e[Ni]=c.current,si(e.nodeType===8?e.parentNode:e),jl(function(){pu(t,c,n,r)}),c}function wu(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=mu(o);s.call(e)}}pu(t,o,e,i)}else o=Cu(n,t,e,i,r);return mu(o)}zt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Dt(t.pendingLanes);n!==0&&(It(t,n|1),Cl(t,dt()),!(Jc&6)&&(cl=dt()+500,ca()))}break;case 13:jl(function(){var t=eo(e,1);t!==null&&Sl(t,e,1,bl())}),gu(e,1)}},Bt=function(e){if(e.tag===13){var t=eo(e,134217728);t!==null&&Sl(t,e,134217728,bl()),gu(e,134217728)}},Vt=function(e){if(e.tag===13){var t=xl(e),n=eo(e,t);n!==null&&Sl(n,e,t,bl()),gu(e,t)}},Ht=function(){return Lt},Ut=function(e,t){var n=Lt;try{return Lt=e,t()}finally{Lt=n}},Pe=function(e,t,n){switch(t){case`input`:if(de(e,n),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=`+JSON.stringify(``+t)+`][type="radio"]`),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=Bi(i);if(!a)throw Error(r(90));se(i),de(i,a)}}}break;case`textarea`:ve(e,n);break;case`select`:t=n.value,t!=null&&he(e,!!n.multiple,t,!1)}},Be=Al,Ve=jl;var Tu={usingClientEntryPoint:!1,Events:[Ri,zi,Bi,Re,ze,Al]},Eu={findFiberByHostInstance:Li,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},Du={bundleType:Eu.bundleType,version:Eu.version,rendererPackageName:Eu.rendererPackageName,rendererConfig:Eu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:S.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=at(e),e===null?null:e.stateNode},findFiberByHostInstance:Eu.findFiberByHostInstance||K,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:`18.3.1-next-f1338f8080-20240426`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Ou=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ou.isDisabled&&Ou.supportsFiber)try{vt=Ou.inject(Du),yt=Ou}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Tu,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!bu(t))throw Error(r(200));return G(e,t,null,n)},e.createRoot=function(e,t){if(!bu(e))throw Error(r(299));var n=!1,i=``,a=_u;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=uu(e,1,!1,null,null,n,!1,i,a),e[Ni]=t.current,si(e.nodeType===8?e.parentNode:e),new vu(t)},e.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=at(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return jl(e)},e.hydrate=function(e,t,n){if(!xu(t))throw Error(r(200));return wu(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!bu(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=_u;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=fu(t,null,e,1,n??null,a,!1,o,s),e[Ni]=t.current,si(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new yu(t)},e.render=function(e,t,n){if(!xu(t))throw Error(r(200));return wu(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!xu(e))throw Error(r(40));return e._reactRootContainer?(jl(function(){wu(null,null,e,!1,function(){e._reactRootContainer=null,e[Ni]=null})}),!0):!1},e.unstable_batchedUpdates=Al,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!xu(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return wu(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),WT=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=Tne()})),GT=o((e=>{var t=WT();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot}))();function KT(e,t){console.error(JSON.stringify({source:`agar`,operation:e,failureKind:t instanceof Error?`Error`:`NonErrorThrown`}),cv(t))}var qT=Symbol(`workers-module`);Symbol.dispose||(Symbol.dispose=Symbol.for(`dispose`)),Symbol.asyncDispose||(Symbol.asyncDispose=Symbol.for(`asyncDispose`)),Promise.withResolvers||(Promise.withResolvers=function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}});var JT=globalThis[qT],YT=JT?JT.RpcTarget:class{},XT=async function(){}.constructor,ZT=typeof Buffer<`u`?Buffer.prototype:void 0;function QT(e){switch(typeof e){case`boolean`:case`number`:case`string`:return`primitive`;case`undefined`:return`undefined`;case`object`:case`function`:break;case`bigint`:return`bigint`;default:return`unsupported`}if(e===null)return`primitive`;let t=Object.getPrototypeOf(e);switch(t){case Object.prototype:return`object`;case Function.prototype:case XT.prototype:return`function`;case Array.prototype:return`array`;case Date.prototype:return`date`;case Uint8Array.prototype:case ZT:case ArrayBuffer.prototype:case DataView.prototype:case Int8Array.prototype:case Uint8ClampedArray.prototype:case Int16Array.prototype:case Uint16Array.prototype:case Int32Array.prototype:case Uint32Array.prototype:case BigInt64Array.prototype:case BigUint64Array.prototype:case Float32Array.prototype:case Float64Array.prototype:return`bytes`;case WritableStream.prototype:return`writable`;case ReadableStream.prototype:return`readable`;case URL.prototype:return`url`;case Headers.prototype:return`headers`;case Request.prototype:return`request`;case Response.prototype:return`response`;case Blob.prototype:return`blob`;case uE.prototype:return`stub`;case dE.prototype:return`rpc-promise`;default:if(JT){if(t==JT.RpcStub.prototype||e instanceof JT.ServiceStub)return`rpc-target`;if(t==JT.RpcPromise.prototype||t==JT.RpcProperty.prototype)return`rpc-thenable`}return e instanceof YT?`rpc-target`:e instanceof Error?`error`:`unsupported`}}function $T(){throw Error(`RPC map() implementation was not loaded.`)}var eE={applyMap:$T,sendMap:$T};function tE(){throw Error(`Stream implementation was not loaded.`)}var nE={createWritableStreamHook:tE,createWritableStreamFromHook:tE,createReadableStreamHook:tE},rE=class{stream(e,t){let n=this.call(e,t),r;try{r=n.pull()}catch(e){throw n.dispose(),e}let i;return r instanceof Promise?i=r.then(e=>{e.dispose()}):(r.dispose(),i=Promise.resolve()),{promise:i}}},iE=class extends rE{error;constructor(e){super(),this.error=e}call(e,t){return t.dispose(),this}map(e,t,n){for(let e of t)e.dispose();return this}get(e){return this}dup(){return this}pull(){return Promise.reject(this.error)}ignoreUnhandledRejections(){}dispose(){}onBroken(e){try{e(this.error)}catch(e){Promise.resolve(e)}}},aE=new iE(Error(`Attempted to use RPC stub after it has been disposed.`)),oE=(e,t,n)=>e.call(t,n);function sE(e,t){let n=oE;oE=e;try{return t()}finally{oE=n}}var cE=Symbol(`realStub`),lE={apply(e,t,n){let r=e.raw;return new dE(oE(r.hook,r.pathIfPromise||[],vE.fromAppParams(n)),[])},get(e,t,n){let r=e.raw;if(t===cE)return r;if(t in dE.prototype)return r[t];if(typeof t==`string`)return new dE(r.hook,r.pathIfPromise?[...r.pathIfPromise,t]:[t]);if(t===Symbol.dispose&&(!r.pathIfPromise||r.pathIfPromise.length==0))return()=>{r.hook.dispose(),r.hook=aE}},has(e,t){let n=e.raw;return t===cE?!0:t in dE.prototype?t in n:typeof t==`string`||t===Symbol.dispose&&(!n.pathIfPromise||n.pathIfPromise.length==0)},construct(e,t){throw Error(`An RPC stub cannot be used as a constructor.`)},defineProperty(e,t,n){throw Error(`Can't define properties on RPC stubs.`)},deleteProperty(e,t){throw Error(`Can't delete properties on RPC stubs.`)},getOwnPropertyDescriptor(e,t){},getPrototypeOf(e){return Object.getPrototypeOf(e.raw)},isExtensible(e){return!1},ownKeys(e){return[]},preventExtensions(e){return!0},set(e,t,n,r){throw Error(`Can't assign properties on RPC stubs.`)},setPrototypeOf(e,t){throw Error(`Can't override prototype of RPC stubs.`)}},uE=class e extends YT{constructor(e,t){if(super(),!(e instanceof rE)){let n=e;if(e=n instanceof YT||n instanceof Function?CE.create(n,void 0):new xE(vE.fromAppReturn(n)),t)throw TypeError(`RpcStub constructor expected one argument, received two.`)}this.hook=e,this.pathIfPromise=t;let n=()=>{};return n.raw=this,new Proxy(n,lE)}hook;pathIfPromise;dup(){let t=this[cE];return t.pathIfPromise?new e(t.hook.get(t.pathIfPromise)):new e(t.hook.dup())}onRpcBroken(e){this[cE].hook.onBroken(e)}map(e){let{hook:t,pathIfPromise:n}=this[cE];return eE.sendMap(t,n||[],e)}toString(){return`[object RpcStub]`}},dE=class extends uE{constructor(e,t){if(e instanceof rE)super(e,t??[]);else{if(t!==void 0)throw TypeError(`RpcPromise constructor expected one argument, received two.`);let n=QT(e);if(n===`rpc-promise`){let t=gE(e);if(t.pathIfPromise.length>0)super(t.hook,t.pathIfPromise);else{let e=t.hook;t.hook=aE,super(e,[])}}else if(n===`rpc-thenable`)super(CE.create(e,void 0),[]);else{let t=new wE(Promise.resolve(e).then(e=>new xE(vE.fromAppReturn(e))));t.ignoreUnhandledRejections(),super(t,[])}}}then(e,t){return _E(this).then(...arguments)}catch(e){return _E(this).catch(...arguments)}finally(e){return _E(this).finally(...arguments)}toString(){return`[object RpcPromise]`}};function fE(e){let{hook:t,pathIfPromise:n}=e[cE];return n&&n.length>0?t.get(n):t}function pE(e){let{hook:t,pathIfPromise:n}=e[cE];return n?t.get(n):t.dup()}function mE(e){let{hook:t,pathIfPromise:n}=e[cE];if(!(n&&n.length>0))return t}function hE(e){return e[cE].hook}function gE(e){return e[cE]}async function _E(e){let{hook:t,pathIfPromise:n}=e[cE];return n.length>0&&(t=t.get(n)),(await t.pull()).deliverResolve()}var vE=class e{value;source;hooks;promises;static fromAppParams(t){return new e(t,`params`)}static fromAppReturn(t){return new e(t,`return`)}static fromArray(t){let n=[],r=[],i=[];for(let e of t){e.ensureDeepCopied();for(let t of e.hooks)n.push(t);for(let t of e.promises)t.parent===e&&(t={parent:i,property:i.length,promise:t.promise}),r.push(t);i.push(e.value)}return new e(i,`owned`,n,r)}static forEvaluate(t,n){return new e(null,`owned`,t,n)}static deepCopyFrom(t,n,r){let i=new e(null,`owned`,[],[]);return i.value=i.deepCopy(t,n,`value`,i,!0,r),i}constructor(e,t,n,r){this.value=e,this.source=t,this.hooks=n,this.promises=r}rpcTargets;getHookForRpcTarget(e,t,n=!0){if(this.source===`params`){if(n){let t=e;typeof t.dup==`function`&&(e=t.dup())}return CE.create(e,t)}if(this.source===`return`){let r=this.rpcTargets?.get(e);return r?n?r.dup():(this.rpcTargets?.delete(e),r):(r=CE.create(e,t),n?(this.rpcTargets||=new Map,this.rpcTargets.set(e,r),r.dup()):r)}throw Error(`owned payload shouldn't contain raw RpcTargets`)}getHookForWritableStream(e,t,n=!0){if(this.source===`params`)return nE.createWritableStreamHook(e);if(this.source===`return`){let t=this.rpcTargets?.get(e);return t?n?t.dup():(this.rpcTargets?.delete(e),t):(t=nE.createWritableStreamHook(e),n?(this.rpcTargets||=new Map,this.rpcTargets.set(e,t),t.dup()):t)}throw Error(`owned payload shouldn't contain raw WritableStreams`)}getHookForReadableStream(e,t,n=!0){if(this.source===`params`)return nE.createReadableStreamHook(e);if(this.source===`return`){let t=this.rpcTargets?.get(e);return t?n?t.dup():(this.rpcTargets?.delete(e),t):(t=nE.createReadableStreamHook(e),n?(this.rpcTargets||=new Map,this.rpcTargets.set(e,t),t.dup()):t)}throw Error(`owned payload shouldn't contain raw ReadableStreams`)}deepCopy(e,t,n,r,i,a){switch(QT(e)){case`unsupported`:return e;case`primitive`:case`bigint`:case`date`:case`bytes`:case`blob`:case`url`:case`error`:case`undefined`:return e;case`array`:{let t=e,n=t.length,r=Array(n);for(let e=0;e<n;e++)r[e]=this.deepCopy(t[e],t,e,r,i,a);return r}case`object`:{let t={},n=e;for(let e in n)t[e]=this.deepCopy(n[e],n,e,t,i,a);return t}case`stub`:case`rpc-promise`:{let t=e,a;if(a=i?pE(t):fE(t),t instanceof dE){let e=new dE(a,[]);return this.promises.push({parent:r,property:n,promise:e}),e}return this.hooks.push(a),new uE(a)}case`function`:case`rpc-target`:{let n=e,r;return r=a?a.getHookForRpcTarget(n,t,i):CE.create(n,t),this.hooks.push(r),new uE(r)}case`rpc-thenable`:{let o=e,s;return s=a?new dE(a.getHookForRpcTarget(o,t,i),[]):new dE(CE.create(o,t),[]),this.promises.push({parent:r,property:n,promise:s}),s}case`writable`:{let n=e,r;return r=a?a.getHookForWritableStream(n,t,i):nE.createWritableStreamHook(n),this.hooks.push(r),n}case`readable`:{let n=e,r;return r=a?a.getHookForReadableStream(n,t,i):nE.createReadableStreamHook(n),this.hooks.push(r),n}case`headers`:return new Headers(e);case`request`:{let t=e;return t.body&&this.deepCopy(t.body,t,`body`,t,i,a),new Request(t)}case`response`:{let t=e;return t.body&&this.deepCopy(t.body,t,`body`,t,i,a),new Response(t.body,t)}default:throw Error(`unreachable`)}}ensureDeepCopied(){if(this.source!==`owned`){let e=this.source===`params`;this.hooks=[],this.promises=[];try{this.value=this.deepCopy(this.value,void 0,`value`,this,e,this)}catch(e){throw this.hooks=void 0,this.promises=void 0,e}if(this.source=`owned`,this.rpcTargets&&this.rpcTargets.size>0)throw Error(`Not all rpcTargets were accounted for in deep-copy?`);this.rpcTargets=void 0}}deliverTo(t,n,r){if(this.ensureDeepCopied(),this.value instanceof dE)e.deliverRpcPromiseTo(this.value,t,n,r);else{t[n]=this.value;for(let t of this.promises)e.deliverRpcPromiseTo(t.promise,t.parent,t.property,r)}}static deliverRpcPromiseTo(t,n,r,i){let a=mE(t);if(!a)throw Error(`property promises should have been resolved earlier`);let o=a.pull();o instanceof e?o.deliverTo(n,r,i):i.push(o.then(e=>{let t=[];if(e.deliverTo(n,r,t),t.length>0)return Promise.all(t)}))}async deliverCall(t,n){try{let r=[];this.deliverTo(this,`value`,r),r.length>0&&await Promise.all(r);let i=Function.prototype.apply.call(t,n,this.value);return i instanceof dE?e.fromAppReturn(i):e.fromAppReturn(await i)}finally{this.dispose()}}async deliverStreamWrite(t){try{let n=[];this.deliverTo(this,`value`,n),n.length>0&&await Promise.all(n);let r=this.value[0];return(this.hooks.length>0||this.promises.length>0)&&r instanceof Object?(Symbol.dispose in r||Object.defineProperty(r,Symbol.dispose,{value:()=>this.dispose(),writable:!0,enumerable:!1,configurable:!0}),await t.write(r),e.fromAppReturn(void 0)):(await t.write(r),this.dispose(),e.fromAppReturn(void 0))}catch(e){throw this.dispose(),e}}async deliverResolve(){try{let e=[];this.deliverTo(this,`value`,e),e.length>0&&await Promise.all(e);let t=this.value;return t instanceof Object&&(Symbol.dispose in t||Object.defineProperty(t,Symbol.dispose,{value:()=>this.dispose(),writable:!0,enumerable:!1,configurable:!0})),t}catch(e){throw this.dispose(),e}}dispose(){if(this.source===`owned`)this.hooks.forEach(e=>e.dispose()),this.promises.forEach(e=>e.promise[Symbol.dispose]());else if(this.source===`return`&&(this.disposeImpl(this.value,void 0),this.rpcTargets&&this.rpcTargets.size>0))throw Error(`Not all rpcTargets were accounted for in disposeImpl()?`);this.source=`owned`,this.hooks=[],this.promises=[]}disposeImpl(e,t){switch(QT(e)){case`unsupported`:case`primitive`:case`bigint`:case`bytes`:case`blob`:case`date`:case`url`:case`error`:case`undefined`:return;case`array`:{let t=e,n=t.length;for(let e=0;e<n;e++)this.disposeImpl(t[e],t);return}case`object`:{let t=e;for(let e in t)this.disposeImpl(t[e],t);return}case`stub`:case`rpc-promise`:{let t=mE(e);t&&t.dispose();return}case`function`:case`rpc-target`:{let t=e,n=this.rpcTargets?.get(t);n?(n.dispose(),this.rpcTargets.delete(t)):SE(t);return}case`rpc-thenable`:return;case`headers`:return;case`request`:{let t=e;t.body&&this.disposeImpl(t.body,t);return}case`response`:{let t=e;t.body&&this.disposeImpl(t.body,t);return}case`writable`:{let t=e,n=this.rpcTargets?.get(t);n?this.rpcTargets.delete(t):n=nE.createWritableStreamHook(t),n.dispose();return}case`readable`:{let t=e,n=this.rpcTargets?.get(t);n?this.rpcTargets.delete(t):n=nE.createReadableStreamHook(t),n.dispose();return}default:return}}ignoreUnhandledRejections(){this.hooks?(this.hooks.forEach(e=>{e.ignoreUnhandledRejections()}),this.promises.forEach(e=>hE(e.promise).ignoreUnhandledRejections())):this.ignoreUnhandledRejectionsImpl(this.value)}ignoreUnhandledRejectionsImpl(e){switch(QT(e)){case`unsupported`:case`primitive`:case`bigint`:case`bytes`:case`blob`:case`date`:case`error`:case`undefined`:case`function`:case`rpc-target`:case`writable`:case`readable`:case`url`:case`headers`:case`request`:case`response`:return;case`array`:{let t=e,n=t.length;for(let e=0;e<n;e++)this.ignoreUnhandledRejectionsImpl(t[e]);return}case`object`:{let t=e;for(let e in t)this.ignoreUnhandledRejectionsImpl(t[e]);return}case`stub`:case`rpc-promise`:hE(e).ignoreUnhandledRejections();return;case`rpc-thenable`:e.then(e=>{},e=>{});return;default:return}}};function yE(e,t,n,r){for(let i=0;i<n.length;i++){t=e;let a=n[i];if(a in Object.prototype){e=void 0;continue}switch(QT(e)){case`object`:case`function`:e=Object.hasOwn(e,a)?e[a]:void 0;break;case`array`:e=Number.isInteger(a)&&a>=0?e[a]:void 0;break;case`rpc-target`:case`rpc-thenable`:if(Object.hasOwn(e,a))throw TypeError(`Attempted to access property '${a}', which is an instance property of the RpcTarget. To avoid leaking private internals, instance properties cannot be accessed over RPC. If you want to make this property available over RPC, define it as a method or getter on the class, instead of an instance property.`);e=e[a],r=null;break;case`stub`:case`rpc-promise`:{let{hook:t,pathIfPromise:r}=gE(e);return{hook:t,remainingPath:r?r.concat(n.slice(i)):n.slice(i)}}case`writable`:e=void 0;break;case`readable`:e=void 0;break;case`primitive`:case`bigint`:case`bytes`:case`blob`:case`date`:case`error`:case`url`:case`headers`:case`request`:case`response`:e=void 0;break;case`undefined`:e=e[a];break;case`unsupported`:if(i===0)throw TypeError(`RPC stub points at a non-serializable type.`);{let e=n.slice(0,i).join(`.`),t=n.slice(0,i).join(`.`);throw TypeError(`'${e}' is not a serializable type, so property ${t} cannot be accessed.`)}default:throw TypeError(`unreachable`)}}if(e instanceof dE){let{hook:t,pathIfPromise:n}=gE(e);return{hook:t,remainingPath:n||[]}}return{value:e,parent:t,owner:r}}var bE=class extends rE{call(e,t){let n;try{let{value:t,owner:r}=this.getValue();n=yE(t,void 0,e,r)}catch(e){return t.dispose(),new iE(e)}return n.hook?n.hook.call(n.remainingPath,t):typeof n.value==`function`?new wE(t.deliverCall(n.value,n.parent).then(e=>new xE(e))):(t.dispose(),new iE(TypeError(`'${e.join(`.`)}' is not a function.`)))}map(e,t,n){try{let r;try{let{value:t,owner:n}=this.getValue();r=yE(t,void 0,e,n)}catch(e){for(let e of t)e.dispose();throw e}return r.hook?r.hook.map(r.remainingPath,t,n):eE.applyMap(r.value,r.parent,r.owner,t,n)}catch(e){return new iE(e)}}get(e){try{let{value:t,owner:n}=this.getValue();if(e.length===0&&n===null){if(t instanceof Object&&`then`in t)return this.dup();throw Error(`Can't dup an RpcTarget stub as a promise.`)}let r=yE(t,void 0,e,n);return r.hook?r.hook.get(r.remainingPath):new xE(vE.deepCopyFrom(r.value,r.parent,r.owner))}catch(e){return new iE(e)}}},xE=class e extends bE{constructor(e){super(),this.payload=e}payload;getPayload(){if(this.payload)return this.payload;throw Error(`Attempted to use an RPC StubHook after it was disposed.`)}getValue(){let e=this.getPayload();return{value:e.value,owner:e}}dup(){let t=this.getPayload();return new e(vE.deepCopyFrom(t.value,void 0,t))}pull(){return this.getPayload()}ignoreUnhandledRejections(){this.payload&&this.payload.ignoreUnhandledRejections()}dispose(){this.payload&&=(this.payload.dispose(),void 0)}onBroken(e){this.payload&&this.payload.value instanceof uE&&this.payload.value.onRpcBroken(e)}};function SE(e){if(Symbol.dispose in e)try{e[Symbol.dispose]()}catch(e){Promise.reject(e)}}var CE=class e extends bE{static create(t,n){return typeof t!=`function`&&(n=void 0),new e(t,n)}constructor(e,t,n){super(),this.target=e,this.parent=t,n?n.refcount&&(this.refcount=n.refcount,++this.refcount.count):Symbol.dispose in e&&(this.refcount={count:1})}target;parent;refcount;getTarget(){if(this.target)return this.target;throw Error(`Attempted to use an RPC StubHook after it was disposed.`)}getValue(){return{value:this.getTarget(),owner:null}}dup(){return new e(this.getTarget(),this.parent,this)}pull(){let e=this.getTarget();return`then`in e?Promise.resolve(e).then(e=>vE.fromAppReturn(e)):Promise.reject(Error(`Tried to resolve a non-promise stub.`))}ignoreUnhandledRejections(){}dispose(){this.target&&=(this.refcount&&--this.refcount.count==0&&SE(this.target),void 0)}onBroken(e){let t=this.target;t&&`then`in t&&Promise.resolve(t).then(()=>{},e)}},wE=class e extends rE{promise;resolution;constructor(e){super(),this.promise=e.then(e=>(this.resolution=e,e))}call(t,n){return n.ensureDeepCopied(),new e(this.promise.then(e=>e.call(t,n),e=>{throw n.dispose(),e}))}stream(e,t){return t.ensureDeepCopied(),{promise:this.promise.then(n=>n.stream(e,t).promise,e=>{throw t.dispose(),e})}}map(t,n,r){return new e(this.promise.then(e=>e.map(t,n,r),e=>{for(let e of n)e.dispose();throw e}))}get(t){return new e(this.promise.then(e=>e.get(t)))}dup(){return this.resolution?this.resolution.dup():new e(this.promise.then(e=>e.dup()))}pull(){return this.resolution?this.resolution.pull():this.promise.then(e=>e.pull())}ignoreUnhandledRejections(){this.resolution?this.resolution.ignoreUnhandledRejections():this.promise.then(e=>{e.ignoreUnhandledRejections()},e=>{})}dispose(){this.promise.then(e=>e.dispose(),()=>{})}onBroken(e){this.resolution?this.resolution.onBroken(e):this.promise.then(t=>{t.onBroken(e)},e)}},TE={maxBigIntDigits:16384,maxDepth:256,maxMessageSize:33554432},EE=new Uint8Array(new Uint16Array([1]).buffer)[0]===1,Ene=[`ArrayBuffer`,`DataView`,`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`BigInt64Array`,`BigUint64Array`,`Float32Array`,`Float64Array`];function Dne(e){return Ene.includes(e)}var DE={ArrayBuffer:void 0,DataView:void 0,Int8Array:void 0,Uint8Array:void 0,Uint8ClampedArray:void 0,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,BigInt64Array:8,BigUint64Array:8,Float32Array:4,Float64Array:8},OE={ArrayBuffer:ArrayBuffer.prototype,DataView:DataView.prototype,Int8Array:Int8Array.prototype,Uint8ClampedArray:Uint8ClampedArray.prototype,Int16Array:Int16Array.prototype,Uint16Array:Uint16Array.prototype,Int32Array:Int32Array.prototype,Uint32Array:Uint32Array.prototype,BigInt64Array:BigInt64Array.prototype,BigUint64Array:BigUint64Array.prototype,Float32Array:Float32Array.prototype,Float64Array:Float64Array.prototype},kE=new Map;for(let e of Object.keys(OE))kE.set(OE[e],e);function AE(e,t){if(t!==2&&t!==4&&t!==8)throw RangeError(`Unsupported element size: ${t}`);let n=new DataView(e.buffer,e.byteOffset,e.byteLength);for(let r=0;r<e.byteLength;r+=t)switch(t){case 2:n.setUint16(r,n.getUint16(r,!1),!0);break;case 4:n.setUint32(r,n.getUint32(r,!1),!0);break;case 8:n.setBigUint64(r,n.getBigUint64(r,!1),!0)}}var One=new class{exportStub(e){throw Error(`Cannot serialize RPC stubs without an RPC session.`)}exportPromise(e){throw Error(`Cannot serialize RPC stubs without an RPC session.`)}getImport(e){}unexport(e){}createPipe(e){throw Error(`Cannot create pipes without an RPC session.`)}onSendError(e){}};async function kne(e,t){let n=await new Response(e).blob();return n.type===t?n:n.slice(0,n.size,t)}var Ane={__proto__:null,Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,AggregateError},jE=class e{exporter;source;encodingLevel;constructor(e,t,n){this.exporter=e,this.source=t,this.encodingLevel=n}static devaluate(t,n,r=One,i,a=`string`){let o=new e(r,i,a);try{return o.devaluateImpl(t,n,0)}catch(e){if(o.exports)try{r.unexport(o.exports)}catch{}throw e}}exports;devaluateImpl(e,t,n){if(n>=256)throw Error(`Serialization exceeded maximum allowed depth. (Does the message contain cycles?)`);switch(QT(e)){case`unsupported`:{let t;try{t=`Cannot serialize value: ${e}`}catch{t=`Cannot serialize value: (couldn't stringify value)`}throw TypeError(t)}case`primitive`:return typeof e==`number`&&!isFinite(e)?this.encodingLevel===`structuredClonable`?e:e===1/0?[`inf`]:e===-1/0?[`-inf`]:[`nan`]:e;case`object`:{let t=e,r={};for(let e in t)r[e]=this.devaluateImpl(t[e],t,n+1);return r}case`array`:{let t=e,r=t.length,i=Array(r);for(let e=0;e<r;e++)i[e]=this.devaluateImpl(t[e],t,n+1);return[i]}case`bigint`:return this.encodingLevel===`structuredClonable`?e:[`bigint`,e.toString()];case`date`:{if(this.encodingLevel===`structuredClonable`)return e;let t=e.getTime();return[`date`,Number.isNaN(t)?null:t]}case`bytes`:{let t=kE.get(Object.getPrototypeOf(e)),n;if(t===`ArrayBuffer`)n=new Uint8Array(e);else if(t===void 0)n=e;else{let r=e;n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);let i=DE[t];!EE&&i&&(n=n.slice(),AE(n,i))}if(this.encodingLevel===`structuredClonable`||this.encodingLevel===`jsonCompatibleWithBytes`)return t===void 0?[`bytes`,n]:[`bytes`,n,t];let r;if(n.toBase64)r=n.toBase64({omitPadding:!0});else if(typeof Buffer<`u`)r=(n instanceof Buffer?n:Buffer.from(n.buffer,n.byteOffset,n.byteLength)).toString(`base64`);else{let e=``;for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);r=btoa(e)}return r=r.replace(/=+$/,``),t===void 0?[`bytes`,r]:[`bytes`,r,t]}case`url`:return[`url`,e.href];case`headers`:return[`headers`,[...e]];case`request`:{let t=e,r={};t.method!==`GET`&&(r.method=t.method);let i=[...t.headers];if(i.length>0&&(r.headers=i),t.body)r.body=this.devaluateImpl(t.body,t,n+1),r.duplex=t.duplex||`half`;else if(t.body===void 0&&![`GET`,`HEAD`,`OPTIONS`,`TRACE`,`DELETE`].includes(t.method)){let e=t.arrayBuffer(),n=new ReadableStream({async start(t){try{t.enqueue(new Uint8Array(await e)),t.close()}catch(e){t.error(e)}}}),i=nE.createReadableStreamHook(n);r.body=[`readable`,this.exporter.createPipe(n,i)],r.duplex=t.duplex||`half`}t.cache&&t.cache!=="default"&&(r.cache=t.cache),t.redirect!==`follow`&&(r.redirect=t.redirect),t.integrity&&(r.integrity=t.integrity),t.mode&&t.mode!==`cors`&&(r.mode=t.mode),t.credentials&&t.credentials!==`same-origin`&&(r.credentials=t.credentials),t.referrer&&t.referrer!==`about:client`&&(r.referrer=t.referrer),t.referrerPolicy&&(r.referrerPolicy=t.referrerPolicy),t.keepalive&&(r.keepalive=t.keepalive);let a=t;return a.cf&&(r.cf=a.cf),a.encodeResponseBody&&a.encodeResponseBody!==`automatic`&&(r.encodeResponseBody=a.encodeResponseBody),[`request`,t.url,r]}case`response`:{let t=e,r=this.devaluateImpl(t.body,t,n+1),i={};t.status!==200&&(i.status=t.status),t.statusText&&(i.statusText=t.statusText);let a=[...t.headers];a.length>0&&(i.headers=a);let o=t;if(o.cf&&(i.cf=o.cf),o.encodeBody&&o.encodeBody!==`automatic`&&(i.encodeBody=o.encodeBody),o.webSocket)throw TypeError(`Can't serialize a Response containing a webSocket.`);return[`response`,r,i]}case`blob`:{let t=e,n=t.stream(),r=nE.createReadableStreamHook(n),i=this.exporter.createPipe(n,r);return[`blob`,t.type,[`readable`,i]]}case`error`:{let t=e,r=this.exporter.onSendError(t);r&&(t=r);let i=t,a,o=(e,r)=>{let i=this.exports?.length??0;try{let i=this.devaluateImpl(r,t,n+1);a||={},a[e]=i}catch{if(this.exports&&this.exports.length>i){let e=this.exports.splice(i);try{this.exporter.unexport(e)}catch{}}}};for(let e of Object.keys(t))e!==`name`&&e!==`message`&&e!==`stack`&&o(e,i[e]);`cause`in t&&o(`cause`,i.cause),t instanceof AggregateError&&o(`errors`,t.errors);let s=[`error`,t.name,t.message];return a?(s.push(r&&r.stack?r.stack:null),s.push(a)):r&&r.stack&&s.push(r.stack),s}case`undefined`:return this.encodingLevel===`structuredClonable`?void 0:[`undefined`];case`stub`:case`rpc-promise`:{if(!this.source)throw Error(`Can't serialize RPC stubs in this context.`);let{hook:t,pathIfPromise:n}=gE(e),r=this.exporter.getImport(t);return r===void 0?(t=n?t.get(n):t.dup(),this.devaluateHook(n?`promise`:`export`,t)):n?n.length>0?[`pipeline`,r,n]:[`pipeline`,r]:[`import`,r]}case`function`:case`rpc-target`:{if(!this.source)throw Error(`Can't serialize RPC stubs in this context.`);let n=this.source.getHookForRpcTarget(e,t);return this.devaluateHook(`export`,n)}case`rpc-thenable`:{if(!this.source)throw Error(`Can't serialize RPC stubs in this context.`);let n=this.source.getHookForRpcTarget(e,t);return this.devaluateHook(`promise`,n)}case`writable`:{if(!this.source)throw Error(`Can't serialize WritableStream in this context.`);let n=this.source.getHookForWritableStream(e,t);return this.devaluateHook(`writable`,n)}case`readable`:{if(!this.source)throw Error(`Can't serialize ReadableStream in this context.`);let n=e,r=this.source.getHookForReadableStream(n,t);return[`readable`,this.exporter.createPipe(n,r)]}default:throw Error(`unreachable`)}}devaluateHook(e,t){this.exports||=[];let n=e===`promise`?this.exporter.exportPromise(t):this.exporter.exportStub(t);return this.exports.push(n),[e,n]}};new class{importStub(e){throw Error(`Cannot deserialize RPC stubs without an RPC session.`)}importPromise(e){throw Error(`Cannot deserialize RPC stubs without an RPC session.`)}getExport(e){}getPipeReadable(e){throw Error(`Cannot retrieve pipe readable without an RPC session.`)}getLimits(){return TE}};function jne(e,t){return new dE(new wE(new Response(t).arrayBuffer().then(t=>{let n=new Uint8Array(t),r=new Request(e,{body:n});return new xE(vE.fromAppReturn(r))})),[])}function ME(e,t){return new dE(new wE(kne(e,t).then(e=>new xE(vE.fromAppReturn(e)))),[])}var NE=class e{importer;encodingLevel;limits;constructor(e,t=`string`){this.importer=e,this.encodingLevel=t,this.limits=e.getLimits()}hooks=[];promises=[];evaluate(e){return this.evaluateWithDepth(e,0)}evaluateWithDepth(e,t){let n=vE.forEvaluate(this.hooks,this.promises);try{return n.value=this.evaluateImpl(e,n,`value`,t),n}catch(e){throw n.dispose(),e}}evaluateCopy(e){return this.evaluate(structuredClone(e))}evaluateImpl(t,n,r,i){let a=this.limits.maxDepth;if(i>=a)throw TypeError(`Deserialization exceeded maximum allowed message depth of ${a}.`);if(this.encodingLevel===`structuredClonable`&&(t instanceof Date||typeof t==`bigint`))return t;if(t instanceof Array){if(t.length==1&&t[0]instanceof Array){let e=t[0];for(let t=0;t<e.length;t++)e[t]=this.evaluateImpl(e[t],e,t,i+1);return e}switch(t[0]){case`bigint`:if(typeof t[1]==`string`){let e=t[1],n=this.limits.maxBigIntDigits;if(e.length>n)throw TypeError(`Deserialized bigint exceeds maximum length of ${n} digits.`);return BigInt(e)}break;case`date`:if(t[1]===null)return new Date(NaN);if(typeof t[1]==`number`)return new Date(t[1]);break;case`bytes`:{let e;if(t[1]instanceof Uint8Array)e=t[1];else if(typeof t[1]==`string`){if(typeof Buffer<`u`)e=Buffer.from(t[1],`base64`);else if(Uint8Array.fromBase64)e=Uint8Array.fromBase64(t[1]);else{let n=atob(t[1]),r=n.length;e=new Uint8Array(r);for(let t=0;t<r;t++)e[t]=n.charCodeAt(t)}}else break;if(t.length===2)return e;if(typeof t[2]!=`string`)throw TypeError(`Unknown bytes type marker type: ${typeof t[2]}`);if(!Dne(t[2])){let e=t[2].slice(0,64);throw TypeError(`Unknown bytes type marker: ${e}`)}let n=t[2],r=DE[n];if(r!==void 0&&e.byteLength%r!==0)throw TypeError(`Invalid byte length ${e.byteLength} for ${n}; expected a multiple of ${r}`);let i=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);switch(!EE&&r!==void 0&&AE(new Uint8Array(i),r),n){case`ArrayBuffer`:return i;case`DataView`:return new DataView(i);case`Int8Array`:return new Int8Array(i);case`Uint8Array`:return new Uint8Array(i);case`Uint8ClampedArray`:return new Uint8ClampedArray(i);case`Int16Array`:return new Int16Array(i);case`Uint16Array`:return new Uint16Array(i);case`Int32Array`:return new Int32Array(i);case`Uint32Array`:return new Uint32Array(i);case`BigInt64Array`:return new BigInt64Array(i);case`BigUint64Array`:return new BigUint64Array(i);case`Float32Array`:return new Float32Array(i);case`Float64Array`:return new Float64Array(i)}}case`error`:if(t.length>=3&&typeof t[1]==`string`&&typeof t[2]==`string`){let e=Ane[t[1]]||Error,n=e===AggregateError?new e([],t[2]):new e(t[2]);if(typeof t[3]==`string`&&(n.stack=t[3]),t.length>=5){let e=t[4];if(!e||typeof e!=`object`||Array.isArray(e))break;let r=n,a=e;for(let e of Object.keys(a))if(e!==`name`&&e!==`message`&&e!==`stack`){if(e in Object.prototype||e===`toJSON`){this.evaluateImpl(a[e],n,e,i+1);continue}r[e]=this.evaluateImpl(a[e],n,e,i+1)}}return n}break;case`undefined`:if(t.length===1)return;break;case`inf`:return 1/0;case`-inf`:return-1/0;case`nan`:return NaN;case`url`:if(t.length===2&&typeof t[1]==`string`)return new URL(t[1]);break;case`headers`:if(t.length===2&&t[1]instanceof Array)return new Headers(t[1]);break;case`request`:{if(t.length!==3||typeof t[1]!=`string`)break;let e=t[1],a=t[2];if(typeof a!=`object`||!a)break;if(a.body&&(a.body=this.evaluateImpl(a.body,a,`body`,i+1),!(a.body===null||typeof a.body==`string`||a.body instanceof Uint8Array||a.body instanceof ReadableStream)))throw TypeError(`Request body must be of type ReadableStream.`);if(a.signal&&(a.signal=this.evaluateImpl(a.signal,a,`signal`,i+1),!(a.signal instanceof AbortSignal)))throw TypeError(`Request siganl must be of type AbortSignal.`);if(a.headers&&!(a.headers instanceof Array))throw TypeError(`Request headers must be serialized as an array of pairs.`);let o=new Request(e,a);if(a.body instanceof ReadableStream&&o.body===void 0){let e=jne(o,a.body);return this.promises.push({promise:e,parent:n,property:r}),e}return o}case`response`:{if(t.length!==3)break;let e=this.evaluateImpl(t[1],n,r,i+1);if(!(e===null||typeof e==`string`||e instanceof Uint8Array||e instanceof ReadableStream))throw TypeError(`Response body must be of type ReadableStream.`);let a=t[2];if(typeof a!=`object`||!a)break;if(a.webSocket)throw TypeError(`Can't deserialize a Response containing a webSocket.`);if(a.headers&&!(a.headers instanceof Array))throw TypeError(`Request headers must be serialized as an array of pairs.`);return new Response(e,a)}case`blob`:{if(t.length!==3||typeof t[1]!=`string`)break;let e=t[1],a=this.evaluateImpl(t[2],n,r,i+1);if(!(a instanceof ReadableStream))throw TypeError(`Blob content must be serialized as a ReadableStream.`);let o=ME(a,e);return this.promises.push({promise:o,parent:n,property:r}),o}case`import`:case`pipeline`:{if(t.length<2||t.length>4||typeof t[1]!=`number`)break;let a=this.importer.getExport(t[1]);if(!a)throw Error(`no such entry on exports table: ${t[1]}`);let o=t[0]==`pipeline`,s=e=>{if(o){let t=new dE(e,[]);return this.promises.push({promise:t,parent:n,property:r}),t}return this.hooks.push(e),new dE(e,[])};if(t.length==2)return s(o?a.get([]):a.dup());let c=t[2];if(!(c instanceof Array)||!c.every(e=>typeof e==`string`||typeof e==`number`))break;if(t.length==3)return s(a.get(c));let l=t[3];if(!(l instanceof Array))break;return l=new e(this.importer).evaluateWithDepth([l],i),s(a.call(c,l))}case`remap`:{if(t.length!==5||typeof t[1]!=`number`||!(t[2]instanceof Array)||!(t[3]instanceof Array)||!(t[4]instanceof Array))break;let e=this.importer.getExport(t[1]);if(!e)throw Error(`no such entry on exports table: ${t[1]}`);let i=t[2];if(!i.every(e=>typeof e==`string`||typeof e==`number`))break;let a=t[3].map(e=>{if(!(e instanceof Array)||e.length!==2||e[0]!==`import`&&e[0]!==`export`||typeof e[1]!=`number`)throw TypeError(`unknown map capture: ${JSON.stringify(e)}`);if(e[0]===`export`)return this.importer.importStub(e[1]);{let t=this.importer.getExport(e[1]);if(!t)throw Error(`no such entry on exports table: ${e[1]}`);return t.dup()}}),o=t[4],s=new dE(e.map(i,a,o),[]);return this.promises.push({promise:s,parent:n,property:r}),s}case`export`:case`promise`:if(typeof t[1]==`number`){if(t[0]==`promise`){let e=new dE(this.importer.importPromise(t[1]),[]);return this.promises.push({parent:n,property:r,promise:e}),e}{let e=this.importer.importStub(t[1]);return this.hooks.push(e),new uE(e)}}break;case`writable`:if(typeof t[1]==`number`){let e=this.importer.importStub(t[1]),n=nE.createWritableStreamFromHook(e);return this.hooks.push(e),n}break;case`readable`:if(typeof t[1]==`number`){let e=this.importer.getPipeReadable(t[1]),n=nE.createReadableStreamHook(e);return this.hooks.push(n),e}}throw TypeError(`unknown special value: ${JSON.stringify(t)}`)}if(t instanceof Object){let e=t;for(let t in e)t in Object.prototype||t===`toJSON`?(this.evaluateImpl(e[t],e,t,i+1),delete e[t]):e[t]=this.evaluateImpl(e[t],e,t,i+1);return e}return t}},PE=16,FE=8,IE=16,LE=64;function RE(e){return 2+e.length*3}function zE(e,t,n=0){if(n>=LE)return FE;switch(typeof e){case`string`:return RE(e);case`number`:return 16;case`bigint`:return 16;case`boolean`:return 8;case`undefined`:return 16;case`object`:{if(e===null)return 8;if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)return IE+e.byteLength;if(typeof Blob<`u`&&e instanceof Blob)return IE+e.size;if(e instanceof Date)return 16;if(t??=new WeakSet,t.has(e))return FE;if(t.add(e),e instanceof Array){let r=PE;for(let i of e)r+=FE+zE(i,t,n+1);return r}if(e instanceof Error){let r=PE+RE(e.name)+RE(e.message)+RE(e.stack??``);for(let i of Object.keys(e))r+=FE+RE(i)+zE(e[i],t,n+1);return r}let r=PE;for(let i of Object.keys(e))r+=FE+RE(i)+zE(e[i],t,n+1);return r}default:return 16}}var BE=class{session;importId;constructor(e,t,n){this.session=e,this.importId=t,n&&(this.activePull=Promise.withResolvers())}localRefcount=0;remoteRefcount=1;activePull;resolution;onBrokenRegistrations;resolve(e){if(this.localRefcount==0){e.dispose();return}if(this.resolution=e,this.sendRelease(),this.onBrokenRegistrations){for(let t of this.onBrokenRegistrations){let n=this.session.onBrokenCallbacks[t],r=this.session.onBrokenCallbacks.length;e.onBroken(n),this.session.onBrokenCallbacks[r]===n?delete this.session.onBrokenCallbacks[r]:delete this.session.onBrokenCallbacks[t]}this.onBrokenRegistrations=void 0}this.activePull&&=(this.activePull.resolve(),void 0)}async awaitResolution(){return this.activePull||=(this.session.sendPull(this.importId),Promise.withResolvers()),await this.activePull.promise,this.resolution.pull()}dispose(){this.resolution?this.resolution.dispose():(this.abort(Error(`RPC was canceled because the RpcPromise was disposed.`)),this.sendRelease())}abort(e){this.resolution||(this.resolution=new iE(e),this.activePull&&=(this.activePull.reject(e),void 0),this.onBrokenRegistrations=void 0)}onBroken(e){if(this.resolution)this.resolution.onBroken(e);else{let t=this.session.onBrokenCallbacks.length;this.session.onBrokenCallbacks.push(e),this.onBrokenRegistrations||=[],this.onBrokenRegistrations.push(t)}}sendRelease(){this.remoteRefcount>0&&(this.session.sendRelease(this.importId,this.remoteRefcount),this.remoteRefcount=0)}},VE=class e extends rE{isPromise;entry;constructor(e,t){super(),this.isPromise=e,++t.localRefcount,this.entry=t}collectPath(e){return this}getEntry(){if(this.entry)return this.entry;throw Error(`This RpcImportHook was already disposed.`)}getEntryTakingOwnership(e){try{return this.getEntry()}catch(t){throw e(),t}}call(e,t){let n=this.getEntryTakingOwnership(()=>t.dispose());return n.resolution?n.resolution.call(e,t):n.session.sendCall(n.importId,e,t)}stream(e,t){let n=this.getEntryTakingOwnership(()=>t.dispose());return n.resolution?n.resolution.stream(e,t):n.session.sendStream(n.importId,e,t)}map(e,t,n){let r=this.getEntryTakingOwnership(()=>{for(let e of t)e.dispose()});return r.resolution?r.resolution.map(e,t,n):r.session.sendMap(r.importId,e,t,n)}get(e){let t=this.getEntry();return t.resolution?t.resolution.get(e):t.session.sendCall(t.importId,e)}dup(){return new e(!1,this.getEntry())}pull(){let e=this.getEntry();if(!this.isPromise)throw Error(`Can't pull this hook because it's not a promise hook.`);return e.resolution?e.resolution.pull():e.awaitResolution()}ignoreUnhandledRejections(){}dispose(){let e=this.entry;this.entry=void 0,e&&--e.localRefcount===0&&e.dispose()}onBroken(e){this.entry&&this.entry.onBroken(e)}},HE=class extends VE{session;constructor(e){super(!1,e),this.session=e.session}dispose(){if(this.session){let e=this.session;this.session=void 0,e.shutdown()}}},UE=class{transport;options;exports=[];reverseExports=new Map;imports=[];abortReason;cancelReadLoop;nextExportId=-1;onBatchDone;pullCount=0;onBrokenCallbacks=[];encodingLevel;limits;constructor(e,t,n){this.transport=e,this.options=n;let r=`string`;if(`encodingLevel`in e){let t=e.encodingLevel;if(t!==void 0){if(t!==`string`&&t!==`jsonCompatible`&&t!==`jsonCompatibleWithBytes`&&t!==`structuredClonable`)throw TypeError(`Unknown transport encodingLevel: ${String(t)}`);r=t}}this.encodingLevel=r,this.limits={...TE,...n.limits},this.exports.push({hook:t,refcount:1}),this.imports.push(new BE(this,0,!1)),this.readLoop().catch(e=>this.abort(e))}getMainImport(){return new HE(this.imports[0])}shutdown(){this.abort(Error(`RPC session was shut down by disposing the main stub`),!1)}exportStub(e){if(this.abortReason)throw this.abortReason;let t=this.reverseExports.get(e);if(t!==void 0)return++this.exports[t].refcount,t;{let t=this.nextExportId--;return this.exports[t]={hook:e,refcount:1},this.reverseExports.set(e,t),t}}exportPromise(e){if(this.abortReason)throw this.abortReason;let t=this.nextExportId--;return this.exports[t]={hook:e,refcount:1},this.reverseExports.set(e,t),this.ensureResolvingExport(t),t}unexport(e){for(let t of e)this.releaseExport(t,1)}releaseExport(e,t){let n=this.exports[e];if(!n)throw Error(`no such export ID: ${e}`);if(n.refcount<t)throw Error(`refcount would go negative: ${n.refcount} < ${t}`);n.refcount-=t,n.refcount===0&&(delete this.exports[e],this.reverseExports.delete(n.hook),n.hook.dispose())}onSendError(e){if(this.options.onSendError)return this.options.onSendError(e)}ensureResolvingExport(e){let t=this.exports[e];if(!t)throw Error(`no such export ID: ${e}`);if(!t.pull){let n=async()=>{let e=t.hook;for(;;){let t=await e.pull();if(t.value instanceof uE){let{hook:n,pathIfPromise:r}=gE(t.value);if(r&&r.length==0&&this.getImport(e)===void 0){e=n;continue}}return t}},r=t.autoRelease;++this.pullCount,t.pull=n().then(t=>{let n=jE.devaluate(t.value,void 0,this,t,this.encodingLevel);this.send([`resolve`,e,n]),r&&this.releaseExport(e,1)},t=>{this.send([`reject`,e,jE.devaluate(t,void 0,this,void 0,this.encodingLevel)]),r&&this.releaseExport(e,1)}).catch(t=>{try{this.send([`reject`,e,jE.devaluate(t,void 0,this,void 0,this.encodingLevel)]),r&&this.releaseExport(e,1)}catch(e){this.abort(e)}}).finally(()=>{--this.pullCount===0&&this.onBatchDone&&this.onBatchDone.resolve()})}}getImport(e){if(e instanceof VE&&e.entry&&e.entry.session===this)return e.entry.importId}importStub(e){if(this.abortReason)throw this.abortReason;let t=this.imports[e];return t||(t=new BE(this,e,!1),this.imports[e]=t),new VE(!1,t)}importPromise(e){if(this.abortReason)throw this.abortReason;if(this.imports[e])return new iE(Error(`Bug in RPC system: The peer sent a promise reusing an existing export ID.`));let t=new BE(this,e,!0);return this.imports[e]=t,new VE(!0,t)}getExport(e){return this.exports[e]?.hook}getPipeReadable(e){let t=this.exports[e];if(!t||!t.pipeReadable)throw Error(`Export ${e} is not a pipe or its readable end was already consumed.`);let n=t.pipeReadable;return t.pipeReadable=void 0,n}getLimits(){return this.limits}createPipe(e,t){if(this.abortReason)throw this.abortReason;this.send([`pipe`]);let n=this.imports.length,r=new BE(this,n,!1);this.imports.push(r);let i=new VE(!1,r),a=nE.createWritableStreamFromHook(i);return e.pipeTo(a).catch(()=>{}).finally(()=>t.dispose()),n}send(e){if(this.abortReason!==void 0)return 0;if(this.encodingLevel===`string`){let t;try{t=JSON.stringify(e)}catch(e){try{this.abort(e)}catch{}throw e}try{let e=this.transport.send(t);e!==void 0&&typeof e.catch==`function`&&e.catch(e=>this.abort(e,!1))}catch(e){queueMicrotask(()=>this.abort(e,!1))}return t.length}try{let t=this.transport.send(e);if(typeof t==`number`)return t;let n=t;n&&typeof n.then==`function`&&Promise.resolve(n).catch(e=>this.abort(e,!1));return}catch(e){queueMicrotask(()=>this.abort(e,!1));return}}sendCall(e,t,n){if(this.abortReason)throw n?.dispose(),this.abortReason;let r=[`pipeline`,e,t];if(n){let e;try{e=jE.devaluate(n.value,void 0,this,n,this.encodingLevel)}catch(e){throw n.dispose(),e}r.push(e[0])}this.send([`push`,r]);let i=new BE(this,this.imports.length,!1);return this.imports.push(i),new VE(!0,i)}sendStream(e,t,n){if(this.abortReason)throw n.dispose(),this.abortReason;let r=[`pipeline`,e,t],i;try{i=jE.devaluate(n.value,void 0,this,n,this.encodingLevel)}catch(e){throw n.dispose(),e}r.push(i[0]);let a=[`stream`,r],o=this.send(a);o===void 0&&(o=zE(a));let s=this.imports.length,c=new BE(this,s,!0);return c.remoteRefcount=0,c.localRefcount=1,this.imports.push(c),{promise:c.awaitResolution().then(e=>{e.dispose(),delete this.imports[s]},e=>{throw delete this.imports[s],e}),size:o}}sendMap(e,t,n,r){if(this.abortReason){for(let e of n)e.dispose();throw this.abortReason}let i=[`remap`,e,t,n.map(e=>{let t=this.getImport(e);return t===void 0?[`export`,this.exportStub(e)]:[`import`,t]}),r];this.send([`push`,i]);let a=new BE(this,this.imports.length,!1);return this.imports.push(a),new VE(!0,a)}sendPull(e){if(this.abortReason)throw this.abortReason;this.send([`pull`,e])}sendRelease(e,t){this.abortReason||(this.send([`release`,e,t]),delete this.imports[e])}abort(e,t=!0){if(this.abortReason===void 0){if(this.cancelReadLoop?.(e),this.cancelReadLoop=void 0,t)try{let t=[`abort`,jE.devaluate(e,void 0,this,void 0,this.encodingLevel)];if(this.encodingLevel===`string`){let e=this.transport.send(JSON.stringify(t));e!==void 0&&typeof e.catch==`function`&&e.catch(e=>{})}else{let e=this.transport.send(t);e&&typeof e.then==`function`&&Promise.resolve(e).catch(e=>{})}}catch{}if(e===void 0&&(e=`undefined`),this.abortReason=e,this.onBatchDone&&this.onBatchDone.reject(e),this.transport.abort)try{this.transport.abort(e)}catch(e){Promise.resolve(e)}for(let t in this.onBrokenCallbacks)try{this.onBrokenCallbacks[t](e)}catch(e){Promise.resolve(e)}for(let t in this.imports)this.imports[t].abort(e);for(let e in this.exports)this.exports[e].hook.dispose()}}async readLoop(){for(;!this.abortReason;){let e=Promise.withResolvers();this.cancelReadLoop=e.reject;let t;try{t=await Promise.race([this.transport.receive(),e.promise])}finally{this.cancelReadLoop===e.reject&&(this.cancelReadLoop=void 0)}if(this.encodingLevel===`string`&&t.length>this.limits.maxMessageSize)throw TypeError(`Incoming message exceeds maximum size of ${this.limits.maxMessageSize} UTF-16 code units.`);if(this.abortReason)break;let n=this.encodingLevel===`string`?JSON.parse(t):t;if(n instanceof Array)switch(n[0]){case`push`:if(n.length>1){let e=new xE(new NE(this,this.encodingLevel).evaluate(n[1]));e.ignoreUnhandledRejections(),this.exports.push({hook:e,refcount:1});continue}break;case`stream`:if(n.length>1){let e=new xE(new NE(this,this.encodingLevel).evaluate(n[1]));e.ignoreUnhandledRejections();let t=this.exports.length;this.exports.push({hook:e,refcount:1,autoRelease:!0}),this.ensureResolvingExport(t);continue}break;case`pipe`:{let{readable:e,writable:t}=new TransformStream,n=nE.createWritableStreamHook(t);this.exports.push({hook:n,refcount:1,pipeReadable:e});continue}case`pull`:{let e=n[1];if(typeof e==`number`){this.ensureResolvingExport(e);continue}break}case`resolve`:case`reject`:{let e=n[1];if(typeof e==`number`&&n.length>2){let t=this.imports[e];if(t){if(n[0]==`resolve`)t.resolve(new xE(new NE(this,this.encodingLevel).evaluate(n[2])));else{let e=new NE(this,this.encodingLevel).evaluate(n[2]);e.dispose(),t.resolve(new iE(e.value))}}else n[0]==`resolve`&&new NE(this,this.encodingLevel).evaluate(n[2]).dispose();continue}break}case`release`:{let e=n[1],t=n[2];if(typeof e==`number`&&typeof t==`number`){this.releaseExport(e,t);continue}break}case`abort`:{let e=new NE(this,this.encodingLevel).evaluate(n[1]);e.dispose(),this.abort(e.value,!1);break}}throw Error(`bad RPC message: ${JSON.stringify(n)}`)}}async drain(){if(this.abortReason)throw this.abortReason;if(this.pullCount>0){let{promise:e,resolve:t,reject:n}=Promise.withResolvers();this.onBatchDone={resolve:t,reject:n},await e}}getStats(){let e={imports:0,exports:0};for(let t in this.imports)++e.imports;for(let t in this.exports)++e.exports;return e}},WE=class{#e;#t;constructor(e,t,n={}){let r;r=t?new xE(vE.fromAppReturn(t)):new iE(Error(`This connection has no main object.`)),this.#e=new UE(e,r,n),this.#t=new uE(this.#e.getMainImport())}getRemoteMain(){return this.#t}getStats(){return this.#e.getStats()}drain(){return this.#e.drain()}};function GE(e,t,n){return new WE(new KE(e),t,n).getRemoteMain()}var KE=class{encodingLevel=`structuredClonable`;constructor(e){this.#e=e,e.start(),e.addEventListener(`message`,e=>{this.#i||(e.data===null?this.#a(Error(`Peer closed MessagePort connection.`)):this.#t?(this.#t(e.data),this.#t=void 0,this.#n=void 0):this.#r.push(e.data))}),e.addEventListener(`messageerror`,e=>{this.#a(Error(`MessagePort message error.`))})}#e;#t;#n;#r=[];#i;send(e){if(this.#i)throw this.#i;this.#e.postMessage(e)}async receive(){if(this.#r.length>0)return this.#r.shift();if(this.#i)throw this.#i;return new Promise((e,t)=>{this.#t=e,this.#n=t})}abort(e){try{this.#e.postMessage(null)}catch{}this.#e.close(),this.#i||=e}#a(e){this.#i||(this.#i=e,this.#n&&=(this.#n(e),this.#t=void 0,void 0))}},qE,JE=class{context;captureMap=new Map;instructions=[];constructor(e,t){this.context=qE?{parent:qE,captures:[],subject:qE.capture(e),path:t}:{parent:void 0,captures:[],subject:e,path:t},qE=this}unregister(){qE=this.context.parent}makeInput(){return new XE(this,0)}makeOutput(e){let t;try{t=jE.devaluate(e.value,void 0,this,e)}finally{e.dispose()}return this.instructions.push(t),this.context.parent?(this.context.parent.instructions.push([`remap`,this.context.subject,this.context.path,this.context.captures.map(e=>[`import`,e]),this.instructions]),new XE(this.context.parent,this.context.parent.instructions.length)):this.context.subject.map(this.context.path,this.context.captures,this.instructions)}pushCall(e,t,n){let r=jE.devaluate(n.value,void 0,this,n);r=r[0];let i=this.capture(e.dup());return this.instructions.push([`pipeline`,i,t,r]),new XE(this,this.instructions.length)}pushGet(e,t){let n=this.capture(e.dup());return this.instructions.push([`pipeline`,n,t]),new XE(this,this.instructions.length)}capture(e){if(e instanceof XE&&e.mapper===this)return e.idx;let t=this.captureMap.get(e);if(t===void 0){if(this.context.parent){let t=this.context.parent.capture(e);this.context.captures.push(t)}else this.context.captures.push(e);t=-this.context.captures.length,this.captureMap.set(e,t)}return t}exportStub(e){throw Error(`Can't construct an RpcTarget or RPC callback inside a mapper function. Try creating a new RpcStub outside the callback first, then using it inside the callback.`)}exportPromise(e){return this.exportStub(e)}getImport(e){return this.capture(e)}unexport(e){}createPipe(e){throw Error(`Cannot send ReadableStream inside a mapper function.`)}onSendError(e){}};eE.sendMap=(e,t,n)=>{let r=new JE(e,t),i;try{i=vE.fromAppReturn(sE(r.pushCall.bind(r),()=>n(new dE(r.makeInput(),[]))))}finally{r.unregister()}if(i instanceof Promise)throw i.catch(e=>{}),Error(`RPC map() callbacks cannot be async.`);return new dE(r.makeOutput(i),[])};function YE(){throw Error(`Attempted to use an abstract placeholder from a mapper function. Please make sure your map function has no side effects.`)}var XE=class extends rE{mapper;idx;constructor(e,t){super(),this.mapper=e,this.idx=t}dup(){return this}dispose(){}get(e){if(e.length==0)return this;if(qE)return qE.pushGet(this,e);YE()}call(e,t){t.dispose(),YE()}map(e,t,n){for(let e of t)e.dispose();YE()}pull(){YE()}ignoreUnhandledRejections(){}onBroken(e){YE()}},ZE=class{captures;variables;constructor(e,t){this.captures=e,this.variables=[t]}dispose(){for(let e of this.variables)e.dispose()}apply(e){try{if(e.length<1)throw Error(`Invalid empty mapper function.`);for(let t of e.slice(0,-1)){let e=new NE(this).evaluateCopy(t);if(e.value instanceof uE){let t=mE(e.value);if(t){this.variables.push(t);continue}}this.variables.push(new xE(e))}return new NE(this).evaluateCopy(e[e.length-1])}finally{for(let e of this.variables)e.dispose()}}importStub(e){throw Error(`A mapper function cannot refer to exports.`)}importPromise(e){return this.importStub(e)}getExport(e){return e<0?this.captures[-e-1]:this.variables[e]}getPipeReadable(e){throw Error(`A mapper function cannot use pipe readables.`)}getLimits(){return TE}};function QE(e,t,n,r,i){let a=new ZE(r,new xE(vE.deepCopyFrom(e,t,n)));try{return a.apply(i)}finally{a.dispose()}}eE.applyMap=(e,t,n,r,i)=>{try{let a;if(e instanceof dE)throw Error(`applyMap() can't be called on RpcPromise`);if(e instanceof Array){let t=[];try{for(let a of e)t.push(QE(a,e,n,r,i))}catch(e){for(let e of t)e.dispose();throw e}a=vE.fromArray(t)}else a=e==null?vE.fromAppReturn(e):QE(e,t,n,r,i);return new xE(a)}finally{for(let e of r)e.dispose()}};var $E=class e extends rE{state;static create(t){let n=t.getWriter();return new e({refcount:1,writer:n,closed:!1})}constructor(e,t){super(),this.state=e,t&&++e.refcount}getState(){if(this.state)return this.state;throw Error(`Attempted to use a WritableStreamStubHook after it was disposed.`)}call(e,t){try{let n=this.getState();if(e.length!==1||typeof e[0]!=`string`)throw Error(`WritableStream stub only supports direct method calls`);let r=e[0];if(r!==`write`&&r!==`close`&&r!==`abort`)throw Error(`Unknown WritableStream method: ${r}`);return(r===`close`||r===`abort`)&&(n.closed=!0),new wE((r===`write`?t.deliverStreamWrite(n.writer):t.deliverCall(n.writer[r],n.writer)).then(e=>new xE(e)))}catch(e){return t.dispose(),new iE(e)}}map(e,t,n){for(let e of t)e.dispose();return new iE(Error(`Cannot use map() on a WritableStream`))}get(e){return new iE(Error(`Cannot access properties on a WritableStream stub`))}dup(){let t=this.getState();return new e(t,this)}pull(){return Promise.reject(Error(`Cannot pull a WritableStream stub`))}ignoreUnhandledRejections(){}dispose(){let e=this.state;this.state=void 0,e&&--e.refcount===0&&(e.closed||e.writer.abort(Error(`WritableStream RPC stub was disposed without calling close()`)).catch(()=>{}),e.writer.releaseLock())}onBroken(e){}},eD=262144,tD=1073741824,nD=65536,rD=2,iD=1.25,aD=.9,oD=3,sD=class{now;window=eD;bytesInFlight=0;inStartupPhase=!0;delivered=0;deliveredTime=0;firstAckTime=0;firstAckDelivered=0;minRtt=1/0;roundsWithoutIncrease=0;lastRoundWindow=0;roundStartTime=0;constructor(e){this.now=e}onSend(e){this.bytesInFlight+=e;let t={sentTime:this.now(),size:e,deliveredAtSend:this.delivered,deliveredTimeAtSend:this.deliveredTime,windowAtSend:this.window,windowFullAtSend:this.bytesInFlight>=this.window};return{token:t,shouldBlock:t.windowFullAtSend}}onError(e){this.bytesInFlight-=e.size}onAck(e){let t=this.now();this.delivered+=e.size,this.deliveredTime=t,this.bytesInFlight-=e.size;let n=t-e.sentTime;if(this.minRtt=Math.min(this.minRtt,n),this.firstAckTime===0)this.firstAckTime=t,this.firstAckDelivered=this.delivered;else{let n,r;e.deliveredTimeAtSend===0?(n=this.firstAckTime,r=this.firstAckDelivered):(n=e.deliveredTimeAtSend,r=e.deliveredAtSend);let i=t-n,a=(this.delivered-r)/i,o=this.inStartupPhase?rD:iD,s=a*this.minRtt*o;s=Math.min(s,e.windowAtSend*o),s=e.windowFullAtSend?Math.max(s,e.windowAtSend*aD):Math.max(s,this.window),this.window=Math.max(Math.min(s,tD),nD),this.inStartupPhase&&e.sentTime>=this.roundStartTime&&(this.window>this.lastRoundWindow*iD?this.roundsWithoutIncrease=0:++this.roundsWithoutIncrease>=oD&&(this.inStartupPhase=!1),this.roundStartTime=t,this.lastRoundWindow=this.window)}return this.bytesInFlight<this.window}};function cD(e){let t,n=!1,r=new sD(()=>performance.now()),i,a,o=()=>{n||(n=!0,e.dispose())};return new WritableStream({write(n,s){if(t!==void 0)throw t;let c=vE.fromAppParams([n]),{promise:l,size:u}=e.stream([`write`],c);if(u===void 0)return l.catch(e=>{throw t===void 0&&(t=e),e});{let{token:e,shouldBlock:n}=r.onSend(u);if(l.then(()=>{r.onAck(e)&&i&&(i(),i=void 0,a=void 0)},n=>{r.onError(e),t===void 0&&(t=n,s.error(n),o()),a&&=(a(n),i=void 0,void 0)}),n)return new Promise((e,t)=>{i=e,a=t})}},async close(){if(t!==void 0)throw o(),t;let{promise:n}=e.stream([`close`],vE.fromAppParams([]));try{await n}catch(e){throw t??e}finally{o()}},abort(n){if(t!==void 0)return;t=n??Error(`WritableStream was aborted`),a&&=(a(t),i=void 0,void 0);let{promise:r}=e.stream([`abort`],vE.fromAppParams([n]));r.then(()=>o(),()=>o())}})}var lD=class e extends rE{state;static create(t){return new e({refcount:1,stream:t,canceled:!1})}constructor(e,t){super(),this.state=e,t&&++e.refcount}call(e,t){return t.dispose(),new iE(Error(`Cannot call methods on a ReadableStream stub`))}map(e,t,n){for(let e of t)e.dispose();return new iE(Error(`Cannot use map() on a ReadableStream`))}get(e){return new iE(Error(`Cannot access properties on a ReadableStream stub`))}dup(){let t=this.state;if(!t)throw Error(`Attempted to dup a ReadableStreamStubHook after it was disposed.`);return new e(t,this)}pull(){return Promise.reject(Error(`Cannot pull a ReadableStream stub`))}ignoreUnhandledRejections(){}dispose(){let e=this.state;this.state=void 0,e&&--e.refcount===0&&(e.canceled||(e.canceled=!0,e.stream.locked||e.stream.cancel(Error(`ReadableStream RPC stub was disposed without being consumed`)).catch(()=>{})))}onBroken(e){}};nE.createWritableStreamHook=$E.create,nE.createWritableStreamFromHook=cD,nE.createReadableStreamHook=lD.create;var uD=uE,dD=YT,fD=GE;function pD(e){return e<32||e>=127&&e<=159||e===1564||e>=8203&&e<=8207||e===8232||e===8233||e>=8234&&e<=8238||e>=8294&&e<=8297||e===65279}function mD(e,t=80){let n=``;for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);n+=pD(r)?` `:e.charAt(t)}return n=n.replace(/\s+/gu,` `).trim(),n.length<=t?n:`${n.slice(0,Math.max(0,t-1)).trimEnd()}…`}function hD(e,t){let n=e.find(e=>e.id===t.itemId);if(n===void 0||n.kind===`text`)return!1;if(n.kind===`menu`){let e=n.options.find(e=>e.id===t.optionId);return e!==void 0&&e.disabled!==!0}return t.optionId===void 0?n.kind!==`button`||n.disabled!==!0:!1}Object.freeze({publish:()=>Promise.resolve(),onBack:()=>()=>void 0,onActivate:()=>()=>void 0});function gD(e,t){if(t.kind===`action`){let n=[...e.primary??[],...e.menu??[]].find(e=>e.id===t.actionId);return n!==void 0&&n.disabled!==!0}let n=e.crumbs?.find(e=>e.id===t.crumbId);return n===void 0?!1:t.siblingId===void 0||n.siblings?.some(e=>e.id===t.siblingId)===!0}function _D(e){let t=e.trim().toLowerCase();if(!t)throw Error(`Invalid keymap token: token cannot be empty`);return t}function vD(e){let t=e.trim().toLowerCase();if(!t)throw Error(`Invalid key name: key name cannot be empty`);return t}function yD(e){return{name:vD(e.name),ctrl:e.ctrl??!1,shift:e.shift??!1,meta:e.meta??!1,super:e.super??!1,hyper:e.hyper||void 0}}function bD(e){return{name:e.name,ctrl:e.ctrl,shift:e.shift,meta:e.meta,super:e.super,hyper:e.hyper||void 0}}function xD(e,t){let n=bD(yD(e));return{stroke:n,display:t?.display??kD(n),match:t?.match??TD(n),tokenName:t?.tokenName?_D(t.tokenName):void 0}}function SD(e){return{stroke:bD(e.stroke),display:e.display,match:e.match,tokenName:e.tokenName,patternName:e.patternName,payloadKey:e.payloadKey}}function CD(e){return e.map(e=>SD(e))}function wD(e){return`match`in e?e.match:`stroke`in e?TD(e.stroke):TD(e)}function TD(e){return`key:${AD(yD(e))}`}function ED(e){let t=e.trim();if(!t)throw Error(`Invalid keymap match id: id cannot be empty`);return`text:${t}`}function DD(e,t){return`stroke`in e?t?.preferDisplay&&e.display?e.display:kD(e.stroke):kD(yD(e))}function OD(e,t){return e.map(e=>DD(e,t)).join(t?.separator??``)}function kD(e){let t=[];return e.ctrl&&t.push(`ctrl`),e.shift&&t.push(`shift`),e.meta&&t.push(`meta`),e.super&&t.push(`super`),e.hyper&&t.push(`hyper`),t.push(e.name===`return`?`enter`:e.name),t.join(`+`)}function AD(e){return`${e.name}:${+!!e.ctrl}:${+!!e.shift}:${+!!e.meta}:${+!!e.super}:${+!!e.hyper}`}var jD=Symbol(`keymap-extension-context`);function MD(e){return e.isDestroyed?null:e.getFocusedTarget()}function ND(e,t,n){let r=t??e.rootTarget,i=t!==null;for(;r;){if(n(r,i)===!1)return;r=e.getParentTarget(r),i=!1}}function PD(e,t){let n=new Set;return ND(e,t,e=>{n.add(e)}),n}function FD(e,t,n){let r=[],i=PD(t,n),a=Array.isArray(e)?e:ID(e);for(let e of a)LD(t,e,n,i)&&r.push(e);return r}function ID(e){return[...e].sort((e,t)=>t.priority-e.priority||t.order-e.order)}function LD(e,t,n,r=PD(e,n)){let i=t.target;return i?e.isTargetDestroyed(i)?!1:t.targetMode===`focus`?i===n:r.has(i):!0}function RD(e){let t=e.binding.sequence[e.index];if(!t?.patternName)return 0;let n=e.patterns?.at(-1);return n?.name===t.patternName?n.values.length:0}function zD(e,t,n=!0){let r=e.binding.sequence[e.index];if(!r?.patternName)return!0;let i=t.get(r.patternName);return i?RD(e)>=i.min:n}function BD(e,t,n=!0){let r=e.binding.sequence[e.index];if(r?.patternName){let n=t.get(r.patternName);if(n&&RD(e)<n.max)return!0}return zD(e,t,n)&&e.index+1<e.binding.sequence.length}function VD(e,t){return e.index===e.binding.sequence.length-1&&zD(e,t,!1)}function HD(e,t,n,r){return{parent:e,depth:e?e.depth+1:0,stroke:t,match:n,pattern:r,children:new Map,patternChildren:[],bindings:[],reachableBindings:[]}}function UD(e,t){let n=HD(null,null,null);for(let r of e){if(r.event!==`press`)continue;let e=n;for(let n of r.sequence){let i;if(n.patternName){let r=t.get(n.patternName);i=e.patternChildren.find(e=>e.pattern?.name===n.patternName),i||(i=HD(e,n.stroke,n.match,r),e.patternChildren.push(i))}else i=e.children.get(n.match),i||(i=HD(e,n.stroke,n.match),e.children.set(n.match,i));i.reachableBindings.push(r),e=i}e.bindings.push(r)}return n}function WD(e,t){let n=[];for(let r of e){if(!zD(r,t))continue;let e=r.index+1,i=r.binding.sequence[e];i&&n.push({part:i,binding:r.binding,index:e,exact:e===r.binding.sequence.length-1,continues:e<r.binding.sequence.length-1})}return n}function GD(e,t,n,r){let i=n.patternName;if(!i)return{...e,index:t};let a=[...e.patterns??[]],o=a.at(-1);return o?.name===i?a[a.length-1]={...o,values:[...o.values,r],parts:[...o.parts,n]}:a.push({name:i,payloadKey:n.payloadKey??i,values:[r],parts:[n]}),{layer:e.layer,binding:e.binding,index:t,parts:[...e.parts,n],patterns:a}}function KD(e,t){let n=e.parts.at(-1);if(!n||n.patternName)return t.length;let r=t.indexOf(n.match);return r===-1?t.length:r}function qD(e,t,n,r,i,a,o,s,c){let l=t.sequence[n];if(l){if(l.patternName){let a=s(l.patternName,o);if(!a)return;let u=c(o,l.patternName,a);return GD({layer:e,binding:t,index:n,parts:r,patterns:i},n,u,a.value??o.name)}if(a.includes(l.match))return{layer:e,binding:t,index:n,parts:[...r,l],patterns:i}}}function JD(e,t,n,r,i,a){let o=e.binding.sequence[e.index];if(o?.patternName){let s=r.get(o.patternName);if(s&&RD(e)<s.max){let t=i(s.name,n);if(t){let r=a(n,s.name,t);return GD(e,e.index,r,t.value??n.name)}}return zD(e,r,!1)?qD(e.layer,e.binding,e.index+1,e.parts,e.patterns,t,n,i,a):void 0}return qD(e.layer,e.binding,e.index+1,e.parts,e.patterns,t,n,i,a)}function YD(e,t,n,r,i){let a=[],o=1/0;for(let s of e.bindings){if(s.event!==`press`)continue;let c=qD(e,s,0,[],void 0,t,n,r,i);if(!c)continue;let l=KD(c,t);l<o&&(o=l,a.length=0),l===o&&a.push(c)}return a}import.meta.require;function XD(e){let t=Object.create(null),n=(e,n)=>{let r=t[e];if(!r)return;let i=r.filter(e=>e!==n);i.length===0?delete t[e]:i.length!==r.length&&(t[e]=i)};return{hook(e,r){return t[e]=[...t[e]??[],r],()=>n(e,r)},has(e){return(t[e]?.length??0)>0},emit(n,...r){let i=t[n];if(i)for(let t of i)try{r.length===0?t():t(r[0])}catch(t){e(n,t)}}}}function ZD(){let e=[];return{get:()=>e,set:t=>{e=t},remove(t){e=e.filter(e=>e!==t)},has:()=>e.length>0,clear:()=>{e=[]}}}function QD(){let e=ZD();return{append(t){return e.set([...e.get(),t]),()=>e.remove(t)},prepend(t){return e.set([t,...e.get()]),()=>e.remove(t)},values:e.get,has:e.has,clear:e.clear}}function $D(){let e=ZD(),t=0;return{register(n,r){let i={...r,listener:n,order:t++};return e.set([...e.get(),i].sort((e,t)=>t.priority-e.priority||e.order-t.order)),()=>e.remove(i)},entries:e.get,has:e.has,clear:e.clear}}function eO(e){return typeof e==`string`||!!e&&typeof e==`object`&&!Array.isArray(e)}function tO(e){if(!Array.isArray(e))return{ok:!1,reason:`Invalid keymap bindings: expected an array of binding objects`};for(let[t,n]of e.entries()){if(!n||typeof n!=`object`||Array.isArray(n))return{ok:!1,reason:`Invalid keymap binding at index ${t}: expected a binding object`};if(!eO(n.key))return{ok:!1,reason:`Invalid keymap binding at index ${t}: expected "key" to be a string or keystroke object`}}return{ok:!0}}function nO(e){let t=tO(e);if(!t.ok)throw Error(t.reason);return e.map(e=>({...e,key:typeof e.key==`string`?e.key:{...e.key}}))}function rO(e){return{...e,sequence:CD(e.sequence)}}function iO(e,t){let n=QD();return{prependLayerAnalyzer(e){return n.prepend(e)},appendLayerAnalyzer(e){return n.append(e)},clearLayerAnalyzers(){n.clear()},analyzeLayer(r){let i=n.values();if(i.length===0)return;let a=aO(r.bindings),o={target:r.target,order:r.order,sourceBindings:r.sourceBindings,bindings:a,hasTokenBindings:r.hasTokenBindings,checkCommandResolution(e){return t.getCommandResolutionStatus(e,r.commands)},warn(t,n,r){e.emitWarning(t,n,r)},warnOnce(t,n,r,i){e.warnOnce(t,n,r,i)},error(t,n,r){e.emitError(t,n,r)}};for(let t of i)try{t(o)}catch(t){e.emitError(`layer-analyzer-error`,t,`[Keymap] Error in layer analyzer:`)}}}}function aO(e){return e.map(t=>({sequence:CD(t.sequence),command:t.command,attrs:t.attrs,event:t.event,preventDefault:t.preventDefault,fallthrough:t.fallthrough,parsedBinding:rO(t.parsedBinding),sourceTarget:t.sourceTarget,sourceLayerOrder:t.sourceLayerOrder,bindingIndex:t.bindingIndex,hasCommandAtSequence:e.some(e=>e.event===`press`&&e.command!==void 0&&oO(e,t)),hasContinuations:e.some(e=>e.event===`press`&&sO(t,e))}))}function oO(e,t){return e.sequence.length===t.sequence.length&&e.sequence.every((e,n)=>e.match===t.sequence[n]?.match)}function sO(e,t){return e.sequence.length<t.sequence.length&&e.sequence.every((e,n)=>e.match===t.sequence[n]?.match)}function cO(){return{version:-1,notifyVersion:-1,focused:void 0,value:[],targets:new WeakMap}}function lO(){return{plain:cO(),bindings:cO(),metadata:cO(),bindingsAndMetadata:cO()}}function uO(e,t){if(t===void 0)return e.plain;let n=t.includeBindings===!0,r=t.includeMetadata===!0;return n?r?e.bindingsAndMetadata:e.bindings:r?e.metadata:e.plain}function dO(e,t,n){let r=n?e.targets.get(n):e.nullTarget;return r?.version===t?r:void 0}function fO(e,t,n,r){let i={version:t,value:r};n?e.targets.set(n,i):e.nullTarget=i}function Mne(e,t){if(e===t)return!0;if(!e||!t||e.captures.length!==t.captures.length)return!1;for(let n=0;n<e.captures.length;n+=1){let r=e.captures[n],i=t.captures[n];if(!r||!i||r.layer!==i.layer||r.binding!==i.binding||r.index!==i.index||r.parts.length!==i.parts.length)return!1;for(let e=0;e<r.parts.length;e+=1)if(r.parts[e]?.match!==i.parts[e]?.match)return!1;let a=r.patterns??[],o=i.patterns??[];if(a.length!==o.length)return!1;for(let e=0;e<a.length;e+=1){let t=a[e],n=o[e];if(!t||!n||t.name!==n.name||t.values.length!==n.values.length)return!1;for(let e=0;e<t.values.length;e+=1)if(!Object.is(t.values[e],n.values[e]))return!1}}return!0}function Nne(e){let t=e.parts.at(-1);if(!t||e.parts.length<=1)return;let n=e.index-1,r=e.patterns;if(t.patternName){let i=r?.at(-1);i?.name===t.patternName&&(i.values.length>1?(n=e.index,r=[...(r??[]).slice(0,-1),{...i,values:i.values.slice(0,-1),parts:i.parts.slice(0,-1)}]):r=(r??[]).slice(0,-1))}return{layer:e.layer,binding:e.binding,index:n,parts:e.parts.slice(0,-1),patterns:r}}function pO(e){let t=e.captures[0];if(!t||t.parts.length===0)return[];let n=[];for(let r=0;r<t.parts.length;r+=1){let i=t.parts[r];if(!i)continue;let a,o,s=!1,c=!1;for(let t of e.captures){let e=t.parts[r];if(e){if(a===void 0){a=e.display,o=e.tokenName;continue}!s&&a!==e.display&&(s=!0),!c&&o!==e.tokenName&&(c=!0)}}(a===void 0||s)&&(a=DD(i.stroke)),c&&(o=void 0),n.push(xD(i.stroke,{display:a,match:i.match,tokenName:o}))}return n}function mO(e){if(e.isDestroyed)throw Error(`Cannot use a keymap after its host was destroyed`);return e}function Pne(e,t,n,r,i,a,o={}){let s=lO(),c=-1,l=[],u=()=>mO(t).getFocusedTarget(),d=()=>MD(t),f=t=>{let n=e.pending;Mne(n,t)||(e.pending=t,o.onPendingSequenceChanged?.(n,t),V(),r.queueStateChange())},p=()=>{let t=e.pending;if(!t)return;let n=u(),r=a.getActiveCommandView(n),o=t.captures.filter(t=>e.layers.has(t.layer)&&C(t.layer,n)&&i.matchesConditions(t.layer)&&D(t.binding,n,r)&&BD(t,e.patterns));if(o.length===0){f(null);return}return o.length!==t.captures.length&&f({captures:o}),e.pending??void 0},m=()=>{t.isDestroyed||!e.pending||p()},h=()=>!t.isDestroyed&&e.pending!==null,g=()=>{if(c===e.cacheVersion)return l;let t=p(),n=t?pO(t):[];return(!t||T())&&(c=e.cacheVersion,l=n),n},_=()=>{let e=p();if(!e)return!1;let t=e.captures[0];if(!t||t.parts.length<=1)return f(null),!0;let n=[];for(let t of e.captures){let e=Nne(t);e&&n.push(e)}return n.length===0?(f(null),!0):(f({captures:n}),!0)},v=t=>{let n=t?.includeBindings===!0,r=t?.includeMetadata===!0,i=uO(s,t);return i.notifyVersion===e.derivedVersion?i.value:y(i,n,r)},y=(n,r,i)=>{t.isDestroyed&&mO(t);let o=u(),s=dO(n,e.cacheVersion,o);if(s)return n.notifyVersion=e.derivedVersion,n.version=e.cacheVersion,n.focused=o,n.value=s.value,s.value;let c=a.getActiveCommandView(o),l=p(),d=l?[]:S(o),f=l?F(l.captures,r,i,o,c):j(d,r,i,o,c);return(l?T():w(d))&&(n.version=e.cacheVersion,n.notifyVersion=e.derivedVersion,n.focused=o,n.value=f,fO(n,e.cacheVersion,o,f)),f},b=(e,t)=>{let n=t?.includeBindings===!0,r=t?.includeMetadata===!0,i=u(),o=a.getActiveCommandView(i);return F(e,n,r,i,o)},x=(e,t)=>{let n=t?.includeBindings===!0,r=t?.includeMetadata===!0,i=e===d()?p():void 0,o=a.getActiveCommandView(e);return i?F(i.captures,n,r,e,o):j(S(e),n,r,e,o)},S=n=>e.activeLayersCacheVersion===e.cacheVersion&&e.activeLayersCacheFocused===n?e.activeLayersCache:(e.activeLayersCacheVersion=e.cacheVersion,e.activeLayersCacheFocused=n,e.activeLayersCache=FD(e.sortedLayers,t,n),e.activeLayersCache),C=(e,n)=>LD(t,e,n),w=t=>!e.commandResolvers.has()&&e.activeKeyCacheBlockers===0,T=()=>!e.commandResolvers.has()&&e.activeKeyCacheBlockers===0,E=(e,t,n)=>{let r=[];for(let o of e)i.matchesConditions(o)&&a.isBindingVisible(o,t,n)&&r.push(o);return r},D=(e,t,n)=>i.matchesConditions(e)&&a.isBindingVisible(e,t,n),O=(e,t)=>{let n,r,i=!1,a=!1;for(let o of e){let e=o.sequence[t];if(e){if(n===void 0){n=e.display,r=e.tokenName;continue}!i&&n!==e.display&&(i=!0),!a&&r!==e.tokenName&&(a=!0)}}if(n===void 0||i){let r=e[0]?.sequence[t]?.stroke;n=r?DD(r):``}return a&&(r=void 0),{display:n,tokenName:r}},k=(e,t,n)=>({sequence:e.sequence,command:e.command,commandAttrs:a.getBindingCommandAttrs(e,t,n),attrs:e.attrs,event:e.event,preventDefault:e.preventDefault,fallthrough:e.fallthrough}),A=(e,t,n)=>e.map(e=>k(e,t,n)),j=(e,t,n,r,a)=>{let o=new Map,s=new Set;for(let n of e)n.root.children.size===0&&n.root.patternChildren.length===0||!i.matchesConditions(n)||(M(n.root.children.values(),o,s,t,r,a),M(n.root.patternChildren,o,s,t,r,a));return R(o,t,n,r,a)},M=(e,t,n,r,i,a)=>{for(let o of e){let e=o.match;if(!e||n.has(e)||!o.stroke)continue;let s=N(o,r,i,a);if(!s)continue;let c=t.get(e);c?ne(c,s,r):t.set(e,B(o.stroke,s,r)),s.stop&&n.add(e)}},N=(e,t,n,r)=>{if(!(e.children.size>0||e.patternChildren.length>0)){let i=te(P(e)?E(e.bindings,n,r):e.bindings,n,r);if(!i)return;let a=O(i.bindings,e.depth-1);return{display:a.display,tokenName:a.tokenName,continues:!1,firstBinding:i.bindings[0],commandBinding:i.commandBinding,bindings:t?[...i.bindings]:void 0,stop:i.stop}}let i=E(e.reachableBindings,n,r);if(i.length===0)return;let a=te(e.bindings,n,r),o=O(i,e.depth-1);return{display:o.display,tokenName:o.tokenName,continues:!0,firstBinding:a?.bindings[0],commandBinding:a?.commandBinding,bindings:t&&a?[...a.bindings]:void 0,stop:!0}},P=t=>{if(e.commandResolvers.has())return!0;for(let e of t.bindings)if(e.matchers.length>0)return!0;return!1},F=(t,n,r,i,a)=>{let o=new Map,s=new Set;return I(WD(t,e.patterns),o,s,n,i,a),R(o,n,r,i,a)},I=(e,t,n,r,i,a)=>{let o=new Set;for(let s of e)o.has(s.part.match)||(o.add(s.part.match),L(s,e,t,n,r,i,a))},L=(e,t,n,r,i,a,o)=>{let s=e.part.match;if(r.has(s))return;let c=z(e,t,i,a,o);if(!c)return;let l=n.get(s);l?ne(l,c,i):n.set(s,B(e.part.stroke,c,i)),c.stop&&r.add(s)},R=(e,t,n,r,i)=>{let a=[];for(let o of e.values()){let e=re(o,t,n,r,i);e&&a.push(e)}return a},z=(e,t,n,r,i)=>{let a=t.filter(t=>t.part.match===e.part.match),o=a.filter(e=>e.exact).map(e=>e.binding),s=te(o,r,i),c=a.some(e=>e.continues);if(!c&&!s)return;let l=ee(a);return{display:l.display,tokenName:l.tokenName,continues:c,firstBinding:s?.bindings[0],commandBinding:s?.commandBinding,bindings:n&&s?[...s.bindings]:void 0,stop:c||s?.stop===!0}},ee=e=>{let t,n,r=!1,i=!1;for(let a of e){let e=a.part;if(t===void 0){t=e.display,n=e.tokenName;continue}!r&&t!==e.display&&(r=!0),!i&&n!==e.tokenName&&(i=!0)}let a=e[0]?.part;return(t===void 0||r)&&(t=a?DD(a.stroke):``),i&&(n=void 0),{display:t,tokenName:n}},te=(e,t,n)=>{let r=[],o;for(let s of e)if(!(!i.matchesConditions(s)||!a.isBindingVisible(s,t,n))&&(r.push(s),s.command!==void 0&&(o??=s,!s.fallthrough)))return{bindings:r,commandBinding:o,stop:!0};if(r.length!==0)return{bindings:r,commandBinding:o,stop:!1}},B=(e,t,n)=>({stroke:e,display:t.display,tokenName:t.tokenName,continues:t.continues,firstBinding:t.firstBinding,commandBinding:t.commandBinding,bindings:n&&t.bindings?[...t.bindings]:void 0}),ne=(e,t,n)=>{if(!e.firstBinding&&t.firstBinding&&(e.firstBinding=t.firstBinding),!e.commandBinding&&t.commandBinding&&(e.commandBinding=t.commandBinding),t.continues&&(e.continues=!0),!(!n||!t.bindings||t.bindings.length===0)){if(!e.bindings){e.bindings=[...t.bindings];return}e.bindings.push(...t.bindings)}},re=(e,t,n,r,i)=>{if(!e.commandBinding&&!e.continues)return;let o={stroke:bD(e.stroke),display:e.display,continues:e.continues};if(e.tokenName&&(o.tokenName=e.tokenName),e.commandBinding&&(o.command=e.commandBinding.command),t&&e.bindings&&e.bindings.length>0&&(o.bindings=e.bindings.length===1?[k(e.bindings[0],r,i)]:A(e.bindings,r,i)),n){e.firstBinding?.attrs&&(o.bindingAttrs=e.firstBinding.attrs);let t=e.commandBinding?a.getBindingCommandAttrs(e.commandBinding,r,i):void 0;t&&(o.commandAttrs=t)}return o},V=()=>{n.has(`pendingSequence`)&&n.emit(`pendingSequence`,e.pending?pO(e.pending):[])};return{getFocusedTarget:u,getFocusedTargetIfAvailable:d,setPendingSequence:f,ensureValidPendingSequence:p,revalidatePendingSequenceIfNeeded:m,hasPendingSequenceState:h,getPendingSequence:g,popPendingSequence:_,getActiveKeys:v,getActiveKeysForCaptures:b,getActiveKeysForFocused:x,getActiveLayers:S,isLayerActiveForFocused:C,collectSequencePartsFromPending:pO,collectMatchingBindings:E,collectActiveBindings:A}}var hO=new Set([`name`,`run`,`fields`,`attrs`,`rejectedResult`]),gO=new Set([`key`,`cmd`,`event`,`preventDefault`,`fallthrough`]),_O=new Set([`target`,`targetMode`,`priority`,`bindings`,`commands`]);function vO(e){if(e===void 0||typeof e==`function`)return e;let t=e.trim();if(!t)throw Error(`Invalid keymap command: command cannot be empty`);return t}function Fne(e){let t=e.trim();if(!t)throw Error(`Invalid keymap command name: name cannot be empty`);if(/\s/.test(t))throw Error(`Invalid keymap command name "${e}": command names cannot contain whitespace`);return t}function yO(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}function Ine(e){let t=[],n=new Map;for(let r of e.layers)for(let e of r.commands){let i={layer:r,commandState:e};t.push(i),yO(n,e.command.name,i)}return{entries:t,chainsByName:n}}function Lne(e,t,n){let r=[],i=[],a=new Map,o=new Map;for(let s of e)if(s.commands.length!==0&&!(n&&!t.matchesConditions(s)))for(let e of s.commands){if(!t.matchesConditions(e))continue;let n={layer:s,commandState:e};r.push(n),yO(o,e.command.name,n),a.has(e.command.name)||(a.set(e.command.name,n),i.push(n))}return{layers:e,entries:r,reachable:i,reachableByName:a,chainsByName:o}}function Rne(e,t,n,r){return(e.activeLayersCacheVersion!==e.cacheVersion||e.activeLayersCacheFocused!==r)&&(e.activeLayersCacheVersion=e.cacheVersion,e.activeLayersCacheFocused=r,e.activeLayersCache=FD(e.sortedLayers,t,r)),Lne(e.activeLayersCache,n,!0)}function zne(e,t,n,r){if(Object.prototype.hasOwnProperty.call(e,t)&&!Object.is(e[t],n))throw Error(`Conflicting keymap requirement for "${t}" from ${r}`);e[t]=n}function Bne(e,t,n,r){if(Object.prototype.hasOwnProperty.call(e,t)&&!Object.is(e[t],n))throw Error(`Conflicting keymap attribute for "${t}" from ${r}`);e[t]=n}function bO(e){let t=`field ${e.fieldName}`;return{require(n,r){zne(e.requirements,n,r,t)},attr(n,r){if(!e.attrs)throw Error(`Keymap ${t} cannot publish attrs`);Bne(e.attrs,n,r,t)},activeWhen(n){e.matchers.push(e.conditions.buildRuntimeMatcher(n,t))}}}function Vne(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function xO(e,t){return e instanceof Error&&e.message?e.message:t}function SO(e){return!e||typeof e!=`object`&&typeof e!=`function`?!1:typeof e.then==`function`}function CO(e,t){let n=t?.deep===!0,r=t?.freeze===!0,i=t?.preserveNonPlainObjects===!0;if(Array.isArray(e)){let i=n?e.map(e=>CO(e,t)):[...e];return r?Object.freeze(i):i}if(e&&typeof e==`object`){if(i&&!Vne(e))return e;let a={};for(let[r,i]of Object.entries(e))a[r]=n?CO(i,t):i;return r?Object.freeze(a):a}return e}var Hne=[`name`],wO=Object.freeze({}),TO=new WeakMap;function Une(e,t,n,r,i){let a=-1,o,s=-1,c,l,u=-1,d,f,p=-1,m,h=-1,g=new Map,_=t=>Wne({commands:t,commandFields:e.commandFields,conditions:r,onError:(e,t,r)=>{n.emitError(e,t,r)}}),v=t=>R(()=>e.commandResolvers.prepend(t),t),y=t=>R(()=>e.commandResolvers.append(t),t),b=()=>{e.commandResolvers.has()&&n.runWithStateChangeBatch(()=>{e.commandResolvers.clear(),i.onCommandResolversChanged(),n.queueStateChange()})},x=e=>ae(e).map(e=>EO(e.commandState)),S=e=>{let t=ie(e),n=ae(e,t);if(n.length===0)return[];let r=n.map(e=>({entry:e,command:EO(e.commandState),commandAttrs:e.commandState.attrs,bindings:[]})),i=new Map;for(let[e,t]of r.entries()){let n=i.get(t.command.name);n?n.push(e):i.set(t.command.name,[e])}return i.size>0&&oe(r,i,t),r.map(e=>({command:e.command,bindings:e.bindings}))},C=t=>{if(t.visibility===`registered`&&u===e.derivedVersion&&d===t.commands&&f)return f;let n=new Map;for(let e of t.commands)n.has(e)||n.set(e,[]);return n.size===0?n:(H(n,ie(t)),t.visibility===`registered`&&(u=e.derivedVersion,d=t.commands,f=n),n)},w=(e,t,n)=>{let r=M(t);if(n){let i=[],a=r.chainsByName.get(e);if(a)for(let e of a)i.push({target:e.layer.target,command:e.commandState.command,attrs:e.commandState.attrs,payload:n.payload});let o=de(e,t,{mode:`active`,execution:n});return o.resolved&&i.push(o.resolved),{entries:i.length>0?i:void 0,hadError:o.hadError}}let i=[];for(let t of r.chainsByName.get(e)??[])i.push({target:t.layer.target,command:t.commandState.command,attrs:t.commandState.attrs});let a=de(e,t,{mode:`active`});return a.resolved&&i.push(a.resolved),{entries:i.length>0?i:void 0,hadError:a.hadError}},T=t=>{if(h!==e.derivedVersion&&(h=e.derivedVersion,g=new Map),g.has(t))return g.get(t)??void 0;let n=B(te(t));return g.set(t,n??null),n},E=(e,t)=>B(M(t).chainsByName.get(e)),D=(e,t)=>de(e,null,{mode:`registered`,execution:t}),O=(e,t,n)=>de(e,t,{mode:`active`,execution:n}),k=(e,t)=>z(e,t)?.command,A=e=>ee(e)?.commandState.command,j=(e,n,i)=>{let a=N().chainsByName.get(e);if(!a||a.length===0)return;let o,s;for(let e of a){if(!LD(t,e.layer,n)){o??=e;continue}(!r.matchesConditions(e.layer)||!r.matchesConditions(e.commandState))&&(s??=e)}let c=s??o;if(c)return{reason:s?`disabled`:`inactive`,command:i?c.commandState.command:void 0}},M=n=>{if(s===e.derivedVersion&&c===n&&l)return l;let i=Rne(e,t,r,n);return P()&&(s=e.derivedVersion,c=n,l=i),i},N=()=>a===e.derivedVersion&&o?o:(a=e.derivedVersion,o=Ine(e),o),P=()=>e.activeCommandViewCacheBlockers===0,F=(e,t,n)=>e.command===void 0||e.run?!0:typeof e.command==`string`?n.reachableByName.has(e.command)?!0:ne(e.command,t,`active`)!==void 0:!1,I=(e,t,n)=>{if(typeof e.command!=`string`)return;let r=n.reachableByName.get(e.command);return r?r.commandState.attrs:ne(e.command,t,`active`)?.attrs},L=(e,n)=>{if(n?.some(t=>t.command.name===e)||N().chainsByName.has(e))return`resolved`;let r=de(e,MD(t));return r.resolved||r.hadError?r.resolved?`resolved`:`error`:`unresolved`},R=(t,r)=>n.runWithStateChangeBatch(()=>{let a=t();return i.onCommandResolversChanged(),n.queueStateChange(),()=>{n.runWithStateChangeBatch(()=>{a(),!e.commandResolvers.values().includes(r)&&(i.onCommandResolversChanged(),n.queueStateChange())})}}),z=(e,t)=>{let n=M(t).reachableByName.get(e);return n?{target:n.layer.target,command:n.commandState.command,attrs:n.commandState.attrs}:ne(e,t,`active`)},ee=e=>te(e)?.[0],te=t=>{let n=[];for(let r of e.sortedLayers)for(let e of r.commands)e.command.name===t&&n.push({layer:r,commandState:e});return n.length>0?n:void 0},B=e=>{if(e?.length)return e.map(e=>({target:e.layer.target,command:e.commandState.command,attrs:e.commandState.attrs}))},ne=(e,t,n)=>de(e,t,{mode:n}).resolved,re=()=>N().entries,V=()=>{if(p===e.derivedVersion&&m)return m;let t=new Map;for(let n of e.layers)for(let e of n.bindings){if(typeof e.command!=`string`)continue;let n=t.get(e.command);n?n.push(e):t.set(e.command,[e])}return p=e.derivedVersion,m=t,t},ie=e=>{let n=e?.visibility??`reachable`,r=e&&Object.prototype.hasOwnProperty.call(e,`focused`)?e.focused??null:MD(t);return n===`registered`?{visibility:n,focused:r}:{visibility:n,focused:r,activeView:M(r)}},ae=(e,t=ie(e))=>{let r;return r=t.visibility===`registered`?re():t.visibility===`active`?t.activeView?.entries??[]:t.activeView?.reachable??[],Jne({entries:r,query:e,getCommand:e=>EO(e),onFilterError:e=>{n.emitError(`command-query-filter-error`,e,`[Keymap] Error in command query filter:`)}})},oe=(e,t,n)=>{se(n,n=>{ce(e,t,n)})},H=(e,t)=>{if(t.visibility===`registered`){let t=V();for(let[n,r]of e){let e=N().chainsByName.get(n)?.[0]?.commandState.attrs;for(let i of t.get(n)??[])r.push(U(i,e))}return}se(t,n=>{le(e,n,t)})},se=(t,n)=>{if(t.visibility===`registered`){for(let t of e.layers)for(let e of t.bindings)n(e);return}let i=t.activeView;if(i){for(let e of i.layers)if(!(e.bindings.length===0||!r.matchesConditions(e)))for(let a of e.bindings)r.matchesConditions(a)&&F(a,t.focused,i)&&n(a)}},ce=(e,t,n)=>{if(typeof n.command!=`string`)return;let r=t.get(n.command);if(!(!r||r.length===0))for(let t of r){let r=e[t];r&&r.bindings.push(U(n,r.commandAttrs))}},le=(e,t,n)=>{if(typeof t.command!=`string`)return;let r=e.get(t.command);r&&r.push(U(t,ue(t,n)))},U=(e,t)=>({sequence:e.sequence,command:e.command,commandAttrs:t,attrs:e.attrs,event:e.event,preventDefault:e.preventDefault,fallthrough:e.fallthrough}),ue=(e,t)=>{if(typeof e.command!=`string`)return;if(t.visibility===`registered`)return N().chainsByName.get(e.command)?.[0]?.commandState.attrs;let n=t.activeView;if(n)return I(e,t.focused,n)},de=(t,r,i)=>{let a=i?.mode??`active`,o=i?.execution??{input:t},s=Gne(t,e.commandResolvers.values(),()=>me(r,a,o),e=>{n.emitError(`command-resolver-error`,e,`[Keymap] Error in command resolver for "${t}":`)}),c=s.resolved;if(c){let e=pe(c.command.name,r,a);e?.commandState.command===c.command&&c.target===void 0&&(c={...c,target:e.layer.target},s.resolved=c)}if(c&&!c.attrs){let e=fe(c.command.name,r,a)??qne(c.command);e&&(s.resolved={...c,attrs:e})}return s},fe=(e,t,n)=>n===`registered`?ee(e)?.commandState.attrs:M(t).reachableByName.get(e)?.commandState.attrs,pe=(e,t,n)=>n===`registered`?ee(e):M(t).reachableByName.get(e),me=(e,t,n)=>{let r=n.input,i=n.payload;return{context:{get input(){return r},get payload(){return i},setInput(e){r=e},setPayload(e){i=e},getCommand:n=>t===`registered`?A(n):k(n,e)},getExecutionFields(){return{input:r,payload:i}}}};return{normalizeCommands:_,prependCommandResolver:v,appendCommandResolver:y,clearCommandResolvers:b,getCommands:x,getCommandEntries:S,getCommandBindings:C,getResolvedCommandChain:w,getRegisteredResolvedEntries:T,getActiveRegisteredResolvedEntries:E,resolveRegisteredResolverFallback:D,resolveActiveResolverFallback:O,getTopCommand:k,getDispatchUnavailableCommandState:j,getActiveCommandView:M,isBindingVisible:F,getBindingCommandAttrs:I,getCommandResolutionStatus:L}}function EO(e){return e.command}function Wne(e){let t=[],n=new Set;for(let r of e.commands)try{let i={},a=[],o=Fne(r.name),s=DO(r),c={};if(n.has(o)){e.onError(`duplicate-command`,{command:o},`Duplicate keymap command "${o}" in the same layer`);continue}r.name=o;for(let[t,n]of Object.entries(s)){if(n===void 0)continue;let r=e.commandFields.get(t);r&&r(n,bO({fieldName:t,conditions:e.conditions,requirements:i,matchers:a,attrs:c}))}let l={command:r,fields:s,attrs:Object.keys(c).length===0?void 0:c,requires:Object.entries(i),matchers:a};n.add(l.command.name),t.push(l)}catch(t){e.onError(`register-command-failed`,t,xO(t,`Failed to register keymap command "${String(r.name)}"`));continue}return t}function Gne(e,t,n,r){if(t.length===0)return{hadError:!1};let i=!1;for(let a of t){let t,o=n();try{t=a(e,o.context)}catch(e){i=!0,r(e);continue}if(t)return{hadError:i,resolved:Kne(t,o.getExecutionFields())}}return{hadError:i}}function DO(e){let t={};for(let[n,r]of Object.entries(e))!hO.has(n)&&r!==void 0&&(t[n]=r);return Object.keys(t).length===0?wO:t}function Kne(e,t){return{command:e,input:t.input,payload:t.payload}}function qne(e){let t=DO(e);return t===wO?void 0:t}function Jne(e){let t=e.query?.namespace,n=Yne(e.query?.limit);if(n===0)return[];let r=e.query?.search?.trim().toLowerCase()??``,i=Hne;e.query?.searchIn&&e.query.searchIn.length>0&&(i=e.query.searchIn);let a=e.query?.filter,o,s,c;if(typeof a==`function`)s=a;else if(a){let e=Object.entries(a),t=[];for(let[n,r]of e){if(n===`name`){if(typeof r==`string`){c=new Set([r]);continue}if(Array.isArray(r)){let e=new Set;for(let t of r)typeof t==`string`&&e.add(t);c=e;continue}}t.push([n,r])}o=t.length>0?t:void 0}let l=[];for(let a of e.entries){let u=a.commandState;if(Zne(u,t)&&Xne(u,r,i)&&!(c&&!c.has(u.command.name))&&Qne(u,o,e)){if(s){let t=!1;try{t=s(e.getCommand(u))}catch(t){e.onFilterError(t);continue}if(!t)continue}if(l.push(a),n!==void 0&&l.length>=n)break}}return l}function Yne(e){if(e===void 0)return;let t=Math.floor(Number(e));return!Number.isFinite(t)||t<=0?0:t}function Xne(e,t,n){if(!t)return!0;for(let r of n)if($ne(e,r,t))return!0;return!1}function Zne(e,t){if(t===void 0)return!0;let n=e.fields;return Object.prototype.hasOwnProperty.call(n,`namespace`)?AO(n.namespace,t):!1}function Qne(e,t,n){if(!t)return!0;for(let[r,i]of t)if(!tre(e,r,i,n))return!1;return!0}function $ne(e,t,n){return ere(e,t)?.includes(n)===!0}function ere(e,t){let n=TO.get(e);if(n||(n=new Map,TO.set(e,n)),n.has(t))return n.get(t);let r=e.fields,i=e.attrs,a;t===`name`?a=e.command.name:Object.prototype.hasOwnProperty.call(r,t)?a=r[t]:i&&Object.prototype.hasOwnProperty.call(i,t)&&(a=i[t]);let o=OO(a);return n.set(t,o),o}function OO(e){if(Array.isArray(e)){let t=[];for(let n of e){let e=OO(n);e!==void 0&&t.push(e)}return t.length>0?t.join(`\0`):void 0}if(typeof e==`string`)return e.toLowerCase();if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e).toLowerCase()}function kO(e,t,n,r){try{return e(t,n)}catch(e){return r(e),!1}}function tre(e,t,n,r){return typeof n==`function`?nre(e,t,n,r):rre(e,t,n)}function nre(e,t,n,r){let i=e.command,a=e.fields,o=e.attrs,s,c=!1,l=()=>s??=r.getCommand(e);return t===`name`&&(c=!0,kO(n,i.name,l(),r.onFilterError))||Object.prototype.hasOwnProperty.call(a,t)&&(c=!0,kO(n,a[t],l(),r.onFilterError))||o&&Object.prototype.hasOwnProperty.call(o,t)&&(c=!0,kO(n,o[t],l(),r.onFilterError))?!0:!c&&kO(n,void 0,l(),r.onFilterError)}function rre(e,t,n){let r=e.command,i=e.fields,a=e.attrs;return t===`name`&&AO(r.name,n)||Object.prototype.hasOwnProperty.call(i,t)&&AO(i[t],n)?!0:!!a&&Object.prototype.hasOwnProperty.call(a,t)&&AO(a[t],n)}function AO(e,t){return Array.isArray(t)?t.some(t=>jO(e,t)):jO(e,t)}function jO(e,t){return Array.isArray(e)?e.some(e=>jO(e,t)):Object.is(e,t)}function ire(e,t,n,r,i){let a=(e,t,n,r,a,o)=>({keymap:i.keymap,event:e,focused:t,target:n,data:r,input:a,payload:o}),o=(t,n,r,i)=>{let a=typeof n==`function`?void 0:n,o=typeof n==`function`?n:n.run,s=i?a:void 0,c;try{c=o(a?{...r,command:a}:r)}catch(n){return e.emitError(`command-execution-error`,n,`[Keymap] Error running command "${t}":`),{status:`error`,result:s?{ok:!1,reason:`error`,command:s}:{ok:!1,reason:`error`}}}if(SO(c))return c.catch(n=>{e.emitError(`async-command-error`,n,`[Keymap] Async error in command "${t}":`)}),{status:`handled`,result:s?{ok:!0,command:s}:{ok:!0}};if(are(c)){let e=c;return(!c.ok&&c.reason!==`not-found`&&i&&a&&!c.command||c.ok&&i&&a&&!c.command)&&(e={...c,command:a}),{status:c.ok?`handled`:`rejected`,result:e}}return c===!1?{status:`rejected`,result:s?{ok:!1,reason:`rejected`,command:s}:{ok:!1,reason:`rejected`}}:{status:`handled`,result:s?{ok:!0,command:s}:{ok:!0}}},s=(e,t,n,r,i,s,c,l)=>{let u;for(let d of t??[]){let t=o(e,d.command,a(n,r,i??d.target??null,s,e,c),l);if(t.status===`handled`||t.status===`error`)return[t.result,u];u=t.result}return[void 0,u]},c=(e,c,l)=>{let u;try{u=vO(e)}catch{return{ok:!1,reason:`invalid-args`}}if(typeof u!=`string`)return{ok:!1,reason:`not-found`};let d=c?.includeCommand===!0,f=c?.focused??n.getFocusedTargetIfAvailable(),p=c?.event??i.createCommandEvent(),m=t.getReadonlyData(),h=c?.payload,g=l===`registered`?r.getRegisteredResolvedEntries(u):r.getActiveRegisteredResolvedEntries(u,f),[_,v]=s(u,g,p,f,c?.target,m,h,d);if(_)return _;let y=v,b=l===`registered`?r.resolveRegisteredResolverFallback(u,{input:u,payload:h}):r.resolveActiveResolverFallback(u,f,{input:u,payload:h});if(b.resolved){let e=o(u,b.resolved.command,a(p,f,c?.target??b.resolved.target??null,m,b.resolved.input??u,b.resolved.payload),d);if(e.status===`handled`||e.status===`error`)return e.result;y=e.result}if(b.hadError)return{ok:!1,reason:`error`};if(l===`active`){let e=r.getDispatchUnavailableCommandState(u,f,d);if(e)return e.command?{ok:!1,reason:e.reason,command:e.command}:{ok:!1,reason:e.reason}}return y??{ok:!1,reason:`not-found`}};return{runCommand(e,t){return c(e,t,`registered`)},dispatchCommand(e,t){return c(e,t,`active`)},runBinding(e,n,i,s,c){let l=t.getReadonlyData();if(n.run)return o(typeof n.command==`string`?n.command:`<function>`,n.run,a(i,s,e.target??null,l,typeof n.command==`string`?n.command:`<function>`,c),!1).status!==`rejected`&&(MO(n,i),!0);if(typeof n.command!=`string`)return!1;let u=r.getResolvedCommandChain(n.command,s,c===void 0?void 0:{input:n.command,payload:c}).entries;for(let t of u??[])if(o(n.command,t.command,a(i,s,t.target??e.target??null,l,t.input??n.command,t.payload),!1).status!==`rejected`)return MO(n,i),!0;return!1}}}function are(e){return typeof e==`object`&&!!e&&`ok`in e}function MO(e,t){e.preventDefault&&(t.preventDefault(),t.stopPropagation())}var NO=Object.freeze({}),ore=[],sre=[];function cre(e){if(Object.keys(e).length!==0)return CO(e,{freeze:!0})}function lre(e,t,n,r){let i=t=>IO(t,e.bindingParsers.values(),{tokens:e.tokens,patterns:e.patterns,layer:NO,parseObjectKey:(e,t)=>c(e,t)}),a=t=>{if(typeof t!=`string`)return[c(t)];let n=FO(t,e.bindingParsers.values(),{tokens:e.tokens,patterns:e.patterns,layer:NO,parseObjectKey:(e,t)=>c(e,t)});for(let e of n.unknownTokens)r.warnUnknownToken(e,t);return n.unknownTokens.length>0?[]:n.parts},o=(e,t)=>OD(a(e),t),s=(i,a,o,s,d)=>{let f=[],p=!1,m=e.bindingExpanders.values(),h=e.bindingParsers.values(),g=e.bindingFields,_=e.disambiguationResolvers.has(),v=r.warnUnknownField,y=r.warnUnknownToken;for(let[r,b]of i.entries()){let i;try{i=dre(b.key,m,{layer:d})}catch(e){t.emitError(`binding-expand-error`,e,xO(e,`Failed to expand keymap binding`));continue}for(let m of i){let i=m.key,x;try{x=typeof i==`string`?FO(i,h,{tokens:a,patterns:e.patterns,layer:d,parseObjectKey:(e,t)=>c(e,t)}):{parts:[c(i)],usedTokens:[],unknownTokens:[],hasTokenBindings:!1},x=fre(x,m)}catch(e){t.emitError(`binding-parse-error`,e,xO(e,`Failed to parse keymap binding`));continue}let S=x.parts;p||=x.hasTokenBindings;for(let e of x.unknownTokens)y(e,typeof i==`string`?i:String(i.name));if(!(x.unknownTokens.length>0))for(let i of u(b,S,a,h,d))try{let t=l(i.event),a=i.sequence,c={},u={},d=[];for(let e in i){if(e===`sequence`||gO.has(e))continue;let t=i[e];if(t===void 0)continue;let r=g.get(e);if(!r){v(`binding`,e);continue}r(t,bO({fieldName:e,conditions:n,requirements:c,matchers:d,attrs:u}))}let p=Object.keys(u).length>0?cre(u):void 0,m=vO(i.cmd),h={binding:b,sequence:a,command:m,event:t,parsedBinding:rO(i),sourceTarget:o,sourceLayerOrder:s,bindingIndex:r,requires:Object.keys(c).length>0?Object.entries(c):ore,matchers:d.length>0?d:sre,preventDefault:i.preventDefault!==!1,fallthrough:i.fallthrough??!1};if(p&&(h.attrs=p),typeof m==`function`&&(h.run=m),a.length===0)continue;if(t===`release`&&a.length>1)throw Error(`Keymap release bindings only support a single key stroke`);let y=a.at(-1);if(y?.patternName){let t=e.patterns.get(y.patternName);if(t&&t.max!==t.min)throw Error(`Keymap unbounded sequence patterns must be followed by a concrete continuation`)}t===`press`&&!_&&ure(f,h),f.push(h)}catch(e){t.emitError(`binding-compile-error`,e,xO(e,`Failed to compile keymap binding`))}}}return{bindings:f,hasTokenBindings:p}},c=(e,t)=>xD(e,t),l=e=>{if(e===void 0||e===`press`)return`press`;if(e===`release`)return`release`;throw Error(`Invalid keymap binding event "${String(e)}": expected "press" or "release"`)},u=(n,r,i,a,o)=>{let s=e.bindingTransformers.values();if(s.length===0)return[{...n,sequence:CD(r)}];let l={...n,sequence:CD(r)},u=[],d=!0,f=o??NO;for(let n of s)try{n(l,{layer:f,parseKey:t=>IO(t,a,{tokens:i,patterns:e.patterns,layer:f,parseObjectKey:(e,t)=>c(e,t)}),add:e=>{u.push(rO(e))},skipOriginal:()=>{d=!1}})}catch(e){t.emitError(`binding-transformer-error`,e,`[Keymap] Error in binding transformer:`)}return d?u.length===0?[l]:[l,...u]:u};return{parseTokenKey:i,parseKeySequence:a,formatKey:o,compileBindings:s}}function PO(e,t){if(e.length>=t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]?.match!==t[n]?.match)return!1;return!0}function ure(e,t){for(let n of e)if(n.event===`press`&&(n.command!==void 0&&PO(n.sequence,t.sequence)||t.command!==void 0&&PO(t.sequence,n.sequence)))throw Error(`Keymap bindings cannot use the same sequence as both an exact match and a prefix in the same layer`)}function dre(e,t,n){if(typeof e!=`string`||t.length===0)return[{key:e}];let r=n?.layer??NO,i=[{key:e}];for(let e of t){let t=[];for(let n of i){let i=e({input:n.key,displays:n.displays,layer:r});if(!i){t.push(n);continue}if(i.length===0)throw Error(`Keymap binding expander must return at least one key sequence for "${n.key}"`);for(let e of i){if(!e||typeof e!=`object`||Array.isArray(e)||typeof e.key!=`string`)throw Error(`Keymap binding expander must return expansion objects with string keys for "${n.key}"`);if(e.displays!==void 0){if(!Array.isArray(e.displays))throw Error(`Keymap binding expander displays must be an array of strings for "${n.key}"`);for(let t of e.displays)if(typeof t!=`string`)throw Error(`Keymap binding expander displays must be an array of strings for "${n.key}"`)}t.push(e)}}i=t}return i}function fre(e,t){if(!t.displays)return e;if(t.displays.length!==e.parts.length)throw Error(`Keymap binding expansion displays length must match parsed sequence length for "${String(t.key)}"`);return{...e,parts:e.parts.map((e,n)=>({...e,display:t.displays[n]}))}}function FO(e,t,n){if(e.length===0)throw Error(`Invalid key sequence: sequence cannot be empty`);if(t.length===0)throw Error(`No keymap binding parsers are registered`);let r=n.tokens??new Map,i=n.patterns??new Map,a=n.layer??NO,o=n.parseObjectKey,s=[],c=new Set,l=new Set,u=0;for(;u<e.length;){let n=!1;for(let d of t){let t=d({input:e,index:u,layer:a,tokens:r,patterns:i,normalizeTokenName:_D,createMatch:ED,parseObjectKey:o});if(t){if(t.nextIndex<=u||t.nextIndex>e.length)throw Error(`Keymap binding parser must advance the input for "${e}" at index ${u}`);s.push(...t.parts);for(let e of t.usedTokens??[])c.add(e);for(let e of t.unknownTokens??[])l.add(e);u=t.nextIndex,n=!0;break}}if(!n)throw Error(`No keymap binding parser handled input at index ${u} in "${e}"`)}return{parts:s,usedTokens:[...c],unknownTokens:[...l],hasTokenBindings:c.size>0||l.size>0}}function IO(e,t,n){if(typeof e!=`string`)return n.parseObjectKey(e);let{parts:r}=FO(e,t,n),[i]=r;if(!i||r.length!==1)throw Error(`Invalid key "${String(e)}": expected a single key stroke`);return i}function pre(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.get==`function`&&typeof t.subscribe==`function`}function mre(e,t){let n=e=>e.requires.length===0&&e.matchers.length===0,r=e=>{try{return e.match()}catch(n){return t.emitError(`runtime-matcher-error`,n,`[Keymap] Error evaluating runtime matcher from ${e.source}:`),!1}},i=e=>{if(e.matchers.length===0)return!0;if(e.matchers.length===1){let[t]=e.matchers;return!t||r(t)}for(let t of e.matchers)if(!r(t))return!1;return!0},a=t=>{if(t.length===0)return!0;for(let[n,r]of t)if(!Object.is(e.data[n],r))return!1;return!0};return{buildRuntimeMatcher(e,t){if(typeof e==`function`)return{source:t,match:e};if(pre(e))return{source:t,match:()=>e.get(),subscribe:t=>e.subscribe(t)};throw Error(`Keymap ${t} expected a function or a reactive matcher`)},matchesConditions:e=>n(e)||a(e.requires)&&i(e)}}var LO=Symbol(`keymap-disambiguation-decision`),RO=Symbol(`keymap-deferred-disambiguation-decision`);function zO(e,t){return{[LO]:!0,action:e,handler:t}}function BO(e){return{[RO]:!0,action:e}}function hre(e){return!!e&&typeof e==`object`&&e[LO]===!0}function gre(e){return!!e&&typeof e==`object`&&e[RO]===!0}function _re(e,t){return t.aborted?Promise.resolve(!1):new Promise(n=>{let r=setTimeout(()=>{t.removeEventListener(`abort`,i),n(!0)},Math.max(0,e)),i=()=>{clearTimeout(r),t.removeEventListener(`abort`,i),n(!1)};t.addEventListener(`abort`,i,{once:!0})})}function vre(e,t,n,r){let i=e.get(n);if(i)try{return i.matcher(r)}catch(e){t.emitError(`sequence-pattern-match-error`,e,`[Keymap] Error matching sequence pattern "${i.name}":`);return}}function yre(e,t,n,r){let i=e.get(n)?.payloadKey??n;return{...xD({name:t.name,ctrl:t.ctrl,shift:t.shift,meta:t.meta,super:t.super??!1,hyper:t.hyper||void 0},{display:r.display??String(r.value??t.name)}),patternName:n,payloadKey:i}}function bre(e,t,n){if(!n?.patterns||n.patterns.length===0)return;let r={},i=!1;for(let a of n.patterns){let n=e.get(a.name),o;try{o=n?.finalize?n.finalize(a.values):a.values.length===1?a.values[0]:[...a.values]}catch(e){t.emitError(`sequence-pattern-finalize-error`,e,`[Keymap] Error finalizing sequence pattern "${a.name}":`);continue}let s=r[a.payloadKey];s===void 0?(r[a.payloadKey]=o,i=!0):Array.isArray(s)?s.push(o):r[a.payloadKey]=[s,o]}return i?r:void 0}function xre(e,t,n,r,i,a,o,s,c,l){let u={resolveKey:e=>o.parseTokenKey(e).match},d=null,f=0;function p(t,n,r){if(t===`key`){let t=r;return e.keyHooks.register(n,{priority:t?.priority??0,release:t?.release??!1})}if(t===`key:after`){let t=r;return e.keyAfterHooks.register(n,{priority:t?.priority??0,release:t?.release??!1})}let i=r;return e.rawHooks.register(n,{priority:i?.priority??0})}function m(t){return e.eventMatchResolvers.prepend(t)}function h(t){return e.eventMatchResolvers.append(t)}function g(){e.eventMatchResolvers.clear()}function _(t){return L(()=>e.disambiguationResolvers.prepend(t),t)}function v(t){return L(()=>e.disambiguationResolvers.append(t),t)}function y(){e.disambiguationResolvers.has()&&t.runWithStateChangeBatch(()=>{e.disambiguationResolvers.clear(),c.recompileBindings()})}function b(e,t){d&&U()}function x(n){let r=e.rawHooks.entries();if(r.length===0)return!1;let i=!1,a={sequence:n,stop(){i=!0}};for(let e of r){try{e.listener(a)}catch(e){t.emitError(`raw-intercept-error`,e,`[Keymap] Error in raw intercept listener:`)}if(i)return!0}return!1}function S(e,t){return{sequence:CD(e.sequence),command:e.command,commandAttrs:s.getBindingCommandAttrs(e,t,s.getActiveCommandView(t)),attrs:e.attrs,event:e.event,preventDefault:e.preventDefault,fallthrough:e.fallthrough,sourceLayerOrder:e.sourceLayerOrder,bindingIndex:e.bindingIndex}}function C(e){l.has(`dispatch`)&&l.emit(`dispatch`,e)}function w(e,t,n,r){l.has(`dispatch`)&&C({phase:e,event:n.event,focused:r,layer:{order:t.order,priority:t.priority,target:t.target,targetMode:t.targetMode},binding:S(n,r),sequence:CD(n.sequence),command:n.command})}function T(e,t,n){if(!l.has(`dispatch`))return;let i=t[0],a=t.length>0?r.collectSequencePartsFromPending({captures:t}):[];C({phase:e,event:`press`,focused:n,layer:i?{order:i.layer.order,priority:i.layer.priority,target:i.layer.target,targetMode:i.layer.targetMode}:void 0,sequence:a})}function E(t){let n=e.keyAfterHooks.entries();for(let e of n)if(e.release===t)return n}function D(e){return e.sequence?CD(e.sequence):e.captures?r.collectSequencePartsFromPending({captures:e.captures}):[]}function O(e,t){return{handled:e!==`sequence-miss`,reason:e,captures:t}}function k(e,t){return{handled:t,reason:t?`binding-handled`:`binding-rejected`,sequence:e.sequence}}function A(e,t){return t.handled||e.reason===`no-match`?t:e}function j(e,i,a,o,s){let c={event:i,eventType:a?`release`:`press`,focused:o,handled:s.handled,reason:s.reason,sequence:D(s),pendingSequence:r.getPendingSequence(),setData:(e,t)=>{n.setData(e,t)},getData:e=>n.getData(e),consume:e=>{let t=e?.preventDefault??!0,n=e?.stopPropagation??!0;t&&i.preventDefault(),n&&i.stopPropagation()}};for(let n of e)if(n.release===a)try{n.listener(c)}catch(e){t.emitError(`key-after-intercept-error`,e,`[Keymap] Error in key:after intercept listener:`)}}function M(){return{handled:!1,reason:`no-match`}}function N(e){e.preventDefault(),e.stopPropagation()}function P(e,t,n,i){r.setPendingSequence({captures:t});let a=O(`sequence-pending`,t);return T(e,t,n),N(i),a}function F(e,t,n,i){let a=O(e,t);return T(`sequence-clear`,t,n),r.setPendingSequence(null),N(i),a}function I(i,a){a||U();let o=E(a),s=o?r.getFocusedTarget():null,c=e.keyHooks.entries(),l={event:i,setData:(e,t)=>{n.setData(e,t)},getData:e=>n.getData(e),consume:e=>{let t=e?.preventDefault??!0,n=e?.stopPropagation??!0;t&&i.preventDefault(),n&&i.stopPropagation()}};for(let e of c)if(e.release===a){try{e.listener(l)}catch(e){t.emitError(`key-intercept-error`,e,`[Keymap] Error in key intercept listener:`)}if(i.propagationStopped){o&&j(o,i,a,s,{handled:!0,reason:`intercept-consumed`,sequence:[]});return}}if(a){let e=R(i);o&&j(o,i,a,s,e);return}let u=z(i);o&&j(o,i,a,s,u)}function L(n,r){return t.runWithStateChangeBatch(()=>{let i=e.disambiguationResolvers.has(),a=n();return!i&&e.disambiguationResolvers.has()&&c.recompileBindings(),()=>{t.runWithStateChangeBatch(()=>{let t=e.disambiguationResolvers.has();a(),!e.disambiguationResolvers.values().includes(r)&&t&&!e.disambiguationResolvers.has()&&c.recompileBindings()})}})}function R(e){let t=r.getFocusedTarget(),n=r.getActiveLayers(t),a=he(e),o=M();for(let r of a)layerLoop:for(let a of n){if(a.bindings.length===0||!i.matchesConditions(a))continue;let n=ge(a,r,e,t);if(o=A(o,n.outcome),n.handled){if(n.stop)return o;continue layerLoop}}return o}function z(e){let t=r.getFocusedTarget(),n=r.ensureValidPendingSequence(),i=he(e);if(n)return ee(n,i,e,t);let a=r.getActiveLayers(t),o=M();for(let n of i){let r=B(a,[n],e,t);if(o=A(o,r),r.handled)return o}return o}function ee(t,n,i,a){let o=s.getActiveCommandView(a),c=[];for(let r of t.captures){let t=JD(r,n,i,e.patterns,_e,ve);t&&c.push(t)}let l=c.reduce((e,t)=>Math.min(e,KD(t,n)),1/0),u=c.filter(e=>KD(e,n)===l);if(u.length===0||!u.some(e=>Se(e,a,o))){let e=O(`sequence-miss`,t.captures);return T(`sequence-clear`,t.captures,a),r.setPendingSequence(null),e}return te(u,0,!1,i,a)}function te(t,n,i,a,o){let s=i,c=M(),l=new Set;for(let i=n;i<t.length;i+=1){let n=t[i];if(!n||l.has(n))continue;let u=pe(t,i,n);if(u.length>0){if(s)continue;let e=me(t,n);return V(t,i,u,e,a,o,s)||P(`sequence-advance`,u,o,a)}if(!VD(n,e.patterns))continue;let d=me(t,n);for(let e of d)l.add(e);let f=Ce(n.layer,d,a,o);if(c=A(c,f.outcome),f.handled&&(s=!0,f.stop))return T(`sequence-clear`,t,o),r.setPendingSequence(null),c}return T(`sequence-clear`,t,o),r.setPendingSequence(null),c}function B(e,t,n,r){return ne(e,0,t,n,r)}function ne(t,n,r,a,o){let c=s.getActiveCommandView(o),l=M();for(let s=n;s<t.length;s+=1){let n=t[s];if(!n||!i.matchesConditions(n))continue;let u=ye(n,r,a,o,c);if(u.length===0)continue;if(u.filter(t=>BD(t,e.patterns,!1)).length>0){let n=u.filter(t=>VD(t,e.patterns)),i=fe(t,s,r,a,o);return re(t,s,r,i,n,a,o)||P(`sequence-start`,i,o,a)}let d=Ce(n,u.filter(t=>VD(t,e.patterns)),a,o);if(l=A(l,d.outcome),d.handled&&d.stop)return l}return l}function re(e,t,n,i,a,o,s){return ie({event:o,focused:s,continuationCaptures:i,exactBindingsSource:a.map(e=>e.binding),sequencePhase:`sequence-start`,runExact:()=>{r.setPendingSequence(null);let i=a[0]?.layer;if(!i)return M();let c=Ce(i,a,o,s);return c.stop?c.outcome:A(c.outcome,ne(e,t+1,n,o,s))}})}function V(e,t,n,i,a,o,s){return ie({event:a,focused:o,continuationCaptures:n,exactBindingsSource:i.map(e=>e.binding),sequencePhase:`sequence-advance`,runExact:()=>{r.setPendingSequence(null);let n=i[0]?.layer;if(!n)return M();let c=Ce(n,i,a,o);return c.stop?c.outcome:A(c.outcome,te(e,t+1,s||c.handled,a,o))}})}function ie(t){let{event:n,focused:i,continuationCaptures:a,exactBindingsSource:o,sequencePhase:c,runExact:l}=t;if(!e.disambiguationResolvers.has()||a.length===0)return;let u=s.getActiveCommandView(i),d=r.collectMatchingBindings(o,i,u);if(!d.some(e=>e.command!==void 0))return;let f=()=>P(c,a,i,n),p=()=>F(`sequence-cleared`,a,i,n),m,h=()=>(m??=r.collectSequencePartsFromPending({captures:a}),m),g=oe({event:n,focused:i,getSequence:h,exactBindings:d,continuationCaptures:a,activeView:u});return g?ae(g,a,l,f,p,i,h):(de(h()),f())}function ae(e,t,n,r,i,a,o){if(e.action===`run-exact`)return n();if(e.action===`continue-sequence`)return r();if(e.action===`clear`)return i();let s=r();return H(t,e.handler,a,o(),e=>{if(e){if(e.action===`run-exact`){n();return}if(e.action===`continue-sequence`){r();return}i()}}),s}function oe(i){let a,o,s,c,l={event:i.event,focused:i.focused,get sequence(){return a??=CD(i.getSequence()),a},get stroke(){let e=i.getSequence().at(-1);if(!e)throw Error(`Disambiguation context expected a non-empty sequence`);return c??={...e,stroke:bD(e.stroke)},c},get exact(){return o??=r.collectActiveBindings(i.exactBindings,i.focused,i.activeView).map(e=>({...e,sequence:CD(e.sequence)})),o},get continuations(){return s??=r.getActiveKeysForCaptures(i.continuationCaptures,{includeBindings:!0,includeMetadata:!0}),s},getData:e=>n.getData(e),setData:(e,t)=>{n.setData(e,t)},runExact:()=>zO(`run-exact`),continueSequence:()=>zO(`continue-sequence`),clear:()=>zO(`clear`),defer:e=>zO(`defer`,e)};for(let n of e.disambiguationResolvers.values()){let e;try{e=n(l)}catch(e){t.emitError(`disambiguation-resolver-error`,e,`[Keymap] Error in disambiguation resolver:`);continue}if(e!==void 0){if(SO(e)){t.emitError(`invalid-disambiguation-resolver-return`,e,`[Keymap] Disambiguation resolvers must return synchronously; use ctx.defer(...) for async handling`);continue}if(!hre(e)){t.emitError(`invalid-disambiguation-decision`,e,`[Keymap] Invalid disambiguation decision returned by resolver:`);continue}return e}}}function H(e,t,n,r,i){U();let a=new AbortController,o={id:f++,controller:a,captures:e,apply:i};d=o,queueMicrotask(()=>{se(o,t,n,r)})}function se(e,n,r,i){if(!ue(e))return;let a={signal:e.controller.signal,sequence:CD(i),focused:r,sleep:t=>_re(t,e.controller.signal),runExact:()=>BO(`run-exact`),continueSequence:()=>BO(`continue-sequence`),clear:()=>BO(`clear`)},o;try{o=n(a)}catch(n){ue(e)&&(t.emitError(`deferred-disambiguation-error`,n,`[Keymap] Error in deferred disambiguation handler:`),le(e));return}if(SO(o)){o.then(t=>{ce(e,t)}).catch(n=>{ue(e)&&(t.emitError(`deferred-disambiguation-error`,n,`[Keymap] Error in deferred disambiguation handler:`),le(e))});return}ce(e,o)}function ce(e,n){if(ue(e)){if(n!==void 0&&!gre(n)){t.emitError(`invalid-deferred-disambiguation-decision`,n,`[Keymap] Invalid deferred disambiguation decision returned by handler:`),le(e);return}le(e),e.apply(n)}}function le(e){ue(e)&&(d=null)}function U(){let e=d;e&&(d=null,e.controller.abort())}function ue(e){return d===e}function de(e){let n=OD(e,{preferDisplay:!0});t.warnOnce(`unresolved-disambiguation:${n}`,`unresolved-disambiguation`,{sequence:n},`[Keymap] Ambiguous exact/prefix sequence "${n}" fell back to prefix handling because no disambiguation resolver resolved it`)}function fe(t,n,r,a,o){let c=[],l=s.getActiveCommandView(o);for(let s=n;s<t.length;s+=1){let n=t[s];if(n&&i.matchesConditions(n))for(let t of ye(n,r,a,o,l))BD(t,e.patterns,!1)&&c.push(t)}return c}function pe(t,n,r){return t.filter((t,i)=>i>=n&&BD(t,e.patterns,!1)&&VO(t.parts,r.parts))}function me(t,n){return t.filter(t=>t.layer===n.layer&&VD(t,e.patterns)&&VO(t.parts,n.parts))}function he(n){let r=e.eventMatchResolvers.values();if(r.length===0)return[];if(r.length===1)return Sre(r[0],n,u,t);let i=[],a=new Set;for(let e of r){let r;try{r=e(n,u)}catch(e){t.emitError(`event-match-resolver-error`,e,`[Keymap] Error in event match resolver:`);continue}if(!(!r||r.length===0))for(let e of r){if(typeof e!=`string`){t.emitError(`invalid-event-match-resolver-candidate`,e,`[Keymap] Invalid event match resolver candidate:`);continue}a.has(e)||(a.add(e),i.push(e))}}return i}function ge(e,t,n,r){let o=!1,s=M();for(let c of e.bindings){if(c.event!==`release`)continue;let l=c.sequence[0];if(!l||l.match!==t||!i.matchesConditions(c))continue;let u=a.runBinding(e,c,n,r);if(s=A(s,k(c,u)),!u){w(`binding-reject`,e,c,r);continue}if(w(`binding-execute`,e,c,r),o=!0,!c.fallthrough)return{handled:!0,stop:!0,outcome:s}}return{handled:o,stop:!1,outcome:s}}function _e(n,r){return vre(e.patterns,t,n,r)}function ve(t,n,r){return yre(e.patterns,t,n,r)}function ye(e,t,n,r,i){let a=YD(e,t,n,_e,ve);return a.some(e=>Se(e,r,i))?a:[]}function be(n){return bre(e.patterns,t,n)}function xe(e,t,n){return i.matchesConditions(e)&&s.isBindingVisible(e,t,n)}function Se(e,t,n){return xe(e.binding,t,n)}function Ce(e,t,n,r){let o=!1,s=M();for(let c of t){let t=c.binding;if(!i.matchesConditions(t))continue;let l=a.runBinding(e,t,n,r,be(c));if(s=A(s,k(t,l)),!l){w(`binding-reject`,e,t,r);continue}if(w(`binding-execute`,e,t,r),o=!0,!t.fallthrough)return{handled:!0,stop:!0,outcome:s}}return{handled:o,stop:!1,outcome:s}}return{intercept:p,prependEventMatchResolver:m,appendEventMatchResolver:h,clearEventMatchResolvers:g,prependDisambiguationResolver:_,appendDisambiguationResolver:v,clearDisambiguationResolvers:y,handlePendingSequenceChange:b,handleRawSequence:x,handleKeyEvent:I}}function Sre(e,t,n,r){let i;try{i=e(t,n)}catch(e){return r.emitError(`event-match-resolver-error`,e,`[Keymap] Error in event match resolver:`),[]}if(!i||i.length===0)return[];if(i.length===1){let[e]=i;return typeof e==`string`?[e]:(r.emitError(`invalid-event-match-resolver-candidate`,e,`[Keymap] Invalid event match resolver candidate:`),[])}let a=[],o=new Set;for(let e of i){if(typeof e!=`string`){r.emitError(`invalid-event-match-resolver-candidate`,e,`[Keymap] Invalid event match resolver candidate:`);continue}o.has(e)||(o.add(e),a.push(e))}return a}function VO(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]?.match!==t[n]?.match)return!1;return!0}var HO=()=>{};function UO(e,t,n,r){if(n===void 0)return r;if(typeof n!=`number`||!Number.isInteger(n)||n<0)throw Error(`Keymap sequence pattern "${e}" ${t} must be a non-negative integer`);return n}function WO(e,t){let{kind:n,reservedFields:r,registeredFields:i,emitError:a}=t,o=Object.entries(e),s=[];for(let[e,t]of o){if(r.has(e)){a(`reserved-${n}-field`,{field:e,kind:n},`Keymap ${n} field "${e}" is reserved`);continue}if(i.has(e)){a(`duplicate-${n}-field`,{field:e,kind:n},`Keymap ${n} field "${e}" is already registered`);continue}i.set(e,t),s.push([e,t])}return()=>{for(let[e,t]of s)i.get(e)===t&&i.delete(e)}}function GO(e,t,n,r,i){let a;try{a=_D(i.name)}catch(e){return t.emitError(`token-name-normalize-error`,e,xO(e,`Failed to register keymap token`)),HO}if(e.tokens.has(a)||e.patterns.has(a))return t.emitError(`duplicate-token`,{token:a},`Keymap token "${a}" is already registered`),HO;let o;try{if(o=n.parseTokenKey(i.key),o.patternName)throw Error(`Invalid key "${String(i.key)}": expected a concrete key stroke`)}catch(e){return t.emitError(`token-parse-error`,e,xO(e,`Failed to register keymap token "${a}"`)),HO}let s={stroke:o.stroke,match:o.match},c=new Map(e.tokens);c.set(a,s);try{r.applyTokenState(c)}catch(e){return t.emitError(`token-register-error`,e,xO(e,`Failed to register keymap token "${a}"`)),HO}return()=>{if(e.tokens.get(a)!==s)return;let n=new Map(e.tokens);n.delete(a);try{r.applyTokenState(n)}catch(e){t.emitError(`token-unregister-error`,e,xO(e,`Failed to unregister keymap token "${a}"`))}}}function KO(e,t,n,r){let i,a;try{i=_D(r.name);let e=UO(i,`min`,r.min,1),t=UO(i,`max`,r.max,2**53-1);if(t<e)throw Error(`Keymap sequence pattern "${i}" max must be greater than or equal to min`);a={name:i,display:r.display,payloadKey:r.payloadKey??i,match:ED(`pattern:${i}`),min:e,max:t,matcher:e=>r.match(e),finalize:r.finalize}}catch(e){return t.emitError(`sequence-pattern-register-error`,e,xO(e,`Failed to register keymap sequence pattern`)),HO}return e.tokens.has(i)||e.patterns.has(i)?(t.emitError(`duplicate-sequence-pattern`,{pattern:i},`Keymap sequence pattern "${i}" is already registered`),HO):(e.patterns.set(i,a),n.recompileBindings(),()=>{e.patterns.get(i)===a&&(e.patterns.delete(i),n.recompileBindings())})}function qO(e,t,n,r){return WO(r,{kind:n,reservedFields:n===`layer`?_O:n===`binding`?gO:hO,registeredFields:n===`layer`?e.layerFields:n===`binding`?e.bindingFields:e.commandFields,emitError:(e,n,r)=>t.emitError(e,n,r)})}var JO=()=>{};function YO(e,t){return t.priority-e.priority||t.order-e.order}function XO(e){if(e.matchers.length>0)return!0;for(let t of e.commands)if(t.matchers.length>0)return!0;for(let t of e.bindings)if(t.matchers.length>0)return!0;return!1}function ZO(e){if(e.commands.length===0)return!1;if(e.matchers.length>0)return!0;for(let t of e.commands)if(t.matchers.length>0)return!0;return!1}function QO(e,t,n,r,i){let a=n=>t.runWithStateChangeBatch(()=>{let a=n.target;if(a&&i.host.isTargetDestroyed(a))return t.emitError(`destroyed-layer-target`,{target:a},`Cannot register a keymap layer for a destroyed keymap target`),JO;let o,s,c,p,m,v,y;try{y=l(n),o=u(nO(n.bindings??[]),n);let e=d(n.commands??[],n);v=e.length===0?[]:i.commands.normalizeCommands(e),{requires:s,matchers:c,fields:p,attrs:m}=f(n)}catch(e){return t.emitError(`register-layer-failed`,e,xO(e,`Failed to register keymap layer`)),JO}let b=e.order++,x=i.compiler.compileBindings(o,e.tokens,a,b,p);if(x.bindings.length===0&&!x.hasTokenBindings&&v.length===0)return JO;i.diagnostics?.analyzeLayer({target:a,order:b,commands:v,sourceBindings:o,bindings:x.bindings,hasTokenBindings:x.hasTokenBindings});let S={order:b,target:a,targetMode:y,priority:n.priority??0,requires:s,matchers:c,fields:p,attrs:m,commands:v,sourceBindings:o,bindings:x.bindings,root:UD(x.bindings,e.patterns),hasTokenBindings:x.hasTokenBindings,activeKeyCacheBlocked:!1,activeCommandViewCacheBlocked:!1};_(S),e.layers.add(S),e.sortedLayers=[...e.sortedLayers,S].sort(YO),g(S);for(let e of S.commands)g(e);for(let e of S.bindings)g(e);return a&&(S.offTargetDestroy=i.host.onTargetDestroy(a,()=>{h(S)})),S.commands.length>0&&r.ensureValidPendingSequence(),t.queueStateChange(),()=>{h(S)}}),o=n=>{t.runWithStateChangeBatch(()=>{let i=new Map;for(let t of e.layers)t.hasTokenBindings&&i.set(t,p(t,n));e.tokens=n;let a=!1;for(let[e,t]of i)m(e,t)&&(a=!0);a&&r.setPendingSequence(null),i.size>0&&t.queueStateChange()})},s=()=>{t.runWithStateChangeBatch(()=>{let n=0,i=!1;for(let t of e.layers){if(t.sourceBindings.length===0)continue;let r=p(t,e.tokens);m(t,r)&&(i=!0),n+=1}i&&r.setPendingSequence(null),n>0&&t.queueStateChange()})},c=()=>{for(let t of e.layers){y(t);for(let e of t.commands)y(e);for(let e of t.bindings)y(e);t.offTargetDestroy?.(),t.offTargetDestroy=void 0}},l=e=>{if(e.targetMode){if(!e.target)throw Error(`Keymap targetMode "${e.targetMode}" requires a target`);return e.targetMode}return e.target?`focus-within`:void 0},u=(t,n)=>{let r=e.layerBindingsTransformers.values();if(r.length===0)return t;let i=t;for(let e of r){let t=e(i,{layer:n,validateBindings:e=>tO(e)});t&&(i=nO(t))}return i},d=(n,r)=>{let i=e.commandTransformers.values();if(n.length===0||i.length===0)return n;let a=[];for(let e of n){let n={...e},o=[],s=!0;for(let e of i)try{e(n,{layer:r,add(e){o.push({...e})},skipOriginal(){s=!1}})}catch(e){t.emitError(`command-transformer-error`,e,`[Keymap] Error in command transformer:`)}s&&a.push(n),a.push(...o)}return a},f=t=>{let r={},a=[],o=Object.create(null),s={};for(let[c,l]of Object.entries(t)){if(_O.has(c)||l===void 0)continue;o[c]=CO(l);let t=e.layerFields.get(c);if(!t){i.warnUnknownField(`layer`,c);continue}t(l,bO({fieldName:c,conditions:n,requirements:r,matchers:a,attrs:s}))}return{requires:Object.entries(r),matchers:a,fields:Object.keys(o).length>0?Object.freeze(o):void 0,attrs:Object.keys(s).length>0?CO(s,{freeze:!0}):void 0}},p=(e,t)=>i.compiler.compileBindings(e.sourceBindings,t,e.target,e.order,e.fields),m=(t,n)=>{i.diagnostics?.analyzeLayer({target:t.target,order:t.order,commands:t.commands,sourceBindings:t.sourceBindings,bindings:n.bindings,hasTokenBindings:n.hasTokenBindings}),v(t);for(let e of t.bindings)y(e);t.bindings=n.bindings,t.root=UD(n.bindings,e.patterns),t.hasTokenBindings=n.hasTokenBindings,_(t);for(let e of t.bindings)g(e);return e.pending?.captures.some(e=>e.layer===t)??!1},h=n=>{t.runWithStateChangeBatch(()=>{if(e.layers.delete(n)){e.sortedLayers=e.sortedLayers.filter(e=>e!==n),v(n),y(n);for(let e of n.commands)y(e);for(let e of n.bindings)y(e);n.offTargetDestroy?.(),n.offTargetDestroy=void 0,e.pending?.captures.some(e=>e.layer===n)?r.setPendingSequence(null):n.commands.length>0&&!i.host.isDestroyed&&r.ensureValidPendingSequence(),t.queueStateChange()}})},g=e=>{for(let n of e.matchers)if(n.subscribe)try{n.dispose=n.subscribe(()=>{if(!r.hasPendingSequenceState()){t.queueStateChange();return}t.runWithStateChangeBatch(()=>{r.revalidatePendingSequenceIfNeeded(),t.queueStateChange()})})}catch(e){t.emitError(`reactive-matcher-subscribe-error`,e,xO(e,`Failed to subscribe to reactive matcher from ${n.source}`))}},_=t=>{let n=XO(t),r=ZO(t);t.activeKeyCacheBlocked=n,t.activeCommandViewCacheBlocked=r,n&&(e.activeKeyCacheBlockers+=1),r&&(e.activeCommandViewCacheBlockers+=1)},v=t=>{t.activeKeyCacheBlocked&&=(--e.activeKeyCacheBlockers,!1),t.activeCommandViewCacheBlocked&&=(--e.activeCommandViewCacheBlockers,!1)},y=e=>{for(let n of e.matchers)if(n.dispose){try{n.dispose()}catch(e){t.emitError(`reactive-matcher-dispose-error`,e,xO(e,`Failed to dispose reactive matcher from ${n.source}`))}n.dispose=void 0}};return{registerLayer:a,applyTokenState:o,recompileBindings:s,cleanup:c}}var $O=1e3;function ek(e,t,n){let r=(e,n,r)=>{if(!t.has(`warning`)){let t=`[${e}] ${r}`;n instanceof Error?console.warn(t,n):console.warn(t);return}t.emit(`warning`,{code:e,message:r,warning:n})},i=(e,n,r)=>{if(!t.has(`error`)){let t=`[${e}] ${r}`;n instanceof Error?console.error(t,n):console.error(t);return}t.emit(`error`,{code:e,message:r,error:n})},a=()=>{if(!(!e.stateChangePending||e.stateChangeDepth>0||e.flushingStateChange)){e.flushingStateChange=!0;try{let t=0;for(;e.stateChangePending&&e.stateChangeDepth===0;){if(t>=$O){e.stateChangePending=!1,i(`state-change-feedback-loop`,{iterations:$O},`[Keymap] Possible infinite state listener feedback loop detected after ${$O} iterations; pending state notifications were dropped`);break}t+=1,e.stateChangePending=!1,n.emit(`state`)}}finally{e.flushingStateChange=!1}}};return{runWithStateChangeBatch(t){e.stateChangeDepth+=1;try{return t()}finally{--e.stateChangeDepth,e.stateChangeDepth===0&&a()}},queueStateChange(t){e.derivedVersion+=1,t?.invalidateCaches!==!1&&(e.cacheVersion+=1),n.has(`state`)&&(e.stateChangePending=!0,e.stateChangeDepth===0&&!e.flushingStateChange&&a())},emitWarning:r,emitError:i,reportListenerError(e,t){if(e===`state`){i(`state-listener-error`,t,`[Keymap] Error in state listener:`);return}if(e===`pendingSequence`){i(`pending-sequence-listener-error`,t,`[Keymap] Error in pending sequence listener:`);return}e===`dispatch`&&i(`dispatch-listener-error`,t,`[Keymap] Error in dispatch listener:`)},warnOnce(t,n,i,a){e.usedWarningKeys.has(t)||(e.usedWarningKeys.add(t),r(n,i,a))}}}function tk(e,t,n){return{getData(t){return e.data[t]},setData(r,i){t.runWithStateChangeBatch(()=>{if(i===void 0){if(!(r in e.data))return;delete e.data[r],e.dataVersion+=1,n.ensureValidPendingSequence(),t.queueStateChange();return}Object.is(e.data[r],i)||(e.data[r]=i,e.dataVersion+=1,n.ensureValidPendingSequence(),t.queueStateChange())})},getReadonlyData(){return e.readonlyDataVersion===e.dataVersion?e.readonlyData:(e.readonlyData=Object.freeze({...e.data}),e.readonlyDataVersion=e.dataVersion,e.readonlyData)}}}var nk=Object.freeze({});function rk(){return{order:0,tokens:new Map,patterns:new Map,layerFields:new Map,layerBindingsTransformers:QD(),bindingExpanders:QD(),bindingParsers:QD(),bindingTransformers:QD(),bindingFields:new Map,commandTransformers:QD(),commandFields:new Map,eventMatchResolvers:QD(),disambiguationResolvers:QD(),keyHooks:$D(),keyAfterHooks:$D(),rawHooks:$D(),layers:new Set,sortedLayers:[],activeLayersCacheVersion:-1,activeLayersCacheFocused:void 0,activeLayersCache:[],activeKeyCacheBlockers:0,activeCommandViewCacheBlockers:0,commandResolvers:QD(),pending:null,data:{},dataVersion:0,readonlyDataVersion:-1,readonlyData:nk,cacheVersion:0,derivedVersion:0,stateChangeDepth:0,stateChangePending:!1,flushingStateChange:!1,usedWarningKeys:new Set}}function ik(e){return wD(e)}var ak=class{#e=rk();#t=!1;#n=new Map;#r=[];#i=XD(()=>{});#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;getPendingSequence;getActiveKeys;constructor(e){if(this.#b=e,e.isDestroyed)throw Error(`Cannot create a keymap for a destroyed host`);this.#a=XD((e,t)=>{this.#o.reportListenerError(e,t)}),this.#o=ek(this.#e,this.#i,this.#a),this.#l=mre(this.#e,this.#o),this.#u=Une(this.#e,this.#b,this.#o,this.#l,{onCommandResolversChanged:()=>{this.#s.ensureValidPendingSequence()}}),this.#s=Pne(this.#e,this.#b,this.#a,this.#o,this.#l,this.#u,{onPendingSequenceChanged:(e,t)=>{this.#p?.handlePendingSequenceChange(e,t)}}),this.#c=tk(this.#e,this.#o,this.#s),this.#d=ire(this.#o,this.#c,this.#s,this.#u,{keymap:this,createCommandEvent:()=>this.#b.createCommandEvent()}),this.#f=lre(this.#e,this.#o,this.#l,{warnUnknownField:(e,t)=>{this.#C(e,t)},warnUnknownToken:(e,t)=>{this.#w(e,t)}}),this.#h=iO(this.#o,this.#u),this.#m=QO(this.#e,this.#o,this.#l,this.#s,{compiler:this.#f,commands:this.#u,host:this.#b,diagnostics:this.#h,warnUnknownField:(e,t)=>{this.#C(e,t)}}),this.#p=xre(this.#e,this.#o,this.#c,this.#s,this.#l,this.#d,this.#f,this.#u,this.#m,this.#a),this.getPendingSequence=this.#s.getPendingSequence,this.getActiveKeys=this.#s.getActiveKeys,this.#g=e=>{this.#p.handleKeyEvent(e,!1)},this.#_=e=>{this.#p.handleKeyEvent(e,!0)},this.#v=e=>this.#p.handleRawSequence(e),this.#y=e=>{this.#S(e)},this.#r.push(this.#b.onKeyPress(this.#g)),this.#r.push(this.#b.onKeyRelease(this.#_)),this.#b.onRawInput&&this.#r.push(this.#b.onRawInput(this.#v)),this.#r.push(this.#b.onFocusChange(this.#y)),this.#b.onDestroy&&this.#r.push(this.#b.onDestroy(()=>{this.#x()}))}[jD](){return{state:this.#e,host:this.#b,conditions:this.#l,catalog:this.#u,activation:this.#s}}#x(){if(!this.#t){this.#t=!0,this.#s.setPendingSequence(null);for(let e of this.#n.values())e.dispose();this.#n.clear(),this.#m.cleanup();for(let e of this.#r.splice(0))e()}}setData(e,t){this.#c.setData(e,t)}getData(e){return this.#c.getData(e)}getHostMetadata(){return this.#b.metadata}hasPendingSequence(){return this.#s.ensureValidPendingSequence()!==void 0}createKeyMatcher(e){let t=this.#f.parseTokenKey(e).match;return e=>e?ik(e)===t:!1}parseKeySequence(e){return this.#f.parseKeySequence(e)}formatKey(e,t){return this.#f.formatKey(e,t)}clearPendingSequence(){this.#s.setPendingSequence(null)}popPendingSequence(){return this.#s.popPendingSequence()}getCommands(e){return this.#u.getCommands(e)}getCommandEntries(e){return this.#u.getCommandEntries(e)}getCommandBindings(e){return this.#u.getCommandBindings(e)}acquireResource(e,t){if(this.#t||this.#b.isDestroyed)throw Error(`Cannot use a keymap after its host was destroyed`);let n=this.#n.get(e);if(n)return n.count+=1,()=>{this.#T(e,n)};let r={count:1,dispose:t()};return this.#n.set(e,r),()=>{this.#T(e,r)}}runCommand(e,t){return this.#d.runCommand(e,t)}dispatchCommand(e,t){return this.#d.dispatchCommand(e,t)}on(e,t){return e===`warning`||e===`error`?this.#i.hook(e,t):this.#a.hook(e,t)}intercept(e,t,n){return this.#p.intercept(e,t,n)}registerLayer(e){return this.#m.registerLayer(e)}registerLayerFields(e){return qO(this.#e,this.#o,`layer`,e)}prependLayerBindingsTransformer(e){return this.#e.layerBindingsTransformers.prepend(e)}appendLayerBindingsTransformer(e){return this.#e.layerBindingsTransformers.append(e)}clearLayerBindingsTransformers(){this.#e.layerBindingsTransformers.clear()}prependBindingTransformer(e){return this.#e.bindingTransformers.prepend(e)}appendBindingTransformer(e){return this.#e.bindingTransformers.append(e)}clearBindingTransformers(){this.#e.bindingTransformers.clear()}prependCommandTransformer(e){return this.#e.commandTransformers.prepend(e)}appendCommandTransformer(e){return this.#e.commandTransformers.append(e)}clearCommandTransformers(){this.#e.commandTransformers.clear()}prependBindingParser(e){return this.#e.bindingParsers.prepend(e)}appendBindingParser(e){return this.#e.bindingParsers.append(e)}clearBindingParsers(){this.#e.bindingParsers.clear()}registerToken(e){return GO(this.#e,this.#o,this.#f,this.#m,e)}registerSequencePattern(e){return KO(this.#e,this.#o,this.#m,e)}prependBindingExpander(e){return this.#e.bindingExpanders.prepend(e)}appendBindingExpander(e){return this.#e.bindingExpanders.append(e)}clearBindingExpanders(){this.#e.bindingExpanders.clear()}registerBindingFields(e){return qO(this.#e,this.#o,`binding`,e)}registerCommandFields(e){return qO(this.#e,this.#o,`command`,e)}prependCommandResolver(e){return this.#u.prependCommandResolver(e)}appendCommandResolver(e){return this.#u.appendCommandResolver(e)}clearCommandResolvers(){this.#u.clearCommandResolvers()}prependLayerAnalyzer(e){return this.#h.prependLayerAnalyzer(e)}appendLayerAnalyzer(e){return this.#h.appendLayerAnalyzer(e)}clearLayerAnalyzers(){this.#h.clearLayerAnalyzers()}prependEventMatchResolver(e){return this.#p.prependEventMatchResolver(e)}appendEventMatchResolver(e){return this.#p.appendEventMatchResolver(e)}clearEventMatchResolvers(){this.#p.clearEventMatchResolvers()}prependDisambiguationResolver(e){return this.#p.prependDisambiguationResolver(e)}appendDisambiguationResolver(e){return this.#p.appendDisambiguationResolver(e)}clearDisambiguationResolvers(){this.#p.clearDisambiguationResolvers()}#S(e){this.#o.runWithStateChangeBatch(()=>{this.#s.setPendingSequence(null),this.#o.queueStateChange({invalidateCaches:!1})})}#C(e,t){this.#o.warnOnce(`${e}:${t}`,`unknown-${e}-field`,{field:t,kind:e},`[Keymap] Unknown ${e} field "${t}" was ignored`)}#w(e,t){this.#o.warnOnce(`token:${e}`,`unknown-token`,{token:e,sequence:t},`[Keymap] Unknown token "${e}" in key sequence "${t}"; binding was skipped until the token is registered`)}#T(e,t){this.#n.get(e)===t&&(--t.count,!(t.count>0)&&(t.dispose(),this.#n.delete(e)))}},ok=new Set(`up.down.left.right.clear.escape.return.linefeed.enter.tab.backspace.delete.insert.home.end.pageup.pagedown.space.lt.gt.plus.minus.equal.comma.period.slash.backslash.semicolon.quote.backquote.leftbracket.rightbracket.capslock.numlock.scrolllock.printscreen.pause.menu.apps.kp0.kp1.kp2.kp3.kp4.kp5.kp6.kp7.kp8.kp9.kpdecimal.kpdivide.kpmultiply.kpminus.kpplus.kpenter.kpequal.kpseparator.kpleft.kpright.kpup.kpdown.kppageup.kppagedown.kphome.kpend.kpinsert.kpdelete.mediaplay.mediapause.mediaplaypause.mediareverse.mediastop.mediafastforward.mediarewind.medianext.mediaprev.mediarecord.volumedown.volumeup.mute.leftshift.leftctrl.leftalt.leftsuper.lefthyper.leftmeta.rightshift.rightctrl.rightalt.rightsuper.righthyper.rightmeta.iso_level3_shift.iso_level5_shift.option.alt.meta.super.hyper.control.ctrl.shift`.split(`.`)),sk=new Set([`ctrl`,`control`,`shift`,`meta`,`alt`,`option`,`super`,`hyper`]),ck=uk(ok),lk=uk(sk);function uk(e){let t=new Map;for(let n of e){let e=n.charCodeAt(0);if(Number.isNaN(e))continue;let r=t.get(e);r||(r=[],t.set(e,r)),r.push(n)}for(let e of t.values())e.sort((e,t)=>t.length-e.length);return t}function dk(e){return e>=65&&e<=90?e+32:e}function fk(e){return e>=48&&e<=57}function pk(e,t,n){if(e.startsWith(t,n))return!0;if(n+t.length>e.length)return!1;for(let r=0;r<t.length;r+=1)if(dk(e.charCodeAt(n+r))!==t.charCodeAt(r))return!1;return!0}function mk(e,t,n){let r=t.charCodeAt(n);if(Number.isNaN(r))return;let i=e.get(dk(r));if(i){for(let e of i)if(pk(t,e,n))return e}}function hk(e,t,n,r,i){return e.parseObjectKey(t,{display:n,match:r,tokenName:i})}function gk(e,t){if(e===` `)return t.parseObjectKey({name:`space`},{display:`space`});if(e===`+`)return t.parseObjectKey({name:`+`},{display:`+`});let n=e.split(`+`),r=``,i=``,a=!1,o=!1,s=!1,c=!1,l=!1;for(let t of n){let n=t.trim();if(!n)continue;let u=n.toLowerCase();if(u===`ctrl`||u===`control`){a=!0;continue}if(u===`shift`){o=!0;continue}if(u===`meta`||u===`alt`||u===`option`){s=!0;continue}if(u===`super`){c=!0;continue}if(u===`hyper`){l=!0;continue}if(r)throw Error(`Invalid key "${e}": multiple key names are not supported`);r=n,i=u}if(!r)throw Error(`Invalid key "${e}": missing key name`);let u=[];return a&&u.push(`ctrl`),o&&u.push(`shift`),s&&u.push(`meta`),c&&u.push(`super`),l&&u.push(`hyper`),u.push(i),t.parseObjectKey({name:r,ctrl:a,shift:o,meta:s,super:c,hyper:l||void 0},{display:u.join(`+`)})}function _k(e,t){let n=e.trim().toLowerCase();return t.parseObjectKey({name:n},{display:n})}function vk(e,t){let n=mk(ck,e,t);if(n)return n;if(dk(e.charCodeAt(t))!==102||!fk(e.charCodeAt(t+1)))return;let r=fk(e.charCodeAt(t+2))?t+3:t+2;return e.slice(t,r).toLowerCase()}function yk(e,t){return mk(lk,e,t)}function bk(e,t,n){let r=t,i=!1,a=!1,o=!1,s=!1,c=!1;for(;r<e.length;){let t=yk(e,r);if(!t)break;let n=r+t.length;if(e[n]!==`+`)break;t===`ctrl`||t===`control`?i=!0:t===`shift`?a=!0:t===`meta`||t===`alt`||t===`option`?o=!0:t===`super`?s=!0:t===`hyper`&&(c=!0),r=n+1}if(r===t)return;let l=e[r];if(l===void 0)throw Error(`Invalid key "${e.slice(t)}": missing key name`);let u=vk(e,r)??l,d=u===` `?`space`:u===`+`?`+`:u.toLowerCase(),f=[];return i&&f.push(`ctrl`),a&&f.push(`shift`),o&&f.push(`meta`),s&&f.push(`super`),c&&f.push(`hyper`),f.push(d),{part:n.parseObjectKey({name:u===` `?`space`:u,ctrl:i,shift:a,meta:o,super:s,hyper:c||void 0},{display:f.join(`+`)}),nextIndex:r+u.length}}var xk=e=>{let{input:t,index:n,tokens:r,normalizeTokenName:i}=e;if(n===0&&t.includes(`+`)&&/\s/.test(t))return{parts:[gk(t,e)],nextIndex:t.length};let a=t[n];if(a===void 0)return;if(a===`<`){let o=t.indexOf(`>`,n);if(o===-1)return{parts:[gk(a,e)],nextIndex:n+1};let s=i(t.slice(n+1,o)),c=r.get(s);return c?{parts:[hk(e,c.stroke,`<${s}>`,c.match,s)],nextIndex:o+1,usedTokens:[s]}:{parts:[],nextIndex:o+1,unknownTokens:[s]}}if(a===`{`){let r=t.indexOf(`}`,n);if(r===-1)return{parts:[gk(a,e)],nextIndex:n+1};let o=i(t.slice(n+1,r)),s=e.patterns.get(o);return s?{parts:[{...e.parseObjectKey({name:o,ctrl:!1,shift:!1,meta:!1,super:!1},{display:s.display??`{${o}}`,match:s.match}),patternName:s.name,payloadKey:s.payloadKey}],nextIndex:r+1,usedTokens:[o]}:{parts:[],nextIndex:r+1,unknownTokens:[o]}}let o=bk(t,n,e);if(o)return{parts:[o.part],nextIndex:o.nextIndex};let s=vk(t,n);return s?{parts:[_k(s,e)],nextIndex:n+s.length}:{parts:[gk(a,e)],nextIndex:n+1}},Sk=(e,t)=>[t.resolveKey({name:e.name,ctrl:e.ctrl,shift:e.shift,meta:e.meta,super:e.super??!1,hyper:e.hyper||void 0})];function Ck(e){return e.appendBindingParser(e=>xk(e))}function wk(e){return e.appendEventMatchResolver((e,t)=>Sk(e,t))}function Tk(e){let t=Ck(e),n=wk(e);return()=>{n(),t()}}var Ek=Symbol(`keymap:mod-bindings`),Dk=/(^|[+,\s])mod(?=\s*\+)/i,Ok=/(^|[+,\s])mod(?=\s*\+)/gi;function kk(e){let t=e.primaryModifier;return(t===`ctrl`||t===`super`)&&e.modifiers[t]!==`unsupported`?t:e.modifiers.ctrl===`unsupported`?`super`:`ctrl`}function Ak(e){if(e.includes(`,`))return[e];let t=e.trim();return t.includes(` `)?t.split(/\s+/):[e]}function jk(e){return e.acquireResource(Ek,()=>e.appendBindingExpander(({input:t,displays:n})=>{if(!Dk.test(t))return;let r=kk(e.getHostMetadata());return[{key:t.replace(Ok,(e,t)=>`${t}${r}`),displays:n??Ak(t)}]}))}var Mk=new Map([[` `,`space`],[`Spacebar`,`space`],[`ArrowUp`,`up`],[`ArrowDown`,`down`],[`ArrowLeft`,`left`],[`ArrowRight`,`right`],[`Escape`,`escape`],[`Esc`,`escape`],[`Enter`,`return`],[`Backspace`,`backspace`],[`Delete`,`delete`],[`Tab`,`tab`],[`Home`,`home`],[`End`,`end`],[`PageUp`,`pageup`],[`PageDown`,`pagedown`],[`Insert`,`insert`],[`CapsLock`,`capslock`],[`NumLock`,`numlock`],[`ScrollLock`,`scrolllock`],[`ContextMenu`,`menu`],[`Meta`,`super`],[`OS`,`super`],[`Alt`,`alt`],[`Control`,`control`],[`Shift`,`shift`]]);function Nk(e){let t=e?.trim().toLowerCase();return t?t.includes(`mac`)||t.includes(`darwin`)?`macos`:t.includes(`win`)?`windows`:t.includes(`linux`)||t.includes(`x11`)?`linux`:`unknown`:`unknown`}function Pk(){let e=globalThis.navigator,t=e?.userAgentData?.platform,n=Nk(t);return n===`unknown`?Nk(e?.platform??e?.userAgent):n}function Fk(){let e=Pk();return{platform:e,primaryModifier:e===`macos`?`super`:e===`unknown`?`unknown`:`ctrl`,modifiers:{ctrl:`supported`,shift:`supported`,meta:`supported`,super:`supported`,hyper:`unsupported`}}}function Ik(e){return e.length===1&&!/^[a-z0-9]$/i.test(e)}function Lk(e){let t={name:e.name,ctrl:e.ctrl,shift:e.shift,meta:e.meta,super:e.super??!1,hyper:e.hyper||void 0};return!t.shift||!Ik(t.name)?[t]:[t,{...t,shift:!1}]}var Rk=class{name;ctrl;shift;meta;superKey;originalEvent;propagationStopped=!1;constructor(e,t,n,r,i,a){this.name=e,this.ctrl=t,this.shift=n,this.meta=r,this.superKey=i,this.originalEvent=a}get super(){return this.superKey}preventDefault(){this.originalEvent?.preventDefault()}stopPropagation(){this.propagationStopped=!0,this.originalEvent?.stopPropagation()}};function zk(){return globalThis.MutationObserver}function Bk(e){return Mk.get(e)||(/^F\d{1,2}$/i.test(e)||e.length===1?e.toLowerCase():e.trim().toLowerCase().replace(/\s+/g,``))}function Vk(e){if(!e)return new Rk(`command`,!1,!1,!1,!1);let t=globalThis.KeyboardEvent;return new Rk(Bk(e.key),e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t&&e instanceof t?e:void 0)}var Hk=class{metadata=Fk();rootTarget;isDestroyed=!1;observer;targetDestroyListeners=new Map;constructor(e){this.rootTarget=e}getFocusedTarget(){let e=this.rootTarget.ownerDocument.activeElement;return!e||typeof e!=`object`?null:e===this.rootTarget||this.rootTarget.contains(e)?e:null}getParentTarget(e){return e.parentElement}isTargetDestroyed(e){return e===this.rootTarget?!1:!e.isConnected||!this.rootTarget.contains(e)}onKeyPress(e){let t=t=>{e(Vk(t))};return this.rootTarget.addEventListener(`keydown`,t,{capture:!0}),()=>{this.rootTarget.removeEventListener(`keydown`,t,{capture:!0})}}onKeyRelease(e){let t=t=>{e(Vk(t))};return this.rootTarget.addEventListener(`keyup`,t,{capture:!0}),()=>{this.rootTarget.removeEventListener(`keyup`,t,{capture:!0})}}onFocusChange(e){let t=()=>{queueMicrotask(()=>{e(this.getFocusedTarget())})};return this.rootTarget.addEventListener(`focusin`,t,{capture:!0}),this.rootTarget.addEventListener(`focusout`,t,{capture:!0}),()=>{this.rootTarget.removeEventListener(`focusin`,t,{capture:!0}),this.rootTarget.removeEventListener(`focusout`,t,{capture:!0})}}onTargetDestroy(e,t){let n=this.targetDestroyListeners.get(e);return n||(n=new Set,this.targetDestroyListeners.set(e,n)),n.add(t),this.ensureObserver(),this.flushDisconnectedTargets(),()=>{let n=this.targetDestroyListeners.get(e);n&&(n.delete(t),n.size===0&&this.targetDestroyListeners.delete(e),this.targetDestroyListeners.size===0&&this.disconnectObserver())}}createCommandEvent(){return Vk()}ensureObserver(){if(this.observer||this.targetDestroyListeners.size===0)return;let e=zk();e&&(this.observer=new e(()=>{this.flushDisconnectedTargets()}),this.observer.observe(this.rootTarget,{childList:!0,subtree:!0}))}disconnectObserver(){this.observer&&=(this.observer.disconnect(),void 0)}flushDisconnectedTargets(){for(let[e,t]of this.targetDestroyListeners)if(this.isTargetDestroyed(e)){this.targetDestroyListeners.delete(e);for(let e of[...t])e()}this.targetDestroyListeners.size===0&&this.disconnectObserver()}};function Uk(e){return new Hk(e)}var Wk=(e,t)=>Lk(e).map(e=>t.resolveKey(e)),Gk=`fungi.app.ready`,Kk=`fungi.app.connect`,qk=e=>XC.pipe(J(yw(1)),J(xw(e))),Jk=e=>GC(qk(e)),Yk=ZC.pipe(J(_w()),J(cw(Number.isSafeInteger,{message:`Expected a safe integer`}))),Xk=Yk.pipe(J(mw(0))),Zk=Yk.pipe(J(pw(0))),Qk=q({appId:qk(160),releaseId:qk(160),surfaceId:qk(160)}),$k=q({editing:QC,surface:nw([qk(160),JC])}),eA=nw([q({kind:KC(`compose`),requestId:qk(160),text:qk(2e3)}),q({kind:KC(`navigate`),requestId:qk(160),params:ew(q({key:qk(64),value:qk(4096)})).pipe(J(xw(16)))})]),tA=q({computerId:nw([qk(256),JC]),teamHasComputers:GC(iw(QC)),computerAccessGranted:GC(QC),focus:$k,openRequest:nw([JC,eA]),visibility:rw([`visible`,`hidden`])}),nA=rw([`connecting`,`connected`,`suspended`,`disconnected`,`disposing`,`disposed`]),rA=q({altKey:QC,ctrlKey:QC,id:qk(160),key:qk(64),metaKey:QC,shiftKey:QC}),iA=q({action:GC(qC),availability:GC(qC),category:qk(160),description:Jk(512),id:qk(160),projections:GC(qC),title:qk(160)}),aA=q({arguments:GC(qC),commandId:qk(321),origin:rw([`agent`,`browser`,`keyboard`,`menu`,`palette`,`programmatic`,`slash`,`terminal`]),requestId:qk(160)}),oA=nw([q({result:GC(qC),status:KC(`handled`)}),q({error:qC,status:KC(`failed`)})]),sA=e=>qk(e).pipe(J(cw(e=>{for(let t=0;t<e.length;t+=1)if(pD(e.charCodeAt(t)))return!1;return!0},{message:`Expected one line of plain text`}))),cA={id:qk(64),text:sA(80),end:WC(QC)},lA=WC(ZC.pipe(J(_w()),J(gw({minimum:0,maximum:9999})))),uA=ew(nw([q({...cA,kind:KC(`text`),tone:WC(rw([`neutral`,`success`,`warning`,`error`]))}),q({...cA,kind:KC(`button`),icon:WC(rw([`folder`,`ports`,`processes`,`access`])),count:lA,tone:WC(rw([`neutral`,`success`,`warning`,`error`])),busy:WC(QC),title:WC(sA(1024)),disabled:WC(QC),opens:WC(KC(`dialog`)),expanded:WC(QC)}),q({...cA,kind:KC(`toggle`),pressed:QC}),q({...cA,kind:KC(`menu`),count:lA,title:WC(sA(1024)),options:ew(q({id:qk(64),text:sA(80),checked:WC(QC),disabled:WC(QC)})).pipe(J(xw(16)),J(cw(e=>new Set(e.map(e=>e.id)).size===e.length,{message:`Expected unique status option ids`})))})])).pipe(J(xw(6)),J(cw(e=>new Set(e.map(e=>e.id)).size===e.length,{message:`Expected unique status item ids`}))),dA=q({computerId:qk(256),path:qk(1024)}),fA=qk(80).pipe(J(cw(e=>e.trim()===e,{message:`Expected a trimmed title`}))),pA=qk(64),mA=qk(80),hA=e=>new Set(e.map(e=>e.id)).size===e.length,gA=q({id:pA,label:mA,siblings:GC(ew(q({id:pA,label:mA})).pipe(J(xw(16)),J(cw(hA,{message:`Expected unique crumb sibling ids`}))))}),_A=q({id:pA,label:mA,icon:GC(KC(`play`)),variant:GC(rw([`primary`,`outline`,`ghost`])),tone:GC(KC(`destructive`)),disabled:GC(QC)}),vA=e=>ew(_A).pipe(J(xw(e)),J(cw(hA,{message:`Expected unique header command ids`}))),yA={status:GC(ew(q({id:pA,label:mA,presentation:GC(KC(`bead`)),tone:GC(rw([`neutral`,`info`,`warning`,`success`,`error`]))})).pipe(J(xw(4)),J(cw(hA,{message:`Expected unique header status ids`})))),crumbs:GC(ew(gA).pipe(J(xw(8)),J(cw(hA,{message:`Expected unique crumb ids`})))),primary:GC(vA(3)),menu:GC(vA(12))},bA=q({contractVersion:KC(1),canGoBack:QC,title:GC(fA),...yA}),xA=q({canGoBack:QC,title:GC(XC),...yA}),SA=nw([q({kind:KC(`crumb`),crumbId:pA,siblingId:GC(pA)}),q({kind:KC(`action`),actionId:pA})]),CA=iw(q({agentId:qk(256),sessionId:qk(256)})),wA=q({agents:GC(ew(rw([`agent.list`,`agent.manage`,`agent.read`,`agent.send`])).pipe(J(xw(4)))),computers:GC(ew(rw([`computer.list`,`computer.readFile`,`computer.writeFile`,`computer.execute`])).pipe(J(xw(4))))}),TA=rw([`granted`,`declined`,`customize`]),EA=q({message:qk(512),tone:GC(rw([`info`,`success`,`warning`,`error`]))}),DA=rw(Ew);q({code:DA.pick([`DELIVERY_PENDING`])});var OA=q({code:DA,message:qk(512),retryable:QC}),kA=q({protocolVersion:KC(2),type:KC(Gk)}),AA=q({epoch:qk(160),protocolVersion:KC(2),type:KC(Kk)}),jA=q({epoch:qk(160),protocolVersion:KC(2)}),MA={[Symbol.dispose]:GC(qC)},NA=nw([q({...MA,ok:KC(!0),value:qC}),q({...MA,error:OA,ok:KC(!1)})]);function PA(e,t,n=`PROTOCOL`){return Rd(VC(e,{onExcessProperty:`error`}),Mm({onFailure:e=>{throw new Y(`The peer sent malformed protocol data`,{cause:e,code:n,retryable:!1})},onSuccess:t}))}function FA(e){return Object.freeze(e)}function IA(e,t){let n=e.arguments===void 0?void 0:xu(e.arguments),r={origin:e.origin,signal:t};return n!==void 0&&Object.assign(r,{arguments:n}),FA(r)}var LA=PA(iA,e=>{let t={category:e.category,id:e.id,title:e.title};return e.action!==void 0&&Object.assign(t,{action:e.action}),e.availability!==void 0&&Object.assign(t,{availability:e.availability}),e.description!==void 0&&Object.assign(t,{description:e.description}),e.projections!==void 0&&Object.assign(t,{projections:e.projections}),FA(Ej(()=>nee(t)))},`INVALID_ARGUMENT`),RA=PA(qk(321),e=>e),zA=PA(aA,e=>{let t=e.arguments===void 0?void 0:xu(e.arguments),n={commandId:e.commandId,origin:e.origin,requestId:e.requestId};return t!==void 0&&Object.assign(n,{arguments:t}),FA(n)}),BA=PA(nw([YC,qC]),e=>e===void 0?void 0:xu(e)),VA=PA(AA,e=>FA(e));PA(jA,e=>FA(e));var HA=PA(tA,e=>{let t={computerId:e.computerId,focus:FA({...e.focus}),openRequest:e.openRequest===null?null:FA({...e.openRequest}),visibility:e.visibility};return e.teamHasComputers!==void 0&&(t.teamHasComputers=e.teamHasComputers),e.computerAccessGranted!==void 0&&(t.computerAccessGranted=e.computerAccessGranted),FA(t)}),UA=PA(OA,e=>FA({...e})),WA=PA($k,e=>FA({...e}),`INVALID_ARGUMENT`),GA=PA(Qk,e=>FA({...e})),KA=PA(nA,e=>e),qA=PA(uA,e=>FA(e.map(e=>e.kind===`menu`?FA({...e,options:FA(e.options.map(e=>FA(e)))}):FA(e))),`INVALID_ARGUMENT`),JA=PA(q({itemId:qk(64),optionId:WC(qk(64)),anchor:WC(q({start:ZC.pipe(J(gw({minimum:0,maximum:1e5}))),width:ZC.pipe(J(gw({minimum:0,maximum:1e5})))}))}),e=>FA(e.anchor===void 0?{...e}:{...e,anchor:FA({...e.anchor})}),`INVALID_ARGUMENT`),YA=PA(dA,e=>FA({...e}),`INVALID_ARGUMENT`);function XA(e){let t={id:e.id,label:e.label};return e.presentation!==void 0&&(t={...t,presentation:e.presentation}),e.tone!==void 0&&(t={...t,tone:e.tone}),FA(t)}function ZA(e){let t={id:e.id,label:e.label};return e.siblings===void 0?FA(t):FA({...t,siblings:FA(e.siblings.map(e=>FA({...e})))})}function QA(e){let t={id:e.id,label:e.label};return e.icon!==void 0&&(t={...t,icon:e.icon}),e.variant!==void 0&&(t={...t,variant:e.variant}),e.tone!==void 0&&(t={...t,tone:e.tone}),e.disabled!==void 0&&(t={...t,disabled:e.disabled}),FA(t)}function $A(e){let t={canGoBack:e.canGoBack};return e.title!==void 0&&(t={...t,title:e.title}),e.crumbs!==void 0&&(t={...t,crumbs:FA(e.crumbs.map(ZA))}),e.primary!==void 0&&(t={...t,primary:FA(e.primary.map(QA))}),e.menu!==void 0&&(t={...t,menu:FA(e.menu.map(QA))}),e.status!==void 0&&(t={...t,status:FA(e.status.map(XA))}),FA(t)}var ej=PA(bA,$A,`INVALID_ARGUMENT`),tj=PA(xA,e=>{let t=e.title?.trim();return nj({...$A({...e,title:t===void 0||t.length===0?void 0:t}),contractVersion:1})},`INVALID_ARGUMENT`),nj=PA(bA,e=>FA({...$A(e),contractVersion:1}),`INVALID_ARGUMENT`),rj=PA(SA,e=>e.kind===`action`?FA({...e}):FA(e.siblingId===void 0?{kind:e.kind,crumbId:e.crumbId}:e),`INVALID_ARGUMENT`),ij=PA(CA,e=>e===null?null:FA({...e}),`INVALID_ARGUMENT`),aj=PA(wA,e=>FA({agents:FA([...new Set(e.agents??[])]),computers:FA([...new Set(e.computers??[])])}),`INVALID_ARGUMENT`);PA(kA,e=>FA(e));var oj=PA(qk(512),e=>e),sj=PA(EA,e=>FA({...e}),`INVALID_ARGUMENT`);PA(q({id:qk(160),repeat:QC}),e=>FA(e));var cj=PA(ew(rA).pipe(J(xw(64))),e=>{if(new Set(e.map(e=>e.id)).size!==e.length)throw new Y(`Reserved chords are invalid`,{code:`PROTOCOL`,retryable:!1});return FA(e.map(e=>FA({...e})))});function lj(e){return PA(q({value:qC,version:Xk}),t=>FA({value:e(t.value),version:t.version}))}var uj=lj(HA),dj=PA(q({capabilities:ew(qC).pipe(J(xw(128))),context:qC}),e=>FA({capabilities:FA(e.capabilities.map(e=>_j(e))),context:uj(e.context)})),fj=lj(KA),pj=lj(cj),mj=lj(oj),hj=Rd(fj,e=>{if(e.value!==`connected`&&e.value!==`suspended`)throw new Y(`The host lifecycle is invalid`,{code:`PROTOCOL`,retryable:!1});return FA({value:e.value,version:e.version})});function gj(e){return PA(q({handle:qC,id:qk(160),version:Zk}),t=>{if(!(t.handle instanceof uD)&&!(e&&t.handle instanceof dD))throw new Y(`A capability handle is invalid`,{code:`PROTOCOL`,retryable:!1});return FA({handle:t.handle,id:t.id,version:t.version})})}var _j=gj(!1),vj=gj(!0);function yj(e){let t=e?vj:_j;return PA(q({capabilities:ew(qC).pipe(J(xw(128))),context:qC,identity:qC,lifecycle:qC,reservedChords:qC,theme:qC}),e=>FA({capabilities:FA(e.capabilities.map(e=>t(e))),context:uj(e.context),identity:GA(e.identity),lifecycle:hj(e.lifecycle),reservedChords:pj(e.reservedChords),theme:mj(e.theme)}))}var bj=yj(!1);yj(!0);function xj(e){return PA(NA,t=>t.ok?FA({ok:!0,value:e(t.value)}):FA({ok:!1,error:UA(t.error)}))}var Sj=xj(bj),Cj=xj(PA(q({commandId:qk(321)}),e=>FA(e)));xj(PA(oA,e=>{if(e.status===`failed`)return FA({status:`failed`,error:Ej(()=>Cu(e.error))});let t=e.result===void 0?void 0:xu(e.result);return FA(t===void 0?{status:`handled`}:{status:`handled`,result:t})}));var wj=xj(PA(YC,()=>void 0)),Tj=xj(PA(TA,e=>e));xj(PA(QC,e=>e)),xj(PA(QC,e=>e));function Ej(e){try{return e()}catch(e){throw new Y(`The command metadata is invalid`,{cause:e,code:`INVALID_ARGUMENT`,retryable:!1})}}var Dj=nw([q({kind:KC(`saveFile`),name:qk(255).pipe(J(uw(/^[^\p{Cc}/\\]+$/u))),mime:qk(255),bytes:qte}),q({kind:KC(`copyText`),text:XC})]);function Oj(e){let t=VC(Dj,{onExcessProperty:`error`})(e);if(jm(t))return{kind:`refused`,reason:`invalid-request`};let n=t.success;return n.kind===`saveFile`?n.name===`.`||n.name===`..`?{kind:`refused`,reason:`invalid-request`}:n.bytes.byteLength>33554432?{kind:`refused`,reason:`too-large`}:{...n,bytes:new Uint8Array(n.bytes)}:n.text.length>1048576||new TextEncoder().encode(n.text).byteLength>1048576?{kind:`refused`,reason:`too-large`}:n}var kj=xj(PA(nw([q({kind:KC(`saved`)}),q({kind:KC(`copied`)}),q({kind:KC(`refused`),reason:rw([`no-user-gesture`,`too-large`,`invalid-request`,`unavailable`,`denied`,`busy`])})]),e=>FA(e)));function Aj(e){return e instanceof Y?{code:e.code,message:Mj(e.message),retryable:e.retryable}:{code:`HOST_FAILURE`,message:`Host operation failed`,retryable:!1}}function jj(e){try{let t=UA(e);return new Y(t.message,{code:t.code,retryable:t.retryable})}catch(e){return new Y(`The host returned a malformed error`,{cause:e,code:`PROTOCOL`,retryable:!1})}}function Mj(e){return e.trim().slice(0,512)||`Host operation failed`}var Nj=e=>({ok:!0,value:e}),Pj=e=>({error:Aj(e),ok:!1});async function Fj(e,t){let n,r=new Set;try{return n=await e,Ij(t(n))}catch(e){throw Lj(e)&&Rj(e,r),e instanceof Y?e:new Y(`The remote operation failed`,{cause:e,code:`HOST_FAILURE`,retryable:!0})}finally{n!==e&&Lj(n)&&Rj(n,r)}}function Ij(e){if(e.ok)return e.value;throw jj(e.error)}function Lj(e){return tf(e)&&Symbol.dispose in e&&Zd(e[Symbol.dispose])}function Rj(e,t){if(!t.has(e)){t.add(e);try{e[Symbol.dispose]()}catch(e){console.warn(`RPC result disposal failed`,e)}}}function zj(){let e=[],t=new Set;return{get:()=>e,subscribe:e=>(t.add(e),()=>t.delete(e)),update:n=>{e=n;for(let e of Array.from(t))try{e()}catch(e){console.warn(`App binding subscriber failed`,e)}}}}function Bj(e){let t=cj(e),n=new Set;return{get:()=>t,subscribe:e=>(n.add(e),()=>n.delete(e)),update:e=>{t=cj(e);for(let e of Array.from(n))try{e()}catch(e){console.warn(`Reserved chord subscriber failed`,e)}}}}function Vj(e){let t=!0,n,r=e.window.document.querySelector(`html`);if(!r)return()=>{t=!1};let i=Uk(r),a=new ak(i);Tk(a),jk(a),a.prependEventMatchResolver(Wk);let o=Uj(e.onBroken),s=qj(a,e.chords,e.remote,o),c=Hj(e,o,()=>t,e=>{n=e},()=>n),l=i.onFocusChange(()=>{queueMicrotask(c)}),u=()=>{queueMicrotask(c)};e.window.addEventListener(`focus`,u),e.window.addEventListener(`blur`,u);let d=e.bindings,f=()=>Wj(e.window.document,e.identity.surfaceId).editing,p=d===void 0?()=>void 0:Gj(a,d,f),m=d===void 0?()=>void 0:d.subscribe(()=>{p(),p=Gj(a,d,f)}),h=e.chords.subscribe(()=>{s(),s=qj(a,e.chords,e.remote,o)});return queueMicrotask(c),()=>{t&&(t=!1,l(),e.window.removeEventListener(`focus`,u),e.window.removeEventListener(`blur`,u),h(),s(),m(),p())}}function Hj(e,t,n,r,i){return()=>{if(!n())return;let a=Wj(e.window.document,e.identity.surfaceId),o=i();(a.editing!==o?.editing||a.surface!==o.surface)&&(r(a),t(()=>e.remote.reportFocus(a)))}}function Uj(e){return t=>{try{Fj(t(),wj).catch(t=>{KT(`browser-bridge.host-call`,t),e(t)})}catch(t){KT(`browser-bridge.host-call`,t),e(t)}}}function Wj(e,t){let n=e.activeElement;return WA({editing:!!(n?.matches(`input, textarea, select, [contenteditable='true']`)===!0||n?.closest(`[contenteditable='true']`)),surface:e.hasFocus()?t:null})}function Gj(e,t,n){let r=t.get();return e.registerLayer({bindings:r.map((e,t)=>({cmd:`app/${String(t)}`,key:e.key})),commands:r.map((e,t)=>({name:`app/${String(t)}`,run:t=>{let r=t.event.originalEvent;if(r?.defaultPrevented||r?.isComposing||Kj(e.key)&&n())return!1;e.run()}})),priority:500})}function Kj(e){return!/(?:^|\+)(?:ctrl|control|super|meta|cmd|alt|option|mod)\+/iu.test(e)}function qj(e,t,n,r){let i=t.get();return e.registerLayer({bindings:i.map(e=>({cmd:`reserved/${e.id}`,key:{ctrl:e.ctrlKey,meta:e.altKey,name:Bk(e.key),shift:e.shiftKey,super:e.metaKey}})),commands:i.map(e=>({name:`reserved/${e.id}`,run:t=>{let i=t.event.originalEvent;if(i?.defaultPrevented||i?.isComposing)return!1;r(()=>n.invokeReservedChord(e.id,i?.repeat??!1))}})),priority:1e3})}function Jj(e){let t=t=>{if(t.defaultPrevented||t.isComposing)return;let n=Zj(t,e.mac);n!==null&&(t.preventDefault(),n===`back`&&!t.repeat&&e.canGoBack()&&e.back())},n=t=>{let n=Xj(t.button);if(n===null)return;let r=t.defaultPrevented;t.preventDefault(),t.type===`mouseup`&&n===`back`&&!r&&e.canGoBack()&&e.back()};e.window.addEventListener(`keydown`,t);for(let t of Yj)e.window.addEventListener(t,n);return()=>{e.window.removeEventListener(`keydown`,t);for(let t of Yj)e.window.removeEventListener(t,n)}}var Yj=[`mousedown`,`mouseup`,`auxclick`];function Xj(e){return e===3?`back`:e===4?`forward`:null}function Zj(e,t){return e.shiftKey||e.ctrlKey?null:t?!e.metaKey||e.altKey?null:e.key===`[`?`back`:e.key===`]`?`forward`:Qj(e.target)?null:e.key===`ArrowLeft`?`back`:e.key===`ArrowRight`?`forward`:null:!e.altKey||e.metaKey?null:e.key===`ArrowLeft`?`back`:e.key===`ArrowRight`?`forward`:null}function Qj(e){return e instanceof HTMLElement?e.isContentEditable||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement:!1}function $j(){return!Qd(globalThis.navigator)&&/Mac|iPhone|iPad/u.test(globalThis.navigator.userAgent)}function eM(e){let t=e,n=new Set;return{get:()=>t,subscribe(e){n.add(e);let t=!0;return()=>{t&&(t=!1,n.delete(e))}},update(e){if(!Object.is(t,e)){t=e;for(let e of Array.from(n))try{e(t)}catch(e){console.warn(`App store subscriber failed`,e)}}}}}function tM(e){let t=new Map,n=eM(0),r=!1,i=e=>{let t=new Map;try{for(let n of e){let e=_j(n),r=oM(e.id,e.version);if(t.has(r))throw rM(e.handle),new Y(`Duplicate capability grant`,{code:`PROTOCOL`,retryable:!1});t.set(r,e.handle)}}catch(e){for(let e of t.values())rM(e);throw e}return t};for(let[n,r]of i(e))t.set(n,r);let a=e=>{for(let t of e)rM(t)},o=e=>{if(r)throw new Y(`The app connection is disposed`,{code:`DISCONNECTED`,retryable:!0});let n=oM(e.id,e.version);return t.get(n)};return{directory:Object.freeze({get version(){return n.get()},subscribe:e=>n.subscribe(e),has(e){return!!o(e)},require(e){let t=o(e);if(!t)throw new Y(`The capability is not granted`,{code:`CAPABILITY_DENIED`,retryable:!1});try{return e.schema.parse(t)}catch(e){throw new Y(`The capability interface is malformed`,{cause:e,code:`PROTOCOL`,retryable:!1})}}}),replace(e){if(r)throw new Y(`The app connection is disposed`,{code:`DISCONNECTED`,retryable:!0});let o=i(e),s=[...t.values()];t.clear();for(let[e,n]of o)t.set(e,n);a(s.filter(e=>![...o.values()].includes(e))),n.update(n.get()+1)},disconnect(){r||(r=!0,a(t.values()),t.clear(),n.update(n.get()+1))}}}var nM=Mc().transform(e=>{let t=su(Object).safeParse(e);if(!t.success)return;let n=Object.create(t.data),r=HC(q({[Symbol.dispose]:GC(sw(Function))}))(n);return{owner:t.data,dispose:r[Symbol.dispose]}});function rM(e){try{let t=nM.parse(e);if(t===void 0||aM.has(t.owner))return;aM.add(t.owner),t.dispose?.call(t.owner)}catch(e){console.warn(`RPC value disposal failed`,e)}}function iM(e){return{value:e,[Symbol.dispose](){rM(e)}}}var aM=new WeakSet;function oM(e,t){return`${e}@${String(t)}`}var sM=class extends dD{#e=!0;#t;#n=new Map;constructor(e){super(),this.#t=e}cancel(e){try{return this.#n.get(RA(e))?.abort(),Promise.resolve(Nj(void 0))}catch(e){return Promise.resolve(Pj(e))}}dispose(){if(this.#e){this.#e=!1;for(let e of this.#n.values())e.abort();this.#n.clear()}}async invoke(e){try{if(!this.#e)throw new Y(`The command is disposed`,{code:`DISCONNECTED`,retryable:!0});let t=zA(e);if(this.#n.has(t.requestId))throw new Y(`Duplicate command request`,{code:`PROTOCOL`,retryable:!1});if(this.#n.size>=64)throw new Y(`Too many command requests`,{code:`HOST_FAILURE`,retryable:!0});let n=new AbortController;this.#n.set(t.requestId,n);try{let e=BA(await this.#t(IA(t,n.signal)));return Nj(e===void 0?{status:`handled`}:{status:`handled`,result:e})}finally{this.#n.delete(t.requestId)}}catch(e){if(e instanceof zu)try{return Nj({status:`failed`,error:Cu({code:e.code,message:e.message,details:e.details})})}catch(e){return Pj(e)}return Pj(e)}}[Symbol.dispose](){this.dispose()}};function cM(e){let t=[];for(let n of e.values()){let{definition:e,handler:r}=n;if(n.commandId===void 0)continue;let i=e.availability?.status!==`unavailable`;for(let n of e.projections?.bindings?.values??[])n.trim().includes(` `)||n.startsWith(`<`)||t.push({key:n,run:()=>{i&&Promise.resolve().then(()=>r({origin:`keyboard`,signal:new AbortController().signal})).catch(e=>{console.warn(`App key command failed`,e)})}})}return t}function lM(e,t,n,r){let i=new Map,a=!1,o=()=>{r?.update(a?[]:cM(i))},s=e=>{try{n()}catch(t){console.warn(`App command failure callback failed`,t,e)}},c=e=>{try{Fj(e(),wj).catch(e=>{s(e)})}catch(e){console.warn(`App command RPC supervision failed`,e),s(e)}};return{commands:dM(e,t,i,()=>a,t=>{let n=i.get(t);if(!n)return;i.delete(t),n.target.dispose(),o();let r=n.commandId;!a&&r!==void 0&&c(()=>e.unregisterCommand(r))},o),dispose(){if(!a){a=!0;for(let e of i.values())e.target[Symbol.dispose]();i.clear(),o()}}}}function uM(e,t,n,r){let i=t.id;if(e.size>=128||e.has(i))throw r.dispose(),new Y(`Command registration is unavailable`,{code:`INVALID_ARGUMENT`,retryable:!1});let a={commandId:void 0,definition:t,handler:n,target:r};e.set(i,a);let o=!1;return{commit(e){o||(a.commandId=e)},release(){o||(o=!0,e.get(i)===a&&e.delete(i),r.dispose())},target:r}}function dM(e,t,n,r,i,a){return Object.freeze({async register(o,s){if(t(),!Zd(s))throw new Y(`Command handler must be a function`,{code:`INVALID_ARGUMENT`,retryable:!1});let c=LA(o),l=new sM(s),u=uM(n,c,s,l);try{let t=await fM(e,c,u.target);r()&&await pM(e,t.commandId,l),u.commit(t.commandId),a()}catch(e){throw u.release(),e}let d=!0;return()=>{d&&(d=!1,i(c.id))}}})}async function fM(e,t,n){return Fj(e.registerCommand(t,n),Cj)}async function pM(e,t,n){throw n.dispose(),await Fj(e.unregisterCommand(t),wj),new Y(`The command controller is disposed`,{code:`DISCONNECTED`,retryable:!0})}var mM=AC(e=>e instanceof uD),hM=class extends dD{#e=!1;#t;constructor(e){super(),this.#t=e}disconnect(e){try{if(this.#e)throw EM();let t=e===void 0?void 0:UA(e);return setTimeout(()=>this.#t.disconnect?.(t??AM()),0),Promise.resolve(Nj(void 0))}catch(e){return Promise.resolve(Pj(e))}}async requestClose(){try{if(this.#e)throw EM();return Nj(await(this.#t.beforeClose?.()??!0))}catch(e){return Pj(e)}}async requestBack(){try{if(this.#e)throw EM();return Nj(await(this.#t.back?.()??!1))}catch(e){return Pj(e)}}async activateNavigation(e){try{if(this.#e)throw EM();let t=rj(e);return gD(this.#t.navigation,t)?Nj(await(this.#t.activate?.(t)??!1)):Nj(!1)}catch(e){return Pj(e)}}async activateStatus(e){try{if(this.#e)throw EM();let t=JA(e);return hD(this.#t.statusItems,t)?Nj(await(this.#t.statusAction?.(t)??!1)):Nj(!1)}catch(e){return Pj(e)}}[Symbol.dispose](){this.#e=!0}async updateContext(e){return this.#e?Pj(EM()):this.#n(e,`context`,HA,e=>{this.#t.context.update(e)})}reconfigure(e){let t=[];try{if(this.#e)throw EM();let n=dj(e);if(n.context.version<=this.#t.versions.context)return Promise.resolve(Nj(void 0));for(let e of n.capabilities)t.push({...e,handle:HC(mM)(e.handle).dup()});if(!this.#t.capabilities)throw EM();return this.#t.capabilities.replace(t),t=[],this.#t.versions.context=n.context.version,this.#t.context.update(n.context.value),Promise.resolve(Nj(void 0))}catch(e){for(let e of t)rM(e.handle);return Promise.resolve(Pj(e))}}updateLifecycle(e){try{if(this.#e)throw EM();let t=lj(KA)(e);if(t.version<=this.#t.versions.lifecycle)return Promise.resolve(Nj(void 0));if(!jM(this.#t.lifecycle.get(),t.value))throw new Y(`The host sent an invalid lifecycle transition`,{code:`PROTOCOL`,retryable:!1});return this.#t.versions.lifecycle=t.version,this.#t.lifecycle.update(t.value),Promise.resolve(Nj(void 0))}catch(e){return Promise.resolve(Pj(e))}}async updateReservedChords(e){return this.#e?Pj(EM()):this.#n(e,`chords`,cj,e=>{this.#t.chords.update(e)})}async updateTheme(e){return this.#e?Pj(EM()):this.#n(e,`theme`,oj,e=>{this.#t.theme.update(e)})}#n(e,t,n,r){try{let i=lj(n)(e);return i.version>this.#t.versions[t]&&(this.#t.versions[t]=i.version,r(i.value)),Promise.resolve(Nj(void 0))}catch(e){return Promise.resolve(Pj(e))}}};async function gM(e){let t=bM(),n=new hM(t),r=fD(e.port,n),i,a=yM(r);try{performance.mark(`fungi.app-open.agar-rpc-connect-start`);let o=await Promise.race([r.connect({epoch:e.epoch,protocolVersion:2}),a]);performance.mark(`fungi.app-open.agar-rpc-connect-ready`),i=o;let s=Ij(Sj(o));if(!e.isActive())throw vM();let c=xM({bootstrap:s,bootstrapOwner:i,options:e,remote:r,state:t,target:n});return performance.mark(`fungi.app-open.agar-root-created`),i=void 0,c}catch(t){return NM(t,e,n,r,i)}}function _M(e,t){e.context.update(t.context.value),e.theme.update(t.theme.value),e.lifecycle.update(t.lifecycle.value),e.chords.update(t.chords.value),e.versions.context=t.context.version,e.versions.theme=t.theme.version,e.versions.lifecycle=t.lifecycle.version,e.versions.chords=t.chords.version}function vM(){return new Y(`App connection was cancelled`,{code:`CANCELLED`,retryable:!1})}function yM(e){let t,n=new Promise((e,n)=>{t=n});return n.catch(e=>{KT(`app-session.rpc-disconnect`,e)}),e.onRpcBroken(()=>t?.(new Y(`The app host disconnected`,{code:`DISCONNECTED`,retryable:!0}))),n}function bM(){return{statusItems:[],navigation:{canGoBack:!1},bindings:zj(),chords:Bj([]),context:eM({computerId:null,focus:{editing:!1,surface:null},openRequest:null,visibility:`hidden`}),lifecycle:eM(`connecting`),theme:eM(`default`),canGoBack:!1,versions:{chords:-1,context:-1,lifecycle:-1,theme:-1}}}function xM(e){let t=GA(e.bootstrap.identity),n=MM(e.bootstrap);_M(e.state,n);let r=tM(e.bootstrap.capabilities);return e.state.capabilities=r,CM(e,t,r)}function SM(e,t,n){return Vj({bindings:e.state.bindings,chords:e.state.chords,identity:t,onBroken:e=>{n({code:`DISCONNECTED`,message:e instanceof Y?e.message:`The app host rejected a browser bridge operation`,retryable:!0})},remote:e.remote,window:e.options.window})}function CM(e,t,n){let r=!1,i=t=>{r||(r=!0,OM([()=>{t&&e.state.lifecycle.update(`disconnected`)},()=>{e.state.lifecycle.update(`disposing`)},l,u,()=>{o.dispose()},()=>{e.state.beforeClose=void 0,e.state.back=void 0,e.state.activate=void 0,e.state.statusAction=void 0},()=>{n.disconnect()},()=>{e.target[Symbol.dispose]()},()=>{rM(e.bootstrapOwner)},()=>{rM(e.remote)},()=>{e.options.port.close()},()=>{e.state.lifecycle.update(`disposed`)},e.options.onDisposed],`app connection disposal`))},a=()=>{if(r)throw new Y(`The app connection is disposed`,{code:`DISCONNECTED`,retryable:!0})},o=lM(e.remote,a,()=>{i({code:`DISCONNECTED`,message:`The app host rejected a terminal command operation`,retryable:!0})},e.state.bindings),s=TM(e.remote,a,e.state),c=wM(e.state,e.remote,a),l=SM(e,t,i),u=Jj({window:e.options.window,mac:$j(),canGoBack:()=>e.state.canGoBack&&e.state.back!==void 0,back:()=>{let t=e.state.back;t&&Promise.resolve().then(t).catch(e=>{KT(`app-window.back-input`,e)})}});return e.state.disconnect=i,e.remote.onRpcBroken(()=>{DM(i)}),kM({capabilities:n.directory,commands:o.commands,context:e.state.context,dispose:i,identity:t,lifecycle:e.state.lifecycle,theme:e.state.theme,ui:s,window:c})}function wM(e,t,n){let r=Object.freeze({async publish(r){n();let i=tj(r);e.canGoBack=i.canGoBack,e.navigation=ej(i),await Fj(t.reportNavigation(i),wj)},onActivate(t){if(n(),e.activate!==void 0)throw new Y(`The App already owns navigation activations`,{code:`INVALID_ARGUMENT`,retryable:!1});e.activate=t;let r=!1;return()=>{r||(r=!0,e.activate===t&&(e.activate=void 0))}},onBack(t){if(n(),e.back!==void 0)throw new Y(`The App already owns Back requests`,{code:`INVALID_ARGUMENT`,retryable:!1});e.back=t;let r=!1;return()=>{r||(r=!0,e.back===t&&(e.back=void 0))}}});return Object.freeze({navigation:r,onBeforeClose(t){if(n(),e.beforeClose!==void 0)throw new Y(`The App already owns a close consultation`,{code:`INVALID_ARGUMENT`,retryable:!1});e.beforeClose=t;let r=!1;return()=>{r||(r=!0,e.beforeClose===t&&(e.beforeClose=void 0))}}})}function TM(e,t,n){return Object.freeze({async requestComputerChoice(){t(),await Fj(e.requestComputerChoice(),wj)},async requestBrowserAction(n){t();let r=Oj(n);return r.kind===`refused`?r:await Fj(e.requestBrowserAction(r),kj)},onStatusAction(e){if(t(),n.statusAction!==void 0)throw new Y(`The App already owns its status actions`,{code:`INVALID_ARGUMENT`,retryable:!1});n.statusAction=e;let r=!1;return()=>{r||(r=!0,n.statusAction===e&&(n.statusAction=void 0))}},async requestAppPermissions(n){return t(),await Fj(e.requestAppPermissions(aj(n)),Tj)},async openDesktopSettings(){t(),await Fj(e.openDesktopSettings(),wj)},async openTeamBilling(){t(),await Fj(e.openTeamBilling(),wj)},async openNavigation(n){t(),await Fj(e.openNavigation(YA(n)),wj)},async reportStatus(r){t();let i=qA(r);n.statusItems=i,await Fj(e.reportStatus(i),wj)},async reportAgentSessionSelection(n){t(),await Fj(e.reportAgentSessionSelection(ij(n)),wj)},async showToast(n){t(),await Fj(e.showToast(sj(n)),wj)}})}function EM(){return new Y(`The app connection is disposed`,{code:`DISCONNECTED`,retryable:!0})}function DM(e){e({code:`DISCONNECTED`,message:`The app host disconnected`,retryable:!0})}function OM(e,t){for(let n of e)try{n()}catch(e){console.warn(`${t} cleanup failed`,e)}}function kM(e){return Object.freeze(e)}function AM(){return{code:`DISCONNECTED`,message:`The app host disconnected`,retryable:!1}}function jM(e,t){return e===t||e===`connected`&&t===`suspended`||e===`suspended`&&t===`connected`}function MM(e){let t=lj(HA)(e.context),n=lj(oj)(e.theme),r=lj(KA)(e.lifecycle),i=lj(cj)(e.reservedChords);if(r.value!==`connected`&&r.value!==`suspended`)throw new Y(`The bootstrap lifecycle is invalid`,{code:`PROTOCOL`,retryable:!1});return{chords:i,context:t,lifecycle:r,theme:n}}function NM(e,t,n,r,i){throw OM([()=>{n[Symbol.dispose]()},()=>{i&&rM(i)},()=>{rM(r)},()=>{t.port.close()},t.onDisposed],`app connection rejection`),e instanceof Y?e:new Y(`Unable to establish the app RPC session`,{cause:e,code:`PROTOCOL`,retryable:!1})}var PM=!1,FM=class{options;#e;#t;#n=!1;#r;#i;constructor(e){this.options=e,this.#e=globalThis.window}start(){performance.mark(`fungi.app-open.agar-connect-start`);let e=this.#l();return e?Promise.reject(e):(PM=!0,this.#a())}#a(){return new Promise((e,t)=>{let n=(n,a)=>{this.#o(n,a,i,r,e,t)},r=()=>{n(LM())},i=e=>{this.#s(e,n,i)};this.#e.addEventListener(`message`,i),this.options.signal?.addEventListener(`abort`,r,{once:!0});let a=()=>{try{performance.mark(`fungi.app-open.agar-ready-sent`),this.#e.parent.postMessage({protocolVersion:2,type:Gk},`*`)}catch(e){KT(`connect.notify-host`,e),n(UM(e))}};this.#r=setInterval(a,200),this.#i=setTimeout(()=>{n(zM())},1e4),a()})}#o(e,t,n,r,i,a){if(!this.#n){if(this.#n=!0,this.#c(),this.#e.removeEventListener(`message`,n),this.options.signal?.removeEventListener(`abort`,r),e||!t){this.#t?.close(),PM=!1,a(e??zM());return}i(t)}}#s(e,t,n){if(!HM(e.data))return;if(performance.mark(`fungi.app-open.agar-connect-received`),e.source!==this.#e.parent||BM(e.origin)===void 0){t(VM());return}let r=WM(e,t);if(!r)return;let i=e.ports.length===1?e.ports[0]:void 0;if(!i){t(GM(`The app host did not transfer exactly one port`));return}this.#t=i,this.#c(),this.#e.removeEventListener(`message`,n),gM({epoch:r.epoch,isActive:()=>!this.#n,onDisposed:()=>{PM=!1},port:i,window:this.#e}).then(e=>{performance.mark(`fungi.app-open.agar-root-ready`),t(void 0,e)},e=>{t(RM(e))})}#c(){clearInterval(this.#r),clearTimeout(this.#i),this.#r=void 0,this.#i=void 0}#l(){if(this.options.signal?.aborted)return LM();if(PM)return new Y(`An app connection is already live`,{code:`IDENTITY`,retryable:!1});if(Qd(globalThis.window)||this.#e.parent===this.#e)return new Y(`The app host is unavailable`,{code:`DISCONNECTED`,retryable:!0})}};function IM(e){return new FM(e).start()}function LM(){return new Y(`App connection was cancelled`,{code:`CANCELLED`,retryable:!1})}function RM(e){return e instanceof Y?e:new Y(`Unable to connect to the app host`,{cause:e,code:`PROTOCOL`,retryable:!1})}function zM(){return new Y(`The app host disconnected`,{code:`DISCONNECTED`,retryable:!0})}function BM(e){if(!URL.canParse(e))return;let t=new URL(e).origin;return t===e?t:void 0}function VM(){return new Y(`The app connection identity is invalid`,{code:`IDENTITY`,retryable:!1})}var HM=RC(q({type:KC(Kk)}));function UM(e){return new Y(`Unable to notify the app host`,{cause:e,code:`DISCONNECTED`,retryable:!0})}function WM(e,t){try{return VA(e.data)}catch(e){KT(`connect.decode-message`,e),t(e instanceof Y?e:new Y(`Malformed app connection`,{cause:e,code:`PROTOCOL`,retryable:!1}));return}}function GM(e){return new Y(e,{code:`PROTOCOL`,retryable:!1})}function KM(e,t,n){e.style.isolation=`isolate`;let r=(0,GT.createRoot)(e),i=new AbortController,a=e.ownerDocument.documentElement,o=Zte(a),s,c,l,u=!1,d=e=>{let i=(0,K.createElement)(qM,{state:e,render:n});r.render(t.queryClient?(0,K.createElement)($te,{client:t.queryClient},i):i)},f=()=>{l?.(),l=void 0,c?.(),c=void 0;let e=s;s=void 0,e?.dispose(),u&&=(o===null?a.removeAttribute(`data-theme`):jw(o,a),!1)},{defaultView:p}=e.ownerDocument;return performance.mark(`fungi.app-open.react-root-render-start`),p?p.parent===p?d({app:null,status:`standalone`}):(d({app:null,status:`connecting`}),IM({host:`parent`,signal:i.signal}).then(e=>{if(i.signal.aborted){e.dispose();return}s=e;let t=()=>{let t=e.lifecycle.get();return t===`disposing`||t===`disconnected`||t===`disposed`?(f(),d({app:null,status:`ended`}),!0):!1};l=e.lifecycle.subscribe(t),!t()&&(u=!0,jw(e.theme.get(),a),c=e.theme.subscribe(e=>{jw(e,a)}),d({app:e,status:`live`}))}).catch(e=>{i.signal.aborted&&e instanceof Y&&e.code===`CANCELLED`||(console.error(`${t.name} host connection failed`,e),f(),i.signal.aborted||d({app:null,status:`not-hosted`,error:e instanceof Y?e:new Y(`The App host is unavailable`,{cause:e,code:`HOST_FAILURE`,retryable:!0})}))})):d({app:null,status:`not-hosted`,error:new Y(`The App document has no window`,{code:`DISCONNECTED`,retryable:!1})}),()=>{i.signal.aborted||(i.abort(),r.unmount(),f())}}function qM({state:e,render:t}){return(0,K.useLayoutEffect)(()=>{performance.mark(`fungi.app-open.react-initial-commit`)},[]),(0,K.useLayoutEffect)(()=>{e.app&&performance.mark(`fungi.app-open.react-connected-commit`)},[e.app]),(0,K.createElement)(K.Fragment,null,e.status===`not-hosted`?(0,K.createElement)(`p`,{role:`alert`},`App host connection unavailable. Open this App through its host to try again.`):null,t(e))}function JM(e){let t=(0,K.useCallback)(t=>e?.subscribe(t)??(()=>void 0),[e]),n=(0,K.useCallback)(()=>e?.get(),[e]);return(0,K.useSyncExternalStore)(t,n,n)}function YM(e){return JM(e?.context)??null}function XM(e){return YM(e)?.computerId??null}function ZM(e,t,n,r){let i=(0,K.useRef)(t);i.current=t;let a=(0,K.useRef)(n);a.current=n;let o=(0,K.useRef)(r);o.current=r;let s=JSON.stringify(t),c=n!==void 0;(0,K.useEffect)(()=>{e&&e.ui.reportStatus(i.current).catch(e=>{o.current?o.current(e):console.error(`Window status report failed`,e)})},[e,s]),(0,K.useEffect)(()=>{if(!(!e||!c))return e.ui.onStatusAction(e=>a.current?.(e)??!1)},[e,c]),(0,K.useEffect)(()=>()=>{e?.ui.reportStatus([]).catch(e=>{console.error(`Window status report failed`,e)})},[e])}function QM(e,{sourceId:t,namespace:n},r){let i=(0,K.useMemo)(()=>Bu(),[]),a=(0,K.useMemo)(r,[r]);return(0,K.useEffect)(()=>{let e=i.contribute({sourceId:t,namespace:n,commands:a});return()=>{e.dispose()}},[i,t,n,a]),(0,K.useEffect)(()=>e?uee(e.commands,a):void 0,[e,a]),i}var $M=class{id;version;#e;constructor(e,t,n){this.id=e,this.version=t,this.#e=n,Object.freeze(this)}get schema(){return this.#e}};function eN(e,t,n){return new $M(e,t,n)}function tN(e){let t=Uc(e),n=su(Object),r=Uc(Object.fromEntries(Object.keys(e).map(e=>[e,Mc().optional()])));return Mc().transform(e=>{let i=n.parse(e),a=Object.create(i),o=r.parse(a),s=Object.fromEntries(Object.entries(o).map(([e,t])=>[e,$l().parse(t).bind(i)]));return{...t.parse(s),[Symbol.dispose](){rM(e)}}})}function nN(e){return Mc().transform(t=>{try{return e.parse(t)}catch(e){throw e instanceof Y?e:new Y(`The capability returned malformed data`,{cause:e,code:`PROTOCOL`,retryable:!1})}finally{rM(t)}})}function rN(e){return $l({output:Zl(Mc().transform(t=>{try{return e.parse(t)}catch(e){throw rM(t),e instanceof Y?e:new Y(`The capability returned a malformed result`,{cause:e,code:`PROTOCOL`,retryable:!1})}}))})}var iN=rN(nN(Ic()));tN({fetch:rN(su(Response)),close:iN});var aN=e=>crypto.getRandomValues(new Uint8Array(e)),oN=(e,t,n)=>{let r=256-256%e.length;if(r===256){let r=e.length-1;return(i=t)=>{if(!i)return``;let a=``;for(;;){let t=n(i),o=i;for(;o--;)if(a+=e[t[o]&r],a.length>=i)return a}}}let i=Math.ceil(409.6*t/r);return(a=t)=>{if(!a)return``;let o=``;for(;;){let t=n(i),s=i;for(;s--;)if(t[s]<r&&(o+=e[t[s]%e.length],o.length>=a))return o}}},sN=(e,t=21)=>oN(e,t|0,aN),cN=`abcdefghijklmnopqrstuvwxyz0123456789`;function lN(e=21){if(e===1/0||e===-1/0)throw RangeError(`nanoid length must be finite`);return sN(cN,e)()}var uN=`gilled.velvety.spored.saprotrophic.mycorrhizal.luminescent.honeycomb.truffley.wispy.earthy.mossy.woody.waxy.gelatinous.coral.inkcapped.feathery.stiped.ringed.annulate.scaly.shaggy.fuzzy.spiky.conical.umbral.parasol.leathery.damp.dewy.bristly.powdery.yeasty.musty.ancient.patient.steady.faithful.hardy.rootbound.forested.shaded.sunlit.sporeladen.golden.honeyed.amber.ivory.crimson.violet.indigo.silver.mossgreen.midnight.creamy.buttery.porcelain.glossy.matte.ribbed.fluted.wavy.lobed.branched.curled.folded.hooded.crowned.blushing.weeping.laughing.dancing.singing.whistling.glowing.ghostly.fairy.elfin.rustic.homey.barnraised.pasture.orchard.mill.woven.gardened.herded.trailed.ridged.meadow.fielded.vined.rooted.tendered.seasoned.ripe.wild.tame.broody.stubborn.gentle.drowsy.watchful.wandering.migratory.burrowed.nested.perched.loamy.mulched.composted.fermented.brewed.cured.smoked.pickled.preserved.aged.vintage.heirloom.grandmothers.forgotten.remembered.beloved.cherished.worn.weathered.windblown.rainsoaked.frosted.snowed.bloomed.flowered.seeded.sprouted.grafted.pruned.harvested.threshed.milled.baked.proofed.risen.folded.twisted.braided.stitched.patched.mended.polished.burnished.glazed.gilded.verdigris.patinaed.microdosed.tripping.wavy.prismatic.shimmering.rippling.echoing.oracular.mystic.kaleidoscopic.auroral.nebular.azure.psychedelic.transcendent.visionary.wandering.dreaming.phantom.spectral.iridescent.liminal.tidal.celestial.cosmic.astral.ethereal.incandescent`.split(`.`),dN=`shiitake.morel.chanterelle.bolete.puffball.oyster.enoki.maitake.lionsmane.truffle.porcini.agaric.amanita.bracket.conk.stipe.cap.gill.spore.hypha.mycelium.sporocarp.earthstar.stinkhorn.jelly.milkcap.blewit.cep.hedgehog.woodear.waxcap.inkcap.birdnest.cup.saddle.fieldcap.rust.smut.ergot.lichen.yeast.mold.toadstool.fruitingbody.basidiocarp.ascocarp.perithecium.apothecium.cystidium.basidium.clamp.septa.rhizomorph.sclerotium.gemma.annulus.volva.pileus.lamella.trama.gleba.peridium.sporangium.zygospora.conidia.teleomorph.anamorph.saprobe.endophyte.epiphyte.decomposer.recycler.alchemist.mycorrhiza.hyphae.web.net.lattice.thread.strand.root.tendril.runner.vine.ivy.moss.fern.liverwort.mule.cairn.almanac.parrot.birddog.watchdog.pigeon.ranch.barn.coop.pasture.meadow.field.orchard.gate.fence.silo.well.windmill.homestead.trail.ridge.creek.hill.grove.vineyard.apiary.garden.plot.furrow.shed.stable.trough.hayloft.rootcellar.smokehouse.springhouse.millstone.weathervane.lantern.tinderbox.candlemold.honeycomb.beeswax.propolis.nectar.pollen.comb.burrow.den.nest.perch.warren.colony.swarm.flock.herd.pod.grist.flour.starter.mother.scoby.kombucha.miso.tempeh.cheese.rennet.whey.curd.cream.butter.braid.loaf.crust.crumb.fiddlehead.sorrel.ramp.morelberry.huckleberry.thimbleberry.salmonberry.serviceberry.chokecherry.microdose.trip.shroom.liberty.teacher.treasure.wanderer.seeker.dreamer.shaman.visionary.tripper.oracle.seer.augur.prism.fractal.kaleidoscope.spectrum.nebula.aurora.comet.meteor.eclipse.zenith.horizon.mirage.echo.ripple.shimmer.glimmer.phantom.twilight.starlight.moonbeam`.split(`.`);function fN(e){let t=Math.floor(4294967296/e.length)*e.length,n;do{let e=crypto.getRandomValues(new Uint32Array(1))[0];if(e===void 0)throw Error(`CSPRNG returned no candidate value`);n=e}while(n>=t);let r=e[n%e.length];if(r===void 0)throw Error(`Candidate vocabulary is empty`);return r}function pN(e){if(e?.count===1/0)throw RangeError(`words count must be finite`);let t=Math.max(1,Math.floor(e?.count??2)),n=e?.separator??`-`,r=[fN(uN)];for(let e=1;e<t;e++)r.push(fN(dN));return r.join(n)}var mN=p(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);yn.init(e,t),e.def=t,e.type=t.type,e.parse=(t,n)=>be(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>we(e,t,n),e.parseAsync=async(t,n)=>Se(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ee(e,t,n),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0}),e.with=e.check,e.clone=(t,n)=>R(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.apply=t=>t(e)}),hN=p(`ZodMiniObject`,(e,t)=>{mr.init(e,t),mN.init(e,t),T(e,`shape`,()=>t.shape)});function gN(e,t){return new hN({type:`object`,shape:e??{},...z(t)})}var _N=p(`ZodMiniLiteral`,(e,t)=>{Pr.init(e,t),mN.init(e,t)});function vN(e,t){return new _N({type:`literal`,values:Array.isArray(e)?e:[e],...z(t)})}function yN(e){return e instanceof Y?e:new Y(`App operation failed`,{cause:e,code:`HOST_FAILURE`,retryable:!1})}var bN=new WeakMap,xN={of(e,...t){return[e?.identity.surfaceId??null,e?.context.get().computerId??null,...t]}};function SN(e){let t={};return e&&bN.set(t,e),t}function CN(){let e=new DT({defaultOptions:{queries:{retry:!1,staleTime:3e4,refetchOnWindowFocus:!1},mutations:{retry:!1}}}),t=new Map;return e.getQueryCache().subscribe(n=>{let r=n.query;if(n.type===`removed`){t.get(r.queryHash)?.release(),t.delete(r.queryHash);return}let i=r.meta&&bN.get(r.meta),a=t.get(r.queryHash);if(a?.app===i||(a?.release(),t.delete(r.queryHash),!i))return;let o=()=>{queueMicrotask(()=>{e.getQueryCache().get(r.queryHash)===r&&t.get(r.queryHash)?.app===i&&e.resetQueries({predicate:e=>e===r})})},s=i.capabilities.subscribe(o);t.set(r.queryHash,{app:i,release:s}),a&&o()}),e}function wN(e,t,n,r){let i=e?.context.get().computerId;return yne({queryKey:n,meta:SN(e),enabled:e!==null,retry:!1,queryFn:async({signal:n})=>{try{if(!e)throw new Y(`No App connection`,{code:`DISCONNECTED`,retryable:!0});if(e.context.get().computerId!==i)throw new Y(`The selected Computer changed`,{code:`SELECTION_CHANGED`,retryable:!1});return await r(e.capabilities.require(t),n)}catch(e){throw yN(e)}}})}function TN(e){return Sne({mutationKey:e.queryKey,scope:{id:Hw(e.queryKey)},mutationFn:async(t,n)=>{try{return await e.mutationFn(t,n)}catch(e){throw yN(e)}},onMutate:async(t,{client:n})=>{if(n.isMutating({mutationKey:e.queryKey,exact:!0})>1)return;await n.cancelQueries({queryKey:e.queryKey,exact:!0});let r=n.getQueryData(e.queryKey);if(r!==void 0)return n.setQueryData(e.queryKey,e.apply(r,t)),{previous:r,optimistic:n.getQueryData(e.queryKey)}},onError:(t,n,r,{client:i})=>{r&&i.getQueryData(e.queryKey)===r.optimistic&&i.setQueryData(e.queryKey,r.previous)},onSettled:(t,n,r,i,{client:a})=>a.invalidateQueries({queryKey:e.queryKey,exact:!0})})}var EN=eN(`app.backend`,1,Yl(()=>tN({request:rN(nN(Mc().transform(e=>xu(e))))}))),DN=eN(`app.methods`,1,Yl(()=>tN({call:rN(nN(Mc().transform(e=>xu(e))))}))),ON=dl({png:`png`,jpeg:`jpeg`,webp:`webp`}),kN=dl({draft:`draft`,balanced:`balanced`,premium:`premium`,max:`max`}),AN=Yl(()=>Wc({transport:dl({json:`json`,multipart:`multipart`}),dimensions:dl({none:`none`,own:`own`}),maxDimension:uc().int().positive().nullable(),maxDimensionDocumented:vc(),defaultWidth:uc().int().positive(),defaultHeight:uc().int().positive(),steps:dl({steps:`steps`,num_steps:`num_steps`,fixed:`fixed`}),maxSteps:uc().int().positive().nullable(),defaultSteps:uc().int().nonnegative().nullable(),referenceField:fs().min(1).max(256).nullable(),maxReferences:uc().int().nonnegative()}).readonly()),jN=dl({seedance:`bytedance/seedance-2.0`,seedanceFast:`bytedance/seedance-2.0-fast`,seedanceMini:`bytedance/seedance-2.0-mini`,veo:`google/veo-3.1`,veoFast:`google/veo-3.1-fast`,minimaxH3Max:`minimax/h3-max`}),MN=dl({p480:`480p`,p720:`720p`,p768:`768p`,p1080:`1080p`,p4k:`4k`}),NN=dl({wide:`16:9`,landscape:`4:3`,square:`1:1`,portrait:`3:4`,tall:`9:16`,ultrawide:`21:9`,ultratall:`9:21`}),PN=dl({first:`first-frame`,last:`last-frame`,reference:`reference`}),FN=Yl(()=>Wc({resolution:MN,aspectRatio:NN,width:uc().int().positive(),height:uc().int().positive()}).readonly()),IN=Yl(()=>Wc({minSeconds:uc().int().positive(),maxSeconds:uc().int().positive(),defaultSeconds:uc().int().positive(),durations:Bc(uc().int().positive()).readonly(),provider:dl({seedance:`seedance`,veo:`veo`,minimax:`minimax`}),formats:Bc(FN).readonly(),defaultResolution:MN,defaultAspectRatio:NN,supportsAudio:vc(),defaultGenerateAudio:vc().nullable(),referenceRoles:Bc(PN).readonly(),maxReferenceImages:uc().int().nonnegative(),referenceResolutions:Bc(MN).readonly(),prices:Bc(Wc({resolution:MN,silentMilliunitsPerSecond:uc().int().positive(),audioMilliunitsPerSecond:uc().int().positive()}).readonly()).readonly()}).readonly()),LN=32e3,RN=2048;Wc({id:fs().min(1).max(256),label:fs().min(1).max(512),kind:dl({image:`image`,video:`video`}),tier:kN,outputFormats:Bc(ON).max(3).readonly(),maxPromptLength:uc().int().positive().max(LN),input:AN,sizes:Bc(fs().regex(/^\d+x\d+$/u)).readonly().nullable(),video:IN.nullable()}).readonly();var zN=e=>Object.freeze({kind:`image`,sizes:null,video:null,outputFormats:Object.freeze([]),...e,input:Object.freeze(e.input)}),BN={"480p":480,"720p":720,"768p":768,"1080p":1080,"4k":2160},VN={"16:9":[16,9],"4:3":[4,3],"1:1":[1,1],"3:4":[3,4],"9:16":[9,16],"21:9":[21,9],"9:21":[9,21]};function HN(e,t,n,r,i){let a=r===`seedance`,o=a?NN.options:[NN.enum.wide,NN.enum.tall,NN.enum.square],s=Object.freeze(i.flatMap(([e])=>o.map(t=>{let[n,r]=VN[t],i=BN[e],a=Math.min(n,r);return Object.freeze({resolution:e,aspectRatio:t,width:Math.ceil(i*n/a/2)*2,height:Math.ceil(i*r/a/2)*2})}))),c=Object.freeze(a?[4,5,6,7,8,9,10,11,12]:[4,6,8]),l=Object.freeze({minSeconds:4,maxSeconds:a?12:8,defaultSeconds:a?5:6,durations:c,provider:r,formats:s,defaultResolution:`720p`,defaultAspectRatio:`16:9`,supportsAudio:!0,defaultGenerateAudio:!a||null,referenceRoles:Object.freeze(a?PN.options:[PN.enum.first]),maxReferenceImages:a?4:0,referenceResolutions:Object.freeze(a?i.map(([e])=>e).filter(e=>e!==`1080p`):[]),prices:Object.freeze(i.map(([e,t,n])=>Object.freeze({resolution:e,silentMilliunitsPerSecond:t,audioMilliunitsPerSecond:n})))});return zN({id:e,label:t,tier:n,maxPromptLength:a?2e3:RN,kind:`video`,video:l,sizes:Object.freeze(s.map(({width:e,height:t})=>`${String(e)}x${String(t)}`)),input:{transport:`json`,dimensions:`own`,maxDimension:Math.max(...s.map(({width:e,height:t})=>Math.max(e,t))),maxDimensionDocumented:!1,defaultWidth:1280,defaultHeight:720,steps:`fixed`,maxSteps:null,defaultSteps:null,referenceField:a?`image`:`image_input`,maxReferences:a?4:1}})}function UN(){let e=[`480p`,`768p`],t=[NN.enum.wide,NN.enum.landscape,NN.enum.square,NN.enum.portrait,NN.enum.tall,NN.enum.ultrawide],n=Object.freeze(e.flatMap(e=>t.map(t=>{let[n,r]=VN[t],i=BN[e],a=Math.min(n,r);return Object.freeze({resolution:e,aspectRatio:t,width:Math.ceil(i*n/a/2)*2,height:Math.ceil(i*r/a/2)*2})}))),r=MN.enum.p768,i=NN.enum.wide,a=n.find(e=>e.resolution===r&&e.aspectRatio===i);if(a===void 0)throw Error(`minimax/h3-max is missing its default format`);let o=Object.freeze(Array.from({length:11},(e,t)=>t+5)),s=Object.freeze({minSeconds:5,maxSeconds:15,defaultSeconds:5,durations:o,provider:`minimax`,formats:n,defaultResolution:r,defaultAspectRatio:i,defaultGenerateAudio:null,supportsAudio:!1,referenceRoles:Object.freeze([PN.enum.first,PN.enum.reference]),maxReferenceImages:4,referenceResolutions:Object.freeze(e),prices:Object.freeze([{resolution:MN.enum.p480,silentMilliunitsPerSecond:5e3,audioMilliunitsPerSecond:5e3},{resolution:MN.enum.p768,silentMilliunitsPerSecond:8e3,audioMilliunitsPerSecond:8e3}])});return zN({id:jN.enum.minimaxH3Max,label:`MiniMax H3 Max`,tier:`balanced`,maxPromptLength:7e3,kind:`video`,video:s,sizes:Object.freeze(n.map(({width:e,height:t})=>`${String(e)}x${String(t)}`)),input:{transport:`json`,dimensions:`own`,maxDimension:Math.max(...n.map(({width:e,height:t})=>Math.max(e,t))),maxDimensionDocumented:!1,defaultWidth:a.width,defaultHeight:a.height,steps:`fixed`,maxSteps:null,defaultSteps:null,referenceField:`image_url`,maxReferences:4}})}Object.freeze([zN({id:`@cf/black-forest-labs/flux-1-schnell`,maxPromptLength:2048,outputFormats:Object.freeze([`jpeg`]),tier:`draft`,label:`Flux 1 Schnell — cheap/fast sketches`,input:{transport:`json`,dimensions:`none`,maxDimension:null,maxDimensionDocumented:!1,defaultWidth:1024,defaultHeight:768,steps:`steps`,maxSteps:8,defaultSteps:4,referenceField:null,maxReferences:0}}),zN({id:`@cf/black-forest-labs/flux-2-klein-4b`,maxPromptLength:RN,tier:`balanced`,label:`Flux 2 Klein 4b — balanced default`,input:{transport:`multipart`,dimensions:`own`,maxDimension:1920,maxDimensionDocumented:!1,defaultWidth:1024,defaultHeight:768,steps:`fixed`,maxSteps:null,defaultSteps:4,referenceField:`input_image_`,maxReferences:4}}),zN({id:`@cf/black-forest-labs/flux-2-klein-9b`,maxPromptLength:RN,tier:`premium`,label:`Flux 2 Klein 9b — higher quality flux-2`,input:{transport:`multipart`,dimensions:`own`,maxDimension:1920,maxDimensionDocumented:!1,defaultWidth:1024,defaultHeight:768,steps:`fixed`,maxSteps:null,defaultSteps:4,referenceField:`input_image_`,maxReferences:4}}),zN({id:`@cf/black-forest-labs/flux-2-dev`,maxPromptLength:RN,tier:`max`,label:`Flux 2 Dev — best detailed quality, expensive`,input:{transport:`multipart`,dimensions:`own`,maxDimension:1920,maxDimensionDocumented:!1,defaultWidth:1024,defaultHeight:768,steps:`steps`,maxSteps:null,defaultSteps:20,referenceField:`input_image_`,maxReferences:4}}),zN({id:`@cf/leonardo/lucid-origin`,maxPromptLength:RN,tier:`premium`,label:`Leonardo Lucid Origin — premium prompt adherence`,input:{transport:`json`,dimensions:`own`,maxDimension:2500,maxDimensionDocumented:!0,defaultWidth:1120,defaultHeight:1120,steps:`num_steps`,maxSteps:40,defaultSteps:null,referenceField:null,maxReferences:0}}),zN({id:`@cf/leonardo/phoenix-1.0`,maxPromptLength:RN,tier:`balanced`,label:`Leonardo Phoenix 1.0 — best prompt adherence`,input:{transport:`json`,dimensions:`own`,maxDimension:2048,maxDimensionDocumented:!0,defaultWidth:1024,defaultHeight:1024,steps:`num_steps`,maxSteps:50,defaultSteps:25,referenceField:null,maxReferences:0}}),zN({id:`openai/gpt-image-2`,maxPromptLength:32e3,outputFormats:Object.freeze([`png`,`jpeg`,`webp`]),tier:`premium`,label:`GPT Image 2 — strong text and layout, premium`,sizes:Object.freeze([`1024x1024`,`1024x1536`,`1536x1024`]),input:{transport:`json`,dimensions:`own`,maxDimension:1536,maxDimensionDocumented:!1,defaultWidth:1024,defaultHeight:1024,steps:`fixed`,maxSteps:null,defaultSteps:null,referenceField:`images`,maxReferences:16}}),HN(jN.enum.seedance,`Seedance 2.0`,`balanced`,`seedance`,[[`480p`,7e3,7e3],[`720p`,15e3,15e3],[`1080p`,37e3,37e3],[`4k`,78e3,78e3]]),HN(jN.enum.seedanceFast,`Seedance 2.0 Fast`,`draft`,`seedance`,[[`480p`,6e3,6e3],[`720p`,12e3,12e3]]),HN(jN.enum.seedanceMini,`Seedance 2.0 Mini`,`draft`,`seedance`,[[`480p`,4e3,4e3],[`720p`,9e3,9e3]]),HN(jN.enum.veo,`Veo 3.1`,`premium`,`veo`,[[`720p`,2e4,4e4],[`1080p`,2e4,4e4]]),HN(jN.enum.veoFast,`Veo 3.1 Fast`,`balanced`,`veo`,[[`720p`,8e3,1e4],[`1080p`,1e4,12e3]]),UN()]);var WN=e=>fs().min(1).max(e),GN=uc().int().min(-(2**53-1)).max(2**53-1),KN=GN.positive(),qN=GN.nonnegative(),JN=Wc({printId:WN(256),computerId:WN(256),kind:dl([`image`,`video`]),prompt:WN(LN),model:WN(256),width:KN.nullable(),height:KN.nullable(),steps:qN.nullable(),durationSeconds:qN.nullable(),format:WN(32),bytes:KN,costMilliunits:qN,actorKind:dl([`member`,`agent`]),actorId:WN(256),derivedFrom:WN(256).nullable(),createdAt:qN,source:dl([`recorded`,`file`]),schemaVersion:KN}),YN=Uc({printId:JN.shape.printId,path:fs().startsWith(`/`).min(2).max(4096)});function XN(e,t){let n=e?.app??null,r=YM(n),i=r?.openRequest,a=r?.computerId,o=i?.kind===`navigate`?i.params.find(e=>e.key===`print`):void 0,s=JN.shape.printId.safeParse(o?.value),c=s.success?s.data:null,l=i?.kind===`navigate`?i.requestId:null,u=(0,K.useRef)({app:n,requestId:l,computerId:a});(u.current.app!==n||u.current.requestId!==l)&&(u.current={app:n,requestId:l,computerId:a});let d=u.current.computerId===a,f=BT({...wN(n,DN,xN.of(n,`prints`,`navigate`,a,l,c),async(e,t)=>{if(!n||!a||!c||!l)throw Error(`No print selected`);let r=await e.call(`openOutput`,JSON.stringify({printId:c,byteLength:1}));if(t.throwIfAborted(),n.context.get().computerId!==a)throw Error(`Computer selection changed`);let i=YN.parse(r);if(i.printId!==c)throw Error(`Print selection changed`);return{path:i.path,requestId:l,computerId:a}}),enabled:!!(n&&d&&a&&l&&c&&n.capabilities.has(DN)),retry:!1,staleTime:1/0}),p=(0,K.useRef)(t);p.current=t;let m=(0,K.useRef)(void 0);return(0,K.useEffect)(()=>{let t=f.data;!e||!t||m.current===t||e.app.context.get().computerId!==t.computerId||(m.current=t,p.current(t.path,`add`,e,t.computerId))},[e,f.data]),{target:f.data??null,error:f.error}}q({operation:KC(`read-library`),computerId:Cw});var ZN=XC.pipe(J(xw(4096)),J(cw(e=>e.startsWith(`/`)&&e!==`/`&&!e.includes(`\0`)&&!e.endsWith(`/`)&&!e.split(`/`).some(e=>e===`.`||e===`..`))));q({path:iw(ZN)});var QN=function(e,t,n){if(t!=null){if(typeof t!=`object`&&typeof t!=`function`)throw TypeError(`Object expected.`);var r,i;if(n){if(!Symbol.asyncDispose)throw TypeError(`Symbol.asyncDispose is not defined.`);r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw TypeError(`Symbol.dispose is not defined.`);r=t[Symbol.dispose],n&&(i=r)}if(typeof r!=`function`)throw TypeError(`Object not disposable.`);i&&(r=function(){try{i.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t},$N=(function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,`An error was suppressed during disposal.`):n,t.hasError=!0}var r,i=0;function a(){for(;r=t.stack.pop();)try{if(!r.async&&i===1)return i=0,t.stack.push(r),Promise.resolve().then(a);if(r.dispose){var e=r.dispose.call(r.value);if(r.async)return i|=2,Promise.resolve(e).then(a,function(e){return n(e),a()})}else i|=1}catch(e){n(e)}if(i===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return a()}})(typeof SuppressedError==`function`?SuppressedError:function(e,t,n){var r=Error(n);return r.name=`SuppressedError`,r.error=e,r.suppressed=t,r}),eP=class extends Y{stage;provider;constructor(e){super(e.message,{code:e.code,retryable:e.retryable}),this.stage=e.stage??null,this.provider=e.provider}},tP=e=>XC.pipe(J(yw(1)),J(xw(e))),nP=q({requestId:tP(256),computerId:tP(256)}),rP=ZC.pipe(J(_w()),J(cw(Number.isSafeInteger,{message:`Expected a safe integer`}))),iP=rP.pipe(J(pw(0))),aP=rP.pipe(J(mw(0))),oP=rw([`first-frame`,`last-frame`,`reference`]),sP=rw([`480p`,`720p`,`768p`,`1080p`,`4k`]),cP=rw([`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`,`9:21`]),lP=q({path:tP(4096),role:GC(oP)}),uP=q({path:tP(4096),role:oP}),dP=q({computerId:tP(256),path:tP(4096)}),fP=q({defaultHeight:iP,defaultSteps:iw(aP),defaultWidth:iP,dimensions:rw([`none`,`own`]),maxDimension:iw(iP),maxDimensionDocumented:QC,maxReferences:aP,maxSteps:iw(iP),referenceField:iw(tP(256)),steps:rw([`steps`,`num_steps`,`fixed`]),transport:rw([`json`,`multipart`])}),pP=q({minSeconds:iP,maxSeconds:iP,defaultSeconds:iP,durations:ew(iP),provider:rw([`seedance`,`veo`,`minimax`]),formats:ew(q({resolution:sP,aspectRatio:cP,width:iP,height:iP})),defaultResolution:sP,defaultAspectRatio:cP,supportsAudio:QC,defaultGenerateAudio:iw(QC),referenceRoles:ew(oP),maxReferenceImages:aP,referenceResolutions:ew(sP),prices:ew(q({resolution:sP,silentMilliunitsPerSecond:iP,audioMilliunitsPerSecond:iP}))}),mP=ew(q({id:tP(256),input:fP,kind:rw([`image`,`video`]),label:tP(512),maxPromptLength:iP,tier:rw([`draft`,`balanced`,`premium`,`max`]),outputFormats:ew(rw([`png`,`jpeg`,`webp`])).pipe(J(xw(3))),sizes:iw(ew(XC.pipe(J(uw(/^\d+x\d+$/u))))),video:iw(pP)})),hP=q({[Symbol.dispose]:GC(qC),computerId:tP(256),models:mP,canGenerate:QC}),gP=q({model:tP(256),prompt:tP(2048),width:iP.pipe(J(hw(5040))),height:iP.pipe(J(hw(5040))),steps:GC(iP),durationSeconds:GC(iP),resolution:GC(sP),aspectRatio:GC(cP),generateAudio:GC(QC),references:GC(ew(lP).pipe(J(xw(16))))});q({model:tP(256),prompt:tP(2048),resolution:GC(sP),aspectRatio:GC(cP),durationSeconds:GC(iP.pipe(J(mw(4)),J(hw(15)))),generateAudio:GC(QC),references:GC(ew(uP).pipe(J(xw(4))))});var _P=[`admission`,`generation-authorization`,`settings`,`estimate`,`billing`,`operation`,`provider`,`normalization`,`artifact`,`destination-authorization`,`destination-write`],vP=q({destination:q({path:tP(4096)}),settings:qC}),yP=q({[Symbol.dispose]:GC(qC),bytes:iP,costMilliunits:aP,destination:dP,format:rw([`png`,`jpeg`,`gif`,`webp`,`mp4`]),height:iP,model:tP(256),width:iP});q({...yP.fields,format:KC(`mp4`)});var bP=q({message:tP(512),stage:GC(rw(_P)),provider:GC(Tw),code:rw([`CANCELLED`,`CAPABILITY_DENIED`,`CAPABILITY_REVOKED`,`DISCONNECTED`,`HOST_FAILURE`,`IDENTITY`,`INSUFFICIENT_CREDIT`,`INVALID_ARGUMENT`,`PROTOCOL`,`SAFETY_FILTER_REFUSED`,`TIMEOUT`]),retryable:QC}),xP=nw([q({[Symbol.dispose]:GC(qC),kind:KC(`succeeded`),result:yP}),q({[Symbol.dispose]:GC(qC),kind:KC(`failed`),failure:bP})]),SP=tN({reference:rN(nN(Mc().transform(e=>HC(nP)(e)))),generate:rN(nN(Mc().transform(e=>{let t=HC(xP,{onExcessProperty:`error`})(e);return t.kind===`succeeded`?{kind:t.kind,result:{bytes:t.result.bytes,costMilliunits:t.result.costMilliunits,destination:t.result.destination,format:t.result.format,height:t.result.height,model:t.result.model,width:t.result.width}}:{kind:t.kind,failure:t.failure}})))}),CP=eN(`media.generation`,5,Yl(()=>tN({describe:rN(nN(Mc().transform(e=>{let{computerId:t,canGenerate:n,models:r}=HC(hP,{onExcessProperty:`error`})(e);return{computerId:t,canGenerate:n,models:r}}))),createAttempt:rN(SP),restoreAttempt:rN(SP),cancelAttempt:iN})));function wP(e,t){try{return HC(e,{onExcessProperty:`error`})(t)}catch(e){throw new Y(`The Media capability returned malformed data`,{cause:e,code:`PROTOCOL`,retryable:!1})}}function TP(e){return e instanceof Y?e:new Y(`The Media capability failed`,{cause:e,code:`HOST_FAILURE`,retryable:!0})}function EP(e){if(e?.aborted)throw new Y(`Media generation was cancelled`,{code:`CANCELLED`,retryable:!1})}function DP(e){let t;try{t=HC(vP,{onExcessProperty:`error`})(e)}catch(e){throw new Y(`Media generation input is invalid`,{cause:e,code:`INVALID_ARGUMENT`,retryable:!1})}let n;try{n=OP(HC(gP,{onExcessProperty:`error`})(t.settings))}catch(e){throw new Y(`Media generation settings are invalid`,{cause:e,code:`INVALID_ARGUMENT`,retryable:!1})}let r={path:t.destination.path.trim()};if(r.path.length===0)throw new Y(`Media generation destination is invalid`,{code:`INVALID_ARGUMENT`,retryable:!1});return Object.freeze({destination:Object.freeze(r),settings:n})}function OP(e){let t=(e,t)=>{let n=e.trim();if(n.length===0)throw Error(`${t} must not be blank`);return n},n={model:t(e.model,`model`),prompt:t(e.prompt,`prompt`),width:e.width,height:e.height};return e.steps!==void 0&&(n.steps=e.steps),e.durationSeconds!==void 0&&(n.durationSeconds=e.durationSeconds),e.resolution!==void 0&&(n.resolution=e.resolution),e.aspectRatio!==void 0&&(n.aspectRatio=e.aspectRatio),e.generateAudio!==void 0&&(n.generateAudio=e.generateAudio),e.references!==void 0&&(n.references=Object.freeze(e.references.map(e=>Object.freeze({...e,path:t(e.path,`reference`)})))),Object.freeze(n)}function kP(e){let t=wP(mP,e),n=new Set;for(let e of t){if(n.has(e.id))throw new Y(`The Media capability repeated a model`,{code:`PROTOCOL`,retryable:!1});n.add(e.id)}return Object.freeze(t.map(e=>Object.freeze(e)))}function AP(e,t,n){let r=wP(yP,e);if(r.model!==t.settings.model||r.destination.computerId!==n||r.destination.path!==t.destination.path||r.width!==t.settings.width||r.height!==t.settings.height)throw new Y(`The Media capability returned an unrelated result`,{code:`PROTOCOL`,retryable:!1});return Object.freeze({bytes:r.bytes,costMilliunits:r.costMilliunits,destination:Object.freeze({...r.destination}),format:r.format,height:r.height,model:r.model,width:r.width})}async function jP(e){try{let t=e.require(CP);{let e={stack:[],error:void 0,hasError:!1};try{let n=wP(hP,QN(e,iM(await t.describe()),!1).value),r=n.computerId.trim();if(r.length===0)throw new Y(`The Media capability returned no Computer`,{code:`PROTOCOL`,retryable:!1});let i=kP(n.models),a=async e=>{let n=iM(e),i;try{{let t={stack:[],error:void 0,hasError:!1};try{let n=QN(t,iM(await e.reference()),!1),a=wP(q({...nP.fields,[Symbol.dispose]:GC(qC)}),n.value);if(i={requestId:a.requestId,computerId:a.computerId},i.computerId!==r)throw new Y(`Media attempt belongs to another Computer`,{code:`IDENTITY`,retryable:!1})}catch(e){t.error=e,t.hasError=!0}finally{$N(t)}}}catch(e){throw n[Symbol.dispose](),TP(e)}let a=!1;return{reference:Object.freeze(i),async generate(n,o={}){if(a)throw new Y(`Media generation attempt is closed`,{code:`CAPABILITY_DENIED`,retryable:!1});EP(o.signal);let s=DP(n),c=o.signal,l,u,d=()=>(u??=t.cancelAttempt(i),u);try{let t=e.generate(s),n=c===void 0?await t:await Promise.race([t,new Promise((e,t)=>{l=()=>{d().then(()=>{t(new Y(`Media generation was cancelled`,{code:`CANCELLED`,retryable:!1}))},t)},c.addEventListener(`abort`,l,{once:!0}),c.aborted&&l()})]);c?.aborted&&(await d(),EP(c)),EP(c);{let e={stack:[],error:void 0,hasError:!1};try{let t=wP(xP,QN(e,iM(n),!1).value);if(t.kind===`failed`)throw new eP(t.failure);return AP(t.result,s,r)}catch(t){e.error=t,e.hasError=!0}finally{$N(e)}}}catch(e){throw c?.aborted&&(await d(),EP(c)),TP(e)}finally{l!==void 0&&c?.removeEventListener(`abort`,l)}},[Symbol.dispose](){a||(a=!0,n[Symbol.dispose]())}}};return Object.freeze({computerId:r,canGenerate:n.canGenerate,models:i,async createAttempt(){return a(await t.createAttempt())},async restoreAttempt(e){let n=wP(nP,e);if(n.computerId!==r)throw new Y(`Select the original Computer to retry this generation`,{code:`IDENTITY`,retryable:!1});let i=await a(await t.restoreAttempt(n));if(i.reference.requestId!==n.requestId)throw i[Symbol.dispose](),new Y(`Media restore changed the request identity`,{code:`PROTOCOL`,retryable:!1});return i}})}catch(t){e.error=t,e.hasError=!0}finally{$N(e)}}}catch(e){throw TP(e)}}var MP=Cw,NP=ew(Cw.pipe(J(xw(1024)))).pipe(J(xw(200)));nw([q({operation:KC(`read-notices`),computerId:MP}),q({operation:KC(`dismiss-notices`),computerId:MP,keys:NP})]);var PP=q({keys:NP});async function FP(e,t){return HC(PP)(await e.require(EN).request(JSON.stringify(t)))}nw([q({operation:KC(`read-folder`),computerId:MP}),q({operation:KC(`select-folder`),computerId:MP,path:ZN})]);var IP=q({path:ZN,configured:QC});async function LP(e,t){return HC(IP)(await e.require(EN).request(JSON.stringify(t)))}var RP=2048,zP=8e3,BP=[{name:`Anime cel`,text:`Anime cel illustration with clean ink outlines, flat cel shading, and a limited palette of saturated colors. Soft painted backgrounds, expressive eyes, and crisp highlights, in the look of a hand-drawn animation frame.`},{name:`Cinematic film still`,text:`Cinematic film still shot on anamorphic lenses with shallow depth of field. Moody, motivated lighting, subtle film grain, and a considered color grade, composed like a frame from a feature film.`},{name:`Watercolor`,text:`Soft watercolor painting on textured paper, with translucent washes, visible pigment bleeds, and gentle color gradients. Loose brushwork, white paper left showing at the edges, and a calm, airy mood.`},{name:`Pixel art`,text:`Pixel art with a limited color palette, crisp square pixels, and no anti-aliasing. Clear readable silhouettes, dithered shading, and the charm of a classic 16-bit game sprite or scene.`},{name:`Product photo`,text:`Professional product photograph on a seamless studio background. Soft diffused lighting with gentle shadows, sharp focus across the subject, accurate colors, and clean, minimal composition suited to a catalog.`},{name:`Comic ink`,text:`Comic book panel with bold black ink linework, hatching and crosshatched shadows, and flat vivid colors. Dynamic angles, strong contrast, and a printed halftone texture.`}].map((e,t)=>({...e,id:-(t+1),builtIn:!0})),VP=XC.pipe(J(yw(1)),J(xw(64))),HP=XC.pipe(J(yw(1)),J(xw(zP))),UP=Cw,WP=q({id:vw,name:VP,text:HP,builtIn:QC});nw([q({operation:KC(`list-styles`),computerId:UP}),q({operation:KC(`save-style`),computerId:UP,id:GC(vw),name:VP,text:HP}),q({operation:KC(`delete-style`),computerId:UP,id:vw}),q({operation:KC(`read-print-style`),computerId:UP,path:Cw})]);var GP=q({styles:ew(WP).pipe(J(xw(50+BP.length)))}),KP=q({style:iw(VP)});function qP(e,t){let n=t.trim();return e===void 0?n:`${e.trim()}\n\n${n}`}function JP(e){return e?.maxPromptLength??RP}function YP(e,t,n,r=[]){if(e.length<=t)return;let i=`${String(e.length)} characters; this model accepts at most ${String(t)}.`,a=r.map(e=>`@${e}`).join(`, `);return n!==void 0&&a!==``?`The "${n}" style and your prompt with ${a} expanded total ${i}`:n===void 0?a===``?`The prompt is ${i}`:`Your prompt with ${a} expanded is ${i}`:`The "${n}" style and your prompt total ${i}`}var XP=e=>e.require(EN),ZP=e=>JSON.stringify(e),QP=HC(GP);async function $P(e,t){return QP(await XP(e).request(ZP({operation:`list-styles`,computerId:t})))}async function eF(e,t,n){return QP(await XP(e).request(ZP({operation:`save-style`,computerId:t,id:n.id,name:n.name,text:n.text})))}async function tF(e,t,n){return QP(await XP(e).request(ZP({operation:`delete-style`,computerId:t,id:n})))}async function nF(e,t,n){return HC(KP)(await XP(e).request(ZP({operation:`read-print-style`,computerId:t,path:n})))}var rF=8,iF=XC.pipe(J(yw(1)),J(xw(32)),J(uw(/^[\p{L}\p{N}_-]+$/u))),aF=XC.pipe(J(xw(500))),oF=ew(q({path:Cw.pipe(J(xw(4096)))})).pipe(J(xw(8))),sF=Cw,cF=q({id:vw,name:iF,description:aF,references:oF});nw([q({operation:KC(`list-characters`),computerId:sF}),q({operation:KC(`save-character`),computerId:sF,id:GC(vw),name:iF,description:aF,references:oF}),q({operation:KC(`delete-character`),computerId:sF,id:vw})]);var lF=q({characters:ew(cF).pipe(J(xw(50)))}),uF=(e,t)=>e.toLowerCase()===t.toLowerCase(),dF=/(?<![\p{L}\p{N}_@-])@([\p{L}\p{N}_-]+)/gu;function fF(e){let t=[];for(let n of e.matchAll(dF)){let e=n.at(1);e!==void 0&&!t.some(t=>uF(t,e))&&t.push(e)}return t}function pF(e,t){let n=[];return{prompt:e.replace(dF,(e,r)=>{let i=t.find(e=>uF(e.name,r));if(i===void 0)return e;let a=!n.includes(i);return a&&n.push(i),a&&i.description.trim()!==``?`${i.name} (${i.description.trim()})`:i.name}),characters:n}}function mF(e,t,n){let r=e.trim();return qP(t,pF(r,n).prompt).length-r.length}function hF(e,t){let n=fF(e),r=t.filter(e=>!n.some(t=>uF(t,e)));return r.length===0?e:`${r.map(e=>`@${e}`).join(` `)} ${e}`}function gF(e,t){let n=[...e];for(let e of t)for(let t of e.references)n.some(e=>e.path===t.path)||n.push({path:t.path});return n}function _F(e){let t=pF(hF(e.prompt,e.names??[]),e.saved),n=gF(e.references,t.characters),r=n.length-e.references.length;if(e.model!==void 0&&r>0&&n.length>e.model.maxReferences){let n=t.characters.map(e=>e.name).join(`, `);return{kind:`refused`,message:e.model.maxReferences===0?`${e.model.label} does not take reference images, so it cannot use ${n}.`:`${n} add ${String(r)} reference ${r===1?`image`:`images`} to your ${String(e.references.length)}; ${e.model.label} accepts at most ${String(e.model.maxReferences)}.`}}return{kind:`ready`,prompt:t.prompt,references:n,characters:t.characters}}function Cre(e,t){let n=/(?<![\p{L}\p{N}_@-])@([\p{L}\p{N}_-]*)$/u.exec(e.slice(0,t));return n===null?null:{start:n.index,query:n.at(1)??``}}function wre(e,t){let n=t.toLowerCase(),r=e=>e.name.toLowerCase();return[...e.filter(e=>r(e).startsWith(n)),...e.filter(e=>!r(e).startsWith(n)&&r(e).includes(n))].slice(0,rF)}var vF=e=>e.require(EN),yF=e=>JSON.stringify(e),bF=HC(lF);async function Tre(e,t){return bF(await vF(e).request(yF({operation:`list-characters`,computerId:t})))}async function Ere(e,t,n){return bF(await vF(e).request(yF({operation:`save-character`,computerId:t,id:n.id,name:n.name,description:n.description,references:n.references})))}async function Dre(e,t,n){return bF(await vF(e).request(yF({operation:`delete-character`,computerId:t,id:n})))}var xF={models:e=>xN.of(e,`prints`,`models`),folder:e=>xN.of(e,`prints`,`folder`),dismissals:e=>xN.of(e,`prints`,`dismissals`),styles:e=>xN.of(e,`prints`,`styles`),printStyle:(e,t)=>xN.of(e,`prints`,`print-style`,t),characters:e=>xN.of(e,`prints`,`characters`)};function Ore(e){return{...wN(e,CP,xF.models(e),async(t,n)=>{if(!e)throw Error(`Prints is disconnected`);let r=await jP(e.capabilities);return n.throwIfAborted(),r}),enabled:!!(e?.context.get().computerId&&e.capabilities.has(CP)),structuralSharing:!1}}function kre(e){let t=e?.context.get().computerId;return{...wN(e,EN,xF.folder(e),async(n,r)=>{if(!e||!t)throw Error(`No Computer selected`);let i=await LP(e.capabilities,{operation:`read-folder`,computerId:t});if(r.throwIfAborted(),e.context.get().computerId!==t)throw new Y(`Computer selection changed`,{code:`SELECTION_CHANGED`,retryable:!1});return i}),enabled:!!(t&&e.capabilities.has(EN))}}function Are(e){let t=e?.context.get().computerId;return{...wN(e,EN,xF.dismissals(e),async(n,r)=>{if(!e||!t)throw Error(`No Computer selected`);let i=await FP(e.capabilities,{operation:`read-notices`,computerId:t});return r.throwIfAborted(),i}),enabled:!!(t&&e.capabilities.has(EN))}}function jre(e){let t=e?.context.get().computerId;return{...wN(e,EN,xF.styles(e),async(n,r)=>{if(!e||!t)throw Error(`No Computer selected`);let i=await $P(e.capabilities,t);return r.throwIfAborted(),i}),enabled:!!(t&&e.capabilities.has(EN))}}function Mre(e,t){let n=e?.context.get().computerId;return{...wN(e,EN,xF.printStyle(e,t??``),async(r,i)=>{if(!e||!n||t===null)throw Error(`No print selected`);let a=await nF(e.capabilities,n,t);return i.throwIfAborted(),a}),enabled:!!(n&&t!==null&&e.capabilities.has(EN))}}function Nre(e){let t=e?.context.get().computerId;return{...wN(e,EN,xF.characters(e),async(n,r)=>{if(!e||!t)throw Error(`No Computer selected`);let i=await Tre(e.capabilities,t);return r.throwIfAborted(),i}),enabled:!!(t&&e.capabilities.has(EN))}}var Pre=Object.freeze({alphaIntercept:-9,alphaSlope:19,blurStdDeviation:1.5}),Fre=Object.freeze([`2xs`,`xs`,`sm`,`md`,`lg`,`xl`,`2xl`,`3xl`,`4xl`]);Object.freeze(`--stipe-font-synthesis.--stipe-surface-frame-width.--stipe-surface-frame-image.--stipe-surface-molding-contrast.--stipe-shadow-raised.--stipe-shadow-inset.--stipe-shadow-edge.--stipe-display-gasket-face.--stipe-display-texture-image.--stipe-display-text-shadow.--stipe-canvas.--stipe-surface.--stipe-surface-raised.--stipe-surface-selected.--stipe-fg-muted.--stipe-linework.--stipe-hairline.--stipe-figure-ink.--stipe-density-compact.--stipe-density-comfortable.--stipe-motion-spring.--stipe-motion-squish.--stipe-motion-fast.--stipe-motion-normal.--stipe-motion-slow.--stipe-motion-ease.--stipe-motion-ease-exit.--stipe-motion-bounce.--stipe-motion-spring-duration.--stipe-motion-stretch.--stipe-motion-distance.--stipe-motion-stagger.--stipe-motion-blur.--stipe-motion-shake.--stipe-motion-steps.--stipe-motion-fuse.--stipe-press-depth.--stipe-press-scale.--stipe-layer-desktop.--stipe-layer-windows.--stipe-layer-chrome.--stipe-layer-popover.--stipe-layer-dialog.--stipe-layer-toast.--stipe-layer-tooltip.--stipe-overlay-shadow-outset.--stipe-icon-size-sm.--stipe-icon-size-md.--stipe-icon-size-lg.--stipe-icon-stroke.--stipe-card-rim.--stipe-card-rim-edge.--stipe-card-face.--stipe-card-panel.--stipe-card-ink.--stipe-card-ink-muted.--stipe-card-accent.--stipe-card-shadow.--stipe-card-foil-highlight.--stipe-card-foil-warm.--stipe-card-foil-cool.--stipe-avatar-shadow.--stipe-art-coral.--stipe-art-blue.--stipe-art-mint.--stipe-art-grape.--stipe-art-yellow.--stipe-art-cream.--stipe-art-ink.--stipe-art-inkcap.--stipe-art-graphite.--stipe-sketch-ink`.split(`.`));function SF(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=SF(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Ire(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=SF(e))&&(r&&(r+=` `),r+=t);return r}var CF=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,wF=Ire,TF=(e,t)=>n=>{if(t?.variants==null)return wF(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=CF(t)||CF(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 wF(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)},EF=Object.defineProperty,Lre=((e,t)=>{let n={};for(var r in e)EF(n,r,{get:e[r],enumerable:!0});return t||EF(n,Symbol.toStringTag,{value:`Module`}),n})({isAny:()=>AF,isAnyNonArbitrary:()=>Zre,isArbitraryFamilyName:()=>iie,isArbitraryImage:()=>oie,isArbitraryLength:()=>tie,isArbitraryNumber:()=>nie,isArbitraryPosition:()=>aie,isArbitraryShadow:()=>sie,isArbitrarySize:()=>eie,isArbitraryValue:()=>VF,isArbitraryVariable:()=>HF,isArbitraryVariableFamilyName:()=>lie,isArbitraryVariableImage:()=>fie,isArbitraryVariableLength:()=>cie,isArbitraryVariablePosition:()=>uie,isArbitraryVariableShadow:()=>pie,isArbitraryVariableSize:()=>die,isArbitraryVariableWeight:()=>mie,isArbitraryWeight:()=>rie,isFraction:()=>Wre,isInteger:()=>Gre,isNamedContainerQuery:()=>Qre,isNumber:()=>kF,isPercent:()=>Kre,isTshirtSize:()=>qre}),DF=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,OF=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Rre=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,zre=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Bre=/\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$/,Vre=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Hre=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ure=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wre=e=>Rre.test(e),kF=e=>!!e&&!Number.isNaN(Number(e)),Gre=e=>!!e&&Number.isInteger(Number(e)),Kre=e=>e.endsWith(`%`)&&kF(e.slice(0,-1)),qre=e=>zre.test(e),AF=()=>!0,Jre=e=>Bre.test(e)&&!Vre.test(e),jF=()=>!1,Yre=e=>Hre.test(e),Xre=e=>Ure.test(e),Zre=e=>!VF(e)&&!HF(e),Qre=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),MF=(e,t,n)=>{let r=DF.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},NF=(e,t,n=!1)=>{let r=OF.exec(e);return r?r[1]?t(r[1]):n:!1},PF=e=>e===`position`||e===`percentage`,FF=e=>e===`image`||e===`url`,IF=e=>e===`length`||e===`size`||e===`bg-size`,LF=e=>e===`length`,$re=e=>e===`number`,RF=e=>e===`family-name`,zF=e=>e===`number`||e===`weight`,BF=e=>e===`shadow`,eie=e=>MF(e,IF,jF),VF=e=>DF.test(e),tie=e=>MF(e,LF,Jre),nie=e=>MF(e,$re,kF),rie=e=>MF(e,zF,AF),iie=e=>MF(e,RF,jF),aie=e=>MF(e,PF,jF),oie=e=>MF(e,FF,Xre),sie=e=>MF(e,BF,Yre),HF=e=>OF.test(e),cie=e=>NF(e,LF),lie=e=>NF(e,RF),uie=e=>NF(e,PF),die=e=>NF(e,IF),fie=e=>NF(e,FF),pie=e=>NF(e,BF,!0),mie=e=>NF(e,zF,!0),UF=(e,t)=>{let n=Object.keys(e);return n.length===1&&n[0]===t&&typeof e[t]==`string`},hie=e=>typeof e==`function`&&e.isThemeGetter===!0,gie=e=>({...e,theme:{...e.theme},classGroups:{...e.classGroups},conflictingClassGroups:{...e.conflictingClassGroups},conflictingClassGroupModifiers:{...e.conflictingClassGroupModifiers},orderSensitiveModifiers:[...e.orderSensitiveModifiers],postfixLookupClassGroups:[...e.postfixLookupClassGroups??[]]}),_ie=(e,t)=>{let n=gie(e);t.prefix!==void 0&&(n.prefix=t.prefix);let r=(e,t)=>{if(t)for(let n in t)t[n]!==void 0&&(e[n]=t[n])},i=t.override;i&&(i.orderSensitiveModifiers&&(n.orderSensitiveModifiers=[...i.orderSensitiveModifiers]),r(n.theme,i.theme),r(n.classGroups,i.classGroups),r(n.conflictingClassGroups,i.conflictingClassGroups),r(n.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers));let a=(e,t)=>{if(t)for(let n in t){let r=t[n];r&&(e[n]=(e[n]??[]).concat(r))}},o=t.extend;return o&&(o.orderSensitiveModifiers&&(n.orderSensitiveModifiers=[...n.orderSensitiveModifiers,...o.orderSensitiveModifiers]),a(n.theme,o.theme),a(n.classGroups,o.classGroups),a(n.conflictingClassGroups,o.conflictingClassGroups),a(n.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers)),n},WF={isAny:0,isAnyNonArbitrary:1,isArbitraryValue:2,isArbitraryVariable:3,isFraction:4,isNumber:5,isInteger:6,isPercent:7,isTshirtSize:8,isNamedContainerQuery:9,isArbitraryLength:10,isArbitraryNumber:11,isArbitraryWeight:12,isArbitraryFamilyName:13,isArbitraryPosition:14,isArbitrarySize:15,isArbitraryImage:16,isArbitraryShadow:17,isArbitraryVariableLength:18,isArbitraryVariableFamilyName:19,isArbitraryVariablePosition:20,isArbitraryVariableSize:21,isArbitraryVariableImage:22,isArbitraryVariableShadow:23,isArbitraryVariableWeight:24},vie=25,yie=()=>({names:[],idByName:new Map,impls:{},fnName:new Map,classifierFns:new Map}),GF=(e,t,n)=>{let r=e.idByName.get(t);return r===void 0&&(r=e.names.length,e.names.push(t),e.idByName.set(t,r),e.classifierFns.set(t,n)),r},KF=(e,t)=>{if(typeof t==`function`){let n=e.fnName.get(t);return n===void 0&&(n=`$c`+e.fnName.size,e.fnName.set(t,n),e.impls[n]=t),GF(e,n,t)}let n=t.$v,r=Lre[n];if(WF[n]===void 0||!r)throw Error(`cn: unknown validator "${n}"`);return GF(e,n,r)},qF=()=>({nextPart:new Map,validators:null,classGroupId:-1,lit:[]}),bie=(e,t)=>e.theme[t]??[],xie=(e,t,n)=>{let r=qF(),i=(e,t)=>{for(let n of t.split(`-`)){let t=e.nextPart.get(n);t||(t=qF(),e.nextPart.set(n,t)),e=t}return e},a=(n,r,o)=>{if(typeof n==`string`){let e=n===``?r:i(r,n);e.classGroupId=o;return}if(typeof n==`function`){if(hie(n)){for(let t of n(e.theme))a(t,r,o);return}(r.validators??=[]).push({validatorId:KF(t,n),groupId:o});return}if(UF(n,`$t`)){for(let t of bie(e,n.$t))a(t,r,o);return}if(UF(n,`$v`)){(r.validators??=[]).push({validatorId:KF(t,n),groupId:o});return}for(let[e,t]of Object.entries(n)){let n=i(r,e);for(let e of t)a(e,n,o)}};for(let[t,i]of Object.entries(e.classGroups)){let e=n(t);for(let t of i)a(t,r,e)}return r},Sie=e=>{let t=yie(),n=[],r=new Map,i=e=>{let t=r.get(e);return t===void 0&&(t=n.length,n.push(e),r.set(e,t)),t},a=xie(e,t,i),o=e=>{if(e.validators)return!1;for(let t of e.nextPart.values())if(!o(t))return!1;return!0},s=(e,t,n)=>{e.classGroupId>=0&&n.push({tail:t,gid:e.classGroupId});for(let[r,i]of e.nextPart)s(i,t+`-`+r,n)},c=e=>{for(let[t,n]of[...e.nextPart])o(n)?(s(n,t,e.lit),e.nextPart.delete(t)):c(n)};c(a);let l=[{edges:new Map,groupId:-1,vlist:-1}],u=()=>(l.push({edges:new Map,groupId:-1,vlist:-1}),l.length-1),d=[],f=new Map,p=e=>{let t=e.map(e=>e.validatorId+`:`+e.groupId).join(`,`),n=f.get(t);return n===void 0&&(n=d.length,d.push(e.map(e=>[e.validatorId,e.groupId])),f.set(t,n)),n},m=(e,t)=>{let n=e;for(let e=0;e<t.length;e++){let r=t.charCodeAt(e),i=l[n].edges.get(r);i===void 0&&(i=u(),l[n].edges.set(r,i)),n=i}return n},h=[],g=(e,t,n)=>{e.classGroupId>=0&&(l[t].groupId=e.classGroupId),e.validators&&(l[t].vlist=p(e.validators));for(let{tail:n,gid:r}of e.lit)h.push({anchor:t,tail:n,gid:r});for(let[r,i]of e.nextPart){let e=t;if(!n){let n=l[t].edges.get(45);n===void 0&&(n=u(),l[t].edges.set(45,n)),e=n}let a=m(e,r);g(i,a,!1)}};g(a,0,!0);let _=new Set(h.map(e=>e.anchor)),v=e=>l[e].groupId>=0||l[e].vlist>=0||_.has(e),y=new Map,b=[],x=e=>{let t=b.length;y.set(e,t);let n={edges:[],groupId:l[e].groupId,vlist:l[e].vlist};b.push(n);let r=[...l[e].edges.entries()].sort((e,t)=>e[0]-t[0]);for(let[e,t]of r){let r=String.fromCharCode(e),i=t;for(;l[i].edges.size===1&&!v(i);){let[[e,t]]=l[i].edges.entries();r+=String.fromCharCode(e),i=t}n.edges.push({label:r,oldTarget:i})}for(let e of n.edges)x(e.oldTarget);return t};x(0);let S=b.length,C=0;for(let e of b)C+=e.edges.length;let w=new Int32Array(S),T=new Int32Array(C),E=``,D=new Int32Array(S),O=new Int32Array(S),k=[];{let e=0;for(let t=0;t<S;t++){let n=b[t];w[t]=n.edges.length;for(let t of n.edges)T[e]=t.label.length,E+=t.label,k.push(y.get(t.oldTarget)),e++;D[t]=n.groupId,O[t]=n.vlist}}{let e=new Int32Array(S);for(let t=S-1;t>=0;t--){let n=1,r=t+1;for(let i=0;i<w[t];i++)n+=e[r],r+=e[r];e[t]=n}let t=0;for(let n=0;n<S;n++){let r=n+1;for(let i=0;i<w[n];i++){if(r!==k[t])throw Error(`cn compiler: edge target mismatch at ${t}`);r+=e[r],t++}}}for(let e of h)e.anchor=y.get(e.anchor);{let e=new Int32Array(d.length).fill(-1),t=[];for(let n=0;n<S;n++){let r=O[n];r>=0&&(e[r]===-1&&(e[r]=t.length,t.push(d[r])),O[n]=e[r])}d.length=0,d.push(...t)}let A=0;for(let e of d)A+=e.length;let j=new Int32Array(A),M=new Int32Array(A);{let e=0;for(let t of d)for(let[n,r]of t)j[e]=n,M[e]=r,e++}h.sort((e,t)=>e.anchor-t.anchor||e.gid-t.gid||(e.tail<t.tail?-1:1));let N=[];for(let e of h){let t=N[N.length-1];t&&t.anchor===e.anchor&&t.gid===e.gid?t.tails.push(e.tail):N.push({anchor:e.anchor,gid:e.gid,tails:[e.tail],set:-1})}let P=new Map,F=[];for(let e of N){let t=e.tails.join(` `),n=P.get(t);n===void 0&&(n=F.length,P.set(t,n),F.push(e.tails)),e.set=n}for(let e of F.flat())if(e.includes(`|`)||e.includes(` `))throw Error(`cn compiler: tail contains delimiter: `+e);let I=new Set(F.flat()).size;N.sort((e,t)=>e.anchor-t.anchor||e.set-t.set);for(let t of Object.values(e.conflictingClassGroups))for(let e of t)i(e);for(let t of Object.values(e.conflictingClassGroupModifiers))for(let e of t)i(e);for(let t of e.postfixLookupClassGroups??[])i(t);let L=n.length,R=new Int32Array(L).fill(-1),z=0,ee=e=>(R[e]===-1&&(R[e]=z++),R[e]);for(let e=0;e<M.length;e++)M[e]=ee(M[e]);for(let e of N)e.gid=ee(e.gid);for(let e=0;e<D.length;e++)D[e]>=0&&(D[e]=ee(D[e]));for(let e=0;e<L;e++)R[e]===-1&&(R[e]=z++);let te=Array(L);for(let e=0;e<L;e++)te[R[e]]=n[e];let B=[],ne=[],re=[],V=[],ie=[];for(let t=0;t<L;t++){let n=te[t],i=(e.conflictingClassGroups[n]??[]).map(e=>R[r.get(e)]),a=(e.conflictingClassGroupModifiers[n]??[]).map(e=>R[r.get(e)]);i.length&&(B.push(t),ne.push(i.length),re.push(...i));for(let e of a)V.push(t),ie.push(e)}let ae=(e.postfixLookupClassGroups??[]).map(e=>R[r.get(e)]),oe=[],H=new Int32Array(j.length);for(let e=0;e<j.length;e++){let n=t.names[j[e]],r=WF[n];if(r!==void 0)H[e]=r;else{let t=oe.indexOf(n);t===-1&&(t=oe.length,oe.push(n)),H[e]=vie+t}}let se=new Map,ce=[],le=[],U=[];{let e=0;for(let t of d){let n=[];for(let r=0;r<t.length;r++)n.push(H[e++]);let r=n.join(`,`),i=se.get(r);i===void 0&&(i=ce.length,se.set(r,i),ce.push(n.length),le.push(...n)),U.push(i)}}let ue={};for(let e of oe)ue[e]=t.classifierFns.get(e);return{G:L,customNames:oe,impls:ue,edgeCounts:w,edgeLabelLen:T,labelText:E,edgeTargetActual:k,nodeGroup:D,nodeVlist:O,nodeCount:S,totalEdges:C,patCounts:ce,patOps:le,listPat:U,vlistGroup:M,litEntries:h,sets:F,attachments:N,uniqueTailCount:I,adjGid:B,adjCnt:ne,adjTgt:re,patGid:V,patTgt:ie,postfixLookup:ae,orderSensitiveModifiers:e.orderSensitiveModifiers.join(` `),prefix:e.prefix}},JF=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},Cie=e=>{let t=Sie(e),n=t.litEntries.length,r=new Int32Array(n),i=new Int32Array(n),a=new Int32Array(n),o=``,s=new Int32Array(t.uniqueTailCount*2);{let e=new Map,n=0,c=0;for(let l of t.attachments)for(let u of t.sets[l.set]){let t=e.get(u);t===void 0&&(t=n++,e.set(u,t),s[t*2]=o.length,s[t*2+1]=u.length,o+=u),r[c]=l.anchor,i[c]=l.gid,a[c]=t,c++}}return{tables:{GROUP_COUNT:t.G,edgeStart:JF(t.edgeCounts),labelStart:JF(t.edgeLabelLen),labelText:t.labelText,edgeTarget:Int32Array.from(t.edgeTargetActual),nodeGroup:t.nodeGroup,nodeVlist:t.nodeVlist,vlistPat:JF(t.patCounts),vlistOps:Int32Array.from(t.patOps),vlistRef:Int32Array.from(t.listPat),vlistGroup:t.vlistGroup,litAnchor:r,litGroup:i,litPool:a,poolOffsets:s,poolText:o,adjGid:Int32Array.from(t.adjGid),adjStart:JF(t.adjCnt),adjTgt:Int32Array.from(t.adjTgt),patGid:Int32Array.from(t.patGid),patTgt:Int32Array.from(t.patTgt),postfixLookupGroups:Int32Array.from(t.postfixLookup),customValidatorNames:t.customNames,orderSensitiveModifiers:t.orderSensitiveModifiers},validatorImpls:t.impls,prefix:t.prefix}},wie=`line`in Error(),YF=-1,XF=-1,ZF=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},QF=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15|0},Tie=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let L=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(ZF(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;L[n]!==-1;)n=n+1&I-1;L[n]=e}let R=(e,t,n,r)=>{let i=(ZF(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=L[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},z=n.cacheSize??8192,ee=n.prefix??e.prefix??``,te=ee===``?``:ee+`:`,B=te.length,ne=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),re=/\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$/,V=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ie=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ae=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oe=0,H=-1,se=-1,ce=-1,le=-1,U=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,ue=e=>/\s/.test(String.fromCharCode(e)),de=(e,t,n)=>{if(oe=0,H=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)oe=1;else if(r===40&&i===41)oe=2;else return;ce=t+1,le=n-1;let a=t+1;if(U(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!U(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(H=t+1,se=a,ce=a+1)}},fe=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},pe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,me=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,he=e=>!!e&&!Number.isNaN(Number(e)),ge=(e,t,n)=>{if(n-t<11||!fe(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&fe(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&fe(e,t+10,t+18,`-normal/`)},_e=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],ve=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),ye=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],be=(e,t,n,r)=>{if(e>=10){if(e>=25)return ne[e-25](t.slice(n,r));let i=e-10;if(oe!==_e[i])return!1;if(H>=0){for(let e of ve[i])if(fe(t,H,se,e))return!0;return!1}switch(ye[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(ce,le);return re.test(e)&&!V.test(e)}case 3:return he(t.slice(ce,le));case 4:return ae.test(t.slice(ce,le));default:return ie.test(t.slice(ce,le))}}switch(e){case 0:return!0;case 1:return oe===0;case 2:return oe===1;case 3:return oe===2;case 4:return pe.test(t.slice(n,r));case 5:return he(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&he(t.slice(n,r-1));case 8:return me.test(t.slice(n,r));default:return ge(t,n,r)}},xe=new Set(typeof E==`string`?E.split(` `):E),Se=(e,t,n,r,i,a)=>{let o=ZF(t,n,r)^(i?2654435769:0)|0,s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},Ce=new Map,we=new Map,Te=2,Ee=4096,De=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||xe.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=we.get(s);return c===void 0&&we.set(s,c=Te++),c},Oe=new Map,ke=r,Ae=r+4096,je=()=>ke++,Me=2097152,Ne=8192,Pe=new Int32Array(Ne),Fe=Array(Ne).fill(null),Ie=new Int32Array(Ne),Le=new Int32Array(Ne),Re=new Uint8Array(Ne),ze=0,Be=(e,t,n,r,i,a,o,s)=>{let c=e;if(Fe[e]!==null){if(Fe[e|1]===null)c=e|1;else if(!(ze++&3))c=e|ze>>2&1;else return}Fe[c]=t.slice(n,r),Pe[c]=i,Ie[c]=a,Le[c]=o,Re[c]=s},Ve=()=>Fe.fill(null),He=256,Ue=[new Int32Array(He),new Int32Array(He),new Int32Array(He),new Int32Array(He)],[We,Ge,Ke,qe]=Ue,Je=new Uint8Array(He),Ye=new Uint8Array(He),Xe=()=>{He*=2,Ue=Ue.map(e=>{let t=new Int32Array(He);return t.set(e),t}),[We,Ge,Ke,qe]=Ue;let e=new Uint8Array(He);e.set(Je),Je=e,Ye=new Uint8Array(He)},Ze=64,Qe=new Int32Array(Ze),$e=new Int32Array(Ze),et=new Int32Array(r),tt=2048,nt=21,rt=new Float64Array(tt),it=new Int32Array(tt),at=0,ot=(e,t)=>{if(e===0&&t<r)return et[t]===at?1:(et[t]=at,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>nt;for(;it[i]===at;){if(rt[i]===n)return 1;i=i+1&tt-1}return rt[i]=n,it[i]=at,0},st=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?YF:Se(Oe,e,t+1,r,0,je)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=$e[t];if(r>n)continue;let i=Qe[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=R(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;de(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(be(d[t],e,r,n))return p[h+t]}return YF},ct=e=>{let t=e.length,n=0,c=0,u=!1;(Te>Ee||Ce.size>Ee)&&(Ce=new Map,we=new Map,Te=2,Ve()),ke>Ae&&(Oe=new Map,ke=r,Ve());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&ue(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&ue(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===He&&Xe();let _=n++;We[_]=p,Ge[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15|0,y=v&8190;{let t=-1;if(Pe[y]===v&&Fe[y]!==null&&Fe[y].length===g?t=y:Pe[y|1]===v&&Fe[y|1]!==null&&Fe[y|1].length===g&&(t=y|1),t>=0){let n=Fe[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){Ke[_]=Ie[t],qe[_]=Le[t],Je[_]=Re[t];continue}}}let b=p;if(B!==0){if(h-p<=B||!e.startsWith(te,p)){Ke[_]=YF,Be(y,e,p,h,v,YF,0,0);continue}b=p+B}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,L=-1,R=0;(l[0]>=0||N[0]===1)&&(Qe[0]=0,$e[0]=M,R=1);let z=XF,ee=0;for(let t=M;t<D;t++)if(t===A&&(z=F<I?XF:P,ee=R),P!==XF){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=L)):P=XF;else{let e=i[P],t=i[P+1],c=XF;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],L=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(R===Ze){Ze*=2;let e=new Int32Array(Ze);e.set(Qe),Qe=e;let t=new Int32Array(Ze);t.set($e),$e=t}Qe[R]=r,$e[R]=t+2,R++}}A===D&&(z=F<I?XF:P,ee=R);let ne=F<I?XF:P,re,V=!1;if(A>=0){if(V=!0,re=st(e,E,A,z,ee),re!==YF&&re<r&&j[re]){let t=st(e,E,D,ne,R);t!==YF&&t!==re&&(re=t,V=!1)}else re===YF&&(re=st(e,E,D,ne,R),V=!1)}else re=st(e,E,D,ne,R);let ie=0,ae=0;re===YF?Ke[_]=YF:(ae=+!!V,ie=b>=C?+!!O:Se(Ce,e,b,C,+!!O,e=>De(e,O)),Ke[_]=re,Je[_]=ae,qe[_]=ie),Be(y,e,p,h,v,re,ie,ae)}if(n===0)return``;if(n===1)return We[0]===0&&Ge[0]===t?e:e.slice(We[0],Ge[0]);if(n*k>tt){for(;n*k>tt;)tt<<=1,nt--;rt=new Float64Array(tt),it=new Int32Array(tt)}if(Te>=Me||ke>=Me)throw Error(`cn: too many distinct classes in one merge`);at=at+1|0,at===0&&(et.fill(0),it.fill(0),at=1);let f=!1;for(let e=n-1;e>=0;e--){let t=Ke[e];if(t===YF){Ye[e]=1;continue}let n=qe[e];if(ot(n,t)===1){Ye[e]=0,f=!0;continue}if(Ye[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)ot(n,x[e]);if(Je[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&ot(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Ye[m]){m++;continue}let t=We[m],r=Ge[m],i=m+1;for(;i<n&&Ye[i]&&We[i]===r+1&&e.charCodeAt(r)===32;)r=Ge[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},lt=16384,ut=new Int32Array(lt*2),dt=0,ft=1,pt=Object.create(null),mt=Object.create(null),ht=new Map,gt=new Map,_t=0,vt=0,yt=()=>{dt^=lt,ft=ft+1|0,vt=0},bt=e=>{let t=pt[e];if(t!==void 0)return t;let n=QF(e,0,e.length),r=(n&16383)+dt,i=ut[r]===(n^ft)||ut[r^lt]===(n^ft-1);return i&&(t=mt[e],t!==void 0)?(pt[e]=t,t):(t=ct(e),i?(pt[e]=t,++_t>z&&(_t=0,mt=pt,pt=Object.create(null),yt())):(ut[r]=n^ft,++vt>lt&&yt()),t)},xt=e=>{let t=ht.get(e);if(t!==void 0)return t;let n=QF(e,0,e.length),r=(n&16383)+dt,i=ut[r]===(n^ft)||ut[r^lt]===(n^ft-1);return i&&(t=gt.get(e),t!==void 0)?(ht.set(e,t),t):(t=ct(e),i?(ht.set(e,t),++_t>z&&(_t=0,gt=ht,ht=new Map,yt())):(ut[r]=n^ft,++vt>lt&&yt()),t)},St=e=>{let t=QF(e,0,e.length),n=(t&16383)+dt;return ut[n]===(t^ft)||ut[n^lt]===(t^ft-1)||(ut[n]=t^ft,++vt>lt&&yt(),!1)},Ct=z===0?ct:wie?e=>{let t=ht.get(e);return t===void 0?xt(e):t}:bt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?Ct(arguments[0]):Ct(Die.apply(null,arguments))},mergeString:Ct,seenBefore:z===0?()=>!1:St,mergeUncached:ct}},$F=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:$F(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},Eie=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:$F(i,t);a&&(n&&(n+=` `),n+=a)}return n},Die=function(){return Eie(arguments,!1)},Oie=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},l=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},u=(t,c)=>{let u=t.length,d=s===null?null:s.n;if(!c){if(d!==null&&l(d,t))return s=d,d.r;if(s!==null&&s!==d&&l(s,t))return s.r}let f=``,p=-1,m=0,h=!1;for(let e=0;e<u;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=$F(n,!0),!n)continue;h=!0}p<0&&(f=n,p=e),m++}}if(m===0)return``;if(m===1)return e(f);if(h){if(d!==null&&l(d,t))return s=d,d.r;if(s!==null&&s!==d&&l(s,t))return s.r}let g=i.get(f);g===void 0&&(g=a.get(f),g!==void 0&&i.set(f,g));let _=null;if(g!==void 0)outer:for(let e=0;e<g.length;e++){let n=g[e];if(n.t!==m)continue;let r=n.a,i=1;for(let e=p+1;e<u;e++){let n=t[e];if(n&&n!==r[i++])continue outer}_=n;break}if(_===null){let s=f,c=[f];for(let e=p+1;e<u;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);_={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},g===void 0&&i.set(f,g=[]),g.length>=256&&g.shift(),g.push(_),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==_&&(s.n=_),s=_,_.r},d=t=>Array.isArray(t)?u(t.slice(),!1):e($F(t,!0));return function(t,n,r){let i=arguments.length;if((i|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&c(i,t,n,r))return s=i,i.r;if(e!==i&&c(e,t,n,r))return e.r}return u([t,n,r],!0)}if(i===1)return typeof t==`string`?e(t):d(t);let a=s;if(a!==null){let e=a.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<i;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(a!==e){let e=a.a,t=0,n=!0;for(let r=0;r<i;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===a.t)return a.r}}let o=[];for(let e=0;e<i;e++)o.push(arguments[e]);return u(o,!0)}},kie=`{"theme":{"animate":[{"$v":"isAny"}],"aspect":["video"],"blur":[{"$v":"isTshirtSize"}],"breakpoint":[{"$v":"isTshirtSize"}],"color":[{"$v":"isAny"}],"container":[{"$v":"isTshirtSize"}],"drop-shadow":[{"$v":"isTshirtSize"}],"ease":["in","out","in-out"],"font":[{"$v":"isAnyNonArbitrary"}],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[{"$v":"isTshirtSize"}],"leading":["none","tight","snug","normal","relaxed","loose"],"perspective":["dramatic","near","normal","midrange","distant","none"],"radius":[{"$v":"isTshirtSize"}],"shadow":[{"$v":"isTshirtSize"}],"spacing":["px",{"$v":"isNumber"}],"text":[{"$v":"isTshirtSize"}],"text-shadow":[{"$v":"isTshirtSize"}],"tracking":["tighter","tight","normal","wide","wider","widest"]},"classGroups":{"aspect":[{"aspect":["auto","square",{"$v":"isFraction"},{"$v":"isArbitraryValue"},{"$v":"isArbitraryVariable"},{"$t":"aspect"}]}],"container":["container"],"container-type":[{"@container":["","normal","size",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"container-named":[{"$v":"isNamedContainerQuery"}],"columns":[{"columns":[{"$v":"isNumber"},{"$v":"isArbitraryValue"},{"$v":"isArbitraryVariable"},{"$t":"container"}]},"columns-auto"],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"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":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"overflow":[{"overflow":["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],"overscroll":[{"overscroll":["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],"position":["static","fixed","absolute","relative","sticky"],"inset":[{"inset":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-x":[{"inset-x":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-y":[{"inset-y":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"start":[{"inset-s":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}],"start":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"end":[{"inset-e":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}],"end":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-bs":[{"inset-bs":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-be":[{"inset-be":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"top":[{"top":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"right":[{"right":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"bottom":[{"bottom":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"left":[{"left":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"visibility":["visible","invisible","collapse"],"z":[{"z":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"basis":[{"basis":[{"$v":"isFraction"},"full","auto",{"$t":"container"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"flex-direction":[{"flex":["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{"flex":["nowrap","wrap","wrap-reverse"]}],"flex":[{"flex":[{"$v":"isNumber"},{"$v":"isFraction"},"auto","initial","none",{"$v":"isArbitraryValue"}]}],"grow":[{"grow":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"shrink":[{"shrink":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"order":[{"order":[{"$v":"isInteger"},"first","last","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-cols":[{"grid-cols":[{"$v":"isInteger"},"none","subgrid",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-start-end":[{"col":["auto",{"span":["full",{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-start":[{"col-start":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-end":[{"col-end":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-rows":[{"grid-rows":[{"$v":"isInteger"},"none","subgrid",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-start-end":[{"row":["auto",{"span":["full",{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-start":[{"row-start":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-end":[{"row-end":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"auto-cols":[{"$t":"spacing"}]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"auto-rows":[{"$t":"spacing"}]}],"gap":[{"gap":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"gap-x":[{"gap-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"gap-y":[{"gap-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"justify-content":[{"justify":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{"content":["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{"items":["start","end","center","stretch","center-safe","end-safe",{"baseline":["","last"]}]}],"align-self":[{"self":["auto","start","end","center","stretch","center-safe","end-safe",{"baseline":["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"p":[{"p":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"px":[{"px":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"py":[{"py":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ps":[{"ps":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pe":[{"pe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pbs":[{"pbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pbe":[{"pbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pt":[{"pt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pr":[{"pr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pb":[{"pb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pl":[{"pl":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"m":[{"m":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mx":[{"mx":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"my":[{"my":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ms":[{"ms":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"me":[{"me":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mbs":[{"mbs":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mbe":[{"mbe":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mt":[{"mt":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mr":[{"mr":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mb":[{"mb":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ml":[{"ml":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-x":[{"space-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-y-reverse":["space-y-reverse"],"size":[{"size":[{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inline-size":[{"inline":["auto",{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},{"inline":[{"$t":"container"}]}],"min-inline-size":[{"min-inline":["auto",{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},{"min-inline":[{"$t":"container"}]}],"max-inline-size":[{"max-inline":["none",{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},{"max-inline":[{"$t":"container"}]}],"block-size":[{"block":["auto",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-block-size":[{"min-block":["auto",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-block-size":[{"max-block":["none",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"w":[{"w":[{"$t":"container"},"screen",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-w":[{"min-w":[{"$t":"container"},"screen","none",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-w":[{"max-w":[{"$t":"container"},"screen","none","prose",{"screen":[{"$t":"breakpoint"}]},{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"h":[{"h":["screen","lh",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-h":[{"min-h":["screen","lh","none",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-h":[{"max-h":["screen","lh",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},"max-h-none"],"font-size":[{"text":["base",{"$t":"text"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{"font":[{"$t":"font-weight"},{"$v":"isArbitraryVariableWeight"},{"$v":"isArbitraryWeight"}]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",{"$v":"isPercent"},{"$v":"isArbitraryValue"}]}],"font-family":[{"font":[{"$v":"isArbitraryVariableFamilyName"},{"$v":"isArbitraryFamilyName"},{"$t":"font"}]}],"font-features":[{"font-features":[{"$v":"isArbitraryValue"}]}],"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":[{"$t":"tracking"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"line-clamp":[{"line-clamp":[{"$v":"isNumber"},"none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryNumber"}]}],"leading":[{"leading":[{"$t":"leading"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"list-image":[{"list-image":["none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"list-style-position":[{"list":["inside","outside"]}],"list-style-type":[{"list":["disc","decimal","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-alignment":[{"text":["left","center","right","justify","start","end"]}],"placeholder-color":[{"placeholder":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-color":[{"text":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{"decoration":["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{"decoration":[{"$v":"isNumber"},"from-font","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryLength"}]}],"text-decoration-color":[{"decoration":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"underline-offset":[{"underline-offset":[{"$v":"isNumber"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{"text":["wrap","nowrap","balance","pretty"]}],"indent":[{"indent":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"tab-size":[{"tab":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"vertical-align":[{"align":["baseline","top","middle","bottom","text-top","text-bottom","sub","super",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"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",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"bg-attachment":[{"bg":["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{"bg":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"},{"position":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"bg-repeat":[{"bg":["no-repeat",{"repeat":["","x","y","space","round"]}]}],"bg-size":[{"bg":["auto","cover","contain",{"$v":"isArbitraryVariableSize"},{"$v":"isArbitrarySize"},{"size":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"bg-image":[{"bg":["none",{"linear":[{"to":["t","tr","r","br","b","bl","l","tl"]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}],"radial":["",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}],"conic":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isArbitraryVariableImage"},{"$v":"isArbitraryImage"}]},{"bg-gradient-to":["t","tr","r","br","b","bl","l","tl"]},"bg-conic"],"bg-color":[{"bg":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-from-pos":[{"from":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-via-pos":[{"via":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-to-pos":[{"to":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-from":[{"from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-via":[{"via":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-to":[{"to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded":[{"rounded":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-s":[{"rounded-s":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-e":[{"rounded-e":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-t":[{"rounded-t":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-r":[{"rounded-r":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-b":[{"rounded-b":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-l":[{"rounded-l":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-ss":[{"rounded-ss":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-se":[{"rounded-se":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-ee":[{"rounded-ee":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-es":[{"rounded-es":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-tl":[{"rounded-tl":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-tr":[{"rounded-tr":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-br":[{"rounded-br":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-bl":[{"rounded-bl":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-w":[{"border":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-x":[{"border-x":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-y":[{"border-y":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-s":[{"border-s":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-e":[{"border-e":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-bs":[{"border-bs":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-be":[{"border-be":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-t":[{"border-t":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-r":[{"border-r":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-b":[{"border-b":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-l":[{"border-l":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-x":[{"divide-x":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{"border":["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{"divide":["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{"border":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-x":[{"border-x":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-y":[{"border-y":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-s":[{"border-s":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-e":[{"border-e":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-bs":[{"border-bs":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-be":[{"border-be":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-t":[{"border-t":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-r":[{"border-r":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-b":[{"border-b":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-l":[{"border-l":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"divide-color":[{"divide":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"outline-style":[{"outline":["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"outline-w":[{"outline":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"outline-color":[{"outline":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"shadow":[{"shadow":["","none",{"$t":"shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]},"shadow-inner"],"shadow-color":[{"shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"inset-shadow":[{"inset-shadow":["none",{"$t":"inset-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"inset-shadow-color":[{"inset-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ring-w":[{"ring":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"ring-w-inset":["ring-inset"],"ring-color":[{"ring":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ring-offset-w":[{"ring-offset":[{"$v":"isNumber"},{"$v":"isArbitraryLength"}]}],"ring-offset-color":[{"ring-offset":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"inset-ring-w":[{"inset-ring":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"inset-ring-color":[{"inset-ring":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-shadow":[{"text-shadow":["none",{"$t":"text-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"text-shadow-color":[{"text-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"opacity":[{"opacity":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"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":[{"$v":"isNumber"}]}],"mask-image-linear-from-pos":[{"mask-linear-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-linear-to-pos":[{"mask-linear-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-linear-from-color":[{"mask-linear-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-linear-to-color":[{"mask-linear-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-t-from-pos":[{"mask-t-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-t-to-pos":[{"mask-t-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-t-from-color":[{"mask-t-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-t-to-color":[{"mask-t-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-r-from-pos":[{"mask-r-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-r-to-pos":[{"mask-r-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-r-from-color":[{"mask-r-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-r-to-color":[{"mask-r-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-b-from-pos":[{"mask-b-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-b-to-pos":[{"mask-b-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-b-from-color":[{"mask-b-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-b-to-color":[{"mask-b-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-l-from-pos":[{"mask-l-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-l-to-pos":[{"mask-l-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-l-from-color":[{"mask-l-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-l-to-color":[{"mask-l-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-x-from-pos":[{"mask-x-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-x-to-pos":[{"mask-x-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-x-from-color":[{"mask-x-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-x-to-color":[{"mask-x-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-y-from-pos":[{"mask-y-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-y-to-pos":[{"mask-y-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-y-from-color":[{"mask-y-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-y-to-color":[{"mask-y-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial":[{"mask-radial":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial-from-pos":[{"mask-radial-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-radial-to-pos":[{"mask-radial-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-radial-from-color":[{"mask-radial-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial-to-color":[{"mask-radial-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"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":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[{"$v":"isNumber"}]}],"mask-image-conic-from-pos":[{"mask-conic-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-conic-to-pos":[{"mask-conic-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-conic-from-color":[{"mask-conic-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-conic-to-color":[{"mask-conic-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-mode":[{"mask":["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{"mask":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"},{"position":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"mask-repeat":[{"mask":["no-repeat",{"repeat":["","x","y","space","round"]}]}],"mask-size":[{"mask":["auto","cover","contain",{"$v":"isArbitraryVariableSize"},{"$v":"isArbitrarySize"},{"size":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{"mask":["none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"filter":[{"filter":["","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"blur":[{"blur":["","none",{"$t":"blur"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"brightness":[{"brightness":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"contrast":[{"contrast":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"drop-shadow":[{"drop-shadow":["","none",{"$t":"drop-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"drop-shadow-color":[{"drop-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grayscale":[{"grayscale":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"hue-rotate":[{"hue-rotate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"invert":[{"invert":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"saturate":[{"saturate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"sepia":[{"sepia":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-filter":[{"backdrop-filter":["","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-blur":[{"backdrop-blur":["","none",{"$t":"blur"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-brightness":[{"backdrop-brightness":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-contrast":[{"backdrop-contrast":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-grayscale":[{"backdrop-grayscale":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-invert":[{"backdrop-invert":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-opacity":[{"backdrop-opacity":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-saturate":[{"backdrop-saturate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-sepia":[{"backdrop-sepia":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-collapse":[{"border":["collapse","separate"]}],"border-spacing":[{"border-spacing":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"border-spacing-x":[{"border-spacing-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"border-spacing-y":[{"border-spacing-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"table-layout":[{"table":["auto","fixed"]}],"caption":[{"caption":["top","bottom"]}],"transition":[{"transition":["","all","colors","opacity","shadow","transform","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transition-behavior":[{"transition":["normal","discrete"]}],"duration":[{"duration":[{"$v":"isNumber"},"initial",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ease":[{"ease":["linear","initial",{"$t":"ease"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"delay":[{"delay":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"animate":[{"animate":["none",{"$t":"animate"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backface":[{"backface":["hidden","visible"]}],"perspective":[{"perspective":[{"$t":"perspective"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"perspective-origin":[{"perspective-origin":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate":[{"rotate":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-x":[{"rotate-x":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-y":[{"rotate-y":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-z":[{"rotate-z":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale":[{"scale":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-x":[{"scale-x":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-y":[{"scale-y":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-z":[{"scale-z":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-3d":["scale-3d"],"skew":[{"skew":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"skew-x":[{"skew-x":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"skew-y":[{"skew-y":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transform":[{"transform":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},"","none","gpu","cpu"]}],"transform-origin":[{"origin":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transform-style":[{"transform":["3d","flat"]}],"translate":[{"translate":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-x":[{"translate-x":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-y":[{"translate-y":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-z":[{"translate-z":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-none":["translate-none"],"zoom":[{"zoom":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"accent":[{"accent":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"appearance":[{"appearance":["none","auto"]}],"caret-color":[{"caret":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"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",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],"resize":[{"resize":["none","","y","x"]}],"scroll-behavior":[{"scroll":["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scrollbar-track-color":[{"scrollbar-track":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{"scrollbar":["auto","thin","none"]}],"scroll-m":[{"scroll-m":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mx":[{"scroll-mx":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-my":[{"scroll-my":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ms":[{"scroll-ms":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-me":[{"scroll-me":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mbs":[{"scroll-mbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mbe":[{"scroll-mbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mt":[{"scroll-mt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mr":[{"scroll-mr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mb":[{"scroll-mb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ml":[{"scroll-ml":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-p":[{"scroll-p":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-px":[{"scroll-px":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-py":[{"scroll-py":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ps":[{"scroll-ps":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pe":[{"scroll-pe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pbs":[{"scroll-pbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pbe":[{"scroll-pbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pt":[{"scroll-pt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pr":[{"scroll-pr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pb":[{"scroll-pb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pl":[{"scroll-pl":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"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",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"fill":[{"fill":["none",{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"stroke-w":[{"stroke":[{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"},{"$v":"isArbitraryNumber"}]}],"stroke":[{"stroke":["none",{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}],"contain":[{"contain":["none","content","strict",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"contain-size":[{"contain":["size","inline-size"]}],"contain-layout":["contain-layout"],"contain-paint":["contain-paint"],"contain-style":["contain-style"]},"conflictingClassGroups":{"container-named":["container-type"],"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"],"contain":["contain-size","contain-layout","contain-paint","contain-style"],"contain-size":["contain"],"contain-layout":["contain"],"contain-paint":["contain"],"contain-style":["contain"]},"conflictingClassGroupModifiers":{"font-size":["leading"]},"orderSensitiveModifiers":["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"],"postfixLookupClassGroups":["container-type"]}`,eI=()=>JSON.parse(kie),Aie=e=>`classGroups`in e&&`theme`in e&&`conflictingClassGroups`in e,jie=e=>e===void 0?{config:eI()}:typeof e==`function`?{config:e(eI())}:Aie(e)?{config:e}:{config:_ie(eI(),e),cacheSize:e.cacheSize},Mie=e=>{let{config:t,cacheSize:n}=jie(e),{tables:r,validatorImpls:i,prefix:a}=Cie(t);return Tie(r,i,{cacheSize:n,prefix:a})},Z=(e=>{let t=null,n=()=>t??=Mie(e);return Oie(e=>n().mergeString(e),{seenBefore:e=>n().seenBefore(e),mergeUncached:e=>n().mergeUncached(e)})})({extend:{theme:{spacing:[...Fre]}}});function tI(e,t){return typeof e==`function`?e(t):e}var Nie=(0,K.forwardRef)(function({tone:e=`neutral`,size:t=`md`,pressed:n=!1,className:r,...i},a){return(0,X.jsx)(`kbd`,{...i,ref:a,className:Z(`caps-keycap`,r),"data-tone":e,"data-size":t,"data-pressed":n})}),nI=(0,K.forwardRef)(function({label:e,shortcut:t,icon:n,readout:r,tone:i=`neutral`,pressed:a,expanded:o,className:s,type:c=`button`,...l},u){let d=a??o;return(0,X.jsxs)(`button`,{...l,ref:u,type:c,className:Z(`caps-keycap-button`,s),"data-tone":i,"aria-pressed":a,"aria-expanded":o,"aria-keyshortcuts":l[`aria-keyshortcuts`]??t,children:[d===void 0?null:(0,X.jsx)(`span`,{className:`caps-keycap-led`,"data-lit":d,"aria-hidden":`true`}),n?(0,X.jsx)(`span`,{className:`caps-keycap-button-icon`,"aria-hidden":`true`,children:n}):null,e===null?null:(0,X.jsx)(`span`,{className:`caps-keycap-button-label`,children:e}),r,t?(0,X.jsx)(Nie,{size:`sm`,tone:`neutral`,"aria-hidden":`true`,children:t}):null]})});function rI(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Pie(...e){return t=>{let n=!1,r=e.map(e=>{let r=rI(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():rI(e[t],null)}}}}function Fie(...e){return K.useCallback(Pie(...e),e)}function Iie(e){let t=K.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];aI(r)&&typeof oI==`function`&&(r=oI(r._payload)),K.Children.forEach(r,e=>{if(Vie(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;aI(n)&&typeof oI==`function`&&(n=oI(n._payload)),a=Rie(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=K.cloneElement(a,void 0,s):!o&&K.Children.count(r)===1&&K.isValidElement(r)&&(a=r);let c=a?Bie(a):void 0,l=Fie(n,c);if(!a){if(r||r===0)throw Error(o?Gie(e):Wie(e));return r}let u=zie(i,a.props??{});return a.type!==K.Fragment&&(u.ref=n?l:c),K.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var iI=Iie(`Slot`),Lie=Symbol.for(`radix.slottable`),Rie=(e,t)=>{if(`child`in e.props){let t=e.props.child;return K.isValidElement(t)?K.cloneElement(t,void 0,e.props.children(t.props.children)):null}return K.isValidElement(t)?t:null};function zie(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Bie(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Vie(e){return K.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Lie}var Hie=Symbol.for(`react.lazy`);function aI(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Hie&&`_payload`in e&&Uie(e._payload)}function Uie(e){return typeof e==`object`&&!!e&&`then`in e}var Wie=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Gie=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,oI=K.use,sI=Object.freeze({reduced:!1,squish:90,fast:120,normal:180,slow:280,springDuration:320,bounce:.3,stretch:.28,distance:4,stagger:24,blur:0,shake:3,steps:0,fuse:1,pressDepth:.5,pressScale:1,ease:`cubic-bezier(0.2, 0, 0, 1)`,easeExit:`cubic-bezier(0.4, 0, 1, 1)`}),cI=`(prefers-reduced-motion: reduce)`;function lI(e){let t=e.ownerDocument.defaultView;if(!t)return sI;let n=t.getComputedStyle(e),r=(e,t)=>{let r=n.getPropertyValue(e).trim(),i=Number.parseFloat(r);return Number.isFinite(i)?Math.max(0,i):t},i=(e,t)=>{let i=n.getPropertyValue(e).trim();return r(e,t)*(i.endsWith(`s`)&&!i.endsWith(`ms`)?1e3:1)},a=t.matchMedia?.(cI).matches??!1,o=(e,t)=>a?120:i(`--stipe-motion-${e}`,t),s=(e,t)=>a?0:r(`--stipe-motion-${e}`,t);return{reduced:a,squish:o(`squish`,sI.squish),fast:o(`fast`,sI.fast),normal:o(`normal`,sI.normal),slow:o(`slow`,sI.slow),springDuration:o(`spring-duration`,sI.springDuration),bounce:Math.min(1,s(`bounce`,sI.bounce)),stretch:s(`stretch`,sI.stretch),distance:s(`distance`,sI.distance),stagger:a?0:i(`--stipe-motion-stagger`,sI.stagger),blur:s(`blur`,sI.blur),shake:s(`shake`,sI.shake),steps:Math.floor(s(`steps`,sI.steps)),fuse:r(`--stipe-motion-fuse`,sI.fuse),pressDepth:a?0:r(`--stipe-press-depth`,sI.pressDepth),pressScale:a?1:r(`--stipe-press-scale`,sI.pressScale),ease:n.getPropertyValue(`--stipe-motion-ease`).trim()||sI.ease,easeExit:n.getPropertyValue(`--stipe-motion-ease-exit`).trim()||sI.easeExit}}function uI(e){let[t,n]=(0,K.useState)(()=>({...sI,reduced:!0}));return(0,K.useLayoutEffect)(()=>{let t=e.current,r=t?.ownerDocument.defaultView;if(!t||!r)return;let i=()=>{let e=lI(t);n(t=>JSON.stringify(t)===JSON.stringify(e)?t:e)};i();let a=new r.MutationObserver(i);for(let e=t;e;e=e.parentElement)a.observe(e,{attributes:!0,attributeFilter:[`data-theme`,`class`,`style`]});let o=r.matchMedia?.(cI);return o?.addEventListener(`change`,i),()=>{a.disconnect(),o?.removeEventListener(`change`,i)}},[e]),t}function dI(e,t){return e.reduced?0:Math.round(t*e.normal/sI.normal)}function Kie(e,t){if(e.reduced)return 0;let n=t*e.bounce/sI.bounce;return Math.min(.9,Math.max(0,n))}function qie(e,t){return e.reduced?0:Math.round(t*e.springDuration/sI.springDuration)}function fI(e,t){return e.steps>0?`steps(${String(e.steps)}, end)`:t}function pI(e){return`animate`in e}var mI=globalThis;function Jie(){return mI.matchMedia?.(cI).matches??!1}function Yie(e){let t=mI.matchMedia?.(cI);return t?.addEventListener(`change`,e),()=>{t?.removeEventListener(`change`,e)}}function Xie(){return!0}function hI(){return(0,K.useSyncExternalStore)(Yie,Jie,Xie)}var gI=(0,K.forwardRef)(function({asChild:e=!1,className:t,...n},r){let i=Z(`absolute h-px w-px overflow-hidden whitespace-nowrap border-0 p-0 [clip:rect(0,0,0,0)]`,t);return e?(0,X.jsx)(iI,{...n,className:i,ref:r}):(0,X.jsx)(`span`,{...n,className:i,ref:r})}),_I=typeof window<`u`,vI=_I?window:null,yI=_I?document:null,bI={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},xI={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},SI={NONE:0,AUTO:1,FORCE:2},CI={replace:0,none:1,blend:2},wI=Symbol(),TI=Symbol(),EI=Symbol(),DI=Symbol(),Zie=Symbol(),OI=1e-11,kI=0xe8d4a51000,AI=1e3,jI=[],MI=(()=>{let e=new Map;return e.set(`x`,`translateX`),e.set(`y`,`translateY`),e.set(`z`,`translateZ`),e})(),NI=[`perspective`,`translateX`,`translateY`,`translateZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`skew`,`skewX`,`skewY`],Qie=NI.reduce((e,t)=>({...e,[t]:t+`(`}),{}),PI=()=>{},$ie=e=>e,eae=/\)\s*[-.\d]/,tae=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,nae=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,rae=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,iae=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,aae=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,FI=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,oae=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,sae=/([a-z])([A-Z])/g,cae=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/,II={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:AI,delay:0,loopDelay:0,ease:`out(2)`,composition:CI.replace,modifier:$ie,onBegin:PI,onBeforeUpdate:PI,onUpdate:PI,onLoop:PI,onPause:PI,onComplete:PI,onRender:PI},LI={current:null,root:yI},RI={defaults:II,precision:4,timeScale:1,tickThreshold:200,editor:null},zI={version:`4.5.0`,engine:null};_I&&(vI.AnimeJS||=[],vI.AnimeJS.push(zI));var BI=e=>e.replace(sae,`$1-$2`).toLowerCase(),VI=(e,t)=>e.indexOf(t)===0,HI=Date.now,UI=Array.isArray,WI=e=>e&&e.constructor===Object,lae=e=>typeof e==`number`&&!isNaN(e),GI=e=>typeof e==`string`,KI=e=>typeof e==`function`,qI=e=>e===void 0,JI=e=>qI(e)||e===null,YI=e=>_I&&e instanceof SVGElement,XI=e=>tae.test(e),ZI=e=>VI(e,`rgb`),QI=e=>VI(e,`hsl`),uae=e=>XI(e)||(ZI(e)||QI(e))&&(e[e.length-1]===`)`||!eae.test(e)),$I=e=>!RI.defaults.hasOwnProperty(e),dae=[`opacity`,`rotate`,`overflow`,`color`],fae=(e,t)=>{if(dae.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t===`scale`){let t=e.parentNode;return t&&t.tagName===`filter`}return!0}},eL=Math.pow,tL=Math.sqrt,nL=Math.sin,rL=Math.cos,pae=Math.abs,iL=Math.exp,mae=Math.ceil,aL=Math.floor,hae=Math.asin,oL=Math.PI,sL=Math.round,cL=(e,t,n)=>e<t?t:e>n?n:e,lL=(e,t)=>{if(t<0)return e;if(!t)return sL(e);let n=10**t;return sL(e*n)/n},uL=(e,t,n)=>n===1?t:n===0?e:e+(t-e)*n,dL=e=>e===1/0?kI:e===-1/0?-kI:e,fL=e=>e<=1e-11?OI:dL(lL(e,11)),pL=e=>UI(e)?[...e]:e,gae=(e,t)=>{let n={...e};for(let r in t){let i=e[r];n[r]=qI(i)?t[r]:i}return n},mL=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._head,o=i;for(n&&(a=e._tail,o=r);a;){let e=a[o];t(a),a=e}},hL=(e,t,n=`_prev`,r=`_next`)=>{let i=t[n],a=t[r];i?i[r]=a:e._head=a,a?a[n]=i:e._tail=i,t[n]=null,t[r]=null},gL=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._tail;for(;a&&n&&n(a,t);)a=a[r];let o=a?a[i]:e._head;a?a[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=a,t[i]=o},_ae=(e,t,n)=>{let r=e.style.transform;if(r){let i=e[DI],a=0,o=r.length,s;for(;a<o;){for(;a<o&&r.charCodeAt(a)===32;)a++;if(a>=o)break;let e=a;for(;a<o&&r.charCodeAt(a)!==40;)a++;if(a>=o)break;let t=r.substring(e,a),n=1,c=a+1,l=-1,u=-1;for(a++;a<o&&n>0;){let e=r.charCodeAt(a);e===40?n++:e===41?n--:e===44&&n===1&&(l===-1?l=a:u===-1&&(u=a)),a++}let d=a-1;t===`translate`||t===`translate3d`?(l===-1?i.translateX=r.substring(c,d).trim():(i.translateX=r.substring(c,l).trim(),u===-1?i.translateY=r.substring(l+1,d).trim():(i.translateY=r.substring(l+1,u).trim(),i.translateZ=r.substring(u+1,d).trim())),s=r.substring(c,d)):t===`scale`||t===`scale3d`?l===-1?i.scale=r.substring(c,d).trim():(i.scaleX=r.substring(c,l).trim(),u===-1?i.scaleY=r.substring(l+1,d).trim():(i.scaleY=r.substring(l+1,u).trim(),i.scaleZ=r.substring(u+1,d).trim())):i[t]=r.substring(c,d)}if(t===`translate3d`&&s)return n&&(n[t]=s),s;let c=i[t];if(!qI(c))return n&&(n[t]=c),c}return t===`translate3d`?`0px, 0px, 0px`:t===`rotate3d`?`0, 0, 0, 0deg`:VI(t,`scale`)?`1`:VI(t,`rotate`)||VI(t,`skew`)?`0deg`:`0px`},_L=e=>{let t=``;for(let n=0,r=NI.length;n<r;n++){let r=NI[n],i=e[r];if(i!==void 0){if(r===`translateX`){let r=e.translateY;if(r!==void 0){let a=e.translateZ;a===void 0?(t+=`translate(${i},${r}) `,n+=1):(t+=`translate3d(${i},${r},${a}) `,n+=2);continue}}if(r===`scaleX`&&e.scale===void 0){let r=e.scaleY;if(r!==void 0){let a=e.scaleZ;a===void 0?(t+=`scale(${i},${r}) `,n+=1):(t+=`scale3d(${i},${r},${a}) `,n+=2);continue}}t+=`${Qie[r]}${i}) `}r===`rotateZ`&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},vL=[];function yL(e,t){if(!e)return null;let n=vL.length;outer:for(let r=0;r<n;r++){let n=vL[r];if(n.detect&&!n.detect(e))continue;let i=n.targetAdapters;for(let n=0,r=i.length;n<r;n++){let r=i[n];if(r.detect(e)){let n=r.props[t];if(n&&(!n.gate||n.gate(e)))return n;break outer}}}for(let r=0;r<n;r++){let n=vL[r];if(n.detect&&!n.detect(e))continue;let i=n.propertyResolvers;for(let n=0,r=i.length;n<r;n++){let r=i[n](e,t);if(r)return r}}return null}var vae=e=>{let t=nae.exec(e)||rae.exec(e),n=qI(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],n]},yae=e=>{let t=e.length,n=t===4||t===5;return[+(`0x`+e[1]+e[n?1:2]),+(`0x`+e[n?2:3]+e[n?2:4]),+(`0x`+e[n?3:5]+e[n?3:6]),t===5||t===9?+((`0x`+e[n?4:7]+e[n?4:8])/255).toFixed(3):1]},bL=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),bae=e=>{let t=iae.exec(e)||aae.exec(e),n=t[1]/360,r=t[2]/100,i=t[3]/100,a=qI(t[4])?1:+t[4],o,s,c;if(r===0)o=s=c=i;else{let e=i<.5?i*(1+r):i+r-i*r,t=2*i-e;o=lL(bL(t,e,n+1/3)*255,0),s=lL(bL(t,e,n)*255,0),c=lL(bL(t,e,n-1/3)*255,0)}return[o,s,c,a]},xae=e=>ZI(e)?vae(e):XI(e)?yae(e):QI(e)?bae(e):[0,0,0,1],xL=(e,t)=>qI(e)?t:e,SL=(e,t)=>{let n=e.match(cae),r=t[TI]?t:document.documentElement,i=getComputedStyle(r)?.getPropertyValue(n[1]);return(!i||i.trim()===``)&&n[2]&&(i=n[2].trim()),i||0},CL=(e,t,n,r,i,a)=>{if(KI(e)){if(!i){let i=e(t,n,r,a);return isNaN(+i)?i||0:+i}let o=()=>{let i=e(t,n,r,a);return isNaN(+i)?i||0:+i};return i.func=o,o()}if(GI(e)&&VI(e,`var(`)){if(!i)return SL(e,t);let n=()=>SL(e,t);return i.func=n,n()}return e},wL=(e,t)=>e[TI]?e[EI]&&fae(e,t)?bI.ATTRIBUTE:NI.includes(t)||MI.get(t)?bI.TRANSFORM:VI(t,`--`)?bI.CSS_VAR:t in e.style?bI.CSS:t in e?bI.OBJECT:bI.ATTRIBUTE:bI.OBJECT,TL=(e,t,n)=>{let r=e.style[t];r&&n&&(n[t]=r);let i=r||getComputedStyle(e[Zie]||e).getPropertyValue(t);return i===`auto`?`0`:i},EL=(e,t,n,r)=>{let i=qI(n)?wL(e,t):n,a=yL(e,t);if(a){let n=a.get(e);return n&&r&&(r[t]=n),n??0}if(i===bI.OBJECT){let n=e[t];return n&&r&&(r[t]=n),n||0}if(i===bI.ATTRIBUTE){let n=e.getAttribute(t);return n&&r&&(r[t]=n),n}return i===bI.TRANSFORM?_ae(e,t,r):i===bI.CSS_VAR?TL(e,t,r).trimStart():TL(e,t,r)},DL=(e,t,n)=>n===`-`?e-t:n===`+`?e+t:e*t,OL=()=>({t:xI.NUMBER,n:0,u:null,o:null,d:null,s:null}),kL=(e,t)=>{if(t.t=xI.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;let n=+e;if(!isNaN(n))return t.n=n,t;let r=e;r[1]===`=`&&(t.o=r[0],r=r.slice(2));let i=!r.includes(` `)&&oae.exec(r);if(i)return t.t=xI.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if(uae(r))return t.t=xI.COLOR,t.d=xae(r),t;{let e=r.match(FI);return t.t=xI.COMPLEX,t.d=e?e.map(Number):[],t.s=r.split(FI)||[],t}},AL=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=pL(e._toNumbers),t.s=pL(e._strings),t),jL=OL(),ML=(e,t,n)=>{let r=e._modifier,i=e._fromNumbers,a=e._toNumbers,o=e._strings,s=o[0];for(let c=0,l=a.length;c<l;c++){let l=r(lL(uL(i[c],a[c],t),n)),u=o[c+1];s+=`${u?l+u:l}`,e._numbers[c]=l}return s},NL=(e,t,n,r,i)=>{let a=e.parent,o=e.duration,s=e.completed,c=e.iterationDuration,l=e.iterationCount,u=e._currentIteration,d=e._loopDelay,f=e._reversed,p=e._alternate,m=e._hasChildren,h=e._delay,g=e._currentTime,_=h+c,v=t-h,y=cL(g,-h,o),b=cL(v,-h,o),x=v-g,S=b>0,C=b>=o,w=o<=OI,T=i===SI.FORCE,E=0,D=v,O=0;if(l>1){let t=c+(C?0:d),n=~~(b/t);e._currentIteration=cL(n,0,l),C&&e._currentIteration--,E=e._currentIteration%2,D=b-n*t||0}let k=f^(p&&E),A=e._ease,j=C?k?0:o:k?c-D:D;A&&(j=c*A(j/c)||0);let M=(a?a.backwards:v<g)?!k:!!k;if(e._currentTime=v,e._iterationTime=j,e.backwards=M,S&&!e.began?(e.began=!0,!n&&!(a&&(M||!a.began))&&e.onBegin(e)):v<=0&&(e.began=!1),!n&&!m&&S&&e._currentIteration!==u&&e.onLoop(e),T||i===SI.AUTO&&(t>=(a&&h>0?0:h)&&t<=_||t<=h&&y>h||t>=_&&y!==o)||j>=_&&y!==o||j<=h&&y>0&&!C||t<=y&&y===o&&s||C&&!s&&w){if(S&&(e.computeDeltaTime(y),n||e.onBeforeUpdate(e)),!m){let t=T||(M?x*-1:x)>=RI.tickThreshold,i=lL(e._offset+(a?a._offset:0)+h+j,12),o=e._head,s,c,l,u,d=0;for(;o;){let e=o._composition,n=o._currentTime,a=o._changeDuration,f=o._absoluteStartTime+o._changeDuration,p=o._nextRep,m=o._prevRep,h=e!==CI.none,g=m?m._absoluteStartTime+m._changeDuration:0,_=m&&m.parent!==o.parent,v=!p||p._isOverridden?f:p.parent===o.parent?f+p._delay:p._absoluteStartTime<p._absoluteUpdateStartTime?p._absoluteStartTime:p._absoluteUpdateStartTime;if((t||(n!==a||i<=v||m&&!_&&(!p||p.parent!==o.parent))&&(n!==0||i>=o._absoluteStartTime||_&&!o._hasFromValue&&!m._isOverridden&&i>=g||p&&!p._isOverridden&&p.parent===o.parent&&p._currentTime!==0&&j<p._startTime))&&(!m||_||j>=o._startTime)&&(!h||!o._isOverridden&&(!o._isOverlapped||i<=f)&&(!p||p._isOverridden||i<=v)&&(!m||m._isOverridden||(_?i>=o._absoluteStartTime||!o._hasFromValue&&i>=g:i>=g+o._delay)))){let t=o._currentTime=cL(j-o._startTime,0,a),n=o._ease(t/o._updateDuration),i=o._modifier,f=o._valueType,p=o._tweenType,m=p===bI.OBJECT,g=f===xI.NUMBER,_=g&&m||n===0||n===1?-1:RI.precision,v,y;if(g)v=y=i(lL(uL(o._fromNumber,o._toNumber,n),_));else if(f===xI.UNIT)y=i(lL(uL(o._fromNumber,o._toNumber,n),_)),v=`${y}${o._unit}`;else if(f===xI.COLOR){let e=o._numbers,t=o._fromNumbers,a=o._toNumbers,s=1-n,c=t[0],l=t[1],u=t[2],d=a[0],f=a[1],p=a[2];e[0]=i(Math.sqrt(c*c*s+d*d*n)),e[1]=i(Math.sqrt(l*l*s+f*f*n)),e[2]=i(Math.sqrt(u*u*s+p*p*n)),e[3]=i(uL(t[3],a[3],n)),(!o._setter||r)&&(v=`rgba(${lL(e[0],0)},${lL(e[1],0)},${lL(e[2],0)},${e[3]})`)}else f===xI.COMPLEX&&(v=ML(o,n,_));if(h&&(o._number=y),!r&&e!==CI.blend){let e=o.property;s=o.target,o._setter?o._setter(s,y,o):m?s[e]=v:p===bI.ATTRIBUTE?s.setAttribute(e,v):(c=s.style,p===bI.TRANSFORM?(s!==l&&(l=s,u=s[DI]),u[e]=v,d=1):p===bI.CSS?c[e]=v:p===bI.CSS_VAR&&c.setProperty(e,v)),S&&(O=1)}else o._value=v}else n&&m&&!_&&j<o._startTime&&(o._currentTime=0);d&&o._renderTransforms&&(c.transform=_L(u),d=0),o=o._next}!n&&O&&e.onRender(e)}!n&&S&&e.onUpdate(e)}return a&&w?!n&&(a.began&&!M&&v>0&&!s||M&&v<=1e-11&&s)&&(e.onComplete(e),e.completed=!M):S&&C?l===1/0?e._startTime+=e.duration:e._currentIteration>=l-1&&(e.paused=!0,!s&&!m&&(e.completed=!0,!n&&!(a&&(M||!a.began))&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,O},PL=(e,t,n,r,i)=>{let a=e._currentIteration;if(NL(e,t,n,r,i),e._hasChildren){let o=e,s=o.backwards,c=r?t:o._iterationTime,l=HI(),u=0,d=!0;if(!r&&o._currentIteration!==a){let e=o.iterationDuration;mL(o,t=>{if(!s)!t.completed&&!t.backwards&&t._currentTime<t.iterationDuration&&NL(t,e,n,1,SI.FORCE),t.began=!1,t.completed=!1;else{let r=t.duration,i=t._offset+t._delay,a=i+r;!n&&r<=1e-11&&(!i||a===e)&&t.onComplete(t)}}),n||o.onLoop(o)}mL(o,e=>{let t=lL((c-e._offset)*e._speed,12);if(s&&t>e._delay+e.duration)return;let a=e._fps<o._fps?e.requestTick(l):i;u+=NL(e,t,n,r,a),!e.completed&&d&&(d=!1)},s),!n&&u&&o.onRender(o),(d||s)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,n||(o.onComplete(o),o._resolve(o))))}},FL={},IL=(e,t,n)=>{if(n===bI.TRANSFORM)return MI.get(e)||e;if(n===bI.CSS||n===bI.ATTRIBUTE&&YI(t)&&e in t.style){let t=FL[e];if(t)return t;{let t=e&&BI(e);return FL[e]=t,t}}return e},LL=(e,t=!1)=>{if(e._hasChildren)mL(e,e=>LL(e,t),!0);else{let n=e;n.pause(),mL(n,e=>{let r=e.property,i=e.target,a=e._tweenType,o=e._inlineValue,s=JI(o)||o===``;if(e._setter){if(!t&&!s){if(kL(o,jL),jL.d){let t=jL.d,n=e._numbers;for(let e=0,r=t.length;e<r;e++)n[e]=t[e]}else e._number=jL.n;e._setter(e.target,e._number,e)}}else if(a===bI.OBJECT)!t&&!s&&(i[r]=o);else if(i[TI]){if(a===bI.ATTRIBUTE)t||(s?i.removeAttribute(r):i.setAttribute(r,o));else{let t=i.style;if(a===bI.TRANSFORM){let n=i[DI];s?delete n[r]:n[r]=o,e._renderTransforms&&(Object.keys(n).length?t.transform=_L(n):t.removeProperty(`transform`))}else s?t.removeProperty(BI(r)):t[r]=o}}i[TI]&&n._tail===e&&n.targets.forEach(e=>{e.getAttribute&&e.getAttribute(`style`)===``&&e.removeAttribute(`style`)})})}return e},RL=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=AI/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){let t=+e,n=t<1e-11?OI:t,r=AI/n;n>II.frameRate&&(II.frameRate=n),this._fps=n,this._frameDuration=r}get speed(){return this._speed}set speed(e){let t=+e;this._speed=t<1e-11?OI:t}requestTick(e){let t=this._frameDuration,n=e-this._lastTickTime,r=t*.25;return n+(r<4?r:4)<t?SI.NONE:(this._lastTickTime=n>=t?e-n%t:e,SI.AUTO)}computeDeltaTime(e){let t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},zL={animation:null,update:PI},BL=e=>{let t=zL.animation;return t||(t={duration:OI,computeDeltaTime:PI,_offset:0,_delay:0,_head:null,_tail:null},zL.animation=t,zL.update=()=>{e.forEach(e=>{for(let t in e){let n=e[t],r=n._head;if(r){let e=r._valueType,t=e===xI.COMPLEX||e===xI.COLOR?pL(r._fromNumbers):null,i=r._fromNumber,a=n._tail;for(;a&&a!==r;){if(t)for(let e=0,n=a._numbers.length;e<n;e++)t[e]+=a._numbers[e];else i+=a._number;a=a._prevAdd}r._toNumber=i,r._toNumbers=t}}}),NL(t,1,1,0,SI.FORCE)}),t},VL=_I?requestAnimationFrame:setImmediate,HL=_I?cancelAnimationFrame:clearImmediate,UL=class extends RL{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=II,this.paused=!0,this.reqId=0}update(){let e=this._currentTime=HI();if(this.requestTick(e)){this.computeDeltaTime(e);let t=this._speed,n=this._fps,r=this._head;for(;r;){let i=r._next;r.paused?(hL(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):PL(r,(e-r._startTime)*r._speed*t,0,0,r._fps<n?r.requestTick(e):SI.AUTO),r=i}zL.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(HI()),this.reqId=VL(GL)),this}pause(){if(this.reqId)return this.paused=!0,KL()}resume(){if(this.paused)return this.paused=!1,mL(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(RI.timeScale===1?1:AI)}set speed(e){let t=e*RI.timeScale;this._speed!==t&&(this._speed=t,mL(this,e=>e.speed=e._speed))}get timeUnit(){return RI.timeScale===1?`ms`:`s`}set timeUnit(e){let t=.001,n=e===`s`,r=n?t:1;if(RI.timeScale!==r){RI.timeScale=r,RI.tickThreshold=200*r;let e=n?t:AI;this.defaults.duration*=e,this._speed*=e}}get precision(){return RI.precision}set precision(e){RI.precision=e}},WL=(()=>{let e=new UL(HI());return _I&&(zI.engine=e,yI.addEventListener(`visibilitychange`,()=>{e.pauseOnDocumentHidden&&(yI.hidden?e.pause():e.resume())})),e})(),GL=()=>{WL._head?(WL.reqId=VL(GL),WL.update()):WL.reqId=0},KL=()=>(HL(WL.reqId),WL.reqId=0,WL),qL={_rep:new WeakMap,_add:new Map},JL=(e,t,n=`_rep`)=>{let r=qL[n],i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},YL=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,XL=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=OI,e._currentTime=OI},ZL=(e,t)=>{let n=e._composition;if(n===CI.replace){let n=e._absoluteStartTime;gL(t,e,YL,`_prevRep`,`_nextRep`);let r=e._prevRep;if(r){let t=r.parent,i=r._absoluteEndTime;if(e.parent.id!==t.id&&t.iterationCount>1&&i+(t.duration-t.iterationDuration)>n){XL(r);let e=r._prevRep;for(;e&&e.parent.id===t.id;)XL(e),e=e._prevRep}let a=e._absoluteUpdateStartTime;if(i>a){let e=r._startTime,t=lL(a-(i-(e+r._updateDuration))-e,12);r._changeDuration=t,r._currentTime=t,r._isOverlapped=1,t<1e-11&&XL(r)}let o=e.parent.parent;if(!o||o!==t.parent){let e=!0;if(mL(t,t=>{t._isOverlapped||(e=!1)}),e){let e=t.parent;if(e){let n=!0;mL(e,e=>{e!==t&&mL(e,e=>{e._isOverlapped||(n=!1)})}),n&&e.cancel()}else t.cancel()}}}}else if(n===CI.blend){let t=JL(e.target,e.property,`_add`),n=BL(qL._add),r=t._head;r||(r={...e},r._composition=CI.replace,r._updateDuration=OI,r._startTime=0,r._numbers=pL(e._fromNumbers),r._number=0,r._next=null,r._prev=null,gL(t,r),gL(n,r));let i=e._toNumber;if(e._fromNumber=r._fromNumber-i,e._toNumber=0,e._numbers=pL(e._fromNumbers),e._number=0,r._fromNumber=i,e._toNumbers.length){let t=pL(e._toNumbers);t.forEach((t,n)=>{e._fromNumbers[n]=r._fromNumbers[n]-t,e._toNumbers[n]=0}),r._fromNumbers=t}gL(t,e,null,`_prevAdd`,`_nextAdd`)}return e},QL=e=>{let t=e._composition;if(t!==CI.none){let n=e.target,r=e.property,i=qL._rep.get(n)[r];if(hL(i,e,`_prevRep`,`_nextRep`),t===CI.blend){let t=qL._add,i=t.get(n);if(!i)return;let a=i[r],o=zL.animation;hL(a,e,`_prevAdd`,`_nextAdd`);let s=a._head;if(s&&s===a._tail){hL(a,s,`_prevAdd`,`_nextAdd`),hL(o,s);let e=!0;for(let t in i)if(i[t]._head){e=!1;break}e&&t.delete(n)}}}return e},$L=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),eR=e=>e._cancelled?(e._hasChildren?mL(e,eR):mL(e,e=>{e._composition!==CI.none&&ZL(e,JL(e.target,e.property))}),e._cancelled=0,e):e,tR=0,nR=(e,t)=>e._priority>t._priority,rR=class extends RL{constructor(e={},t=null,n=0){super(0),++tR;let{id:r,delay:i,duration:a,reversed:o,alternate:s,loop:c,loopDelay:l,autoplay:u,frameRate:d,playbackRate:f,priority:p,onComplete:m,onLoop:h,onPause:g,onBegin:_,onBeforeUpdate:v,onUpdate:y}=e;LI.current&&LI.current.register(this);let b=t?0:WL._lastTickTime,x=t?t.defaults:RI.defaults,S=KI(i)||qI(i)?x.delay:+i,C=KI(a)||qI(a)?1/0:+a,w=xL(c,x.loop),T=xL(l,x.loopDelay),E=w===!0||w===1/0||w<0?1/0:w+1,D=0;t?D=n:(WL.reqId||WL.requestTick(HI()),D=(WL._lastTickTime-WL._startTime)*RI.timeScale),this.id=qI(r)?tR:r,this.parent=t,this.duration=dL((C+T)*E-T)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=_||x.onBegin,this.onBeforeUpdate=v||x.onBeforeUpdate,this.onUpdate=y||x.onUpdate,this.onLoop=h||x.onLoop,this.onPause=g||x.onPause,this.onComplete=m||x.onComplete,this.iterationDuration=C,this.iterationCount=E,this._autoplay=!t&&xL(u,x.autoplay),this._offset=D,this._delay=S,this._loopDelay=T,this._iterationTime=0,this._currentIteration=0,this._resolve=PI,this._running=!1,this._reversed=+xL(o,x.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=xL(s,x.alternate),this._prev=null,this._next=null,this._lastTickTime=b,this._startTime=b,this._lastTime=b,this._fps=xL(d,x.frameRate),this._speed=xL(f,x.playbackRate),this._priority=+xL(p,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return cL(lL(this._currentTime,RI.precision),-this._delay,this.duration)}set currentTime(e){let t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return cL(lL(this._iterationTime,RI.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return cL(lL(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return cL(lL(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){let t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*cL(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return eR(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,PL(this,0,1,~~e,SI.FORCE),$L(this),this._hasChildren&&mL(this,$L),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&PL(this,this.duration,1,~~e,SI.FORCE),this.reset(e);let t=this._autoplay;return t===!0?this.resume():t&&!qI(t.linked)&&t.link(this),this}resetTime(){let e=1/(this._speed*WL._speed);return this._startTime=HI()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?PL(this,OI,0,0,SI.FORCE):(this._running||=(gL(WL,this,nR),WL._hasChildren=!0,!0),this.resetTime(),this._startTime-=12,WL.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,n=0){eR(this),this.completed=!1;let r=this.paused;return this.paused=!0,PL(this,e+this._delay,~~t,~~n,SI.AUTO),r?this:this.resume()}alternate(){let e=this._reversed,t=this.iterationCount,n=this.iterationDuration,r=t===1/0?aL(kI/n):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(n*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?mL(this,e=>e.cancel(),!0):mL(this,QL),this._cancelled=1,this.pause()}stretch(e){let t=this.duration,n=fL(e);if(t===n)return this;let r=e/t,i=e<=OI;return this.duration=i?OI:n,this.iterationDuration=i?OI:fL(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){PL(this,0,1,0,SI.AUTO);let e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=PI){let t=this.then,n=()=>{this.then=null,e(this),this.then=t,this._resolve=PI};return new Promise(e=>(this._resolve=()=>e(n()),this.completed&&this._resolve(),this))}};function iR(e){let t=GI(e)?LI.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function aR(e){if(JI(e))return[];if(!_I)return UI(e)&&e.flat(1/0)||[e];if(UI(e)){let t=e.flat(1/0),n=[];for(let e=0,r=t.length;e<r;e++){let r=t[e];if(!JI(r)){let e=iR(r);if(e)for(let t=0,r=e.length;t<r;t++){let r=e[t];if(!JI(r)){let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}else{let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}}return n}let t=iR(e);return t?Array.from(t):[e]}function oR(e){let t=aR(e),n=t.length;for(let e=0;e<n;e++){let n=t[e];if(!n[wI]){n[wI]=!0;let e=YI(n);(n.nodeType||e)&&(n[TI]=!0,n[EI]=e,n[DI]={})}}return t}var sR={deg:1,rad:180/oL,turn:360},cR={},lR=(e,t,n,r=!1)=>{let i=t.u,a=t.n;if(t.t===xI.UNIT&&i===n)return t;let o=a+i+n,s=cR[o];if(!qI(s)&&!r)t.n=s;else{let r;if(i in sR)r=a*sR[i]/sR[n];else{let t=e.cloneNode(),o=e.parentNode,s=o&&o!==yI?o:yI.body;s.appendChild(t);let c=t.style;c.width=100+i;let l=t.offsetWidth||100;c.width=100+n;let u=l/(t.offsetWidth||100);s.removeChild(t),r=u*a}t.n=r,cR[o]=r}return t.t,xI.UNIT,t.u=n,t},uR=e=>e,dR=(e=1.68)=>t=>eL(t,+e),fR={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},pR=oL/2,mR=oL*2,hR={"":dR,Quad:dR(2),Cubic:dR(3),Quart:dR(4),Quint:dR(5),Sine:e=>1-rL(e*pR),Circ:e=>1-tL(1-e*e),Expo:e=>e?eL(2,10*e-10):0,Bounce:e=>{let t,n=4;for(;e<((t=eL(2,--n))-1)/11;);return 1/eL(4,3-n)-7.5625*eL((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{let n=cL(+e,1,10),r=cL(+t,OI,2),i=r/mR*hae(1/n),a=mR/r;return e=>e===0||e===1?e:-n*eL(2,-10*(1-e))*nL((1-e-i)*a)}},gR=(()=>{let e={linear:uR,none:uR};for(let t in fR)for(let n in hR){let r=hR[n],i=fR[t];e[t+n]=n===``||n===`Back`||n===`Elastic`?(e,t)=>i(r(e,t)):i(r)}return e})(),_R={linear:uR,none:uR},vR=e=>{if(_R[e])return _R[e];if(e.indexOf(`(`)<=-1){let t=fR[e]||e.includes(`Back`)||e.includes(`Elastic`)?gR[e]():gR[e];return t?_R[e]=t:uR}{let t=e.slice(0,-1).split(`(`),n=gR[t[0]];return n?_R[e]=n(...t[1].split(`,`)):uR}},yR=[`steps(`,`irregular(`,`linear(`,`cubicBezier(`],bR=e=>{if(GI(e)){for(let t=0,n=yR.length;t<n;t++)if(VI(e,yR[t]))return console.warn(`String syntax for \`ease: "${e}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${e}\``),uR}return KI(e)?e:GI(e)?vR(e):uR},xR=OL(),SR=OL(),CR={},wR={func:null},TR={func:null},ER=[null],DR=[null,null],OR={to:null},kR=0,AR=0,jR,MR,NR=(e,t)=>{let n={};if(UI(e)){let t=[].concat(...e.map(e=>Object.keys(e))).filter($I);for(let r=0,i=t.length;r<i;r++){let i=t[r];n[i]=e.map(e=>{let t={};for(let n in e){let r=e[n];$I(n)?n===i&&(t.to=r):t[n]=r}return t})}}else{let r=xL(t.duration,RI.defaults.duration);Object.keys(e).map(t=>({o:parseFloat(t)/100,p:e[t]})).sort((e,t)=>e.o-t.o).forEach(e=>{let t=e.o,i=e.p;for(let e in i)if($I(e)){let a=n[e];a||=n[e]=[];let o=t*r,s=a.length,c=a[s-1],l={to:i[e]},u=0;for(let e=0;e<s;e++)u+=a[e].duration;s===1&&(l.from=c.to),i.ease&&(l.ease=i.ease),l.duration=o-(s?u:0),a.push(l)}return e});for(let e in n){let t=n[e],r;for(let e=0,n=t.length;e<n;e++){let n=t[e],i=n.ease;n.ease=r||void 0,r=i}t[0].duration||t.shift()}}return n},PR=class extends rR{constructor(e,t,n,r,i=!1,a=0,o){super(t,n,r),this._head,this._tail,++AR;let s=oR(e),c=s.length,l=t.keyframes,u=l?gae(NR(l,t),t):t,{id:d,delay:f,duration:p,ease:m,playbackEase:h,modifier:g,composition:_,onRender:v}=u,y=n?n.defaults:RI.defaults,b=xL(m,y.ease),x=xL(h,y.playbackEase),S=x?bR(x):null,C=!qI(b.ease),w=C?b.ease:xL(m,S?`linear`:y.ease),T=C?b.settlingDuration:xL(p,y.duration),E=xL(f,y.delay),D=g||y.modifier,O=qI(_)&&c>=1e3?CI.none:qI(_)?y.composition:_,k=this._offset+(n?n._offset:0);C&&(b.parent=this);let A=NaN,j=NaN,M=0,N=0;for(let e=0;e<c;e++){let t=s[e],r=a||e,c=o||s,l=NaN,d=NaN;for(let e in u)if($I(e)){let a=wL(t,e),o=yL(t,e),s=IL(e,t,a),f=u[e],p=UI(f);if(i&&!p&&(DR[0]=f,DR[1]=f,f=DR),p){let e=f.length,t=!WI(f[0]);e===2&&t?(OR.to=f,ER[0]=OR,jR=ER):e>2&&t?(jR=[],f.forEach((e,t)=>{t?t===1?(DR[1]=e,jR.push(DR)):jR.push(e):DR[0]=e})):jR=f}else ER[0]=f,jR=ER;let m=null,h=null,g=NaN,_=0,v=0;for(let e=jR.length;v<e;v++){let i=jR[v];WI(i)?MR=i:(OR.to=i,MR=OR),wR.func=null,TR.func=null;let l=CL(xL(MR.composition,O),t,r,c,null,null),u=lae(l)?l:CI[l];!m&&u!==CI.none&&(m=JL(t,s));let d=m?m._tail:null,f=n&&d&&d.parent.parent===n?d:h,p=CL(MR.to,t,r,c,wR,f),y;WI(p)&&!qI(p.to)?(MR=p,y=p.to):y=p;let b=CL(MR.from,t,r,c,TR,f),x=MR.ease||w,S=CL(x,t,r,c,null,f),C=KI(S)||GI(S)?S:x,A=!qI(C)&&!qI(C.ease),j=A?C.ease:C,P=A?C.settlingDuration:CL(xL(MR.duration,e>1?CL(T,t,r,c,null,f)/e:T),t,r,c,null,f),F=CL(xL(MR.delay,v?0:E),t,r,c,null,f),I=MR.modifier||D,L=!qI(b),R=!qI(y),z=UI(y),ee=z||L&&R,te=h?_:0,B=h?_+F:F,ne=lL(k+B,12),re=lL(k+te,12);!N&&(L||z)&&(N=1);let V=h;if(u!==CI.none){let e=m._head;for(;e&&e._absoluteStartTime<=ne;)if(e._isOverridden||(V=e),e=e._nextRep,e&&e._absoluteStartTime>=ne)for(;e;)XL(e),e=e._nextRep}if(ee){kL(z?CL(y[0],t,r,c,TR,f):b,xR),kL(z?CL(y[1],t,r,c,wR,f):y,SR);let e=EL(t,s,a,CR);xR.t===xI.NUMBER&&(V?V._valueType===xI.UNIT&&(xR.t=xI.UNIT,xR.u=V._unit):(kL(e,jL),jL.t===xI.UNIT&&(xR.t=xI.UNIT,xR.u=jL.u)))}else R?kL(y,SR):h?AL(h,SR):kL(n&&V&&V.parent.parent===n?V._value:EL(t,s,a,CR),SR),L?kL(b,xR):h?AL(h,xR):kL(n&&V&&V.parent.parent===n?V._value:EL(t,s,a,CR),xR);if(xR.o&&(xR.n=DL(V?V._toNumber:kL(EL(t,s,a,CR),jL).n,xR.n,xR.o)),SR.o&&(SR.n=DL(xR.n,SR.n,SR.o)),xR.t!==SR.t){if(xR.t===xI.COMPLEX||SR.t===xI.COMPLEX){let e=xR.t===xI.COMPLEX?xR:SR,t=xR.t===xI.COMPLEX?SR:xR;t.t=xI.COMPLEX,t.s=pL(e.s),t.d=e.d.map(()=>t.n)}else if(xR.t===xI.UNIT||SR.t===xI.UNIT){let e=xR.t===xI.UNIT?xR:SR,t=xR.t===xI.UNIT?SR:xR;t.t=xI.UNIT,t.u=e.u}else if(xR.t===xI.COLOR||SR.t===xI.COLOR){let e=xR.t===xI.COLOR?xR:SR,t=xR.t===xI.COLOR?SR:xR;t.t=xI.COLOR,t.d=e.d.map(()=>0)}}if(xR.u!==SR.u){let e=SR.u?xR:SR;e=lR(t,e,SR.u?SR.u:xR.u,!1)}if(SR.d&&xR.d&&SR.d.length!==xR.d.length){let e=xR.d.length>SR.d.length?xR:SR,t=e===xR?SR:xR;t.d=e.d.map((e,n)=>qI(t.d[n])?0:t.d[n]),t.s=pL(e.s)}let ie=lL(+P||1e-11,12),ae=CR[s];JI(ae)||(CR[s]=null);let oe=o?o.set:null;_=lL(B+ie,12);let H=xR.d,se=SR.d,ce=SR.s,le={parent:this,id:kR++,property:s,target:t,_value:null,_toFunc:wR.func,_fromFunc:TR.func,_ease:bR(j),_fromNumbers:H?pL(H):jI,_toNumbers:se?pL(se):jI,_strings:ce?pL(ce):jI,_fromNumber:xR.n,_toNumber:SR.n,_numbers:H?pL(H):jI,_number:xR.n,_unit:SR.u,_modifier:I,_currentTime:0,_startTime:B,_delay:+F,_updateDuration:ie,_changeDuration:ie,_absoluteStartTime:ne,_absoluteUpdateStartTime:re,_absoluteEndTime:lL(k+_,12),_hasFromValue:L||z?1:0,_tweenType:a,_setter:oe,_valueType:SR.t,_composition:u,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:ae,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};u!==CI.none&&ZL(le,m);let U=le._valueType;if(U===xI.COMPLEX)le._value=ML(le,1,-1);else if(U===xI.UNIT)le._value=`${I(le._toNumber)}${le._unit}`;else if(U===xI.COLOR){let e=SR.d;le._value=`rgba(${lL(e[0],0)},${lL(e[1],0)},${lL(e[2],0)},${e[3]})`}else le._value=I(le._toNumber);isNaN(g)&&(g=le._startTime),h=le,M++,gL(this,le)}(isNaN(j)||g<j)&&(j=g),(isNaN(A)||_>A)&&(A=_),a===bI.TRANSFORM&&(l=M-v,d=M)}if(!isNaN(l)){let e=0;mL(this,t=>{e>=l&&e<d&&(t._renderTransforms=1,t._composition===CI.blend&&mL(zL.animation,e=>{e.id===t.id&&(e._renderTransforms=1)})),e++})}}c||console.warn(`No target found. Make sure the element you're trying to animate is accessible before creating your animation.`),j?(mL(this,e=>{e._startTime-e._delay||(e._delay-=j),e._startTime-=j}),A-=j):j=0,A||(A=OI,this.iterationCount=0),this.targets=s,this.id=qI(d)?AR:d,this.duration=A===1e-11?OI:dL((A+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=v||y.onRender,this._ease=S,this._delay=j,this.iterationDuration=A,!this._autoplay&&N&&this.onRender(this)}stretch(e){let t=this.duration;if(t===fL(e))return this;let n=e/t;return mL(this,e=>{e._updateDuration=fL(e._updateDuration*n),e._changeDuration=fL(e._changeDuration*n),e._currentTime*=n,e._delay*=n,e._startTime*=n,e._absoluteStartTime*=n,e._absoluteUpdateStartTime*=n,e._absoluteEndTime*=n}),super.stretch(e)}refresh(){return mL(this,e=>{let t=e._toFunc,n=e._fromFunc;(t||n)&&(n?(kL(n(),xR),xR.u!==e._unit&&e.target[TI]&&lR(e.target,xR,e._unit,!0),e._fromNumbers=pL(xR.d),e._fromNumber=xR.n):t&&(kL(EL(e.target,e.property,e._tweenType),jL),e._fromNumbers=pL(jL.d),e._fromNumber=jL.n),t&&(kL(t(),SR),e._toNumbers=pL(SR.d),e._strings=pL(SR.s),e._toNumber=SR.o?DL(e._fromNumber,SR.n,SR.o):SR.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),LL(this)}then(e){return super.then(e)}},FR=(e,t)=>RI.editor?RI.editor.addAnimation(e,t):new PR(e,t,null,0,!1).init(),IR=AI*10,LR=class{constructor(e={}){let t=!qI(e.bounce)||!qI(e.duration);this.timeStep=.02,this.restThreshold=5e-4,this.restDuration=200,this.maxDuration=6e4,this.maxRestSteps=this.restDuration/this.timeStep/AI,this.maxIterations=this.maxDuration/this.timeStep/AI,this.bn=cL(xL(e.bounce,.5),-1,1),this.pd=cL(xL(e.duration,628),10*RI.timeScale,IR*RI.timeScale),this.m=cL(xL(e.mass,1),1,IR),this.s=cL(xL(e.stiffness,100),OI,IR),this.d=cL(xL(e.damping,10),OI,IR),this.v=cL(xL(e.velocity,0),-IR,IR),this.w0=0,this.zeta=0,this.wd=0,this.b=0,this.completed=!1,this.solverDuration=0,this.settlingDuration=0,this.parent=null,this.onComplete=e.onComplete||PI,t&&this.calculateSDFromBD(),this.compute(),this.ease=e=>{let t=e*this.settlingDuration,n=this.completed,r=this.pd;return t>=r&&!n&&(this.completed=!0,this.onComplete(this.parent)),t<r&&n&&(this.completed=!1),e===0||e===1?e:this.solve(e*this.solverDuration)}}solve(e){let{zeta:t,w0:n,wd:r,b:i}=this,a=e;return a=t<1?iL(-a*t*n)*(1*rL(r*a)+i*nL(r*a)):t===1?(1+i*a)*iL(-a*n):((1+i)*iL((-t*n+r)*a)+(1-i)*iL((-t*n-r)*a))/2,1-a}calculateSDFromBD(){let e=RI.timeScale===1?this.pd/AI:this.pd;this.m=1,this.v=0,this.s=eL(2*oL/e,2),this.d=this.bn>=0?(1-this.bn)*4*oL/e:4*oL/(e*(1+this.bn)),this.s=lL(cL(this.s,OI,IR),3),this.d=lL(cL(this.d,OI,300),3)}calculateBDFromSD(){let e=2*oL/tL(this.s);this.pd=e*(RI.timeScale===1?AI:1),this.bn=this.d/(2*tL(this.s))<=1?1-this.d*e/(4*oL):4*oL/(this.d*e)-1,this.bn=lL(cL(this.bn,-1,1),3),this.pd=lL(cL(this.pd,10*RI.timeScale,IR*RI.timeScale),3)}compute(){let{maxRestSteps:e,maxIterations:t,restThreshold:n,timeStep:r,m:i,d:a,s:o,v:s}=this,c=this.w0=cL(tL(o/i),OI,AI),l=this.zeta=a/(2*tL(o*i));l<1?(this.wd=c*tL(1-l*l),this.b=(l*c+-s)/this.wd):l===1?(this.wd=0,this.b=-s+c):(this.wd=c*tL(l*l-1),this.b=(l*c+-s)/this.wd);let u=0,d=0,f=0;for(;d<=e&&f<=t;)pae(1-this.solve(u))<n?d++:d=0,this.solverDuration=u,u+=r,f++;this.settlingDuration=lL(this.solverDuration*AI,0)*RI.timeScale}get bounce(){return this.bn}set bounce(e){this.bn=cL(xL(e,1),-1,1),this.calculateSDFromBD(),this.compute()}get duration(){return this.pd}set duration(e){this.pd=cL(xL(e,1),10*RI.timeScale,IR*RI.timeScale),this.calculateSDFromBD(),this.compute()}get stiffness(){return this.s}set stiffness(e){this.s=cL(xL(e,100),OI,IR),this.calculateBDFromSD(),this.compute()}get damping(){return this.d}set damping(e){this.d=cL(xL(e,10),OI,IR),this.calculateBDFromSD(),this.compute()}get mass(){return this.m}set mass(e){this.m=cL(xL(e,1),1,IR),this.compute()}get velocity(){return this.v}set velocity(e){this.v=cL(xL(e,0),-IR,IR),this.compute()}},RR=e=>new LR(e),zR=(e=10,t)=>{let n=t?mae:aL;return t=>n(cL(t,0,1)*e)*(1/e)},BR=s({animate:()=>FR,spring:()=>RR}),VR=(0,K.forwardRef)(function({id:e,transform:t},n){return(0,X.jsxs)(`radialGradient`,{ref:n,id:e,gradientUnits:`userSpaceOnUse`,cx:`-1.2`,cy:`-1.6`,r:`5.6`,gradientTransform:t,children:[(0,X.jsx)(`stop`,{offset:`0`,stopColor:`color-mix(in oklab, var(--color-white) calc(var(--depth) * 50%), currentColor)`}),(0,X.jsx)(`stop`,{offset:`1`,stopColor:`currentColor`})]})});function HR({id:e}){return(0,X.jsx)(`filter`,{id:e,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:(0,X.jsx)(`feDropShadow`,{dx:`0`,dy:`1.5`,stdDeviation:`1`,floodColor:`currentColor`,style:{floodOpacity:`calc(var(--depth) * 0.6)`}})})}function UR({id:e}){return(0,X.jsxs)(`filter`,{id:e,x:`-10%`,y:`-10%`,width:`120%`,height:`120%`,colorInterpolationFilters:`sRGB`,children:[(0,X.jsx)(`feGaussianBlur`,{in:`SourceAlpha`,stdDeviation:`0.3`,result:`soft-edge`}),(0,X.jsx)(`feOffset`,{in:`soft-edge`,dx:`0.25`,dy:`0.45`,result:`lower-edge`}),(0,X.jsx)(`feComposite`,{in:`SourceAlpha`,in2:`lower-edge`,operator:`out`,result:`inner-shadow`}),(0,X.jsx)(`feFlood`,{floodColor:`var(--color-black)`,floodOpacity:`calc(var(--depth) * 0.28)`}),(0,X.jsx)(`feComposite`,{in2:`inner-shadow`,operator:`in`,result:`shade`}),(0,X.jsx)(`feOffset`,{in:`soft-edge`,dx:`-0.2`,dy:`-0.35`,result:`upper-edge`}),(0,X.jsx)(`feComposite`,{in:`SourceAlpha`,in2:`upper-edge`,operator:`out`,result:`inner-highlight`}),(0,X.jsx)(`feFlood`,{floodColor:`var(--color-white)`,floodOpacity:`calc(var(--depth) * 0.7)`}),(0,X.jsx)(`feComposite`,{in2:`inner-highlight`,operator:`in`,result:`highlight`}),(0,X.jsxs)(`feMerge`,{children:[(0,X.jsx)(`feMergeNode`,{in:`SourceGraphic`}),(0,X.jsx)(`feMergeNode`,{in:`shade`}),(0,X.jsx)(`feMergeNode`,{in:`highlight`})]})]})}var WR=Object.freeze({alphaIntercept:-8,alphaSlope:18,blurStdDeviation:2});function GR({id:e,values:t=Pre}){return(0,X.jsxs)(`filter`,{id:e,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:[(0,X.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:t.blurStdDeviation,result:`blur`}),(0,X.jsx)(`feColorMatrix`,{in:`blur`,values:`1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 ${String(t.alphaSlope)} ${String(t.alphaIntercept)}`,result:`gooey`}),(0,X.jsx)(`feComposite`,{in:`SourceGraphic`,in2:`gooey`,operator:`atop`})]})}function KR(e,t){let n=e.ownerDocument,r=!0,i=()=>{t(r&&!n.hidden)},a=globalThis,o=`IntersectionObserver`in globalThis&&a.IntersectionObserver?new a.IntersectionObserver(t=>{let n=t.find(t=>t.target===e);n&&(r=n.isIntersecting,i())}):void 0;return o?.observe(e),n.addEventListener(`visibilitychange`,i),i(),()=>{o?.disconnect(),n.removeEventListener(`visibilitychange`,i)}}function qR(e){let t=Math.max(0,Math.min(1,e));return t*t*(3-2*t)}function JR(e,t){let n=Math.max(0,Math.min(1,(t-(e-1)*.085)/.68));return Math.sin(n*Math.PI)**2}function YR(e,t,n){let r=n*Math.PI*2,i=t*2.1,a=Math.sin(r*2+i)*.15,o={rx:4*(1+a),ry:4/(1+a)};if(e===`line`){let e=7.5+4*Math.cos(r+(t===2?-.45:0));return{cx:(t-1)*e,cy:Math.sin(r+i)*.7,...o}}if(e===`square`){let e=4.7+2.7*Math.cos(r);return{cx:(t%2?1:-1)*e,cy:(t<2?-1:1)*e,...o}}if(e===`donut`){let e=qR(n/.66)*Math.PI*2,o=Math.min(e,t*Math.PI/8)-Math.PI/2,s=qR((n-.79)/.21),c=8+Math.sin(r*2+i)*.35*Math.sin(n*Math.PI);return{cx:Math.cos(o)*c*(1-s),cy:Math.sin(o)*c*(1-s)-8*s,rx:3.6*(1+a*Math.sin(n*Math.PI)),ry:3.6/(1+a*Math.sin(n*Math.PI))}}if(e===`bloom`){if(t===0){let e=[1,2,3,4].reduce((e,t)=>e+JR(t,n),0),t=Math.sqrt(49-e*4);return{cx:Math.sin(r)*.4,cy:Math.sin(r*2)*.4,rx:t*(1+a),ry:t/(1+a)}}let e=JR(t,n),i=(t-1)*Math.PI/2-Math.PI/4+Math.sin(r)*.22;return{cx:Math.cos(i)*14*e,cy:Math.sin(i)*14*e,rx:3.2*(1+a),ry:3.2/(1+a)}}return{cx:Math.sin(r+i)*6+Math.sin(r*3+i)*2.5,cy:Math.cos(r*2+i)*6,...o}}var XR={line:1700,square:1900,donut:3e3,wander:4600,bloom:2800};function ZR({variant:e}){let t=`caps-loader-${(0,K.useId)().replaceAll(`:`,``)}`,n=(0,K.useRef)(null),r=(0,K.useRef)(null),i=uI(r),{reduced:a}=i,o=e===`donut`?16:e===`bloom`?5:e===`square`?4:3;return(0,K.useLayoutEffect)(()=>{if(a||!n.current||!r.current)return;let t=[...n.current.querySelectorAll(`ellipse`)].map((t,n)=>FR(t,{keyframes:Array.from({length:48},(t,r)=>({...YR(e,n,(r+1)/48),duration:dI(i,XR[e])/48})),ease:`linear`,loop:!0})),o=KR(r.current,e=>{for(let n of t)e?n.resume():n.pause()});return()=>{o();for(let e of t)e.revert()}},[e,a,i]),(0,X.jsxs)(`svg`,{ref:r,"aria-hidden":`true`,focusable:`false`,viewBox:e===`line`?`-20 -10 40 20`:`-20 -20 40 40`,children:[(0,X.jsxs)(`defs`,{children:[(0,X.jsx)(GR,{id:t,values:WR}),(0,X.jsx)(VR,{id:`${t}-surface`,transform:e===`line`?`matrix(3.4 0 0 1.4 0 0)`:`matrix(3 0 0 3 0 0)`}),(0,X.jsx)(HR,{id:`${t}-shadow`}),(0,X.jsx)(`mask`,{id:`${t}-mask`,maskUnits:`userSpaceOnUse`,x:`-20`,y:`-20`,width:`40`,height:`40`,style:{maskType:`alpha`},children:(0,X.jsx)(`g`,{ref:n,fill:`currentColor`,filter:`url(#${t})`,children:Array.from({length:o},(t,n)=>(0,X.jsx)(`ellipse`,{...YR(e,n,0)},n))})})]}),(0,X.jsx)(`g`,{filter:`url(#${t}-shadow)`,children:(0,X.jsx)(`rect`,{x:`-20`,y:`-20`,width:`40`,height:`40`,fill:`url(#${t}-surface)`,mask:`url(#${t}-mask)`})})]})}var QR={sm:`caps-loader-sm`,md:`caps-loader-md`,lg:`caps-loader-lg`,fill:`caps-loader-fill`},$R={neutral:`text-base-content`,accent:`text-accent`,primary:`text-primary`,success:`text-success`},ez=(0,K.forwardRef)(function({"aria-label":e,"aria-labelledby":t,className:n,decorative:r=!1,label:i=`Loading`,size:a=`md`,variant:o=`line`,tone:s=`neutral`,...c},l){let u=`${(0,K.useId)()}-label`,d=!r&&e===void 0&&t===void 0;return(0,X.jsxs)(`span`,{...c,"aria-label":r?void 0:e,"aria-hidden":r||void 0,"aria-labelledby":r?void 0:t??(e===void 0?u:void 0),className:Z(`caps-loader`,QR[a],$R[s],n),"data-variant":o,role:r?void 0:`status`,ref:l,children:[(0,X.jsx)(ZR,{variant:o}),d?(0,X.jsx)(gI,{id:u,children:i}):null]})}),tz=`disabled:bg-base-200 disabled:text-base-content disabled:outline-1 disabled:outline-solid disabled:outline-base-content/25 aria-disabled:bg-base-200 aria-disabled:text-base-content aria-disabled:outline-1 aria-disabled:outline-solid aria-disabled:outline-base-content/25`,nz=TF(`btn caps-button disabled:pointer-events-none`,{variants:{variant:{primary:`btn-primary caps-button-filled`,secondary:`btn-secondary caps-button-filled`,accent:`btn-accent caps-button-filled`,destructive:`btn-error caps-button-filled`,outline:`btn-outline ${tz}`,ghost:`btn-ghost`,"ghost-destructive":`btn-ghost caps-button-ghost-destructive`,link:`btn-link ${tz}`},size:{xs:`btn-xs`,sm:`btn-sm`,default:`btn-md`,lg:`btn-lg`,icon:`btn-square btn-md`,menubar:`caps-button-menubar`}},defaultVariants:{variant:`primary`,size:`default`}}),rz=(0,K.forwardRef)(function({asChild:e=!1,children:t,className:n,disabled:r,loading:i=!1,result:a,resultLabel:o,onResultEnd:s,size:c=`default`,variant:l=`primary`,...u},d){let f=Z(nz({size:c,variant:l}),n),p=(0,K.useRef)(a).current,m=(0,K.useRef)(null);return(0,K.useImperativeHandle)(d,()=>m.current),iz(m,i,a),e?(0,X.jsx)(iI,{...u,"aria-busy":i?!0:u[`aria-busy`],"aria-disabled":r===!0||i?!0:void 0,className:f,ref:m,children:t}):(0,X.jsx)(`button`,{...u,"aria-busy":i?!0:u[`aria-busy`],className:f,disabled:r===!0||i,ref:m,type:u.type??`button`,children:a===void 0&&o===void 0?(0,X.jsxs)(X.Fragment,{children:[i?(0,X.jsx)(ez,{className:`size-3`,decorative:!0,size:`sm`}):null,t]}):(0,X.jsx)(lz,{label:o,loading:i,onResultEnd:s,result:a,settled:p,children:t})})});function iz(e,t,n){let r=(0,K.useRef)(null),i=(0,K.useRef)(null),a=(0,K.useRef)(null);(0,K.useLayoutEffect)(()=>{let o=e.current;if(!o)return;let s=JSON.stringify([t,n??null,o.textContent]),c=s!==i.current;i.current=s;let l=a.current;if(!c&&l)return;let u=l?o.offsetWidth:r.current;l&&(a.current=null,l.cancel(),o.style.removeProperty(`overflow`),o.style.removeProperty(`white-space`));let d=o.offsetWidth;if(r.current=d>0?d:null,!c||u===null||d===0||Math.abs(u-d)<1||!pI(o))return;let f=lI(o);if(f.reduced)return;let p=o.animate([{width:`${String(u)}px`},{width:`${String(d)}px`}],{duration:f.normal,easing:fI(f,f.ease)});a.current=p,o.style.overflow=`clip`,o.style.whiteSpace=`nowrap`;let m=()=>{a.current===p&&(a.current=null,o.style.removeProperty(`overflow`),o.style.removeProperty(`white-space`))};p.onfinish=m,p.oncancel=m})}var az=1100;function oz(e,t){let n=t.bounce/.3,r=1+.05*Math.min(1.4,.4+n),i=1-.02*Math.min(1.4,n);return e.animate([{transform:`scale(1)`},{transform:`scale(${String(r)})`,offset:.35},{transform:`scale(${String(i)})`,offset:.7},{transform:`scale(1)`}],{duration:t.springDuration,easing:fI(t,`ease-out`)})}function sz(e,t){let n=t.shake;return e.animate([{transform:`none`},{transform:`translateX(${String(-n)}px)`},{transform:`translateX(${String(n)}px)`},{transform:`translateX(${String(-n*.6)}px)`},{transform:`translateX(${String(n*.3)}px)`},{transform:`none`}],{duration:t.slow*1.3,easing:fI(t,`linear`)})}function cz(e,t,n){let r=n.distance+2,i=`blur(${String(n.blur)}px)`;return[e.animate([{opacity:1,transform:`none`,filter:`blur(0px)`},{opacity:0,transform:`translateY(${String(-r)}px)`,filter:i}],{duration:n.fast,easing:fI(n,n.ease)}),t.animate([{opacity:0,transform:`translateY(${String(r)}px)`,filter:i},{opacity:1,transform:`none`,filter:`blur(0px)`}],{duration:n.normal,easing:fI(n,n.ease),fill:`backwards`})]}function lz({children:e,label:t,loading:n,onResultEnd:r,result:i,settled:a}){let o=(0,K.useRef)(null),s=hI(),[c,l]=(0,K.useState)(!1),[u,d]=(0,K.useState)(!1);c&&!u&&d(!0);let f=(0,K.useRef)(a),p=(0,K.useRef)(r);(0,K.useEffect)(()=>{p.current=r},[r]),(0,K.useLayoutEffect)(()=>{let e=f.current;if(f.current=i,i===e)return;if(i===`done`){l(!0);let e=setTimeout(()=>{p.current?p.current():l(!1)},az);return()=>{clearTimeout(e)}}l(!1);let t=o.current;if(i!==`failed`||!t||!pI(t))return;let n=lI(t);if(n.shake<=0)return;let r=sz(t,n);return()=>{r.cancel()}},[i,s]);let m=(0,K.useRef)(c);return(0,K.useLayoutEffect)(()=>{let e=o.current;if(!e||m.current===c)return;m.current=c;let t=e.querySelector(`[data-face="label"]`),n=e.querySelector(`[data-face="result"]`);if(!t||!n||!pI(e)){c||d(!1);return}let r=lI(e),i=c?cz(t,n,r):cz(n,t,r);if(c||i[0]?.addEventListener(`finish`,()=>{d(!1)}),c&&!r.reduced){i.push(oz(e.closest(`button`)??e,r));let t=n.querySelector(`path`);t&&i.push(t.animate([{strokeDashoffset:1},{strokeDashoffset:0}],{duration:r.normal*1.4,delay:r.fast/2,easing:fI(r,r.ease),fill:`backwards`}))}return()=>{for(let e of i)e.cancel()}},[c,s]),(0,X.jsxs)(`span`,{ref:o,className:`caps-button-faces`,"data-showing":c?`result`:`label`,children:[(0,X.jsxs)(`span`,{className:`caps-button-face`,"data-face":`label`,"aria-hidden":c?!0:void 0,children:[n||c?(0,X.jsx)(ez,{className:`size-3`,decorative:!0,size:`sm`}):null,e]}),u?(0,X.jsxs)(`span`,{className:`caps-button-face`,"data-face":`result`,"aria-hidden":!c||void 0,children:[(0,X.jsx)(`svg`,{className:`caps-button-check`,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:(0,X.jsx)(`path`,{d:`M4.5 12.5 9.5 17.5 19.5 6.5`,pathLength:1})}),t===void 0?e:t]}):null]})}var uz={xs:`size-3`,sm:`size-[var(--stipe-icon-size-sm)]`,md:`size-[var(--stipe-icon-size-md)]`,lg:`size-[var(--stipe-icon-size-lg)]`},dz=(0,K.forwardRef)(function({active:e=!1,icon:t,iconSize:n=`xs`,className:r,reveal:i=!1,size:a=`xs`,tone:o=`default`,variant:s=`ghost`,...c},l){let u=a===`responsive`;return(0,X.jsx)(rz,{...c,resultLabel:c.result===void 0?void 0:null,ref:l,size:u?`sm`:a,variant:s,className:Z(`caps-icon-button btn-circle`,u&&`caps-icon-button-responsive md:btn-xs`,e&&`text-accent`,i&&`scale-0 transition-transform group-hover:scale-100 focus-visible:scale-100`,o===`destructive`&&`hover:text-error`,r),children:(0,X.jsx)(`span`,{"aria-hidden":`true`,className:Z(`inline-flex shrink-0 [&>svg]:size-full [&>svg]:[stroke-width:var(--stipe-icon-stroke)]`,uz[n]),children:t})})}),fz=(0,K.forwardRef)(function({className:e,size:t=`md`,depth:n=`shallow`,placement:r=`standalone`,...i},a){return(0,X.jsx)(`div`,{...i,ref:a,"data-surface-size":t,"data-surface-depth":n,"data-surface-placement":r,className:Z(`caps-surface`,e)})}),pz=(0,K.forwardRef)(function({className:e,...t},n){return(0,X.jsx)(`div`,{...t,ref:n,className:Z(`caps-screen`,e)})});(0,K.forwardRef)(function({children:e,className:t,depth:n=`deep`,fit:r=`content`,density:i=`normal`,...a},o){let s=r===`fill`;return(0,X.jsx)(fz,{...a,className:Z(t,s&&`flex min-h-0 flex-1`),depth:n,ref:o,children:(0,X.jsx)(`div`,{className:Z(`caps-display-gasket`,s&&`flex min-h-0 min-w-0 flex-1`),"data-display-density":i,children:(0,X.jsx)(pz,{className:Z(s&&`flex min-h-0 min-w-0 flex-1 overflow-hidden`),children:e})})})}),(0,K.forwardRef)(function({className:e,icon:t,status:n,title:r,...i},a){return(0,X.jsxs)(`header`,{...i,className:Z(`caps-screen-header`,e),ref:a,children:[t?(0,X.jsx)(`span`,{className:`caps-screen-header-icon`,"aria-hidden":`true`,children:t}):null,(0,X.jsx)(`span`,{className:`caps-screen-header-title`,children:r}),n?(0,X.jsx)(`span`,{className:`caps-screen-header-status`,children:n}):null]})}),(0,K.forwardRef)(function({appearance:e,className:t,...n},r){return(0,X.jsx)(`div`,{...n,className:Z(`caps-screen-cells`,t),"data-appearance":e===`compact`?e:void 0,ref:r})}),(0,K.forwardRef)(function({children:e,className:t,legend:n,readout:r,icon:i,appearance:a,wide:o=!1,...s},c){return(0,X.jsxs)(`div`,{...s,className:Z(`caps-screen-cell`,t),"data-wide":o||void 0,"data-appearance":a===`compact`?a:void 0,ref:c,children:[i?(0,X.jsx)(`span`,{className:`caps-screen-cell-icon`,children:i}):null,n?(0,X.jsx)(`span`,{className:`caps-screen-cell-legend`,children:n}):null,r?(0,X.jsx)(`span`,{className:`caps-screen-cell-readout`,children:r}):null,a===`compact`?(0,X.jsx)(`div`,{className:`caps-screen-cell-controls`,children:e}):e]})});var mz=(0,K.forwardRef)(function({className:e,density:t=`regular`,...n},r){return(0,X.jsx)(`ul`,{...n,className:Z(`list`,t===`compact`&&`list-sm`,e),ref:r})}),hz=(0,K.forwardRef)(function({className:e,...t},n){return(0,X.jsx)(`li`,{...t,className:Z(`list-row`,e),ref:n})}),gz=(0,K.forwardRef)(function({aside:e,children:t,className:n,level:r=2,...i},a){return(0,X.jsxs)(r===3?`h3`:`h2`,{...i,className:Z(`caps-data-list-heading`,n),ref:a,children:[(0,X.jsx)(`span`,{children:t}),e===void 0?null:(0,X.jsx)(`span`,{className:`caps-data-list-heading-aside`,children:e})]})}),_z={coral:`var(--stipe-art-coral, #ff6558)`,blue:`var(--stipe-art-blue, #43a6f2)`,mint:`var(--stipe-art-mint, #63cfaa)`,grape:`var(--stipe-art-grape, #a66cc1)`,yellow:`var(--stipe-art-yellow, #ffd05d)`,cream:`var(--stipe-art-cream, #fff4de)`,ink:`var(--stipe-art-ink, #242c28)`,graphite:`var(--stipe-art-graphite, #49423f)`,inkcap:`var(--stipe-art-inkcap, #80499d)`},vz=`light-dark(var(--stipe-sketch-ink, #242c28), var(--stipe-art-cream, #fff4de))`,yz=`var(--color-base-100, light-dark(#fff4de, #242c28))`;function bz({transform:e,fill:t=vz}){return(0,X.jsx)(`path`,{transform:e,style:{fill:t},d:`M-1.264-9.479C-2.098-8.643-1.802-1.057-.907-.332.47.782 1.6-.446 1.618-3.075 1.623-3.888 1.691-5.398 1.77-6.429 1.979-9.202 1.596-10 .055-10-.588-10-.843-9.9-1.264-9.479Z`})}function xz(){return(0,X.jsxs)(`g`,{children:[(0,X.jsx)(bz,{transform:`translate(25.4 19.8) rotate(-39) scale(.95 .76)`}),(0,X.jsx)(bz,{transform:`translate(32.1 17.8) scale(.96 .95)`}),(0,X.jsx)(bz,{transform:`translate(38.8 19.9) rotate(39) scale(.95 .77)`})]})}function Sz(){return(0,X.jsxs)(`g`,{style:{fill:_z.blue},children:[(0,X.jsx)(`path`,{d:`M10.574 .604C9.804 1.375 9.867-.885 9.961 22.81 10.054 47.202 9.722 45.378 14.193 45.94 25.813 47.399 38.465 52.211 44.662 57.532 47.653 60.097 48.082 59.411 47.967 52.242L47.734 19.335C47.734 17.523 47.13 16.616 45.964 15.076 40.604 8.018 30.127 2.767 16.804 .462 13.045-.184 11.326-.148 10.574 .604Z`}),(0,X.jsx)(`path`,{d:`M81.571 .746C71.063 2.665 62.221 6.713 56.562 12.199 54.242 14.45 52 17.356 52.115 19.335L52.033 52.628C51.927 59.934 51.979 59.994 55.74 57.091 62.423 51.931 71.272 48.541 84.103 46.221 90.625 45.039 89.967 47.631 90.145 22.432 90.326-3.079 91.148-1 81.571 .746Z`}),(0,X.jsx)(`path`,{d:`M1.906 12.692C.1 13.42 .151 12.804 .151 33.825 .151 54.097 .163 54.302 1.447 55.498 2.71 56.674 3.384 56.81 7.937 56.816 20.943 56.834 30.647 58.293 38.776 61.45 45.964 64.242 46.435 61.924 39.526 57.773 32.296 53.429 26.656 51.544 14.943 49.553 5.958 48.027 6.535 49.414 6.408 29.003 6.32 14.74 6.263 13.103 5.816 12.764 5.254 12.335 2.9 12.293 1.906 12.692Z`}),(0,X.jsx)(`path`,{d:`M94.326 12.858C93.656 13.326 93.656 13.326 93.653 28.492 93.653 48.882 93.997 48.063 84.743 49.556 73.574 51.36 64.45 54.695 57.801 59.405 54.082 62.039 55.384 63.864 59.722 62.1 68.897 58.372 76.363 57.115 90.03 56.994 100.405 56.903 99.489 58.976 99.773 34.976 100.018 14.142 100.006 13.958 98.399 12.979 97.236 12.269 95.251 12.208 94.326 12.858Z`})]})}function Cz(){return(0,X.jsxs)(`g`,{children:[(0,X.jsx)(`path`,{style:{fill:_z.cream},d:`M-8.572-25.123C-21.412-23.39-33.235-17.39-44.235-7.027-51.235-.433-51.251 .358-44.524 6.749-20.77 29.316 10.23 31.893 36.364 13.487 41.043 10.187 48.193 3.551 49.235 1.524 50.358-.642 49.471-2.102 43.738-7.497 29.257-21.128 9.968-27.631-8.572-25.123Z`}),(0,X.jsx)(`path`,{style:{fill:_z.ink},d:`M-6.225-16.807C-17.727-13.267-21.176 4.433-12.08 13.257-1.118 23.898 16.829 16.102 17.032 .604 17.209-12.412 6.219-20.642-6.225-16.807Z`})]})}function wz(){return(0,X.jsxs)(`g`,{children:[(0,X.jsx)(`path`,{style:{fill:_z.mint},d:`M540 342C520 340 497 355 477 374C450 399 440 421 456 444C465 458 480 462 492 464C503 466 500 477 494 486C487 500 508 496 522 478L530 468C557 468 578 464 591 451C601 442 599 429 585 427C572 425 556 432 547 418C538 403 550 390 568 385C579 382 589 380 584 368C576 352 557 341 540 342Z`}),(0,X.jsx)(`path`,{style:{fill:_z.coral},d:`M589 396C614 380 659 381 683 392C709 404 721 428 710 451C704 464 693 472 685 479C680 487 684 498 689 503C695 514 684 513 675 507C667 502 662 497 657 491C637 496 610 495 594 486C584 480 583 469 595 464C607 460 622 454 622 441C622 428 612 423 597 420C580 417 578 407 589 396Z`})]})}function Tz({fill:e}){return(0,X.jsx)(`path`,{style:{fill:e},d:`M44.648 .288C26.645 1.615 13.263 8.266 5.942 19.529-4.299 35.277-.917 57.684 13.224 67.784 16.958 70.452 16.936 71.742 13.064 77.665 11.28 80.391 10.895 81.565 11.341 82.914 13.163 88.435 25.022 86.396 36.307 78.62L38.681 76.986 41.294 77.335C45.371 77.878 59.645 77.789 64.125 77.191 89.213 73.837 100.562 61.427 99.92 38.044 99.18 11.1 79.587-2.285 44.648 .288Z`})}function Ez({onFigure:e=!1}){return(0,X.jsxs)(`g`,{style:{fill:e?yz:_z.ink},children:[(0,X.jsx)(`rect`,{x:`-15`,y:`-11`,width:`10`,height:`22`,rx:`5`}),(0,X.jsx)(`rect`,{x:`5`,y:`-11`,width:`10`,height:`22`,rx:`5`})]})}function Dz(){return(0,X.jsx)(`path`,{style:{fill:_z.cream},d:`M18.125 .621C.039 1.574-2.575 4.791 2.264 20.133 17.454 68.284 77.345 69.396 96.119 21.875 100.749 10.154 100.318 4.348 94.605 1.513 91.981 .21 37.878-.421 18.125 .621Z`})}function Oz(){return(0,X.jsxs)(`g`,{children:[(0,X.jsx)(`path`,{style:{fill:_z.yellow},d:`M31.42 5.279C29.108 5.983 28.068 6.993 25.817 10.732 24.033 13.687 24.027 13.762 25.58 14.265 30.375 15.821 36.711 20.506 39.938 24.885 42.077 27.788 41.835 27.806 45.281 24.463 48.633 21.213 49.164 20.185 48.982 17.325 48.812 14.643 48.174 13.872 42.68 9.741 36.737 5.273 34.439 4.361 31.42 5.279Z`}),(0,X.jsx)(`path`,{style:{fill:_z.yellow},d:`M22.538 16.207C22.093 16.652 19.732 20.231 13.309 30.196 10.737 34.188 10.723 33.911 13.589 35.351 16.461 36.798 19.778 39.28 21.825 41.523L22.6 42.37Q23.34 43.186 24.05 42.538L24.711 41.933C31.278 35.937 38.928 28.484 38.928 28.083 38.928 24.656 24.521 14.219 22.538 16.207Z`}),(0,X.jsx)(`path`,{style:{fill:_z.cream},d:`M8.89 38.053C8.203 39.566 6.598 44.473 6.598 45.056 6.598 45.137 6.887 45.125 7.236 45.036 9.655 44.404 13.526 47.475 13.526 50.027 13.526 51.132 13.361 51.164 16.187 49.49 21.421 46.387 21.966 45.665 20.575 43.659 19.002 41.387 14.975 38.238 11.909 36.881 9.799 35.949 9.854 35.926 8.89 38.053Z`}),(0,X.jsx)(`path`,{style:{fill:_z.graphite},d:`M6.598 45.056C5.732 46.866 5.155 49.464 6.309 50.907 8.041 53.505 10.928 52.639 13.526 50.907 13.526 48.021 9.978 44.404 7.236 45.036Z`})]})}function kz(){return(0,X.jsx)(`path`,{style:{fill:_z.coral},d:`M40.804 40.625C38.238 41.462 37.291 41.953 31.169 45.625 15.743 54.871 8.047 56.158 5.879 49.856 5.501 48.754 5.501 48.754 4.843 50.913 1.673 61.302 12.377 61.671 30.386 51.796 39.649 46.719 41.142 46.647 40.81 51.291 40.565 54.775 41.168 56.135 43.486 57.31 49.556 60.387 62.035 54.816 59.605 50.116 58.502 47.983 56.1 47.882 52.163 49.799 47.082 52.273 45.983 51.652 47.998 47.449 50.89 41.416 47.686 38.376 40.804 40.625Z`})}function Az({transform:e}){return(0,X.jsx)(`path`,{style:{fill:_z.mint},transform:e,d:`M0 0C3 -2 5 -5 5 -8 5 -10.5 3 -12 0 -12S-5 -10.5 -5 -8C-5 -5 -3 -2 0 0Z`})}function jz(){return(0,X.jsxs)(`g`,{children:[(0,X.jsx)(`path`,{fillRule:`evenodd`,style:{fill:vz},d:`M25.3 17.69C14.8 19.34 10.66 20.18 9.05 20.99 5.51 22.78 4.2 27.21 6.71 28.9 7.47 29.42 8.48 29.4 10.25 28.84 12.41 28.15 12.56 27.57 11.02 25.85 10 24.71 10.53 23.62 11.79 24.27 13.9 25.36 15.02 28.98 15.63 36.66 16.18 43.48 17.33 47.43 19.69 50.49 22.76 54.48 27.69 55.73 30.31 53.19 33 50.57 31.24 46.04 28.44 48.38 26.29 50.17 26.16 47.08 28.3 45.14 29.61 43.95 30.78 43.58 38.92 41.75 39.45 41.63 39.41 41.52 38.39 40.01 36.87 37.78 36.04 35.22 34.72 28.69 33.37 22 32.04 19.3 29.5 18.07 28.69 17.68 26.59 17.49 25.3 17.69M24.11 26.51C18.61 27.67 18.16 27.82 17.98 28.55 17.64 29.91 18.54 30.44 20.51 30.05 25.4 29.08 30.11 28.03 30.49 27.83 31.65 27.23 31 25.33 29.66 25.4 29.5 25.4 27 25.91 24.11 26.51M29.2 31.42C28.64 31.54 26.23 32.07 23.85 32.58 20.01 33.41 19.48 33.57 19.15 33.96 18.67 34.5 18.66 35.05 19.12 35.63 19.61 36.26 19.86 36.23 26.05 34.88 29.05 34.23 31.53 33.7 31.57 33.7 31.82 33.7 32.34 32.88 32.34 32.5 32.34 31.25 31.37 30.92 29.2 31.42M29.79 37.19C28.81 37.41 26.45 37.94 24.53 38.37 22.62 38.8 20.84 39.23 20.58 39.33 19.61 39.71 19.35 40.62 19.98 41.41 20.48 42.05 21 41.99 27.59 40.5 33.85 39.09 34.21 38.91 33.45 37.44 33.02 36.61 32.51 36.58 29.79 37.19M45.41 41.95C44.89 42.09 41.61 42.89 38.12 43.73 30.94 45.45 29.81 45.84 31.05 46.15 33.2 46.69 34.11 50.18 32.77 52.76 32.23 53.79 32.23 54.03 32.76 54.16 33.34 54.31 45.35 51.3 46.72 50.67 50.19 49.06 51.76 45.01 49.79 42.76 48.8 41.64 47.46 41.39 45.41 41.95`}),(0,X.jsx)(`path`,{style:{fill:_z.grape},d:`M48.21 10.15C47.92 10.41 47.5 11.27 46.96 12.74 45.52 16.61 45.24 16.99 43.01 18.15 39.18 20.15 39.05 20.99 42.28 22.73 45.37 24.39 45.68 24.79 47.12 28.95 48.3 32.32 49.28 32.2 50.65 28.52 52.23 24.25 52.26 24.22 55.2 22.56 57.53 21.24 57.79 21 57.79 20.16 57.79 19.49 57.55 19.31 55.01 18.06 52.16 16.66 52.2 16.72 50.31 11.56 49.7 9.89 49.03 9.44 48.21 10.15M32.59 13.92C31.78 14.73 32.28 15.89 33.58 16.22 35.07 16.6 36.19 17.1 37.17 17.84 38.42 18.77 39.23 18.86 39.79 18.15 39.99 17.9 40.15 17.53 40.15 17.32 40.15 15.29 33.99 12.52 32.59 13.92M42.48 34.38C40.96 35.96 40.65 36.88 41.39 37.57 42.2 38.33 43.36 37.74 44.55 35.95 45.2 34.97 45.22 34.35 44.62 33.88 43.89 33.31 43.41 33.42 42.48 34.38`}),(0,X.jsx)(`path`,{style:{fill:_z.yellow},d:`M40.75 25.96C39.69 27.07 38.11 30.69 38.11 31.98 38.11 32.66 38.55 33.19 39.12 33.19 39.8 33.19 40.24 32.73 40.58 31.66 40.95 30.46 41.65 29.09 42.42 28.01 43.77 26.14 42.29 24.32 40.75 25.96M54.85 27.67C54.71 27.81 54.47 28.32 54.31 28.82 53.67 30.76 53.19 31.37 51.67 32.13 50.25 32.85 50.34 33.36 52.04 34.21 53.25 34.82 53.57 35.23 54.24 37.01 54.98 38.98 55.47 39.08 56.03 37.37 56.7 35.32 57.08 34.81 58.64 33.87 60.18 32.95 60.14 32.65 58.38 31.78 57.02 31.11 56.68 30.66 56.02 28.65 55.69 27.64 55.25 27.27 54.85 27.67`})]})}function Mz(){return(0,X.jsxs)(`g`,{children:[(0,X.jsx)(`path`,{fillRule:`evenodd`,style:{fill:vz},d:`M42.24 14.07C41.52 14.24 40.53 14.54 35.06 16.26 33.33 16.8 31.2 17.47 30.34 17.74 29.47 18.01 27.86 18.52 26.75 18.88 25.64 19.23 24.03 19.74 23.16 20.01 20.16 20.94 19.45 21.4 18.97 22.71 18.71 23.44 18.45 26.33 17.83 35.41 17.64 38.25 17.44 41.03 17.41 41.58 17.32 42.77 17.24 42.69 18.79 42.84L20.01 42.95 21.98 39.97C24.69 35.88 24.85 35.82 27.05 37.9 27.9 38.7 28.43 39.08 28.61 39.02 28.76 38.96 28.91 38.91 28.94 38.91 28.98 38.91 29.38 38.38 29.84 37.73 30.3 37.08 31.47 35.48 32.43 34.17 33.4 32.86 34.86 30.85 35.67 29.71 36.49 28.56 37.5 27.29 37.91 26.88 39.73 25.07 41.01 26.43 43.32 32.67 43.76 33.84 44.3 35.28 44.52 35.86 44.74 36.44 44.97 37.28 45.04 37.74 45.19 38.71 45.17 38.71 46.63 38.03 47.69 37.53 47.77 37.46 47.68 37.02 47.58 36.52 46.97 30.64 46.79 28.41 46.73 27.69 46.62 26.43 46.53 25.61 46.44 24.79 46.24 22.87 46.09 21.32 45.61 16.44 45.5 15.66 45.22 15.12 44.72 14.15 43.59 13.76 42.24 14.07M29.38 22.45C26.04 23.47 24.49 27.62 26.6 29.91 29.17 32.7 34.15 30.16 34.16 26.05 34.16 23.38 31.9 21.68 29.38 22.45M46.7 41.5C39.3 44.23 28.33 46.04 20.1 45.88L17.21 45.82 17.16 46.88C17.08 48.22 17.33 49.03 18.01 49.68 18.73 50.37 19.73 50.35 23.77 49.53 25.46 49.19 29.12 48.47 31.91 47.93 46.31 45.14 46.9 44.99 47.57 43.91 47.95 43.3 48.25 41.29 47.99 41.15 47.91 41.11 47.33 41.26 46.7 41.5`}),(0,X.jsx)(`path`,{style:{fill:_z.coral},d:`M29.72 22.45C25.84 23.34 24.28 28.36 27.25 30.42 29.34 31.88 32.91 30.43 33.83 27.75 34.92 24.55 32.75 21.76 29.72 22.45`}),(0,X.jsx)(`path`,{style:{fill:_z.mint},d:`M12.96 14.29C12.87 14.41 12.7 15.03 12.58 15.68 12.37 16.82 11.59 18.26 11.18 18.26 11.08 18.26 10.88 18.46 10.72 18.7 10.36 19.25 10.59 19.58 11.45 19.74 12.18 19.88 13.08 20.63 13.54 21.49 14.23 22.76 14.75 22.53 15.15 20.79 15.39 19.71 15.51 19.51 16.4 18.66 17.54 17.58 17.51 17.36 16.18 16.85 15.16 16.47 14.84 16.19 14.14 15.1 13.56 14.2 13.22 13.96 12.96 14.29M49.04 24.13C48.56 24.86 48.91 25.31 50.59 26.09 53.89 27.64 54.85 29.82 53.45 32.6 52.01 35.43 46.84 38.54 40.51 40.39 39.73 40.62 38.88 40.89 38.62 40.99 37.24 41.52 30.85 42.64 27.54 42.93 20.72 43.52 13.63 42.49 10.57 40.46 5.81 37.3 7.51 32.32 14.74 28.24 15.84 27.61 16.17 27.1 15.9 26.4 15.66 25.78 15.35 25.84 13.19 26.94 6 30.61 2.97 35.32 4.95 39.74 7.86 46.21 22.78 47.8 40.05 43.46 51.97 40.47 58.57 36.38 59.47 31.43 60.09 27.97 57.74 25.34 52.93 24.12 50.6 23.53 49.43 23.54 49.04 24.13`}),(0,X.jsx)(`path`,{style:{fill:_z.grape},d:`M34.82 8.91C33.48 10.04 34.21 12.14 35.94 12.14 37.29 12.14 38.18 10.99 37.77 9.77 37.36 8.53 35.81 8.08 34.82 8.91M53.15 43.16C53 43.28 52.74 43.86 52.57 44.45 52.18 45.78 51.76 46.32 50.64 46.93 49.52 47.53 49.45 47.89 50.33 48.34 51.34 48.85 52.24 49.95 52.56 51.04 53.13 53.01 53.6 53 54.21 50.99 54.61 49.69 55.13 48.93 55.91 48.54 57.17 47.91 57.23 47.51 56.15 46.96 55.23 46.49 54.67 45.76 54.23 44.44 53.8 43.15 53.54 42.84 53.15 43.16M24.18 53.18C22.45 53.9 22.87 56.59 24.71 56.59 26.79 56.59 27.2 53.67 25.2 53.09 24.89 53.01 24.51 53.04 24.18 53.18`}),(0,X.jsx)(`path`,{style:{fill:_z.yellow},d:`M51.76 11.04C51.21 12.77 50.56 13.61 49.24 14.34 48.6 14.69 48.72 15.07 49.59 15.48 50.54 15.93 51.11 16.69 51.62 18.22 52.06 19.57 52.26 19.54 52.79 18.08 53.29 16.69 53.87 15.91 54.86 15.31 55.76 14.77 55.77 14.48 54.92 14.02 53.91 13.46 53.5 12.99 52.89 11.66 52.23 10.21 52.06 10.12 51.76 11.04M11.06 48.22C10.99 48.35 10.71 48.88 10.46 49.41 9.95 50.48 9.45 50.99 8.59 51.33 7.89 51.61 7.85 52.1 8.52 52.37 9.51 52.79 10.3 53.85 10.89 55.58 11.09 56.18 11.48 55.88 11.87 54.84 12.24 53.87 13.33 52.56 13.79 52.56 14 52.56 14.5 52.06 14.5 51.85 14.5 51.77 14.19 51.54 13.81 51.34 12.98 50.92 12.36 50.14 11.93 48.99 11.6 48.09 11.31 47.83 11.06 48.22`})]})}function Nz(){return(0,X.jsxs)(`g`,{transform:`translate(2 8) scale(.114) translate(-125 -122)`,children:[(0,X.jsx)(`path`,{style:{fill:_z.coral},d:`M278 155 482 123C517 117 527 135 530 167L542 309Q543 329 561 341L631 404Q649 419 646 444 645 465 623 472L407 521Q374 531 345 519L156 436Q115 418 128 375L221 191Q238 163 278 155Z`}),(0,X.jsx)(`path`,{style:{fill:_z.ink},d:`M317 183 461 161Q493 155 497 188L504 288Q508 320 478 326L318 356Q289 362 286 331L281 226Q278 194 317 183Z`}),(0,X.jsx)(`path`,{style:{fill:_z.cream},d:`M304 386 553 340Q562 337 570 346L631 404Q649 419 646 444Q645 448 629 452L411 483Q382 492 367 474Z`}),(0,X.jsxs)(`g`,{style:{fill:_z.cream},children:[(0,X.jsx)(`rect`,{x:`319`,y:`236`,width:`26`,height:`59`,rx:`13`}),(0,X.jsx)(`rect`,{x:`364`,y:`229`,width:`26`,height:`59`,rx:`13`})]}),(0,X.jsxs)(`g`,{style:{fill:_z.ink},transform:`rotate(-11 470 411)`,children:[(0,X.jsx)(`rect`,{x:`369`,y:`380`,width:`61`,height:`25`,rx:`13`}),(0,X.jsx)(`rect`,{x:`444`,y:`380`,width:`61`,height:`25`,rx:`13`}),(0,X.jsx)(`rect`,{x:`518`,y:`380`,width:`57`,height:`25`,rx:`13`}),(0,X.jsx)(`rect`,{x:`392`,y:`421`,width:`58`,height:`25`,rx:`13`}),(0,X.jsx)(`rect`,{x:`462`,y:`421`,width:`65`,height:`25`,rx:`13`}),(0,X.jsx)(`rect`,{x:`539`,y:`421`,width:`58`,height:`25`,rx:`13`})]})]})}function Pz(){return(0,X.jsxs)(`g`,{transform:`translate(3 10) scale(.114) translate(-760 -140)`,children:[(0,X.jsx)(`path`,{style:{fill:_z.blue},d:`M1226 153C1257 153 1273 195 1267 231Q1263 265 1237 268L1176 270V215C1176 178 1195 153 1226 153Z`}),(0,X.jsx)(`path`,{style:{fill:_z.blue},d:`M824 376Q908 372 871 400C842 427 866 442 902 450L1113 480Q1188 479 1199 392C1207 447 1204 497 1163 511Q1134 521 1097 516C1055 510 991 507 957 507S869 511 826 512C781 513 758 483 760 441Q760 385 824 376Z`}),(0,X.jsx)(`path`,{style:{fill:_z.cream},d:`M824 376 857 184Q864 133 911 141C1039 169 1124 151 1226 153Q1179 159 1184 241L1199 377C1202 434 1174 482 1117 480L902 450C864 445 849 429 871 400Q908 372 824 376Z`}),(0,X.jsxs)(`g`,{style:{fill:_z.coral},children:[(0,X.jsx)(`path`,{d:`M982 198C1008 190 1030 197 1028 220L1023 265Q1020 295 1000 279C981 261 951 223 963 210Q970 202 982 198Z`}),(0,X.jsx)(`path`,{d:`M1063 220C1077 215 1100 237 1102 251Q1107 267 1084 282L1063 295Q1037 307 1040 278L1045 245Q1049 224 1063 220Z`}),(0,X.jsx)(`path`,{d:`M911 252C925 240 939 254 957 269L978 291Q995 311 961 316C938 318 907 316 898 308Q884 296 911 252Z`}),(0,X.jsx)(`path`,{d:`M1106 289Q1127 281 1134 304C1142 327 1146 352 1125 350Q1097 348 1073 335C1051 324 1072 311 1084 302Z`}),(0,X.jsx)(`path`,{d:`M927 338C946 334 972 334 985 343Q1004 353 984 384C970 408 957 418 940 403C922 389 896 356 913 345Z`}),(0,X.jsx)(`path`,{d:`M1010 375Q1025 363 1037 384C1049 407 1064 438 1044 442Q1025 448 1002 436C984 428 991 410 997 393Z`}),(0,X.jsx)(`path`,{d:`M1068 357C1084 359 1110 376 1120 389Q1130 402 1107 419C1090 432 1082 418 1073 401C1062 383 1043 355 1068 357Z`}),(0,X.jsx)(`path`,{d:`M1018 311C1037 312 1050 334 1034 343C1018 351 998 337 1005 320Q1009 311 1018 311Z`})]})]})}function Fz(){return(0,X.jsxs)(`g`,{transform:`translate(2 7) scale(.11) translate(-1380 -96)`,children:[(0,X.jsx)(`path`,{style:{fill:_z.inkcap},d:`M1384 276C1394 238 1445 200 1497 158C1547 119 1604 97 1647 97C1690 97 1720 109 1745 138C1772 170 1791 184 1833 194C1870 201 1919 220 1922 257C1923 307 1891 339 1853 336C1801 335 1767 299 1701 294C1666 291 1620 294 1642 303Q1670 307 1675 333C1681 367 1697 389 1717 413C1735 434 1738 443 1719 464C1700 485 1692 502 1686 520Q1682 541 1653 541L1626 541Q1598 541 1594 519C1590 495 1578 474 1563 458C1545 440 1544 429 1559 410C1585 377 1608 337 1572 326C1554 320 1529 333 1506 340C1461 356 1428 357 1402 340Q1371 319 1384 276Z`}),(0,X.jsx)(`path`,{style:{fill:_z.cream},d:`M1634 362Q1641 346 1649 362C1660 390 1676 404 1705 424Q1721 435 1704 453C1685 475 1677 490 1671 513Q1670 526 1653 525L1626 525Q1611 525 1610 513C1606 492 1592 465 1575 449Q1562 437 1577 424C1604 404 1620 390 1634 362Z`}),(0,X.jsx)(`path`,{style:{fill:_z.inkcap},d:`M1634 456A18 18 0 1 1 1648 456V492Q1648 500 1641 500T1634 492Z`}),(0,X.jsx)(`path`,{style:{fill:_z.inkcap},d:`M1780 391Q1786 386 1793 396C1810 420 1828 444 1827 467C1826 508 1768 510 1753 480C1741 456 1762 413 1780 391Z`})]})}var{coral:Iz,blue:Lz,mint:Rz,grape:zz,yellow:Bz,cream:Vz,ink:Hz}=_z,Uz={bonsai:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:`none`,stroke:Rz,strokeWidth:`3.7`,strokeLinecap:`round`,d:`M35 27.5C36 25 35.5 22.5 34 21S31.5 17.5 31.5 14M36 27C40 26.8 43 26 45 24S47 20.5 47.5 18.5M30.5 31C32.5 26.5 30.5 24.6 26.5 24 22 23.5 18.5 21.6 16.8 18.5M29 37C26.5 34.5 25 33.7 21.5 33.2S15.5 32 13 31.6M36 39.5C38 38 40 37.5 42 36.5S47 34 51 32.2`}),(0,X.jsx)(`path`,{fill:Rz,d:`M25.5 43.5C28 40.5 28 37 27.5 33 27.3 29.5 29.5 27 33.5 26.3L37.5 26V29.5C35 29.8 34.2 31.5 34.3 34 34.5 37.5 37 39.5 41 43.5Z`}),(0,X.jsx)(`circle`,{fill:Lz,cx:`31.5`,cy:`10.7`,r:`4.8`}),(0,X.jsx)(`circle`,{fill:zz,cx:`16.6`,cy:`18.3`,r:`4.6`}),(0,X.jsx)(`circle`,{fill:Bz,cx:`47.9`,cy:`17.7`,r:`4.6`}),(0,X.jsx)(`circle`,{fill:Bz,cx:`12.8`,cy:`31.5`,r:`4.6`}),(0,X.jsx)(`circle`,{fill:Lz,cx:`50.9`,cy:`32.1`,r:`4.6`}),(0,X.jsx)(`path`,{fill:Iz,d:`M16 46H47.5C47.5 54 44 58 38 58H25.5C19.5 58 16 54 16 46Z`}),(0,X.jsx)(`rect`,{fill:Iz,x:`14`,y:`43`,width:`35.5`,height:`4.6`,rx:`2.3`})]}),computer:(0,X.jsx)(Nz,{}),prints:(0,X.jsx)(Pz,{}),inkcap:(0,X.jsx)(Fz,{}),vishnu:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{style:{fill:Iz},d:`M6 37C6 21 17.5 9 32 9s26 12 26 28c0 2.2-1.8 4-4 4H10c-2.2 0-4-1.8-4-4Z`}),(0,X.jsx)(`circle`,{style:{fill:Vz},cx:`19`,cy:`25`,r:`4`}),(0,X.jsx)(`circle`,{style:{fill:Vz},cx:`33`,cy:`19.5`,r:`4.8`}),(0,X.jsx)(`circle`,{style:{fill:Vz},cx:`46`,cy:`28`,r:`3.4`}),(0,X.jsx)(`rect`,{style:{fill:Lz},x:`13`,y:`39`,width:`38`,height:`18`,rx:`9`}),(0,X.jsx)(`rect`,{style:{fill:Vz},x:`18.5`,y:`46.2`,width:`10`,height:`3.6`,rx:`1.8`}),(0,X.jsx)(`rect`,{style:{fill:Vz},x:`21.7`,y:`43`,width:`3.6`,height:`10`,rx:`1.8`}),(0,X.jsx)(`circle`,{style:{fill:Bz},cx:`39`,cy:`50.5`,r:`2.7`}),(0,X.jsx)(`circle`,{style:{fill:Vz},cx:`45`,cy:`45.5`,r:`2.7`})]}),generateText:(0,X.jsx)(jz,{}),generateMedia:(0,X.jsx)(Mz,{}),buyApps:(0,X.jsxs)(`g`,{transform:`rotate(-6 32 32)`,children:[(0,X.jsx)(`circle`,{fill:Bz,cx:`32`,cy:`20`,r:`12`}),(0,X.jsx)(`circle`,{stroke:Vz,strokeWidth:`4`,cx:`32`,cy:`20`,r:`6`}),(0,X.jsx)(bz,{fill:Bz,transform:`translate(15.5 12) rotate(-60) scale(1.1 .85)`}),(0,X.jsx)(bz,{fill:Bz,transform:`translate(48.5 12) rotate(60) scale(1.1 .85)`}),(0,X.jsx)(`path`,{fill:Lz,d:`M10 35H54L50 53Q49 58 44 58H20Q15 58 14 53Z`}),(0,X.jsx)(`rect`,{fill:Iz,x:`5`,y:`27`,width:`54`,height:`10`,rx:`5`}),(0,X.jsxs)(`g`,{fill:Vz,children:[(0,X.jsx)(`rect`,{x:`20`,y:`41`,width:`5`,height:`11`,rx:`2.5`}),(0,X.jsx)(`rect`,{x:`29.5`,y:`41`,width:`5`,height:`11`,rx:`2.5`}),(0,X.jsx)(`rect`,{x:`39`,y:`41`,width:`5`,height:`11`,rx:`2.5`})]})]}),browseBazaar:(0,X.jsxs)(`g`,{transform:`rotate(-5 32 32)`,children:[(0,X.jsx)(`rect`,{fill:Lz,x:`10`,y:`14`,width:`44`,height:`38`,rx:`6`}),(0,X.jsx)(`rect`,{fill:Lz,x:`5`,y:`47`,width:`54`,height:`12`,rx:`6`}),(0,X.jsx)(`rect`,{fill:Vz,x:`12`,y:`50.5`,width:`40`,height:`4.5`,rx:`2.25`}),(0,X.jsx)(`rect`,{fill:Iz,x:`2`,y:`4`,width:`60`,height:`9`,rx:`4.5`}),(0,X.jsx)(`path`,{fill:Iz,d:`M3 9H14.6V18A5.8 5.8 0 0 1 3 18Z`}),(0,X.jsx)(`path`,{fill:Vz,d:`M14.6 9H26.2V18A5.8 5.8 0 0 1 14.6 18Z`}),(0,X.jsx)(`path`,{fill:Iz,d:`M26.2 9H37.8V18A5.8 5.8 0 0 1 26.2 18Z`}),(0,X.jsx)(`path`,{fill:Vz,d:`M37.8 9H49.4V18A5.8 5.8 0 0 1 37.8 18Z`}),(0,X.jsx)(`path`,{fill:Iz,d:`M49.4 9H61V18A5.8 5.8 0 0 1 49.4 18Z`}),(0,X.jsx)(`g`,{transform:`translate(32 36.5) scale(.34)`,children:(0,X.jsx)(Cz,{})})]}),agent:(0,X.jsxs)(`g`,{transform:`translate(32 33) scale(2.02) translate(-47.2 -41.8)`,children:[(0,X.jsx)(`path`,{fill:Lz,d:`M46.666 29.533C39.623 30.116 34.627 34.849 34.603 40.96 34.585 45.387 36.412 47.971 40.602 49.445 42.036 49.95 42.076 50.049 41.491 51.666 40.968 53.111 41.167 53.761 42.201 53.988 43.463 54.265 46.679 52.293 47.929 50.475 48.134 50.178 48.268 50.13 49.332 49.977 56.938 48.882 60.956 43.889 59.582 37.237 58.622 32.59 53.42 29.07 48.034 29.424 47.904 29.432 47.289 29.482 46.666 29.533Z`}),(0,X.jsx)(`g`,{transform:`translate(47.3 40) scale(.36 .34)`,children:(0,X.jsx)(Ez,{})})]}),list:(0,X.jsxs)(`g`,{transform:`rotate(-7 32 32)`,children:[(0,X.jsx)(`path`,{style:{fill:Lz},d:`M12 13Q6 13 6 19V50Q6 57 13 57H47Q53 57 53 50V20Q53 13 47 13Z`}),(0,X.jsx)(`path`,{style:{fill:Vz},d:`M19 7H39Q42 7 44 9L55 20Q57 22 57 26V44Q57 50 51 50H19Q13 50 13 44V13Q13 7 19 7Z`}),(0,X.jsx)(`path`,{style:{fill:Iz},d:`M39 7V18Q39 24 45 24H57Q57 22 55 20L44 9Q42 7 39 7Z`}),(0,X.jsxs)(`g`,{style:{fill:Iz},children:[(0,X.jsx)(`circle`,{cx:`22`,cy:`21`,r:`3`}),(0,X.jsx)(`circle`,{cx:`22`,cy:`31`,r:`3`}),(0,X.jsx)(`circle`,{cx:`22`,cy:`41`,r:`3`})]}),(0,X.jsx)(`path`,{style:{stroke:Lz},strokeWidth:`5`,strokeLinecap:`round`,d:`M31 21H32M31 31H46M31 41H42`})]}),chat:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`g`,{transform:`translate(3 11) scale(.22) translate(-449 -327)`,children:(0,X.jsx)(wz,{})}),(0,X.jsx)(bz,{transform:`translate(38.2 18) rotate(16) scale(.95 .6)`}),(0,X.jsx)(bz,{transform:`translate(44.4 20.5) rotate(47) scale(.95 .6)`})]}),read:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`g`,{transform:`translate(4 20.5) scale(.56)`,children:(0,X.jsx)(Sz,{})}),(0,X.jsx)(`g`,{transform:`translate(32 38.6) scale(.3164)`,children:(0,X.jsx)(Cz,{})}),(0,X.jsx)(xz,{})]}),readConversations:(0,X.jsxs)(`g`,{transform:`translate(32 32) scale(.9) translate(-32 -32)`,children:[(0,X.jsx)(`g`,{transform:`translate(4 7.88) scale(.56)`,children:(0,X.jsx)(Tz,{fill:Lz})}),(0,X.jsx)(`g`,{transform:`translate(32.2 30.3) scale(.352)`,children:(0,X.jsx)(Cz,{})})]}),listAgents:(0,X.jsxs)(`g`,{transform:`translate(32 32) scale(1.04) translate(-32 -32)`,children:[(0,X.jsx)(`path`,{style:{fill:vz},d:`M32.059 10.146C23.878 10.646 18.949 14.844 18.925 21.331 18.912 24.856 20.167 27.259 22.274 27.74 24.437 28.233 26.097 29.061 27.481 30.337 28.275 31.068 28.328 31.096 29.352 31.306 31.161 31.677 31.653 32.094 32.115 33.651 32.392 34.582 32.557 34.868 32.915 35.041 33.919 35.523 35.864 33.733 36.539 31.706L36.775 30.997 38.008 30.681C42.663 29.489 45.29 26.142 45.468 21.176 45.734 13.784 40.673 9.62 32.059 10.146Z`}),(0,X.jsx)(`g`,{transform:`translate(32.4 21.2) scale(.39)`,children:(0,X.jsx)(Ez,{onFigure:!0})}),(0,X.jsx)(`path`,{style:{fill:Iz},d:`M14.375 27.586C8.014 28.591 4.363 32.396 4.355 38.027 4.347 43.93 8.071 47.469 15.239 48.368L16.828 48.568 17.873 49.568C19.854 51.464 22.469 52.496 23.691 51.864 24.384 51.506 24.431 51.044 23.924 49.606 23.337 47.943 23.479 47.492 24.749 46.977 32.756 43.73 32.643 31.899 24.573 28.49 22.238 27.504 17.535 27.087 14.375 27.586Z`}),(0,X.jsx)(`g`,{transform:`translate(17.6 37.7) scale(.38 .36)`,children:(0,X.jsx)(Ez,{})}),(0,X.jsx)(`path`,{style:{fill:Lz},d:`M46.666 29.533C39.623 30.116 34.627 34.849 34.603 40.96 34.585 45.387 36.412 47.971 40.602 49.445 42.036 49.95 42.076 50.049 41.491 51.666 40.968 53.111 41.167 53.761 42.201 53.988 43.463 54.265 46.679 52.293 47.929 50.475 48.134 50.178 48.268 50.13 49.332 49.977 56.938 48.882 60.956 43.889 59.582 37.237 58.622 32.59 53.42 29.07 48.034 29.424 47.904 29.432 47.289 29.482 46.666 29.533Z`}),(0,X.jsx)(`g`,{transform:`translate(47.3 40) scale(.36 .34)`,children:(0,X.jsx)(Ez,{})})]}),createAgents:(0,X.jsxs)(`g`,{transform:`translate(32 32) scale(1.08) translate(-32 -32)`,children:[(0,X.jsx)(`path`,{style:{fill:vz},d:`M20.436 24.499C13.35 25.216 7.504 28.799 5.442 33.687 3.114 39.208 4.438 45.791 8.593 49.358 10.446 50.949 10.34 50.831 10.34 51.301 10.34 51.796 10.106 52.294 9.281 53.558 7.191 56.76 12.108 56.905 16.701 53.777 17.517 53.221 17.715 53.135 18.015 53.201 20.013 53.639 25.739 53.051 28.595 52.113 35.47 49.857 39.129 44.162 37.83 37.738C37 31 33 26 26.717 24.428L24.075 24.413C22.623 24.405 20.985 24.444 20.436 24.499Z`}),(0,X.jsx)(`g`,{transform:`translate(21.9 40) scale(.46 .43)`,children:(0,X.jsx)(Ez,{onFigure:!0})}),(0,X.jsx)(`path`,{style:{fill:Rz},d:`M37.987 15.734C32.277 16.627 28.675 20.713 28.92 26.022 29.062 29.118 30.627 31.606 33.331 33.036 34.675 33.747 34.761 34.018 34.237 35.923 33.376 39.051 36.878 38.551 39.174 35.218 39.574 34.637 39.65 34.583 40.058 34.583 46.203 34.583 50.414 30.91 50.424 25.543 50.435 18.989 44.932 14.649 37.987 15.734Z`}),(0,X.jsx)(`g`,{transform:`translate(38.9 24.9) scale(.31)`,children:(0,X.jsx)(Ez,{})}),(0,X.jsx)(bz,{fill:Bz,transform:`translate(48.1 15.7) rotate(31) scale(1.25 .85)`}),(0,X.jsx)(bz,{fill:Bz,transform:`translate(52.2 19.8) rotate(70) scale(1.25 .85)`})]}),sendPrompts:(0,X.jsxs)(`g`,{transform:`translate(32 32) scale(1.08) translate(-32 -32)`,children:[(0,X.jsx)(`g`,{transform:`translate(4 13.2) scale(.412 .436)`,children:(0,X.jsx)(Tz,{fill:Iz})}),(0,X.jsx)(`g`,{transform:`translate(17.1 28.7) scale(.19)`,children:(0,X.jsx)(Dz,{})}),(0,X.jsx)(bz,{fill:Rz,transform:`translate(48.1 26.4) rotate(65) scale(1.7 1.28)`}),(0,X.jsx)(bz,{fill:Rz,transform:`translate(48.4 33.8) rotate(110) scale(1.7 1.28)`})]}),write:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Oz,{}),(0,X.jsx)(kz,{})]}),run:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`rect`,{style:{fill:Lz},x:`6`,y:`9`,width:`52`,height:`43`,rx:`7`}),(0,X.jsx)(`path`,{style:{stroke:Vz},strokeWidth:`5`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`m17 22 9 8-9 8m17 0h12`})]}),connected:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:`none`,style:{stroke:Lz},strokeWidth:`12`,strokeLinecap:`round`,d:`M34 37Q43 21 26 20H18Q3 20 6 37q2 10 15 9`}),(0,X.jsx)(`path`,{fill:`none`,style:{stroke:Iz},strokeWidth:`12`,strokeLinecap:`round`,d:`M29 33Q20 50 38 53h8q16-1 12-17-2-11-14-10`}),(0,X.jsx)(`path`,{style:{stroke:Bz},strokeWidth:`4`,strokeLinecap:`round`,d:`m27 4 2 6m10-5-2 7m12 0-5 4`})]}),working:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`ellipse`,{style:{fill:Rz},cx:`23`,cy:`14`,rx:`13`,ry:`8`,transform:`rotate(-30 23 14)`}),(0,X.jsx)(`ellipse`,{style:{fill:Bz},cx:`48`,cy:`36`,rx:`13`,ry:`8`,transform:`rotate(35 48 36)`}),(0,X.jsx)(`ellipse`,{style:{fill:zz},cx:`22`,cy:`48`,rx:`13`,ry:`8`,transform:`rotate(45 22 48)`}),(0,X.jsx)(`path`,{fill:`none`,style:{stroke:vz},strokeWidth:`3`,strokeLinecap:`round`,d:`M42 8q13 2 13 13M43 55q-5 5-12 4M5 39q-5-9 1-17`})]}),complete:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{style:{fill:Rz},d:`M32 6q5-8 10 0 9-3 10 6 9 2 5 11 8 6 0 12 3 9-6 11-1 9-10 6-6 8-12 0-9 3-11-6-9-2-6-11-8-6 0-12-3-9 6-11 1-9 10-6Z`}),(0,X.jsx)(`path`,{fill:`none`,style:{stroke:Hz},strokeWidth:`6`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`m23 29 7 7 13-15`}),(0,X.jsx)(`path`,{style:{stroke:vz},strokeWidth:`3`,strokeLinecap:`round`,d:`m4 8 5 6m48-4 5-5M2 24l6 1`})]}),installApps:(0,X.jsxs)(`g`,{transform:`rotate(-6 32 32)`,children:[(0,X.jsx)(`rect`,{style:{fill:Lz},x:`9`,y:`26`,width:`46`,height:`32`,rx:`10`}),(0,X.jsx)(`rect`,{style:{fill:Vz},x:`17`,y:`33`,width:`30`,height:`18`,rx:`5`}),(0,X.jsx)(`path`,{style:{fill:Rz},d:`M22 38h8v8h-8z`}),(0,X.jsx)(`path`,{style:{fill:zz},d:`M34 38h8v8h-8z`}),(0,X.jsx)(`path`,{style:{stroke:Iz},strokeWidth:`6`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`M32 4v17m-8-7 8 8 8-8`})]}),restricted:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:`none`,style:{stroke:Iz},strokeWidth:`9`,strokeLinecap:`round`,d:`M16 23V19q0-17 16-17t16 17v4`}),(0,X.jsx)(`rect`,{style:{fill:Iz},x:`8`,y:`26`,width:`48`,height:`36`,rx:`9`}),(0,X.jsx)(`path`,{style:{fill:Vz},d:`M32 34a7 7 0 0 0-4 13v7h8v-7a7 7 0 0 0-4-13Z`})]}),error:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{style:{fill:Iz},d:`M32 6q5-8 10 0 9-3 10 6 9 2 5 11 8 6 0 12 3 9-6 11-1 9-10 6-6 8-12 0-9 3-11-6-9-2-6-11-8-6 0-12-3-9 6-11 1-9 10-6Z`}),(0,X.jsx)(`path`,{fill:`none`,style:{stroke:Vz},strokeWidth:`7`,strokeLinecap:`round`,d:`M32 18v15`}),(0,X.jsx)(`circle`,{style:{fill:Vz},cx:`32`,cy:`45`,r:`4`})]}),trellis:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`g`,{fill:Bz,children:[(0,X.jsx)(`rect`,{x:`17.25`,y:`9`,width:`3.9`,height:`49.2`,rx:`1.95`}),(0,X.jsx)(`rect`,{x:`42.95`,y:`9`,width:`3.9`,height:`49.2`,rx:`1.95`}),(0,X.jsx)(`rect`,{x:`30.4`,y:`18`,width:`3.2`,height:`26`}),(0,X.jsx)(`rect`,{x:`14.8`,y:`15.75`,width:`34.4`,height:`3.1`,rx:`1.55`}),(0,X.jsx)(`rect`,{x:`14.8`,y:`28.85`,width:`34.4`,height:`3.1`,rx:`1.55`}),(0,X.jsx)(`rect`,{x:`14.8`,y:`42.55`,width:`34.4`,height:`3.1`,rx:`1.55`})]}),(0,X.jsx)(`path`,{fill:`none`,stroke:Rz,strokeWidth:`3`,strokeLinecap:`round`,d:`M21.9 56.1C31.5 54.4 32.9 47 32.1 45.8`}),(0,X.jsx)(`path`,{fill:`none`,stroke:Rz,strokeWidth:`3`,strokeLinecap:`round`,d:`M32 44.2C28.7 41.8 25.2 35.7 32 32.3 38.8 28 38.9 24 31.9 18.8 32.4 16.3 32.8 14.7 34.5 12.2`}),(0,X.jsx)(Az,{transform:`translate(32.1 14.1) rotate(45) scale(0.45 0.86)`}),(0,X.jsx)(Az,{transform:`translate(32.2 14.7) rotate(-60) scale(0.42 0.58)`}),(0,X.jsx)(Az,{transform:`translate(34.8 28.3) rotate(65) scale(0.38 0.8)`}),(0,X.jsx)(Az,{transform:`translate(28.2 33.1) rotate(-51) scale(0.5 0.57)`}),(0,X.jsx)(Az,{transform:`translate(28.6 53.3) rotate(-48) scale(0.47 0.6)`}),(0,X.jsx)(`circle`,{fill:Iz,cx:`31.9`,cy:`18.8`,r:`4`}),(0,X.jsx)(`circle`,{fill:Lz,cx:`32`,cy:`32.3`,r:`4`}),(0,X.jsx)(`circle`,{fill:zz,cx:`32`,cy:`44.2`,r:`4`})]}),games:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:Lz,d:`M18.5 28.5H45.5C49.5 29.5 53 32 54 35 55 37.5 56.8 45.5 56.6 48 56.5 53 52.5 57.5 47 58H15C9.5 56.5 6.6 51 7.6 45.5 8.6 39.5 9.3 35 10.5 33 12 31 14.5 29.5 18.5 28.5Z`}),(0,X.jsx)(`ellipse`,{fill:Vz,cx:`26.8`,cy:`37.9`,rx:`9.1`,ry:`5.6`}),(0,X.jsx)(`ellipse`,{fill:Hz,cx:`27`,cy:`37.6`,rx:`4.7`,ry:`2.2`}),(0,X.jsx)(`path`,{fill:Hz,d:`M23.1 26V35.4A4 4.2 0 0 0 31.1 35.4V26Z`}),(0,X.jsx)(`circle`,{fill:Iz,cx:`27.1`,cy:`18.3`,r:`12.4`}),(0,X.jsx)(`circle`,{fill:Vz,cx:`22.6`,cy:`14.3`,r:`3.05`}),(0,X.jsx)(`ellipse`,{fill:Bz,cx:`45.1`,cy:`37.2`,rx:`5.6`,ry:`3.95`}),(0,X.jsx)(`ellipse`,{fill:Vz,cx:`40.1`,cy:`46.6`,rx:`6.2`,ry:`4.4`})]}),oyster:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:zz,d:`M35.5 6C33.7 6.3 32.3 7.6 31.4 9.4 30.9 10.3 30.4 10.3 29.5 10 25.5 9 20.6 11.6 19.6 15.9 19.4 16.6 19 17 18 17.1 14.5 17.6 12 20.6 12.1 24.2 12.2 25.4 12 25.9 11.5 26.5 7.5 30 10.5 34.5 17.5 34.4 15.3 32.6 16 31 19 29 26 24 37 19.5 43.5 19 46 19 46 22 43 25.5 46.5 23.5 51.5 18.5 53.5 15 55 11 50 7 45 9 43.8 9.4 43.3 9.2 42.5 8 40.7 6.3 38 5.6 35.5 6Z`}),(0,X.jsx)(`circle`,{fill:Vz,cx:`34.9`,cy:`41.9`,r:`11.3`}),(0,X.jsxs)(`g`,{fill:Hz,children:[(0,X.jsx)(`rect`,{x:`29.9`,y:`33.2`,width:`3.2`,height:`5.6`,rx:`1.6`}),(0,X.jsx)(`rect`,{x:`36.7`,y:`33.2`,width:`3.2`,height:`5.6`,rx:`1.6`})]}),(0,X.jsx)(`path`,{fill:zz,d:`M49.5 39C47.9 39.3 46.5 40 46.1 41.6 45.8 43.2 45.5 43.5 44 43.5 38.5 43.5 35 48 39 49.5 40 50 39.5 50.5 38 51 35.5 52.5 32.5 52 30 51 29 50.5 28.5 50 29.5 50 33 47.5 30 43.5 24.5 43.5 23.3 43.5 22.9 43.3 22.5 43 20.5 40.5 19 40 17.5 39.5 13 39.5 13 44 17 47.5 18.3 48.4 18.6 48.7 19 49.5 20.5 53 23 55 26 55 26.8 55 27 55.3 27.5 56 31 58.5 36.5 58.5 40 56 40.8 55.2 41.2 55 42 55 45 55 47.5 53 49 49.5 49.6 48.5 50 48 50.5 47.5 56 43.5 55 38.5 49.5 39Z`}),(0,X.jsx)(`path`,{fill:`none`,stroke:Bz,strokeWidth:`3`,strokeLinecap:`round`,d:`M46.6 31.8 49.2 27.8 M49.4 35.5 52.8 33.7 M21.5 32.5 22.9 33.5 M19.3 37.5 21.1 38.1`})]}),tourtois:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`rect`,{fill:Vz,x:`11.07`,y:`35.73`,width:`26.8`,height:`9.7`,rx:`3.25`,transform:`rotate(-5 24.47 40.58)`}),(0,X.jsx)(`path`,{fill:Bz,d:`M14.8 16C19 14.6 23 13.5 26.5 12.6 28.4 12.1 29.6 13.4 30.1 15.3L31.6 21 17.4 37.6C13.8 38.2 10.6 37.8 10.1 35.4L9.2 27.8C9.1 26.1 10.1 24.7 11.6 24.1 11.4 22.4 11.4 20.6 11.8 19.1 12.3 17.4 13.3 16.5 14.8 16Z`}),(0,X.jsx)(`path`,{fill:Iz,d:`M14.0 24.1Q13.3 21.2 16.2 20.4L30.7 16.2Q33.6 15.4 34.6 18.2L36.0 22.7Q37.0 25.5 34.7 27.4L20.2 39.7Q17.9 41.6 17.2 38.7Z`}),(0,X.jsx)(`path`,{fill:Lz,d:`M21 23.4 35.5 20.6C37.3 20.2 38.6 21 38.9 22.6L40 34.5C40.1 36.2 39.1 37.3 37.5 37.7 32.6 39.9 26 41 21 41 16 41 12.2 40.2 11 38.8 10.4 37.6 10.8 36.4 12.4 37L19.6 38.4 18.4 27C18.2 25.2 19.3 23.7 21 23.4Z`}),(0,X.jsx)(`path`,{fill:Vz,d:`M22.8 29.6 34.8 26.9C36.2 26.6 37 27.3 37.2 28.6L37.9 33C38.1 34.2 37.5 35 36.3 35.3L24.3 37.8C23 38.1 22.3 37.5 22.1 36.3L21.3 31.6C21.1 30.6 21.7 29.8 22.8 29.6Z`}),(0,X.jsxs)(`g`,{fill:Vz,children:[(0,X.jsx)(`circle`,{cx:`14.7`,cy:`18.45`,r:`1`}),(0,X.jsx)(`circle`,{cx:`17.6`,cy:`17.65`,r:`1`}),(0,X.jsx)(`circle`,{cx:`20.5`,cy:`16.85`,r:`1`}),(0,X.jsx)(`circle`,{cx:`17.9`,cy:`22.2`,r:`1`}),(0,X.jsx)(`circle`,{cx:`21`,cy:`21.5`,r:`1`}),(0,X.jsx)(`circle`,{cx:`24.1`,cy:`20.75`,r:`1`}),(0,X.jsx)(`circle`,{cx:`28.2`,cy:`25.3`,r:`1`})]}),(0,X.jsx)(`circle`,{fill:Iz,cx:`21.7`,cy:`26.6`,r:`1`}),(0,X.jsx)(`circle`,{fill:Bz,cx:`24.9`,cy:`25.9`,r:`1.05`}),(0,X.jsxs)(`g`,{fill:Rz,children:[(0,X.jsx)(`ellipse`,{cx:`8.8`,cy:`36.6`,rx:`3.6`,ry:`1.9`,transform:`rotate(22 8.8 36.6)`}),(0,X.jsx)(`path`,{d:`M12 41C10 41.5 7.5 44.5 7 46.5 7 48 8.5 49.5 10.5 50 12.5 50.5 13.5 50 15 48 15.5 47 16.5 47.5 19 50 22 49.5 22 46.5 22 45.5 20.5 45.5 17 45 16.5 44.5 16.5 44 16.5 42 13.5 40.5 12 41Z`}),(0,X.jsx)(`path`,{d:`M40 33C39 38 36 42 34.5 41.5 32.5 40.5 29.5 42 28.5 44 26 49 27.5 51.5 32.5 51 36 51 37 50 36 46.5 36 45 37 44.5 38 44.5 38.5 45.5 40.5 49 43.5 50 46.5 47.5 47.5 46.5 46 43.5 44 42 43 41.5 43.5 40.5 44.5 39.5 46 38 47 37.5L47 33Z`})]}),(0,X.jsx)(`ellipse`,{fill:Rz,cx:`46.4`,cy:`30.6`,rx:`8.1`,ry:`8.3`}),(0,X.jsxs)(`g`,{fill:Hz,children:[(0,X.jsx)(`rect`,{x:`45.05`,y:`26.95`,width:`2.25`,height:`4.6`,rx:`1.1`,transform:`rotate(-6 46.2 29.3)`}),(0,X.jsx)(`rect`,{x:`49.25`,y:`26.4`,width:`2.25`,height:`4.6`,rx:`1.1`,transform:`rotate(-6 50.4 28.7)`})]}),(0,X.jsx)(`path`,{fill:Iz,d:`M46.8 32.2H51C51 34.3 50 35.4 48.9 35.4S46.8 34.3 46.8 32.2Z`,transform:`rotate(-8 48.9 33.5)`}),(0,X.jsx)(`path`,{fill:`none`,stroke:Bz,strokeWidth:`3`,strokeLinecap:`round`,d:`M50.9 17.7 50.5 19.7 M55.2 20.1 53.4 21.9 M56.5 24.5 55.7 24.7`})]}),allApps:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`rect`,{fill:Iz,x:`7`,y:`7.25`,width:`23.2`,height:`22.7`,rx:`4.6`,transform:`rotate(-6.2 18.6 18.6)`}),(0,X.jsx)(`rect`,{fill:Lz,x:`33.9`,y:`7.25`,width:`23.2`,height:`22.7`,rx:`4.6`,transform:`rotate(6.2 45.5 18.6)`}),(0,X.jsx)(`rect`,{fill:Rz,x:`7`,y:`34.15`,width:`23.2`,height:`22.7`,rx:`4.6`,transform:`rotate(6.2 18.6 45.5)`}),(0,X.jsx)(`rect`,{fill:Bz,x:`33.9`,y:`34.15`,width:`23.2`,height:`22.7`,rx:`4.6`,transform:`rotate(-6.2 45.5 45.5)`})]}),search:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:`none`,stroke:Lz,strokeWidth:`6.5`,d:`M37 37.5 43 43.5`}),(0,X.jsx)(`path`,{fill:`none`,stroke:Iz,strokeWidth:`12.6`,strokeLinecap:`round`,d:`M44.2 43.8 51.4 51.8`}),(0,X.jsx)(`path`,{fill:`none`,stroke:Bz,strokeWidth:`3`,strokeLinecap:`round`,d:`M47.2 42.4 52.8 47.8`}),(0,X.jsx)(`ellipse`,{fill:Lz,cx:`25.6`,cy:`24.6`,rx:`19.25`,ry:`18.6`}),(0,X.jsx)(`ellipse`,{fill:Vz,cx:`25.2`,cy:`24.1`,rx:`14.2`,ry:`13.6`})]}),browser:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`rect`,{fill:Iz,x:`5.9`,y:`6.15`,width:`52.2`,height:`51.7`,rx:`5.5`}),(0,X.jsx)(`path`,{fill:Vz,d:`M10 16.5H29.4C30.3 16.1 31 14.4 31.8 12.5 32.5 10.9 33.2 10 34.5 10H52.2C53.4 10 54 10.7 54 12V16.5C55.2 16.5 56 17.1 56 18.3V52.4C56 53.7 55.1 54.6 53.8 54.6H10.2C8.9 54.6 8 53.7 8 52.4V18.2C8 17.1 8.7 16.5 10 16.5Z`}),(0,X.jsx)(`circle`,{fill:Bz,cx:`12.2`,cy:`11.9`,r:`1.95`}),(0,X.jsx)(`circle`,{fill:Lz,cx:`18.6`,cy:`11.9`,r:`1.95`}),(0,X.jsx)(`circle`,{fill:zz,cx:`25.1`,cy:`11.9`,r:`1.95`}),(0,X.jsx)(`circle`,{fill:Rz,cx:`32`,cy:`34.9`,r:`14.5`}),(0,X.jsxs)(`g`,{fill:`none`,stroke:Vz,strokeWidth:`3`,children:[(0,X.jsx)(`ellipse`,{cx:`32`,cy:`34.9`,rx:`7.7`,ry:`13.3`}),(0,X.jsx)(`path`,{d:`M17.5 34.9H46.5`})]})]}),internet:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`ellipse`,{fill:`none`,stroke:Bz,strokeWidth:`4.4`,cx:`32.2`,cy:`30.2`,rx:`25.6`,ry:`8.1`,transform:`rotate(-20.8 32.2 30.2)`}),(0,X.jsx)(`circle`,{fill:Lz,cx:`32`,cy:`32`,r:`21.1`}),(0,X.jsxs)(`g`,{fill:`none`,stroke:Vz,strokeWidth:`3`,children:[(0,X.jsx)(`ellipse`,{cx:`32`,cy:`31.8`,rx:`12.2`,ry:`18.7`}),(0,X.jsx)(`path`,{d:`M32 13.1V50.5M15 20.4Q32 29 49 20.4M12.5 39Q32 44.6 51.5 39`})]}),(0,X.jsx)(`path`,{fill:`none`,stroke:Bz,strokeWidth:`4.4`,d:`M6.6 30.2A25.6 8.1 0 0 0 57.8 30.2`,transform:`rotate(-20.8 32.2 30.2)`})]}),members:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`circle`,{fill:Lz,cx:`41.9`,cy:`22.85`,r:`12.2`}),(0,X.jsx)(`path`,{fill:Lz,d:`M36 34C33.8 34.8 32.2 35.8 31 37 37.5 39.5 40.5 43.5 40.5 49.5V53.5H54.5C57 53.5 58 51 58 47.5 58 40 55 35.5 49 34Z`}),(0,X.jsx)(`circle`,{fill:Iz,cx:`22.95`,cy:`27.6`,r:`12.85`}),(0,X.jsx)(`path`,{fill:Iz,d:`M15.5 38C10.5 39 7.5 42.5 6.5 47 5.5 50.5 6 53.5 8.5 53.5H38.5C42 52 40 43 36 40 34.5 39 32 38 31 38Z`}),(0,X.jsxs)(`g`,{fill:Hz,children:[(0,X.jsx)(`circle`,{cx:`18.3`,cy:`28`,r:`1.6`}),(0,X.jsx)(`circle`,{cx:`27.9`,cy:`28`,r:`1.6`}),(0,X.jsx)(`circle`,{cx:`39.1`,cy:`23.05`,r:`1.55`}),(0,X.jsx)(`circle`,{cx:`47.25`,cy:`23.05`,r:`1.55`})]})]}),sell:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:Bz,d:`M6.4 41.2V48.4C6.4 51.4 13.2 54 21.8 54S37.2 51.4 37.2 48.4V41.2C37.2 37.8 30.4 35 21.8 35S6.4 37.8 6.4 41.2Z`}),(0,X.jsx)(`ellipse`,{fill:Vz,cx:`21.9`,cy:`40.8`,rx:`13.2`,ry:`3.6`}),(0,X.jsxs)(`g`,{transform:`rotate(-3 22.5 30) translate(0.5 0)`,children:[(0,X.jsx)(`path`,{fill:Bz,d:`M7.5 26V34C7.5 37.3 14.2 40 22.5 40S37.5 37.3 37.5 34V26C37.5 22.7 30.8 20 22.5 20S7.5 22.7 7.5 26Z`}),(0,X.jsx)(`ellipse`,{fill:Vz,cx:`23.7`,cy:`26.55`,rx:`13.05`,ry:`4.4`})]}),(0,X.jsxs)(`g`,{transform:`translate(46.3 40.3) rotate(-25)`,children:[(0,X.jsx)(`path`,{fill:Iz,d:`M-8.5-10Q-8.5-12-7-13L-1.5-16.3Q0-17.2 1.5-16.3L7-13Q8.5-12 8.5-10V9Q8.5 12 5.5 12H-5.5Q-8.5 12-8.5 9Z`}),(0,X.jsx)(`circle`,{fill:Vz,cx:`0`,cy:`-10.7`,r:`2.2`})]}),(0,X.jsx)(bz,{fill:Bz,transform:`translate(38.2 18.6) scale(1.1 .86)`}),(0,X.jsx)(bz,{fill:Bz,transform:`translate(42.8 21.2) rotate(45) scale(1.1 .85)`})]}),schedule:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`rect`,{fill:Vz,x:`6`,y:`11`,width:`47.6`,height:`44`,rx:`6`}),(0,X.jsx)(`path`,{fill:Iz,d:`M12 11H47.6Q53.6 11 53.6 17V21.5H6V17Q6 11 12 11Z`}),(0,X.jsxs)(`g`,{fill:Vz,children:[(0,X.jsx)(`circle`,{cx:`16.1`,cy:`16.15`,r:`3.4`}),(0,X.jsx)(`circle`,{cx:`43.4`,cy:`16.15`,r:`3.4`})]}),(0,X.jsxs)(`g`,{fill:Lz,children:[(0,X.jsx)(`rect`,{x:`13.6`,y:`6`,width:`5`,height:`11.2`,rx:`2.5`}),(0,X.jsx)(`rect`,{x:`40.9`,y:`6`,width:`5`,height:`11.2`,rx:`2.5`})]}),(0,X.jsxs)(`g`,{fill:Rz,children:[(0,X.jsx)(`rect`,{x:`11.1`,y:`25.1`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,X.jsx)(`rect`,{x:`20.7`,y:`25.1`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,X.jsx)(`rect`,{x:`30.4`,y:`25.1`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,X.jsx)(`rect`,{x:`20.7`,y:`33.9`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,X.jsx)(`rect`,{x:`30.4`,y:`33.9`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,X.jsx)(`rect`,{x:`11.1`,y:`42.7`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,X.jsx)(`rect`,{x:`30.4`,y:`42.7`,width:`6.9`,height:`6.6`,rx:`1.8`})]}),(0,X.jsxs)(`g`,{fill:zz,children:[(0,X.jsx)(`rect`,{x:`40.4`,y:`25.1`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,X.jsx)(`rect`,{x:`11.1`,y:`33.9`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,X.jsx)(`rect`,{x:`20.7`,y:`42.7`,width:`6.9`,height:`6.6`,rx:`1.8`})]}),(0,X.jsx)(`circle`,{fill:Bz,cx:`45.5`,cy:`45.6`,r:`12.2`}),(0,X.jsx)(`path`,{fill:`none`,stroke:Hz,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`M45.1 39.3V46.2L51.3 49.8`}),(0,X.jsx)(`circle`,{fill:Hz,cx:`45.1`,cy:`46.2`,r:`2.5`})]}),fungi:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`ellipse`,{fill:Vz,cx:`33.5`,cy:`43.6`,rx:`18.6`,ry:`14.4`,transform:`rotate(-6 33.5 43.6)`}),(0,X.jsx)(`path`,{fill:Iz,d:`M29.5 6.5C22 7.5 16 11 11 18.5 4 29 4.6 39.6 13.5 42.2 24 45 44 40.5 54 34.6 57.6 32.6 58.6 29.2 57.5 25 56.5 20 53 16 48.5 13 43.5 8 37 5.5 29.5 6.5Z`}),(0,X.jsxs)(`g`,{fill:Vz,children:[(0,X.jsx)(`ellipse`,{cx:`29`,cy:`15.7`,rx:`8.7`,ry:`6.3`,transform:`rotate(-15.5 29 15.7)`}),(0,X.jsx)(`ellipse`,{cx:`50.8`,cy:`20.1`,rx:`6.5`,ry:`3.5`,transform:`rotate(51.6 50.8 20.1)`}),(0,X.jsx)(`ellipse`,{cx:`13`,cy:`26.8`,rx:`4.2`,ry:`3.3`,transform:`rotate(-54.5 13 26.8)`})]}),(0,X.jsxs)(`g`,{fill:Hz,transform:`translate(26.6 46.6) scale(1.1) translate(-33.7 -38.5)`,children:[(0,X.jsx)(`rect`,{x:`31.85`,y:`35.9`,width:`3.75`,height:`5.25`,rx:`1.85`}),(0,X.jsx)(`path`,{d:`M 47.4 34.3 C 46 35 44.6 35.8 43.5 36.7 42.9 37.2 43.2 38.3 44 38.4 45.2 38.6 46.5 38.6 47.7 38.4 48.4 38.3 48.3 37.3 47.6 37.3 46.6 37.4 45.7 37.4 45 37.3 45.9 36.7 46.9 36.1 48 35.6 48.7 35.3 48.2 34 47.4 34.3 Z`}),(0,X.jsx)(`path`,{d:`M 37.4 41.1 C 38.6 44.3 42.6 44.3 43.6 40.5 43.7 40 43.1 39.8 42.9 40.3 41.9 42.8 39.1 42.9 38.3 40.7 38.1 40.2 37.3 40.5 37.4 41.1 Z`})]})]})};function Wz({name:e,size:t}){return(0,X.jsx)(`svg`,{viewBox:`0 0 64 64`,width:t,height:t,fill:`none`,stroke:`none`,"aria-hidden":`true`,focusable:`false`,"data-sigil":e,children:Uz[e]})}var Gz=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Kz=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),qz={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`},Jz=(0,K.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,K.createElement)(`svg`,{ref:c,...qz,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Kz(`lucide`,i),...s},[...o.map(([e,t])=>(0,K.createElement)(e,t)),...Array.isArray(a)?a:[a]])),Yz=(e,t)=>{let n=(0,K.forwardRef)(({className:n,...r},i)=>(0,K.createElement)(Jz,{ref:i,iconNode:t,className:Kz(`lucide-${Gz(e)}`,n),...r}));return n.displayName=`${e}`,n},Xz=Yz(`ArrowUp`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Zz=Yz(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Qz=Yz(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),$z=Yz(`Clapperboard`,[[`path`,{d:`M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3Z`,key:`1tn4o7`}],[`path`,{d:`m6.2 5.3 3.1 3.9`,key:`iuk76l`}],[`path`,{d:`m12.4 3.4 3.1 4`,key:`6hsd6n`}],[`path`,{d:`M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z`,key:`ltgou9`}]]),eB=Yz(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),tB=Yz(`EyeOff`,[[`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`}]]),nB=Yz(`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`}]]),rB=Yz(`FileImage`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),iB=Yz(`Folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),aB=Yz(`ImagePlus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),oB=Yz(`Info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),sB=Yz(`Minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),cB=Yz(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),lB=Yz(`RotateCcw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),uB=Yz(`Shuffle`,[[`path`,{d:`M2 18h1.4c1.3 0 2.5-.6 3.3-1.7l6.1-8.6c.7-1.1 2-1.7 3.3-1.7H22`,key:`1wmou1`}],[`path`,{d:`m18 2 4 4-4 4`,key:`pucp1d`}],[`path`,{d:`M2 6h1.9c1.5 0 2.9.9 3.6 2.2`,key:`10bdb2`}],[`path`,{d:`M22 18h-5.9c-1.3 0-2.6-.7-3.3-1.8l-.5-.8`,key:`vgxac0`}],[`path`,{d:`m18 14 4 4-4 4`,key:`10pe0f`}]]),dB=Yz(`SlidersHorizontal`,[[`line`,{x1:`21`,x2:`14`,y1:`4`,y2:`4`,key:`obuewd`}],[`line`,{x1:`10`,x2:`3`,y1:`4`,y2:`4`,key:`1q6298`}],[`line`,{x1:`21`,x2:`12`,y1:`12`,y2:`12`,key:`1iu8h1`}],[`line`,{x1:`8`,x2:`3`,y1:`12`,y2:`12`,key:`ntss68`}],[`line`,{x1:`21`,x2:`16`,y1:`20`,y2:`20`,key:`14d8ph`}],[`line`,{x1:`12`,x2:`3`,y1:`20`,y2:`20`,key:`m0wm8r`}],[`line`,{x1:`14`,x2:`14`,y1:`2`,y2:`6`,key:`14e1ph`}],[`line`,{x1:`8`,x2:`8`,y1:`10`,y2:`14`,key:`1i6ji0`}],[`line`,{x1:`16`,x2:`16`,y1:`18`,y2:`22`,key:`1lctlv`}]]),fB=Yz(`Square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),pB=Yz(`Upload`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`17 8 12 3 7 8`,key:`t8dd8p`}],[`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`,key:`widbto`}]]),mB=Yz(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),hB=`@cf/black-forest-labs/flux-2-klein-4b`,gB={landscape:{height:768,width:1024},portrait:{height:1024,width:768},square:{height:1024,width:1024}},_B=[`landscape`,`portrait`,`square`],vB=2021;function yB(e){return e instanceof eP&&e.stage===`provider`&&e.provider!==void 0&&`code`in e.provider&&e.provider.code===vB}function bB(e){return yB(e)?{title:`Out of AI Gateway credits`,message:`This model is paid with Cloudflare AI Gateway credits, and the account has none left. Add credits in the Cloudflare dashboard under AI Gateway, or choose a Workers AI model such as Flux. Nothing was charged.`,retryable:!1}:Ow(e,{INSUFFICIENT_CREDIT:{title:`Couldn’t create image`,message:`Media generation needs Team credits. Add credits in Billing, then retry.`}})}function xB(){return{destination:void 0,height:768,model:hB,prompt:``,references:[],steps:void 0,width:1024}}function SB(e,t,n=`png`){if(e.trim().length===0)throw Error(`Media generation token must not be empty.`);let r=e.trim();if(!/^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$/.test(r))throw Error(`Media generation basename contains invalid characters.`);return`${t.replace(/\/$/,``)}/generated-${r}.${n}`}function CB(e,t,n){let r=e.destination?.trim();if(r)return r;let i=n?.outputFormats.includes(`png`)?`png`:n?.outputFormats[0]??`png`,a=n?.kind===`video`?`mp4`:i===`jpeg`?`jpg`:i;return SB(pN({count:4}),t,a)}function wB(e){return e?.kind===`video`?`Generate video`:`Generate image`}function TB(e){return e===void 0?`Creating media…`:e.kind===`video`?`Creating video…`:`Creating image…`}var EB=(e,t)=>t===0?e:EB(t,e%t),DB=(e,t,n)=>{if(n!==void 0)return`${String(e)} × ${String(t)} · ${String(n[0])}:${String(n[1])}`;let r=EB(e,t);return`${String(e)} × ${String(t)} · ${String(e/r)}:${String(t/r)}`},OB=[[16,9],[21,9]],kB=16;function AB(e){let t=e.input.maxDimension;if(e.kind!==`image`||e.input.dimensions!==`own`||!e.input.maxDimensionDocumented||t===null)return[];let n=Math.floor(t/kB)*kB;return OB.map(([e,t])=>{let r=Math.round(n*t/e/kB)*kB;return{value:`${String(n)}x${String(r)}`,label:DB(n,r,[e,t]),width:n,height:r}})}function jB(e,t,n){if(e?.input.dimensions===`none`)return null;let r=e?.video?.formats.find(e=>e.width===t&&e.height===n);if(r!==void 0)return`${r.resolution} ${r.aspectRatio}`;let i=EB(t,n),a=t/i,o=n/i;return a<=21&&o<=21?`${String(a)}:${String(o)}`:`${String(t)} × ${String(n)}`}function MB(e){return e?.video!==void 0&&e.video!==null?e.video.formats.map(e=>({value:`${String(e.width)}x${String(e.height)}`,label:`${e.resolution} · ${e.aspectRatio} · ${String(e.width)} × ${String(e.height)}`,width:e.width,height:e.height})):e!==void 0&&e.sizes!==null?e.sizes.flatMap(e=>{let t=/^(\d+)x(\d+)$/u.exec(e);if(t===null)return[];let n=Number(t[1]),r=Number(t[2]);return[{value:e,label:DB(n,r),width:n,height:r}]}):[..._B.map(e=>({value:e,label:DB(gB[e].width,gB[e].height),...gB[e]})),...e===void 0?[]:AB(e)]}function NB(e,t,n){return n?.kind===`video`&&t.kind===`video`||t.input.dimensions!==`none`&&Oee(VC(UB(()=>t))({model:t.id,width:e.width,height:e.height}))?{width:e.width,height:e.height}:{width:t.input.defaultWidth,height:t.input.defaultHeight}}function PB(e){return e.label.split(` — `)[0]??e.label}function FB(e,t){return e.find(e=>e.id===t)}function IB(e,t){return{...e,height:t.input.defaultHeight,model:t.id,steps:t.input.steps===`fixed`?void 0:t.input.defaultSteps??void 0,durationSeconds:t.video?.defaultSeconds,generateAudio:t.video?.defaultGenerateAudio??void 0,width:t.input.defaultWidth}}var LB={"first-frame":`First frame`,"last-frame":`Last frame`,reference:`Reference`};function RB(e,t,n){let r=t[n]?.role,i=r===void 0?0:e.indexOf(r)+1;return[...e.slice(i),...e.slice(0,i)].find(e=>e!==r&&(e===`reference`||!t.some((t,r)=>r!==n&&t.role===e)))}function zB(e){return e?.video?.referenceRoles??[]}function BB(e,t){let n=zB(t);if(t?.video==null)return e.map(e=>({path:e.path}));let r=e.map(e=>e.role!==void 0&&n.includes(e.role)?e.role:void 0),i=e=>r.includes(e),a=n.includes(`last-frame`),o=i(`reference`)||!i(`first-frame`)&&!i(`last-frame`)&&e.length>(a?2:1);return e.map((e,t)=>{let s=r[t];return s===void 0&&(s=o&&n.includes(`reference`)?`reference`:!i(`first-frame`)&&n.includes(`first-frame`)?`first-frame`:a&&!i(`last-frame`)?`last-frame`:n.includes(`reference`)?`reference`:`first-frame`,r[t]=s),{path:e.path,role:s}})}function VB(e,t,n){let r=t.video;if(r===null||e.length===0)return;let i=t=>e.filter(e=>e.role===t).length,a=i(`first-frame`),o=i(`last-frame`),s=i(`reference`);if(a>1||o>1)return r.referenceRoles.includes(`last-frame`)?`${t.label} takes one first frame and one last frame.`:`${t.label} takes one first frame.`;if(o>0&&a===0)return`A last frame needs a first frame as well.`;if(s>0&&a+o>0)return`Frames and references cannot be mixed. Use a first and last frame, or references.`;if(s>r.maxReferenceImages)return r.maxReferenceImages===0?`${t.label} takes no reference images.`:`${t.label} takes up to ${String(r.maxReferenceImages)} reference images.`;if(s>0&&n!==void 0&&!r.referenceResolutions.some(e=>e===n))return`${t.label} takes reference images only at ${r.referenceResolutions.join(`, `)}.`}function HB(e,t){let n=t.video?.formats.find(t=>t.width===e.width&&t.height===e.height);if(t.kind===`video`&&n===void 0)throw Error(`Choose a supported video resolution and aspect ratio.`);let r={height:e.height,model:e.model,prompt:e.prompt.trim(),width:e.width};return n!==void 0&&(r.resolution=n.resolution,r.aspectRatio=n.aspectRatio),e.steps!==void 0&&(r.steps=e.steps),e.durationSeconds!==void 0&&(r.durationSeconds=e.durationSeconds),e.references.length>0&&(r.references=BB(e.references,t)),t.video?.supportsAudio===!0&&e.generateAudio!==void 0&&(r.generateAudio=e.generateAudio),{destination:{path:e.destination?.trim()??``},settings:r}}function UB(e){return q({model:XC,width:ZC,height:ZC,durationSeconds:WC(aw(ZC)),steps:WC(aw(ZC))}).check(cw(t=>{let n=e(t.model);if(!Number.isSafeInteger(t.width)||t.width<1)return{path:[`width`],issue:`Width must be a positive integer.`};if(!Number.isSafeInteger(t.height)||t.height<1)return{path:[`height`],issue:`Height must be a positive integer.`};if(n!==void 0){if(n.input.dimensions===`own`){let e=n.input.maxDimension??4096;if(t.width<256||t.height<256)return{path:[t.width<256?`width`:`height`],issue:`${n.label} requires dimensions of at least 256 × 256.`};if(t.width>e||t.height>e)return{path:[t.width>e?`width`:`height`],issue:`${n.label} accepts dimensions up to ${String(e)}.`}}if(n.sizes!==null&&!n.sizes.includes(`${String(t.width)}x${String(t.height)}`))return{path:[`width`],issue:`${n.label} accepts only these sizes: ${n.sizes.join(`, `)}.`};if(n.video!==null&&t.durationSeconds!==void 0&&(!Number.isSafeInteger(t.durationSeconds)||t.durationSeconds<n.video.minSeconds||t.durationSeconds>n.video.maxSeconds))return{path:[`durationSeconds`],issue:`${n.label} makes clips from ${String(n.video.minSeconds)} to ${String(n.video.maxSeconds)} seconds.`};if(n.input.steps===`fixed`&&t.steps!==void 0)return{path:[`steps`],issue:`${n.label} uses fixed steps.`};if(t.steps!==void 0&&(!Number.isSafeInteger(t.steps)||t.steps<1||n.input.maxSteps!==null&&t.steps>n.input.maxSteps))return{path:[`steps`],issue:`${n.label} accepts at most ${String(n.input.maxSteps??`the provider limit`)} steps.`}}}))}function WB(e,t){let n=e.trim().length;return n>t.maxPromptLength?{length:n,excess:n-t.maxPromptLength}:null}function GB(e,t){if(e.destination?.trim().length===0)return`A destination file path is required.`;if(e.prompt.trim().length===0)return t?.kind===`video`?`Describe the video to generate.`:`Describe the image to generate.`;if(t===void 0)return`Choose a model from the granted registry.`;let n=WB(e.prompt,t);if(n!==null)return`${t.label} accepts prompts up to ${String(t.maxPromptLength)} characters; this one is ${String(n.length)}. Shorten it by ${String(n.excess)}.`;let r=VC(UB(()=>t))(e);if(jm(r))return Uv()(r.failure.issue).issues.map(e=>e.message).join(` `);if(e.references.length>t.input.maxReferences)return`${t.label} accepts at most ${String(t.input.maxReferences)} reference images.`;if(e.references.length>0&&t.input.referenceField===null)return`${t.label} does not accept reference images.`;if(t.video!==null){let n=t.video.formats.find(t=>t.width===e.width&&t.height===e.height);return VB(BB(e.references,t),t,n?.resolution)}}var KB=BC(Ute(q({error:KC(`too_large`)})));async function qB(e,t){let n,r=()=>n??=e.close(),i=()=>{r().catch(e=>{KT(`files.read.abort-close`,e)})};t.signal?.addEventListener(`abort`,i,{once:!0});try{t.signal?.throwIfAborted();let n=await e.response();try{let e=HC(sw(Response))(n);if(e.status===413)throw new Y(`App file exceeds the read bound`,{code:KB(await e.text())._tag===`Some`?`FILE_TOO_LARGE`:`PROTOCOL`,retryable:!1});if(!e.ok)throw Error(`App file unavailable (${String(e.status)})`);let r=await e.blob();return t.signal?.throwIfAborted(),new File([r],t.name,{type:r.type,lastModified:0})}finally{rM(n)}}finally{t.signal?.removeEventListener(`abort`,i);try{await r()}finally{e[Symbol.dispose]()}}}async function JB(e,t,n){let r,i=()=>r??=e.close(),a=()=>{i().catch(e=>{KT(`files.write.abort-close`,e)})};n.signal?.addEventListener(`abort`,a,{once:!0});try{n.signal?.throwIfAborted(),await e.write(t.stream())}finally{n.signal?.removeEventListener(`abort`,a);try{await i()}catch(e){KT(`files.write.remote-close`,e)}try{e[Symbol.dispose]()}catch(e){KT(`files.write.local-dispose`,e)}}}var YB=q({path:XC,entries:ew(q({name:XC,type:rw([`file`,`directory`,`symlink`]),size:ZC,modifiedAt:ZC})),nextOffset:iw(ZC)}),XB=eN(`computer.list`,1,Yl(()=>tN({list:rN(nN(Mc().transform(e=>HC(YB)(e))))}))),ZB=nw([q({state:rw([`running`,`sleeping`,`starting`])}),q({state:KC(`queued`),position:ZC.pipe(J(_w()),J(pw(0)))})]),QB=q({enabled:QC,effective:QC,blockedBy:iw(rw([`team`,`global`]))}),$B=q({computerId:Cw,name:Cw,runtime:ZB,backends:ew(q({id:Cw,kind:rw([`platform-container`,`on-box-vm`,`local`]),status:rw([`ready`,`queued`,`online`,`offline`]),queuePosition:iw(ZC.pipe(J(_w()),J(pw(0)))),hostId:iw(XC),hostLabel:iw(XC),folderLabel:iw(XC),detachable:QC})),internet:QB});eN(`computer.instrument.read`,1,Yl(()=>tN({read:rN(nN(Mc().transform(e=>HC($B)(e))))}))),eN(`computer.instrument.control`,1,Yl(()=>tN({start:rN(nN(Mc().transform(e=>HC(ZB)(e)))),setInternetAccess:rN(nN(Mc().transform(e=>HC(QB)(e)))),detachLocal:rN(nN(Mc().transform(e=>HC(q({detached:QC}))(e))))})));var eV=nw([q({ports:ew(q({port:ZC.pipe(J(_w()),J(gw({minimum:1,maximum:65535}))),previewUrl:Cw,openMode:rw([`inline`,`external-only`]),expiresAt:ZC.pipe(J(_w()),J(pw(0)))})).pipe(J(xw(64)))}),q({error:KC(`port_previews_not_configured`)})]),tV=q({port:ZC.annotate({message:`Use a port from 1 to 65535.`}).check(_w({message:`Use a port from 1 to 65535.`}),gw({minimum:1,maximum:65535},{message:`Use a port from 1 to 65535.`})),exposed:QC}),nV=q({port:ZC.pipe(J(_w()),J(gw({minimum:1,maximum:65535}))),removed:QC});eN(`computer.ports`,2,Yl(()=>tN({list:rN(nN(Mc().transform(e=>HC(eV)(e)))),expose:rN(nN(Mc().transform(e=>HC(tV)(e)))),unexpose:rN(nN(Mc().transform(e=>HC(nV)(e))))})));var rV=rw([`synced`,`pending`,`unknown`]),iV=q({port:iw(tV.fields.port),id:Cw,command:Cw,cwd:iw(XC),startedAt:ZC.pipe(J(_w()),J(mw(0))),state:rw([`running`,`exited`,`uncertain`]),exitCode:iw(ZC.pipe(J(_w()))),sync:rV,endedAt:iw(ZC.pipe(J(_w()),J(mw(0))))}),aV=q({processes:ew(iV)}),oV=q({process:iV,signalled:QC});q({requestId:Cw.pipe(J(xw(256))),command:Cw.pipe(J(xw(16384))),cwd:WC(XC),port:WC(tV.fields.port)}),eN(`computer.processes`,1,Yl(()=>tN({start:rN(nN(Mc().transform(e=>HC(iV)(e)))),list:rN(nN(Mc().transform(e=>HC(aV)(e)))),kill:rN(nN(Mc().transform(e=>HC(oV)(e))))})));var sV=eN(`computer.readFile`,1,Yl(()=>tN({open:rN(tN({response:rN(su(Response)),close:iN}))})));async function cV(e,t,n){return await qB(await e.require(sV).open(t),{...n,name:t.path.split(`/`).at(-1)??`file`})}async function lV(e,t){return HC(YB)(await e.require(XB).list(t))}var uV=eN(`computer.writeFile`,3,Yl(()=>tN({open:rN(tN({write:iN,close:iN})),mkdir:iN,replace:rN(nN(Mc().transform(e=>HC(dV)(e))))}))),dV=nw([q({kind:KC(`replaced`),path:Cw,bytes:ZC.pipe(J(_w()),J(mw(0)))}),q({kind:KC(`conflict`)})]),fV=q({computerName:Cw.pipe(J(xw(256))),teamName:Cw.pipe(J(xw(256))),modelDoor:Cw.pipe(J(xw(256))),uptimeSeconds:ZC.pipe(J(_w()),J(mw(0))),version:Cw.pipe(J(xw(64)))});eN(`computer.terminal`,2,Yl(()=>tN({open:rN(tN({information:rN(nN(Mc().transform(e=>HC(fV)(e)))),output:rN(su(ReadableStream).transform(e=>e.pipeThrough(new TransformStream({transform(e,t){t.enqueue(su(Uint8Array).parse(e))}})))),input:rN(su(WritableStream)),resize:iN,close:iN}))})));async function pV(e,t,n){await JB(await e.require(uV).open({path:t.path}),t.content,n)}var mV=o((e=>{function t(e,t,n){if(n===void 0&&(n=Array.prototype),e&&typeof n.find==`function`)return n.find.call(e,t);for(var i=0;i<e.length;i++)if(r(e,i)){var a=e[i];if(t.call(void 0,a,i,e))return a}}function n(e,t){return t===void 0&&(t=Object),t&&typeof t.getOwnPropertyDescriptors==`function`&&(e=t.create(null,t.getOwnPropertyDescriptors(e))),t&&typeof t.freeze==`function`?t.freeze(e):e}function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function i(e,t){if(typeof e!=`object`||!e)throw TypeError(`target is not an object`);for(var n in t)r(t,n)&&(e[n]=t[n]);return e}var a=n({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});function o(e){return r(a,e.toLowerCase())}var s=n({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function c(e){return r(s,e.toLowerCase())}var l=n({script:!1,style:!1,textarea:!0,title:!0});function u(e){var t=e.toLowerCase();return r(l,t)&&!l[t]}function d(e){var t=e.toLowerCase();return r(l,t)&&l[t]}function f(e){return e===m.HTML}function p(e){return f(e)||e===m.XML_XHTML_APPLICATION}var m=n({HTML:`text/html`,XML_APPLICATION:`application/xml`,XML_TEXT:`text/xml`,XML_XHTML_APPLICATION:`application/xhtml+xml`,XML_SVG_IMAGE:`image/svg+xml`}),h=Object.keys(m).map(function(e){return m[e]});function g(e){return h.indexOf(e)>-1}var _=n({HTML:`http://www.w3.org/1999/xhtml`,SVG:`http://www.w3.org/2000/svg`,XML:`http://www.w3.org/XML/1998/namespace`,XMLNS:`http://www.w3.org/2000/xmlns/`});e.assign=i,e.find=t,e.freeze=n,e.HTML_BOOLEAN_ATTRIBUTES=a,e.HTML_RAW_TEXT_ELEMENTS=l,e.HTML_VOID_ELEMENTS=s,e.hasDefaultHTMLNamespace=p,e.hasOwn=r,e.isHTMLBooleanAttribute=o,e.isHTMLRawTextElement=u,e.isHTMLEscapableRawTextElement=d,e.isHTMLMimeType=f,e.isHTMLVoidElement=c,e.isValidMimeType=g,e.MIME_TYPE=m,e.NAMESPACE=_})),hV=o((e=>{var t=mV();function n(e,t){e.prototype=Object.create(Error.prototype,{constructor:{value:e},name:{value:e.name,enumerable:!0,writable:t}})}var r=t.freeze({Error:`Error`,IndexSizeError:`IndexSizeError`,DomstringSizeError:`DomstringSizeError`,HierarchyRequestError:`HierarchyRequestError`,WrongDocumentError:`WrongDocumentError`,InvalidCharacterError:`InvalidCharacterError`,NoDataAllowedError:`NoDataAllowedError`,NoModificationAllowedError:`NoModificationAllowedError`,NotFoundError:`NotFoundError`,NotSupportedError:`NotSupportedError`,InUseAttributeError:`InUseAttributeError`,InvalidStateError:`InvalidStateError`,SyntaxError:`SyntaxError`,InvalidModificationError:`InvalidModificationError`,NamespaceError:`NamespaceError`,InvalidAccessError:`InvalidAccessError`,ValidationError:`ValidationError`,TypeMismatchError:`TypeMismatchError`,SecurityError:`SecurityError`,NetworkError:`NetworkError`,AbortError:`AbortError`,URLMismatchError:`URLMismatchError`,QuotaExceededError:`QuotaExceededError`,TimeoutError:`TimeoutError`,InvalidNodeTypeError:`InvalidNodeTypeError`,DataCloneError:`DataCloneError`,EncodingError:`EncodingError`,NotReadableError:`NotReadableError`,UnknownError:`UnknownError`,ConstraintError:`ConstraintError`,DataError:`DataError`,TransactionInactiveError:`TransactionInactiveError`,ReadOnlyError:`ReadOnlyError`,VersionError:`VersionError`,OperationError:`OperationError`,NotAllowedError:`NotAllowedError`,OptOutError:`OptOutError`}),i=Object.keys(r);function a(e){return typeof e==`number`&&e>=1&&e<=25}function o(e){return typeof e==`string`&&e.substring(e.length-r.Error.length)===r.Error}function s(e,t){a(e)?(this.name=i[e],this.message=t||``):(this.message=e,this.name=o(t)?t:r.Error),Error.captureStackTrace&&Error.captureStackTrace(this,s)}n(s,!0),Object.defineProperties(s.prototype,{code:{enumerable:!0,get:function(){var e=i.indexOf(this.name);return a(e)?e:0}}});for(var c={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},l=Object.entries(c),u=0;u<l.length;u++){var d=l[u][0];s[d]=l[u][1]}function f(e,t,n){this.message=e,this.locator=t,this.cause=n,Error.captureStackTrace&&Error.captureStackTrace(this,f)}n(f),e.DOMException=s,e.DOMExceptionName=r,e.ExceptionCode=c,e.ParseError=f})),gV=o((e=>{function t(e){try{typeof e!=`function`&&(e=RegExp);var t=new e(`𝌆`,`u`).exec(`𝌆`);return!!t&&t[0].length===2}catch{}return!1}var n=t();function r(e){if(e.source[0]!==`[`)throw Error(e+` can not be used with chars`);return e.source.slice(1,e.source.lastIndexOf(`]`))}function i(e,t){if(e.source[0]!==`[`)throw Error(`/`+e.source+`/ can not be used with chars_without`);if(!t||typeof t!=`string`)throw Error(JSON.stringify(t)+` is not a valid search`);if(e.source.indexOf(t)===-1)throw Error(`"`+t+`" is not is /`+e.source+`/`);if(t===`-`&&e.source.indexOf(t)!==1)throw Error(`"`+t+`" is not at the first postion of /`+e.source+`/`);return new RegExp(e.source.replace(t,``),n?`u`:``)}function a(e){var t=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(e){var n=typeof e==`string`;if(n&&t===void 0&&e===`|`)throw Error("use regg instead of reg to wrap expressions with `|`!");return n?e:e.source}).join(``),n?`u`:``)}function o(e){if(arguments.length===0)throw Error(`no parameters provided`);return a.apply(o,[`(?:`].concat(Array.prototype.slice.call(arguments),[`)`]))}var s=`�`,c=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;n&&(c=a(`[`,r(c),`\\u{10000}-\\u{10FFFF}`,`]`));var l=RegExp(`[^`+r(c)+`]`,n?`u`:``),u=/[\x20\x09\x0D\x0A]/,d=r(u),f=a(u,`+`),p=a(u,`*`),m=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;n&&(m=a(`[`,r(m),`\\u{10000}-\\u{10FFFF}`,`]`));var h=a(`[`,r(m),r(/[-.0-9\xB7]/),r(/[\u0300-\u036F\u203F-\u2040]/),`]`),g=a(m,h,`*`),_=a(`^`,g,`$`),v=a(h,`+`),y=o(a(`&`,g,`;`),`|`,o(/&#[0-9]+;|&#x[0-9a-fA-F]+;/)),b=a(`%`,g,`;`),x=o(a(`"`,o(/[^%&"]/,`|`,b,`|`,y),`*`,`"`),`|`,a(`'`,o(/[^%&']/,`|`,b,`|`,y),`*`,`'`)),S=o(`"`,o(/[^<&"]/,`|`,y),`*`,`"`,`|`,`'`,o(/[^<&']/,`|`,y),`*`,`'`),C=a(i(m,`:`),i(h,`:`),`*`),w=a(`^`,C,`$`),T=a(C,o(`:`,C),`?`),E=a(`^`,T,`$`),D=a(`(`,T,`)`),O=o(/"[^"]*"|'[^']*'/),k=a(/^<\?/,`(`,g,`)`,o(f,`(?!`,u,`)(`,c,`*?)`),`?`,/\?>/),A=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,j=o(`"`,A,`*"`,`|`,`'`,i(A,`'`),`*'`),M=`<!--`,N=`-->`,P=a(M,o(i(c,`-`),`|`,a(`-`,i(c,`-`))),`*`,N),F=`#PCDATA`,I=o(`EMPTY`,`|`,`ANY`,`|`,o(a(/\(/,p,F,o(p,/\|/,p,T),`*`,p,/\)\*/),`|`,a(/\(/,p,F,p,/\)/)),`|`,a(/\([^>]+\)/,/[?*+]?/)),L=a(`<!ELEMENT`,f,o(T,`|`,b),f,o(I,`|`,b),p,`>`),R=a(`<!ATTLIST`,f,g,o(f,g,f,o(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,`|`,o(a(`NOTATION`,f,/\(/,p,g,o(p,/\|/,p,g),`*`,p,/\)/),`|`,a(/\(/,p,v,o(p,/\|/,p,v),`*`,p,/\)/))),f,o(/#REQUIRED|#IMPLIED/,`|`,o(o(`#FIXED`,f),`?`,S))),`*`,p,`>`),z=`about:legacy-compat`,ee=o(`"`+z+`"`,`|`,`'`+z+`'`),te=`SYSTEM`,B=`PUBLIC`,ne=o(o(te,f,O),`|`,o(B,f,j,f,O)),re=a(`^`,o(o(te,f,`(?<SystemLiteralOnly>`,O,`)`),`|`,o(B,f,`(?<PubidLiteral>`,j,`)`,f,`(?<SystemLiteral>`,O,`)`))),V=a(`^`,j,`$`),ie=a(`^`,O,`$`),ae=o(x,`|`,o(ne,o(f,`NDATA`,f,g),`?`)),oe=`<!ENTITY`,H=o(a(oe,f,g,f,ae,p,`>`),`|`,a(oe,f,`%`,f,g,f,o(x,`|`,ne),p,`>`)),se=a(`<!NOTATION`,f,g,f,o(ne,`|`,a(B,f,j)),p,`>`),ce=a(p,`=`,p),le=/1[.]\d+/,U=a(f,`version`,ce,o(`'`,le,`'`,`|`,`"`,le,`"`)),ue=/[A-Za-z][-A-Za-z0-9._]*/,de=a(/^<\?xml/,U,o(f,`encoding`,ce,o(`"`,ue,`"`,`|`,`'`,ue,`'`)),`?`,o(f,`standalone`,ce,o(`'`,o(`yes`,`|`,`no`),`'`,`|`,`"`,o(`yes`,`|`,`no`),`"`)),`?`,p,/\?>/),fe=`<!DOCTYPE`,pe=`<![CDATA[`,me=`]]>`,he=a(/<!\[CDATA\[/,a(c,`*?`,/\]\]>/));e.chars=r,e.chars_without=i,e.detectUnicodeSupport=t,e.reg=a,e.regg=o,e.ABOUT_LEGACY_COMPAT=z,e.ABOUT_LEGACY_COMPAT_SystemLiteral=ee,e.AttlistDecl=R,e.CDATA_START=pe,e.CDATA_END=me,e.CDSect=he,e.Char=c,e.Comment=P,e.COMMENT_START=M,e.COMMENT_END=N,e.DOCTYPE_DECL_START=fe,e.elementdecl=L,e.EntityDecl=H,e.EntityValue=x,e.ExternalID=ne,e.ExternalID_match=re,e.Name=g,e.Name_exact=_,e.NCName_exact=w,e.NotationDecl=se,e.Reference=y,e.PEReference=b,e.PI=k,e.PUBLIC=B,e.PubidLiteral=j,e.PubidLiteral_match=V,e.QName=T,e.QName_exact=E,e.QName_group=D,e.S=f,e.SChar_s=d,e.S_OPT=p,e.SYSTEM=te,e.SystemLiteral=O,e.SystemLiteral_match=ie,e.InvalidChar=l,e.UNICODE_REPLACEMENT_CHARACTER=s,e.UNICODE_SUPPORT=n,e.XMLDecl=de})),_V=o((e=>{var t=mV(),n=t.find,r=t.hasDefaultHTMLNamespace,i=t.hasOwn,a=t.isHTMLMimeType,o=t.isHTMLRawTextElement,s=t.isHTMLVoidElement,c=t.MIME_TYPE,l=t.NAMESPACE,u=Symbol(),d=hV(),f=d.DOMException,p=d.DOMExceptionName,m=gV();function h(e){if(e!==u)throw TypeError(`Illegal constructor`)}function g(e){return e!==``}function _(e){return e?e.split(/[\t\n\f\r ]+/).filter(g):[]}function v(e,t){return i(e,t)||(e[t]=!0),e}function y(e){if(!e)return[];var t=_(e);return Object.keys(t.reduce(v,{}))}function b(e){return function(t){return e&&e.indexOf(t)!==-1}}function x(e){if(!m.QName_exact.test(e))throw new f(f.INVALID_CHARACTER_ERR,`invalid character in qualified name "`+e+`"`)}function S(e,n){x(n),e||=null;var r=null,i=n;if(n.indexOf(`:`)>=0){var a=n.split(`:`);r=a[0],i=a[1]}if(r!==null&&e===null)throw new f(f.NAMESPACE_ERR,`prefix is non-null and namespace is null`);if(r===`xml`&&e!==t.NAMESPACE.XML)throw new f(f.NAMESPACE_ERR,`prefix is "xml" and namespace is not the XML namespace`);if((r===`xmlns`||n===`xmlns`)&&e!==t.NAMESPACE.XMLNS)throw new f(f.NAMESPACE_ERR,`either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace`);if(e===t.NAMESPACE.XMLNS&&r!==`xmlns`&&n!==`xmlns`)throw new f(f.NAMESPACE_ERR,`namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"`);return[e,r,i]}function C(e,t){for(var n in e)i(e,n)&&(t[n]=e[n])}function w(e,t){var n=e.prototype;if(!(n instanceof t)){function r(){}r.prototype=t.prototype,r=new r,C(n,r),e.prototype=n=r}n.constructor!=e&&(typeof e!=`function`&&console.error(`unknown Class:`+e),n.constructor=e)}var T={},E=T.ELEMENT_NODE=1,D=T.ATTRIBUTE_NODE=2,O=T.TEXT_NODE=3,k=T.CDATA_SECTION_NODE=4,A=T.ENTITY_REFERENCE_NODE=5,j=T.ENTITY_NODE=6,M=T.PROCESSING_INSTRUCTION_NODE=7,N=T.COMMENT_NODE=8,P=T.DOCUMENT_NODE=9,F=T.DOCUMENT_TYPE_NODE=10,I=T.DOCUMENT_FRAGMENT_NODE=11,L=T.NOTATION_NODE=12,R=t.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function z(e,t){if(t.length<e.length)return z(t,e);var n=null;for(var r in e){if(e[r]!==t[r])return n;n=e[r]}return n}function ee(e){return e.guid||=Math.random(),e.guid}function te(){}te.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e){for(var t=typeof e==`function`?{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:e}:e?{requireWellFormed:!!e.requireWellFormed,splitCDATASections:e.splitCDATASections!==!1,nodeFilter:e.nodeFilter||null}:{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null},n=[],r=0;r<this.length;r++)Ge(this[r],n,null,t);return n.join(``)},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},te.prototype[Symbol.iterator]=function(){var e=this,t=0;return{next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function B(e,t){this._node=e,this._refresh=t,ne(this)}function ne(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var n=e._refresh(e._node);if(Je(e,`length`,n.length),!e.$$length||n.length<e.$$length)for(var r=n.length;r in e;r++)i(e,r)&&delete e[r];C(n,e),e._inc=t}}B.prototype.item=function(e){return ne(this),this[e]||null},w(B,te);function re(){this._nsIndex=Object.create(null),this._noNsIndex=Object.create(null)}function V(e,t){for(var n=0;n<e.length;){if(e[n]===t)return n;n++}}function ie(e,t,n){if(!t)return e._noNsIndex;var r=e._nsIndex[t];return!r&&n&&(r=e._nsIndex[t]=Object.create(null)),r}function ae(e,t,n){var r=ie(e,t,!1);return r&&r[n]||null}function oe(e,t){ie(e,t.namespaceURI,!0)[t.localName]=t}function H(e,t){var n=ie(e,t.namespaceURI,!1);n&&delete n[t.localName]}function se(e,t,n,r){if(r?t[V(t,r)]=n:(t[t.length]=n,t.length++),oe(t,n),e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&he(i,e,r),me(i,e,n))}}function ce(e,t,n){var r=V(t,n);if(r>=0){for(var i=t.length-1;r<=i;)t[r]=t[++r];if(t.length=i,H(t,n),e){var a=e.ownerDocument;a&&he(a,e,n),n.ownerElement=null}}}re.prototype={length:0,item:te.prototype.item,getNamedItem:function(e){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());for(var t=0;t<this.length;){var n=this[t];if(n.nodeName===e)return n;t++}return null},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!==this._ownerElement)throw new f(f.INUSE_ATTRIBUTE_ERR);var n=ae(this,e.namespaceURI,e.localName);return n===e?e:(se(this._ownerElement,this,e,n),n)},setNamedItemNS:function(e){return this.setNamedItem(e)},removeNamedItem:function(e){var t=this.getNamedItem(e);if(!t)throw new f(f.NOT_FOUND_ERR,e);return ce(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);if(!n)throw new f(f.NOT_FOUND_ERR,e?e+` : `+t:t);return ce(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){e||=null;for(var n=0;n<this.length;){var r=this[n];if(r.localName===t&&r.namespaceURI===e)return r;n++}return null}},re.prototype[Symbol.iterator]=function(){var e=this,t=0;return{next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function le(){}le.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var r=c.XML_APPLICATION;e===l.HTML?r=c.XML_XHTML_APPLICATION:e===l.SVG&&(r=c.XML_SVG_IMAGE);var i=new pe(u,{contentType:r});if(i.implementation=this,i.childNodes=new te,i.doctype=n||null,n&&i.appendChild(n),t){var a=i.createElementNS(e,t);i.appendChild(a)}return i},createDocumentType:function(e,t,n,r){x(e);var i=new Fe(u);return i.name=e,i.nodeName=e,i.publicId=t||``,i.systemId=n||``,i.internalSubset=r||``,i.childNodes=new te,i},createHTMLDocument:function(e){var t=new pe(u,{contentType:c.HTML});if(t.implementation=this,t.childNodes=new te,e!==!1){t.doctype=this.createDocumentType(`html`),t.doctype.ownerDocument=t,t.appendChild(t.doctype);var n=t.createElement(`html`);t.appendChild(n);var r=t.createElement(`head`);if(n.appendChild(r),typeof e==`string`){var i=t.createElement(`title`);i.appendChild(t.createTextNode(e)),r.appendChild(i)}n.appendChild(t.createElement(`body`))}return t}};function U(e){h(e)}U.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:`about:blank`,get isConnected(){var e=this.getRootNode();return e&&e.nodeType===e.DOCUMENT_NODE},contains:function(e){if(!e)return!1;var t=e;do{if(this===t)return!0;t=t.parentNode}while(t);return!1},getRootNode:function(e){var t=this;do{if(!t.parentNode)return t;t=t.parentNode}while(t)},isEqualNode:function(e){if(!e)return!1;for(var t=[{node:this,other:e}];t.length>0;){var n=t.pop(),r=n.node,i=n.other;if(r.nodeType!==i.nodeType)return!1;switch(r.nodeType){case r.DOCUMENT_TYPE_NODE:if(r.name!==i.name||r.publicId!==i.publicId||r.systemId!==i.systemId)return!1;break;case r.ELEMENT_NODE:if(r.namespaceURI!==i.namespaceURI||r.prefix!==i.prefix||r.localName!==i.localName||r.attributes.length!==i.attributes.length)return!1;for(var a=0;a<r.attributes.length;a++){var o=r.attributes.item(a),s=i.getAttributeNodeNS(o.namespaceURI,o.localName);if(!s)return!1;t.push({node:o,other:s})}break;case r.ATTRIBUTE_NODE:if(r.namespaceURI!==i.namespaceURI||r.localName!==i.localName||r.value!==i.value)return!1;break;case r.PROCESSING_INSTRUCTION_NODE:if(r.target!==i.target||r.data!==i.data)return!1;break;case r.TEXT_NODE:case r.CDATA_SECTION_NODE:case r.COMMENT_NODE:if(r.data!==i.data)return!1}if(r.childNodes.length!==i.childNodes.length)return!1;for(var a=r.childNodes.length-1;a>=0;a--)t.push({node:r.childNodes[a],other:i.childNodes[a]})}return!0},isSameNode:function(e){return this===e},insertBefore:function(e,t){return Oe(this,e,t)},replaceChild:function(e,t){Oe(this,e,t,De),t&&this.removeChild(t)},removeChild:function(e){return _e(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(e){return qe(this.ownerDocument||this,this,e)},normalize:function(){fe(this,null,{enter:function(e){for(var t=e.firstChild;t;){var n=t.nextSibling;if(n!==null&&n.nodeType===O&&t.nodeType===O){for(var r=[],i=n;i!==null&&i.nodeType===O;)r.push(i.data),i=i.nextSibling;for(var a=t.nextSibling;a!==i;){var o=a.nextSibling;a.parentNode=null,a.previousSibling=null,a.nextSibling=null,a=o}t.nextSibling=i,i===null?e.lastChild=t:i.previousSibling=t,t.appendData(r.join(``)),ge(e.ownerDocument,e),t=i}else t=n}return!0}})},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n){for(var r in n)if(i(n,r)&&n[r]===e)return r}t=t.nodeType==D?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&i(n,e))return n[e];t=t.nodeType==D?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return this.lookupPrefix(e)==null},compareDocumentPosition:function(e){if(this===e)return 0;var t=e,n=this,r=null,i=null;if(t instanceof Ae&&(r=t,t=r.ownerElement),n instanceof Ae&&(i=n,n=i.ownerElement,r&&t&&n===t))for(var a=0,o;o=n.attributes[a];a++){if(o===r)return R.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+R.DOCUMENT_POSITION_PRECEDING;if(o===i)return R.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+R.DOCUMENT_POSITION_FOLLOWING}if(!t||!n||n.ownerDocument!==t.ownerDocument)return R.DOCUMENT_POSITION_DISCONNECTED+R.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(ee(n.ownerDocument)>ee(t.ownerDocument)?R.DOCUMENT_POSITION_FOLLOWING:R.DOCUMENT_POSITION_PRECEDING);if(i&&t===n)return R.DOCUMENT_POSITION_CONTAINS+R.DOCUMENT_POSITION_PRECEDING;if(r&&t===n)return R.DOCUMENT_POSITION_CONTAINED_BY+R.DOCUMENT_POSITION_FOLLOWING;for(var s=[],c=t.parentNode;c;){if(!i&&c===n)return R.DOCUMENT_POSITION_CONTAINED_BY+R.DOCUMENT_POSITION_FOLLOWING;s.push(c),c=c.parentNode}s.reverse();for(var l=[],u=n.parentNode;u;){if(!r&&u===t)return R.DOCUMENT_POSITION_CONTAINS+R.DOCUMENT_POSITION_PRECEDING;l.push(u),u=u.parentNode}l.reverse();var d=z(s,l);for(var f in d.childNodes){var p=d.childNodes[f];if(p===n)return R.DOCUMENT_POSITION_FOLLOWING;if(p===t)return R.DOCUMENT_POSITION_PRECEDING;if(l.indexOf(p)>=0)return R.DOCUMENT_POSITION_FOLLOWING;if(s.indexOf(p)>=0)return R.DOCUMENT_POSITION_PRECEDING}return 0}};function ue(e){return e==`<`&&`<`||e==`>`&&`>`||e==`&`&&`&`||e==`"`&&`"`||`&#`+e.charCodeAt()+`;`}C(T,U),C(T,U.prototype),C(R,U),C(R,U.prototype);function de(e,t){fe(e,null,{enter:function(e){return!t(e)||fe.STOP}})}function fe(e,t,n){for(var r=[{node:e,context:t,phase:fe.ENTER}];r.length>0;){var i=r.pop();if(i.phase===fe.ENTER){var a=n.enter(i.node,i.context);if(a===fe.STOP)return fe.STOP;if(r.push({node:i.node,context:a,phase:fe.EXIT}),a==null)continue;for(var o=i.node.lastChild;o;)r.push({node:o,context:a,phase:fe.ENTER}),o=o.previousSibling}else n.exit&&n.exit(i.node,i.context)}}fe.STOP=Symbol(`walkDOM.STOP`),fe.ENTER=0,fe.EXIT=1;function pe(e,t){h(e);var n=t||{};this.ownerDocument=this,this.contentType=n.contentType||c.XML_APPLICATION,this.type=a(this.contentType)?`html`:`xml`}function me(e,t,n){e&&e._inc++,n.namespaceURI===l.XMLNS&&(t._nsMap[n.prefix?n.localName:``]=n.value)}function he(e,t,n,r){e&&e._inc++,n.namespaceURI===l.XMLNS&&delete t._nsMap[n.prefix?n.localName:``]}function ge(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n&&!n.nextSibling)r[r.length++]=n;else{for(var i=t.firstChild,a=0;i;)r[a++]=i,i=i.nextSibling;r.length=a,delete r[r.length]}}}function _e(e,t){if(e!==t.parentNode)throw new f(f.NOT_FOUND_ERR,`child's parent is not parent`);var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,ge(e.ownerDocument,e),t.parentNode=null,t.previousSibling=null,t.nextSibling=null,t}function ve(e){return e&&(e.nodeType===U.DOCUMENT_NODE||e.nodeType===U.DOCUMENT_FRAGMENT_NODE||e.nodeType===U.ELEMENT_NODE)}function ye(e){return e&&(e.nodeType===U.CDATA_SECTION_NODE||e.nodeType===U.COMMENT_NODE||e.nodeType===U.DOCUMENT_FRAGMENT_NODE||e.nodeType===U.DOCUMENT_TYPE_NODE||e.nodeType===U.ELEMENT_NODE||e.nodeType===U.PROCESSING_INSTRUCTION_NODE||e.nodeType===U.TEXT_NODE)}function be(e){return e&&e.nodeType===U.DOCUMENT_TYPE_NODE}function xe(e){return e&&e.nodeType===U.ELEMENT_NODE}function Se(e){return e&&e.nodeType===U.TEXT_NODE}function Ce(e,t){var r=e.childNodes||[];if(n(r,xe)||be(t))return!1;var i=n(r,be);return!(t&&i&&r.indexOf(i)>r.indexOf(t))}function we(e,t){var r=e.childNodes||[];function i(e){return xe(e)&&e!==t}if(n(r,i))return!1;var a=n(r,be);return!(t&&a&&r.indexOf(a)>r.indexOf(t))}function Te(e,t,n){if(!ve(e))throw new f(f.HIERARCHY_REQUEST_ERR,`Unexpected parent node type `+e.nodeType);if(n&&n.parentNode!==e)throw new f(f.NOT_FOUND_ERR,`child not in parent`);if(!ye(t)||be(t)&&e.nodeType!==U.DOCUMENT_NODE)throw new f(f.HIERARCHY_REQUEST_ERR,`Unexpected node type `+t.nodeType+` for parent node type `+e.nodeType)}function Ee(e,t,r){var i=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===U.DOCUMENT_FRAGMENT_NODE){var o=a.filter(xe);if(o.length>1||n(a,Se))throw new f(f.HIERARCHY_REQUEST_ERR,`More than one element or text in fragment`);if(o.length===1&&!Ce(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Element in fragment can not be inserted before doctype`)}if(xe(t)&&!Ce(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one element can be added and only after doctype`);if(be(t)){if(n(i,be))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one doctype is allowed`);var s=n(i,xe);if(r&&i.indexOf(s)<i.indexOf(r))throw new f(f.HIERARCHY_REQUEST_ERR,`Doctype can only be inserted before an element`);if(!r&&s)throw new f(f.HIERARCHY_REQUEST_ERR,`Doctype can not be appended since element is present`)}}function De(e,t,r){var i=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===U.DOCUMENT_FRAGMENT_NODE){var o=a.filter(xe);if(o.length>1||n(a,Se))throw new f(f.HIERARCHY_REQUEST_ERR,`More than one element or text in fragment`);if(o.length===1&&!we(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Element in fragment can not be inserted before doctype`)}if(xe(t)&&!we(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one element can be added and only after doctype`);if(be(t)){function e(e){return be(e)&&e!==r}if(n(i,e))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one doctype is allowed`);var s=n(i,xe);if(r&&i.indexOf(s)<i.indexOf(r))throw new f(f.HIERARCHY_REQUEST_ERR,`Doctype can only be inserted before an element`)}}function Oe(e,t,n,r){Te(e,t,n),e.nodeType===U.DOCUMENT_NODE&&(r||Ee)(e,t,n);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===I){var a=t.firstChild;if(a==null)return t;var o=t.lastChild}else a=o=t;var s=n?n.previousSibling:e.lastChild;a.previousSibling=s,o.nextSibling=n,s?s.nextSibling=a:e.firstChild=a,n==null?e.lastChild=o:n.previousSibling=o;do a.parentNode=e;while(a!==o&&(a=a.nextSibling));return ge(e.ownerDocument||e,e,t),t.nodeType==I&&(t.firstChild=t.lastChild=null),t}pe.prototype={implementation:null,nodeName:`#document`,nodeType:P,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType===I){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return Oe(this,e,t),e.ownerDocument=this,this.documentElement===null&&e.nodeType===E&&(this.documentElement=e),e},removeChild:function(e){var t=_e(this,e);return t===this.documentElement&&(this.documentElement=null),t},replaceChild:function(e,t){Oe(this,e,t,De),e.ownerDocument=this,t&&this.removeChild(t),xe(e)&&(this.documentElement=e)},importNode:function(e,t){return Ke(this,e,t)},getElementById:function(e){var t=null;return de(this.documentElement,function(n){if(n.nodeType==E&&n.getAttribute(`id`)==e)return t=n,!0}),t},createElement:function(e){var t=new ke(u);t.ownerDocument=this,this.type===`html`&&(e=e.toLowerCase()),r(this.contentType)&&(t.namespaceURI=l.HTML),t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new te;var n=t.attributes=new re;return n._ownerElement=t,t},createDocumentFragment:function(){var e=new ze(u);return e.ownerDocument=this,e.childNodes=new te,e},createTextNode:function(e){var t=new Me(u);return t.ownerDocument=this,t.childNodes=new te,t.appendData(e),t},createComment:function(e){var t=new Ne(u);return t.ownerDocument=this,t.childNodes=new te,t.appendData(e),t},createCDATASection:function(e){if(e.indexOf(`]]>`)!==-1)throw new f(f.INVALID_CHARACTER_ERR,`data contains "]]>"`);var t=new Pe(u);return t.ownerDocument=this,t.childNodes=new te,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new Be(u);return n.ownerDocument=this,n.childNodes=new te,n.nodeName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){if(!m.QName_exact.test(e))throw new f(f.INVALID_CHARACTER_ERR,`invalid character in name "`+e+`"`);return this.type===`html`&&(e=e.toLowerCase()),this._createAttribute(e)},_createAttribute:function(e){var t=new Ae(u);return t.ownerDocument=this,t.childNodes=new te,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){if(!m.Name_exact.test(e))throw new f(f.INVALID_CHARACTER_ERR,`not a valid xml name "`+e+`"`);if(this.type===`html`)throw new f(`document is an html document`,p.NotSupportedError);var t=new Re(u);return t.ownerDocument=this,t.childNodes=new te,t.nodeName=e,t},createElementNS:function(e,t){var n=S(e,t),r=new ke(u),i=r.attributes=new re;return r.childNodes=new te,r.ownerDocument=this,r.nodeName=t,r.tagName=t,r.namespaceURI=n[0],r.prefix=n[1],r.localName=n[2],i._ownerElement=r,r},createAttributeNS:function(e,t){var n=S(e,t),r=new Ae(u);return r.ownerDocument=this,r.childNodes=new te,r.nodeName=t,r.name=t,r.specified=!0,r.namespaceURI=n[0],r.prefix=n[1],r.localName=n[2],r}},w(pe,U);function ke(e){h(e),this._nsMap=Object.create(null)}ke.prototype={nodeType:E,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+`:`+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return this.ownerDocument.type===`html`&&this.namespaceURI===l.HTML},hasAttributes:function(){return!!(this.attributes&&this.attributes.length)},hasAttribute:function(e){return!!this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t?t.value:null},getAttributeNode:function(e){return this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase()),this.attributes.getNamedItem(e)},setAttribute:function(e,t){this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());var n=this.getAttributeNode(e);n?n.value=n.nodeValue=``+t:(n=this.ownerDocument._createAttribute(e),n.value=n.nodeValue=``+t,this.setAttributeNode(n))},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n?n.value:null},setAttributeNS:function(e,t,n){var r=S(e,t)[2],i=this.getAttributeNodeNS(e,r);i?i.value=i.nodeValue=``+n:(i=this.ownerDocument.createAttributeNS(e,t),i.value=i.nodeValue=``+n,this.setAttributeNode(i))},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByClassName:function(e){var t=y(e);return new B(this,function(n){var r=[];return t.length>0&&de(n,function(i){if(i!==n&&i.nodeType===E){var a=i.getAttribute(`class`);if(a){var o=e===a;if(!o){var s=y(a);o=t.every(b(s))}o&&r.push(i)}}}),r})},getElementsByTagName:function(e){var t=(this.nodeType===P?this:this.ownerDocument).type===`html`,n=e.toLowerCase();return new B(this,function(r){var i=[];return de(r,function(a){a!==r&&a.nodeType===E&&(e===`*`||a.getQualifiedName()===(t&&a.namespaceURI===l.HTML?n:e))&&i.push(a)}),i})},getElementsByTagNameNS:function(e,t){return new B(this,function(n){var r=[];return de(n,function(i){i!==n&&i.nodeType===E&&(e===`*`||i.namespaceURI===e)&&(t===`*`||i.localName==t)&&r.push(i)}),r})}},pe.prototype.getElementsByClassName=ke.prototype.getElementsByClassName,pe.prototype.getElementsByTagName=ke.prototype.getElementsByTagName,pe.prototype.getElementsByTagNameNS=ke.prototype.getElementsByTagNameNS,w(ke,U);function Ae(e){h(e),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}Ae.prototype.nodeType=D,w(Ae,U);function je(e){h(e)}je.prototype={data:``,substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},deleteData:function(e,t){this.replaceData(e,t,``)},replaceData:function(e,t,n){var r=this.data.substring(0,e),i=this.data.substring(e+t);n=r+n+i,this.nodeValue=this.data=n,this.length=n.length}},w(je,U);function Me(e){h(e)}Me.prototype={nodeName:`#text`,nodeType:O,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},w(Me,je);function Ne(e){h(e)}Ne.prototype={nodeName:`#comment`,nodeType:N},w(Ne,je);function Pe(e){h(e)}Pe.prototype={nodeName:`#cdata-section`,nodeType:k},w(Pe,Me);function Fe(e){h(e)}Fe.prototype.nodeType=F,w(Fe,U);function Ie(e){h(e)}Ie.prototype.nodeType=L,w(Ie,U);function Le(e){h(e)}Le.prototype.nodeType=j,w(Le,U);function Re(e){h(e)}Re.prototype.nodeType=A,w(Re,U);function ze(e){h(e)}ze.prototype.nodeName=`#document-fragment`,ze.prototype.nodeType=I,w(ze,U);function Be(e){h(e)}Be.prototype.nodeType=M,w(Be,je);function Ve(){}Ve.prototype.serializeToString=function(e,t){return He.call(e,t)},U.prototype.toString=He;function He(e){var t=typeof e==`function`?{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:e}:e==null?{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null}:{requireWellFormed:!!e.requireWellFormed,splitCDATASections:e.splitCDATASections!==!1,nodeFilter:e.nodeFilter||null},n=[],r=this.nodeType===P&&this.documentElement||this,i=r.prefix,a=r.namespaceURI;if(a&&i==null){var i=r.lookupPrefix(a);if(i==null)var o=[{namespace:a,prefix:null}]}return Ge(this,n,o,t),n.join(``)}function Ue(e,t,n){var r=e.prefix||``,i=e.namespaceURI;if(!i||r===`xml`&&i===l.XML||i===l.XMLNS)return!1;for(var a=n.length;a--;){var o=n[a];if(o.prefix===r)return o.namespace!==i}return!0}function We(e,t,n,r){if(r&&!m.QName_exact.test(t))throw new f(`The attribute name "`+t+`" is not a valid XML QName`,p.InvalidStateError);e.push(` `,t,`="`,n.replace(/[<>&"\t\n\r]/g,ue),`"`)}function Ge(e,t,n,r){n||=[];var i=r.nodeFilter,a=r.requireWellFormed,c=r.splitCDATASections,u=(e.nodeType===P?e:e.ownerDocument).type===`html`;fe(e,{ns:n},{enter:function(e,n){var d=n.ns;if(i){if(e=i(e),e){if(typeof e==`string`)return t.push(e),null}else return null}switch(e.nodeType){case E:var h=e.attributes,g=h.length,_=e.tagName,v=_;if(!u&&!e.prefix&&e.namespaceURI){for(var y,b=0;b<h.length;b++)if(h.item(b).name===`xmlns`){y=h.item(b).value;break}if(!y)for(var x=d.length-1;x>=0;x--){var S=d[x];if(S.prefix===``&&S.namespace===e.namespaceURI){y=S.namespace;break}}if(y!==e.namespaceURI)for(var x=d.length-1;x>=0;x--){var S=d[x];if(S.namespace===e.namespaceURI){S.prefix&&(v=S.prefix+`:`+_);break}}}if(a&&!m.QName_exact.test(v))throw new f(`The element name "`+v+`" is not a valid XML QName`,p.InvalidStateError);t.push(`<`,v);for(var C=d.slice(),w=0;w<g;w++){var T=h.item(w);T.prefix==`xmlns`?C.push({prefix:T.localName,namespace:T.value}):T.nodeName==`xmlns`&&C.push({prefix:``,namespace:T.value})}for(var w=0;w<g;w++){var T=h.item(w);if(Ue(T,u,C)){var j=T.prefix||``,L=T.namespaceURI;We(t,j?`xmlns:`+j:`xmlns`,L,a),C.push({prefix:j,namespace:L})}var R=i?i(T):T;R&&(typeof R==`string`?t.push(R):We(t,R.name,R.value,a))}if(_===v&&Ue(e,u,C)){var z=e.prefix||``,L=e.namespaceURI;We(t,z?`xmlns:`+z:`xmlns`,L,a),C.push({prefix:z,namespace:L})}var ee=!e.firstChild;if(ee&&(u||e.namespaceURI===l.HTML)&&(ee=s(_)),ee)return t.push(`/>`),null;if(t.push(`>`),u&&o(_)){for(var te=e.firstChild;te;)te.data?t.push(te.data):Ge(te,t,C.slice(),r),te=te.nextSibling;return t.push(`</`,v,`>`),null}return{ns:C,tag:v};case P:case I:if(a&&e.nodeType===P&&e.documentElement==null)throw new f(`The Document has no documentElement`,p.InvalidStateError);return{ns:d};case D:return We(t,e.name,e.value,a),null;case O:if(a&&m.InvalidChar.test(e.data))throw new f(`The Text node data contains characters outside the XML Char production`,p.InvalidStateError);return t.push(e.data.replace(/[<&>]/g,ue)),null;case k:if(a&&e.data.indexOf(`]]>`)!==-1)throw new f(`The CDATASection data contains "]]>"`,p.InvalidStateError);return c?t.push(m.CDATA_START,e.data.replace(/]]>/g,`]]]]><![CDATA[>`),m.CDATA_END):t.push(m.CDATA_START,e.data,m.CDATA_END),null;case N:if(a){if(m.InvalidChar.test(e.data))throw new f(`The comment node data contains characters outside the XML Char production`,p.InvalidStateError);if(e.data.indexOf(`--`)!==-1||e.data[e.data.length-1]===`-`)throw new f(`The comment node data contains "--" or ends with "-"`,p.InvalidStateError)}return t.push(m.COMMENT_START,e.data,m.COMMENT_END),null;case F:var B=e.publicId,ne=e.systemId;if(a){if(!m.Name_exact.test(e.name))throw new f(`The doctype name "`+e.name+`" is not a valid XML Name`,p.InvalidStateError);if(B&&!m.PubidLiteral_match.test(B))throw new f(`DocumentType publicId is not a valid PubidLiteral`,p.InvalidStateError);if(ne&&ne!==`.`&&!m.SystemLiteral_match.test(ne))throw new f(`DocumentType systemId is not a valid SystemLiteral`,p.InvalidStateError);if(e.internalSubset&&e.internalSubset.indexOf(`]>`)!==-1)throw new f(`DocumentType internalSubset contains "]>"`,p.InvalidStateError)}return t.push(m.DOCTYPE_DECL_START,` `,e.name),B?(t.push(` `,m.PUBLIC,` `,B),ne&&ne!==`.`&&t.push(` `,ne)):ne&&ne!==`.`&&t.push(` `,m.SYSTEM,` `,ne),e.internalSubset&&t.push(` [`,e.internalSubset,`]`),t.push(`>`),null;case M:if(a){if(!m.NCName_exact.test(e.target)||e.target.toLowerCase()===`xml`)throw new f(`The processing instruction target "`+e.target+`" is not a valid XML NCName or is reserved`,p.InvalidStateError);if(m.InvalidChar.test(e.data))throw new f(`The ProcessingInstruction data contains characters outside the XML Char production`,p.InvalidStateError);if(e.data.indexOf(`?>`)!==-1)throw new f(`The ProcessingInstruction data contains "?>"`,p.InvalidStateError)}return t.push(`<?`,e.target,` `,e.data,`?>`),null;case A:if(a&&!m.Name_exact.test(e.nodeName))throw new f(`The entity reference name "`+e.nodeName+`" is not a valid XML Name`,p.InvalidStateError);return t.push(`&`,e.nodeName,`;`),null;default:return t.push(`??`,e.nodeName),null}},exit:function(e,n){n&&n.tag&&t.push(`</`,n.tag,`>`)}})}function Ke(e,t,n){var r;return fe(t,null,{enter:function(t,i){var a=t.cloneNode(!1);return a.ownerDocument=e,a.parentNode=null,i===null?r=a:i.appendChild(a),t.nodeType===D||n?a:null}}),r}function qe(e,t,n){var r;return fe(t,null,{enter:function(t,a){var o=new t.constructor(u);for(var s in t)if(i(t,s)){var c=t[s];typeof c!=`object`&&c!=o[s]&&(o[s]=c)}t.childNodes&&(o.childNodes=new te),o.ownerDocument=e;var l=n;switch(o.nodeType){case E:var d=t.attributes,f=o.attributes=new re,p=d.length;f._ownerElement=o;for(var m=0;m<p;m++)o.setAttributeNode(qe(e,d.item(m),!0));break;case D:l=!0}return a===null?r=o:a.appendChild(o),l?o:null}}),r}function Je(e,t,n){e[t]=n}function Ye(e){for(var t=[],n=e.firstChild;n;)n.nodeType===E&&t.push(n),n=n.nextSibling;return t}try{Object.defineProperty&&(Object.defineProperty(B.prototype,"length",{get:function(){return ne(this),this.$$length}}),Object.defineProperty(U.prototype,"textContent",{get:function(){if(this.nodeType===E||this.nodeType===I){var e=[];return fe(this,null,{enter:function(t){if(t.nodeType===E||t.nodeType===I)return!0;if(t.nodeType===M||t.nodeType===N)return null;e.push(t.nodeValue)}}),e.join(``)}return this.nodeValue},set:function(e){switch(this.nodeType){case E:case I:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Object.defineProperty(je.prototype,"data",{get:function(){return this._data==null?``:this._data},set:function(e){this._data=e,this.length=typeof e==`string`?e.length:0}}),Object.defineProperty(je.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!0,configurable:!0}),Object.defineProperty(ke.prototype,"children",{get:function(){return new B(this,Ye)}}),Object.defineProperty(pe.prototype,"children",{get:function(){return new B(this,Ye)}}),Object.defineProperty(ze.prototype,"children",{get:function(){return new B(this,Ye)}}),Je=function(e,t,n){e[`$$`+t]=n})}catch{}e._updateLiveList=ne,e.Attr=Ae,e.CDATASection=Pe,e.CharacterData=je,e.Comment=Ne,e.Document=pe,e.DocumentFragment=ze,e.DocumentType=Fe,e.DOMImplementation=le,e.Element=ke,e.Entity=Le,e.EntityReference=Re,e.LiveNodeList=B,e.NamedNodeMap=re,e.Node=U,e.NodeList=te,e.Notation=Ie,e.Text=Me,e.ProcessingInstruction=Be,e.walkDOM=fe,e.XMLSerializer=Ve})),vV=o((e=>{var t=mV().freeze;e.XML_ENTITIES=t({amp:`&`,apos:`'`,gt:`>`,lt:`<`,quot:`"`}),e.HTML_ENTITIES=t({Aacute:`Á`,aacute:`á`,Abreve:`Ă`,abreve:`ă`,ac:`∾`,acd:`∿`,acE:`∾̳`,Acirc:`Â`,acirc:`â`,acute:`´`,Acy:`А`,acy:`а`,AElig:`Æ`,aelig:`æ`,af:``,Afr:`𝔄`,afr:`𝔞`,Agrave:`À`,agrave:`à`,alefsym:`ℵ`,aleph:`ℵ`,Alpha:`Α`,alpha:`α`,Amacr:`Ā`,amacr:`ā`,amalg:`⨿`,AMP:`&`,amp:`&`,And:`⩓`,and:`∧`,andand:`⩕`,andd:`⩜`,andslope:`⩘`,andv:`⩚`,ang:`∠`,ange:`⦤`,angle:`∠`,angmsd:`∡`,angmsdaa:`⦨`,angmsdab:`⦩`,angmsdac:`⦪`,angmsdad:`⦫`,angmsdae:`⦬`,angmsdaf:`⦭`,angmsdag:`⦮`,angmsdah:`⦯`,angrt:`∟`,angrtvb:`⊾`,angrtvbd:`⦝`,angsph:`∢`,angst:`Å`,angzarr:`⍼`,Aogon:`Ą`,aogon:`ą`,Aopf:`𝔸`,aopf:`𝕒`,ap:`≈`,apacir:`⩯`,apE:`⩰`,ape:`≊`,apid:`≋`,apos:`'`,ApplyFunction:``,approx:`≈`,approxeq:`≊`,Aring:`Å`,aring:`å`,Ascr:`𝒜`,ascr:`𝒶`,Assign:`≔`,ast:`*`,asymp:`≈`,asympeq:`≍`,Atilde:`Ã`,atilde:`ã`,Auml:`Ä`,auml:`ä`,awconint:`∳`,awint:`⨑`,backcong:`≌`,backepsilon:`϶`,backprime:`‵`,backsim:`∽`,backsimeq:`⋍`,Backslash:`∖`,Barv:`⫧`,barvee:`⊽`,Barwed:`⌆`,barwed:`⌅`,barwedge:`⌅`,bbrk:`⎵`,bbrktbrk:`⎶`,bcong:`≌`,Bcy:`Б`,bcy:`б`,bdquo:`„`,becaus:`∵`,Because:`∵`,because:`∵`,bemptyv:`⦰`,bepsi:`϶`,bernou:`ℬ`,Bernoullis:`ℬ`,Beta:`Β`,beta:`β`,beth:`ℶ`,between:`≬`,Bfr:`𝔅`,bfr:`𝔟`,bigcap:`⋂`,bigcirc:`◯`,bigcup:`⋃`,bigodot:`⨀`,bigoplus:`⨁`,bigotimes:`⨂`,bigsqcup:`⨆`,bigstar:`★`,bigtriangledown:`▽`,bigtriangleup:`△`,biguplus:`⨄`,bigvee:`⋁`,bigwedge:`⋀`,bkarow:`⤍`,blacklozenge:`⧫`,blacksquare:`▪`,blacktriangle:`▴`,blacktriangledown:`▾`,blacktriangleleft:`◂`,blacktriangleright:`▸`,blank:`␣`,blk12:`▒`,blk14:`░`,blk34:`▓`,block:`█`,bne:`=⃥`,bnequiv:`≡⃥`,bNot:`⫭`,bnot:`⌐`,Bopf:`𝔹`,bopf:`𝕓`,bot:`⊥`,bottom:`⊥`,bowtie:`⋈`,boxbox:`⧉`,boxDL:`╗`,boxDl:`╖`,boxdL:`╕`,boxdl:`┐`,boxDR:`╔`,boxDr:`╓`,boxdR:`╒`,boxdr:`┌`,boxH:`═`,boxh:`─`,boxHD:`╦`,boxHd:`╤`,boxhD:`╥`,boxhd:`┬`,boxHU:`╩`,boxHu:`╧`,boxhU:`╨`,boxhu:`┴`,boxminus:`⊟`,boxplus:`⊞`,boxtimes:`⊠`,boxUL:`╝`,boxUl:`╜`,boxuL:`╛`,boxul:`┘`,boxUR:`╚`,boxUr:`╙`,boxuR:`╘`,boxur:`└`,boxV:`║`,boxv:`│`,boxVH:`╬`,boxVh:`╫`,boxvH:`╪`,boxvh:`┼`,boxVL:`╣`,boxVl:`╢`,boxvL:`╡`,boxvl:`┤`,boxVR:`╠`,boxVr:`╟`,boxvR:`╞`,boxvr:`├`,bprime:`‵`,Breve:`˘`,breve:`˘`,brvbar:`¦`,Bscr:`ℬ`,bscr:`𝒷`,bsemi:`⁏`,bsim:`∽`,bsime:`⋍`,bsol:`\\`,bsolb:`⧅`,bsolhsub:`⟈`,bull:`•`,bullet:`•`,bump:`≎`,bumpE:`⪮`,bumpe:`≏`,Bumpeq:`≎`,bumpeq:`≏`,Cacute:`Ć`,cacute:`ć`,Cap:`⋒`,cap:`∩`,capand:`⩄`,capbrcup:`⩉`,capcap:`⩋`,capcup:`⩇`,capdot:`⩀`,CapitalDifferentialD:`ⅅ`,caps:`∩︀`,caret:`⁁`,caron:`ˇ`,Cayleys:`ℭ`,ccaps:`⩍`,Ccaron:`Č`,ccaron:`č`,Ccedil:`Ç`,ccedil:`ç`,Ccirc:`Ĉ`,ccirc:`ĉ`,Cconint:`∰`,ccups:`⩌`,ccupssm:`⩐`,Cdot:`Ċ`,cdot:`ċ`,cedil:`¸`,Cedilla:`¸`,cemptyv:`⦲`,cent:`¢`,CenterDot:`·`,centerdot:`·`,Cfr:`ℭ`,cfr:`𝔠`,CHcy:`Ч`,chcy:`ч`,check:`✓`,checkmark:`✓`,Chi:`Χ`,chi:`χ`,cir:`○`,circ:`ˆ`,circeq:`≗`,circlearrowleft:`↺`,circlearrowright:`↻`,circledast:`⊛`,circledcirc:`⊚`,circleddash:`⊝`,CircleDot:`⊙`,circledR:`®`,circledS:`Ⓢ`,CircleMinus:`⊖`,CirclePlus:`⊕`,CircleTimes:`⊗`,cirE:`⧃`,cire:`≗`,cirfnint:`⨐`,cirmid:`⫯`,cirscir:`⧂`,ClockwiseContourIntegral:`∲`,CloseCurlyDoubleQuote:`”`,CloseCurlyQuote:`’`,clubs:`♣`,clubsuit:`♣`,Colon:`∷`,colon:`:`,Colone:`⩴`,colone:`≔`,coloneq:`≔`,comma:`,`,commat:`@`,comp:`∁`,compfn:`∘`,complement:`∁`,complexes:`ℂ`,cong:`≅`,congdot:`⩭`,Congruent:`≡`,Conint:`∯`,conint:`∮`,ContourIntegral:`∮`,Copf:`ℂ`,copf:`𝕔`,coprod:`∐`,Coproduct:`∐`,COPY:`©`,copy:`©`,copysr:`℗`,CounterClockwiseContourIntegral:`∳`,crarr:`↵`,Cross:`⨯`,cross:`✗`,Cscr:`𝒞`,cscr:`𝒸`,csub:`⫏`,csube:`⫑`,csup:`⫐`,csupe:`⫒`,ctdot:`⋯`,cudarrl:`⤸`,cudarrr:`⤵`,cuepr:`⋞`,cuesc:`⋟`,cularr:`↶`,cularrp:`⤽`,Cup:`⋓`,cup:`∪`,cupbrcap:`⩈`,CupCap:`≍`,cupcap:`⩆`,cupcup:`⩊`,cupdot:`⊍`,cupor:`⩅`,cups:`∪︀`,curarr:`↷`,curarrm:`⤼`,curlyeqprec:`⋞`,curlyeqsucc:`⋟`,curlyvee:`⋎`,curlywedge:`⋏`,curren:`¤`,curvearrowleft:`↶`,curvearrowright:`↷`,cuvee:`⋎`,cuwed:`⋏`,cwconint:`∲`,cwint:`∱`,cylcty:`⌭`,Dagger:`‡`,dagger:`†`,daleth:`ℸ`,Darr:`↡`,dArr:`⇓`,darr:`↓`,dash:`‐`,Dashv:`⫤`,dashv:`⊣`,dbkarow:`⤏`,dblac:`˝`,Dcaron:`Ď`,dcaron:`ď`,Dcy:`Д`,dcy:`д`,DD:`ⅅ`,dd:`ⅆ`,ddagger:`‡`,ddarr:`⇊`,DDotrahd:`⤑`,ddotseq:`⩷`,deg:`°`,Del:`∇`,Delta:`Δ`,delta:`δ`,demptyv:`⦱`,dfisht:`⥿`,Dfr:`𝔇`,dfr:`𝔡`,dHar:`⥥`,dharl:`⇃`,dharr:`⇂`,DiacriticalAcute:`´`,DiacriticalDot:`˙`,DiacriticalDoubleAcute:`˝`,DiacriticalGrave:"`",DiacriticalTilde:`˜`,diam:`⋄`,Diamond:`⋄`,diamond:`⋄`,diamondsuit:`♦`,diams:`♦`,die:`¨`,DifferentialD:`ⅆ`,digamma:`ϝ`,disin:`⋲`,div:`÷`,divide:`÷`,divideontimes:`⋇`,divonx:`⋇`,DJcy:`Ђ`,djcy:`ђ`,dlcorn:`⌞`,dlcrop:`⌍`,dollar:`$`,Dopf:`𝔻`,dopf:`𝕕`,Dot:`¨`,dot:`˙`,DotDot:`⃜`,doteq:`≐`,doteqdot:`≑`,DotEqual:`≐`,dotminus:`∸`,dotplus:`∔`,dotsquare:`⊡`,doublebarwedge:`⌆`,DoubleContourIntegral:`∯`,DoubleDot:`¨`,DoubleDownArrow:`⇓`,DoubleLeftArrow:`⇐`,DoubleLeftRightArrow:`⇔`,DoubleLeftTee:`⫤`,DoubleLongLeftArrow:`⟸`,DoubleLongLeftRightArrow:`⟺`,DoubleLongRightArrow:`⟹`,DoubleRightArrow:`⇒`,DoubleRightTee:`⊨`,DoubleUpArrow:`⇑`,DoubleUpDownArrow:`⇕`,DoubleVerticalBar:`∥`,DownArrow:`↓`,Downarrow:`⇓`,downarrow:`↓`,DownArrowBar:`⤓`,DownArrowUpArrow:`⇵`,DownBreve:`̑`,downdownarrows:`⇊`,downharpoonleft:`⇃`,downharpoonright:`⇂`,DownLeftRightVector:`⥐`,DownLeftTeeVector:`⥞`,DownLeftVector:`↽`,DownLeftVectorBar:`⥖`,DownRightTeeVector:`⥟`,DownRightVector:`⇁`,DownRightVectorBar:`⥗`,DownTee:`⊤`,DownTeeArrow:`↧`,drbkarow:`⤐`,drcorn:`⌟`,drcrop:`⌌`,Dscr:`𝒟`,dscr:`𝒹`,DScy:`Ѕ`,dscy:`ѕ`,dsol:`⧶`,Dstrok:`Đ`,dstrok:`đ`,dtdot:`⋱`,dtri:`▿`,dtrif:`▾`,duarr:`⇵`,duhar:`⥯`,dwangle:`⦦`,DZcy:`Џ`,dzcy:`џ`,dzigrarr:`⟿`,Eacute:`É`,eacute:`é`,easter:`⩮`,Ecaron:`Ě`,ecaron:`ě`,ecir:`≖`,Ecirc:`Ê`,ecirc:`ê`,ecolon:`≕`,Ecy:`Э`,ecy:`э`,eDDot:`⩷`,Edot:`Ė`,eDot:`≑`,edot:`ė`,ee:`ⅇ`,efDot:`≒`,Efr:`𝔈`,efr:`𝔢`,eg:`⪚`,Egrave:`È`,egrave:`è`,egs:`⪖`,egsdot:`⪘`,el:`⪙`,Element:`∈`,elinters:`⏧`,ell:`ℓ`,els:`⪕`,elsdot:`⪗`,Emacr:`Ē`,emacr:`ē`,empty:`∅`,emptyset:`∅`,EmptySmallSquare:`◻`,emptyv:`∅`,EmptyVerySmallSquare:`▫`,emsp:` `,emsp13:` `,emsp14:` `,ENG:`Ŋ`,eng:`ŋ`,ensp:` `,Eogon:`Ę`,eogon:`ę`,Eopf:`𝔼`,eopf:`𝕖`,epar:`⋕`,eparsl:`⧣`,eplus:`⩱`,epsi:`ε`,Epsilon:`Ε`,epsilon:`ε`,epsiv:`ϵ`,eqcirc:`≖`,eqcolon:`≕`,eqsim:`≂`,eqslantgtr:`⪖`,eqslantless:`⪕`,Equal:`⩵`,equals:`=`,EqualTilde:`≂`,equest:`≟`,Equilibrium:`⇌`,equiv:`≡`,equivDD:`⩸`,eqvparsl:`⧥`,erarr:`⥱`,erDot:`≓`,Escr:`ℰ`,escr:`ℯ`,esdot:`≐`,Esim:`⩳`,esim:`≂`,Eta:`Η`,eta:`η`,ETH:`Ð`,eth:`ð`,Euml:`Ë`,euml:`ë`,euro:`€`,excl:`!`,exist:`∃`,Exists:`∃`,expectation:`ℰ`,ExponentialE:`ⅇ`,exponentiale:`ⅇ`,fallingdotseq:`≒`,Fcy:`Ф`,fcy:`ф`,female:`♀`,ffilig:`ffi`,fflig:`ff`,ffllig:`ffl`,Ffr:`𝔉`,ffr:`𝔣`,filig:`fi`,FilledSmallSquare:`◼`,FilledVerySmallSquare:`▪`,fjlig:`fj`,flat:`♭`,fllig:`fl`,fltns:`▱`,fnof:`ƒ`,Fopf:`𝔽`,fopf:`𝕗`,ForAll:`∀`,forall:`∀`,fork:`⋔`,forkv:`⫙`,Fouriertrf:`ℱ`,fpartint:`⨍`,frac12:`½`,frac13:`⅓`,frac14:`¼`,frac15:`⅕`,frac16:`⅙`,frac18:`⅛`,frac23:`⅔`,frac25:`⅖`,frac34:`¾`,frac35:`⅗`,frac38:`⅜`,frac45:`⅘`,frac56:`⅚`,frac58:`⅝`,frac78:`⅞`,frasl:`⁄`,frown:`⌢`,Fscr:`ℱ`,fscr:`𝒻`,gacute:`ǵ`,Gamma:`Γ`,gamma:`γ`,Gammad:`Ϝ`,gammad:`ϝ`,gap:`⪆`,Gbreve:`Ğ`,gbreve:`ğ`,Gcedil:`Ģ`,Gcirc:`Ĝ`,gcirc:`ĝ`,Gcy:`Г`,gcy:`г`,Gdot:`Ġ`,gdot:`ġ`,gE:`≧`,ge:`≥`,gEl:`⪌`,gel:`⋛`,geq:`≥`,geqq:`≧`,geqslant:`⩾`,ges:`⩾`,gescc:`⪩`,gesdot:`⪀`,gesdoto:`⪂`,gesdotol:`⪄`,gesl:`⋛︀`,gesles:`⪔`,Gfr:`𝔊`,gfr:`𝔤`,Gg:`⋙`,gg:`≫`,ggg:`⋙`,gimel:`ℷ`,GJcy:`Ѓ`,gjcy:`ѓ`,gl:`≷`,gla:`⪥`,glE:`⪒`,glj:`⪤`,gnap:`⪊`,gnapprox:`⪊`,gnE:`≩`,gne:`⪈`,gneq:`⪈`,gneqq:`≩`,gnsim:`⋧`,Gopf:`𝔾`,gopf:`𝕘`,grave:"`",GreaterEqual:`≥`,GreaterEqualLess:`⋛`,GreaterFullEqual:`≧`,GreaterGreater:`⪢`,GreaterLess:`≷`,GreaterSlantEqual:`⩾`,GreaterTilde:`≳`,Gscr:`𝒢`,gscr:`ℊ`,gsim:`≳`,gsime:`⪎`,gsiml:`⪐`,Gt:`≫`,GT:`>`,gt:`>`,gtcc:`⪧`,gtcir:`⩺`,gtdot:`⋗`,gtlPar:`⦕`,gtquest:`⩼`,gtrapprox:`⪆`,gtrarr:`⥸`,gtrdot:`⋗`,gtreqless:`⋛`,gtreqqless:`⪌`,gtrless:`≷`,gtrsim:`≳`,gvertneqq:`≩︀`,gvnE:`≩︀`,Hacek:`ˇ`,hairsp:` `,half:`½`,hamilt:`ℋ`,HARDcy:`Ъ`,hardcy:`ъ`,hArr:`⇔`,harr:`↔`,harrcir:`⥈`,harrw:`↭`,Hat:`^`,hbar:`ℏ`,Hcirc:`Ĥ`,hcirc:`ĥ`,hearts:`♥`,heartsuit:`♥`,hellip:`…`,hercon:`⊹`,Hfr:`ℌ`,hfr:`𝔥`,HilbertSpace:`ℋ`,hksearow:`⤥`,hkswarow:`⤦`,hoarr:`⇿`,homtht:`∻`,hookleftarrow:`↩`,hookrightarrow:`↪`,Hopf:`ℍ`,hopf:`𝕙`,horbar:`―`,HorizontalLine:`─`,Hscr:`ℋ`,hscr:`𝒽`,hslash:`ℏ`,Hstrok:`Ħ`,hstrok:`ħ`,HumpDownHump:`≎`,HumpEqual:`≏`,hybull:`⁃`,hyphen:`‐`,Iacute:`Í`,iacute:`í`,ic:``,Icirc:`Î`,icirc:`î`,Icy:`И`,icy:`и`,Idot:`İ`,IEcy:`Е`,iecy:`е`,iexcl:`¡`,iff:`⇔`,Ifr:`ℑ`,ifr:`𝔦`,Igrave:`Ì`,igrave:`ì`,ii:`ⅈ`,iiiint:`⨌`,iiint:`∭`,iinfin:`⧜`,iiota:`℩`,IJlig:`IJ`,ijlig:`ij`,Im:`ℑ`,Imacr:`Ī`,imacr:`ī`,image:`ℑ`,ImaginaryI:`ⅈ`,imagline:`ℐ`,imagpart:`ℑ`,imath:`ı`,imof:`⊷`,imped:`Ƶ`,Implies:`⇒`,in:`∈`,incare:`℅`,infin:`∞`,infintie:`⧝`,inodot:`ı`,Int:`∬`,int:`∫`,intcal:`⊺`,integers:`ℤ`,Integral:`∫`,intercal:`⊺`,Intersection:`⋂`,intlarhk:`⨗`,intprod:`⨼`,InvisibleComma:``,InvisibleTimes:``,IOcy:`Ё`,iocy:`ё`,Iogon:`Į`,iogon:`į`,Iopf:`𝕀`,iopf:`𝕚`,Iota:`Ι`,iota:`ι`,iprod:`⨼`,iquest:`¿`,Iscr:`ℐ`,iscr:`𝒾`,isin:`∈`,isindot:`⋵`,isinE:`⋹`,isins:`⋴`,isinsv:`⋳`,isinv:`∈`,it:``,Itilde:`Ĩ`,itilde:`ĩ`,Iukcy:`І`,iukcy:`і`,Iuml:`Ï`,iuml:`ï`,Jcirc:`Ĵ`,jcirc:`ĵ`,Jcy:`Й`,jcy:`й`,Jfr:`𝔍`,jfr:`𝔧`,jmath:`ȷ`,Jopf:`𝕁`,jopf:`𝕛`,Jscr:`𝒥`,jscr:`𝒿`,Jsercy:`Ј`,jsercy:`ј`,Jukcy:`Є`,jukcy:`є`,Kappa:`Κ`,kappa:`κ`,kappav:`ϰ`,Kcedil:`Ķ`,kcedil:`ķ`,Kcy:`К`,kcy:`к`,Kfr:`𝔎`,kfr:`𝔨`,kgreen:`ĸ`,KHcy:`Х`,khcy:`х`,KJcy:`Ќ`,kjcy:`ќ`,Kopf:`𝕂`,kopf:`𝕜`,Kscr:`𝒦`,kscr:`𝓀`,lAarr:`⇚`,Lacute:`Ĺ`,lacute:`ĺ`,laemptyv:`⦴`,lagran:`ℒ`,Lambda:`Λ`,lambda:`λ`,Lang:`⟪`,lang:`⟨`,langd:`⦑`,langle:`⟨`,lap:`⪅`,Laplacetrf:`ℒ`,laquo:`«`,Larr:`↞`,lArr:`⇐`,larr:`←`,larrb:`⇤`,larrbfs:`⤟`,larrfs:`⤝`,larrhk:`↩`,larrlp:`↫`,larrpl:`⤹`,larrsim:`⥳`,larrtl:`↢`,lat:`⪫`,lAtail:`⤛`,latail:`⤙`,late:`⪭`,lates:`⪭︀`,lBarr:`⤎`,lbarr:`⤌`,lbbrk:`❲`,lbrace:`{`,lbrack:`[`,lbrke:`⦋`,lbrksld:`⦏`,lbrkslu:`⦍`,Lcaron:`Ľ`,lcaron:`ľ`,Lcedil:`Ļ`,lcedil:`ļ`,lceil:`⌈`,lcub:`{`,Lcy:`Л`,lcy:`л`,ldca:`⤶`,ldquo:`“`,ldquor:`„`,ldrdhar:`⥧`,ldrushar:`⥋`,ldsh:`↲`,lE:`≦`,le:`≤`,LeftAngleBracket:`⟨`,LeftArrow:`←`,Leftarrow:`⇐`,leftarrow:`←`,LeftArrowBar:`⇤`,LeftArrowRightArrow:`⇆`,leftarrowtail:`↢`,LeftCeiling:`⌈`,LeftDoubleBracket:`⟦`,LeftDownTeeVector:`⥡`,LeftDownVector:`⇃`,LeftDownVectorBar:`⥙`,LeftFloor:`⌊`,leftharpoondown:`↽`,leftharpoonup:`↼`,leftleftarrows:`⇇`,LeftRightArrow:`↔`,Leftrightarrow:`⇔`,leftrightarrow:`↔`,leftrightarrows:`⇆`,leftrightharpoons:`⇋`,leftrightsquigarrow:`↭`,LeftRightVector:`⥎`,LeftTee:`⊣`,LeftTeeArrow:`↤`,LeftTeeVector:`⥚`,leftthreetimes:`⋋`,LeftTriangle:`⊲`,LeftTriangleBar:`⧏`,LeftTriangleEqual:`⊴`,LeftUpDownVector:`⥑`,LeftUpTeeVector:`⥠`,LeftUpVector:`↿`,LeftUpVectorBar:`⥘`,LeftVector:`↼`,LeftVectorBar:`⥒`,lEg:`⪋`,leg:`⋚`,leq:`≤`,leqq:`≦`,leqslant:`⩽`,les:`⩽`,lescc:`⪨`,lesdot:`⩿`,lesdoto:`⪁`,lesdotor:`⪃`,lesg:`⋚︀`,lesges:`⪓`,lessapprox:`⪅`,lessdot:`⋖`,lesseqgtr:`⋚`,lesseqqgtr:`⪋`,LessEqualGreater:`⋚`,LessFullEqual:`≦`,LessGreater:`≶`,lessgtr:`≶`,LessLess:`⪡`,lesssim:`≲`,LessSlantEqual:`⩽`,LessTilde:`≲`,lfisht:`⥼`,lfloor:`⌊`,Lfr:`𝔏`,lfr:`𝔩`,lg:`≶`,lgE:`⪑`,lHar:`⥢`,lhard:`↽`,lharu:`↼`,lharul:`⥪`,lhblk:`▄`,LJcy:`Љ`,ljcy:`љ`,Ll:`⋘`,ll:`≪`,llarr:`⇇`,llcorner:`⌞`,Lleftarrow:`⇚`,llhard:`⥫`,lltri:`◺`,Lmidot:`Ŀ`,lmidot:`ŀ`,lmoust:`⎰`,lmoustache:`⎰`,lnap:`⪉`,lnapprox:`⪉`,lnE:`≨`,lne:`⪇`,lneq:`⪇`,lneqq:`≨`,lnsim:`⋦`,loang:`⟬`,loarr:`⇽`,lobrk:`⟦`,LongLeftArrow:`⟵`,Longleftarrow:`⟸`,longleftarrow:`⟵`,LongLeftRightArrow:`⟷`,Longleftrightarrow:`⟺`,longleftrightarrow:`⟷`,longmapsto:`⟼`,LongRightArrow:`⟶`,Longrightarrow:`⟹`,longrightarrow:`⟶`,looparrowleft:`↫`,looparrowright:`↬`,lopar:`⦅`,Lopf:`𝕃`,lopf:`𝕝`,loplus:`⨭`,lotimes:`⨴`,lowast:`∗`,lowbar:`_`,LowerLeftArrow:`↙`,LowerRightArrow:`↘`,loz:`◊`,lozenge:`◊`,lozf:`⧫`,lpar:`(`,lparlt:`⦓`,lrarr:`⇆`,lrcorner:`⌟`,lrhar:`⇋`,lrhard:`⥭`,lrm:``,lrtri:`⊿`,lsaquo:`‹`,Lscr:`ℒ`,lscr:`𝓁`,Lsh:`↰`,lsh:`↰`,lsim:`≲`,lsime:`⪍`,lsimg:`⪏`,lsqb:`[`,lsquo:`‘`,lsquor:`‚`,Lstrok:`Ł`,lstrok:`ł`,Lt:`≪`,LT:`<`,lt:`<`,ltcc:`⪦`,ltcir:`⩹`,ltdot:`⋖`,lthree:`⋋`,ltimes:`⋉`,ltlarr:`⥶`,ltquest:`⩻`,ltri:`◃`,ltrie:`⊴`,ltrif:`◂`,ltrPar:`⦖`,lurdshar:`⥊`,luruhar:`⥦`,lvertneqq:`≨︀`,lvnE:`≨︀`,macr:`¯`,male:`♂`,malt:`✠`,maltese:`✠`,Map:`⤅`,map:`↦`,mapsto:`↦`,mapstodown:`↧`,mapstoleft:`↤`,mapstoup:`↥`,marker:`▮`,mcomma:`⨩`,Mcy:`М`,mcy:`м`,mdash:`—`,mDDot:`∺`,measuredangle:`∡`,MediumSpace:` `,Mellintrf:`ℳ`,Mfr:`𝔐`,mfr:`𝔪`,mho:`℧`,micro:`µ`,mid:`∣`,midast:`*`,midcir:`⫰`,middot:`·`,minus:`−`,minusb:`⊟`,minusd:`∸`,minusdu:`⨪`,MinusPlus:`∓`,mlcp:`⫛`,mldr:`…`,mnplus:`∓`,models:`⊧`,Mopf:`𝕄`,mopf:`𝕞`,mp:`∓`,Mscr:`ℳ`,mscr:`𝓂`,mstpos:`∾`,Mu:`Μ`,mu:`μ`,multimap:`⊸`,mumap:`⊸`,nabla:`∇`,Nacute:`Ń`,nacute:`ń`,nang:`∠⃒`,nap:`≉`,napE:`⩰̸`,napid:`≋̸`,napos:`ʼn`,napprox:`≉`,natur:`♮`,natural:`♮`,naturals:`ℕ`,nbsp:`\xA0`,nbump:`≎̸`,nbumpe:`≏̸`,ncap:`⩃`,Ncaron:`Ň`,ncaron:`ň`,Ncedil:`Ņ`,ncedil:`ņ`,ncong:`≇`,ncongdot:`⩭̸`,ncup:`⩂`,Ncy:`Н`,ncy:`н`,ndash:`–`,ne:`≠`,nearhk:`⤤`,neArr:`⇗`,nearr:`↗`,nearrow:`↗`,nedot:`≐̸`,NegativeMediumSpace:``,NegativeThickSpace:``,NegativeThinSpace:``,NegativeVeryThinSpace:``,nequiv:`≢`,nesear:`⤨`,nesim:`≂̸`,NestedGreaterGreater:`≫`,NestedLessLess:`≪`,NewLine:`
|
|
84
|
-
`,nexist:`∄`,nexists:`∄`,Nfr:`𝔑`,nfr:`𝔫`,ngE:`≧̸`,nge:`≱`,ngeq:`≱`,ngeqq:`≧̸`,ngeqslant:`⩾̸`,nges:`⩾̸`,nGg:`⋙̸`,ngsim:`≵`,nGt:`≫⃒`,ngt:`≯`,ngtr:`≯`,nGtv:`≫̸`,nhArr:`⇎`,nharr:`↮`,nhpar:`⫲`,ni:`∋`,nis:`⋼`,nisd:`⋺`,niv:`∋`,NJcy:`Њ`,njcy:`њ`,nlArr:`⇍`,nlarr:`↚`,nldr:`‥`,nlE:`≦̸`,nle:`≰`,nLeftarrow:`⇍`,nleftarrow:`↚`,nLeftrightarrow:`⇎`,nleftrightarrow:`↮`,nleq:`≰`,nleqq:`≦̸`,nleqslant:`⩽̸`,nles:`⩽̸`,nless:`≮`,nLl:`⋘̸`,nlsim:`≴`,nLt:`≪⃒`,nlt:`≮`,nltri:`⋪`,nltrie:`⋬`,nLtv:`≪̸`,nmid:`∤`,NoBreak:``,NonBreakingSpace:`\xA0`,Nopf:`ℕ`,nopf:`𝕟`,Not:`⫬`,not:`¬`,NotCongruent:`≢`,NotCupCap:`≭`,NotDoubleVerticalBar:`∦`,NotElement:`∉`,NotEqual:`≠`,NotEqualTilde:`≂̸`,NotExists:`∄`,NotGreater:`≯`,NotGreaterEqual:`≱`,NotGreaterFullEqual:`≧̸`,NotGreaterGreater:`≫̸`,NotGreaterLess:`≹`,NotGreaterSlantEqual:`⩾̸`,NotGreaterTilde:`≵`,NotHumpDownHump:`≎̸`,NotHumpEqual:`≏̸`,notin:`∉`,notindot:`⋵̸`,notinE:`⋹̸`,notinva:`∉`,notinvb:`⋷`,notinvc:`⋶`,NotLeftTriangle:`⋪`,NotLeftTriangleBar:`⧏̸`,NotLeftTriangleEqual:`⋬`,NotLess:`≮`,NotLessEqual:`≰`,NotLessGreater:`≸`,NotLessLess:`≪̸`,NotLessSlantEqual:`⩽̸`,NotLessTilde:`≴`,NotNestedGreaterGreater:`⪢̸`,NotNestedLessLess:`⪡̸`,notni:`∌`,notniva:`∌`,notnivb:`⋾`,notnivc:`⋽`,NotPrecedes:`⊀`,NotPrecedesEqual:`⪯̸`,NotPrecedesSlantEqual:`⋠`,NotReverseElement:`∌`,NotRightTriangle:`⋫`,NotRightTriangleBar:`⧐̸`,NotRightTriangleEqual:`⋭`,NotSquareSubset:`⊏̸`,NotSquareSubsetEqual:`⋢`,NotSquareSuperset:`⊐̸`,NotSquareSupersetEqual:`⋣`,NotSubset:`⊂⃒`,NotSubsetEqual:`⊈`,NotSucceeds:`⊁`,NotSucceedsEqual:`⪰̸`,NotSucceedsSlantEqual:`⋡`,NotSucceedsTilde:`≿̸`,NotSuperset:`⊃⃒`,NotSupersetEqual:`⊉`,NotTilde:`≁`,NotTildeEqual:`≄`,NotTildeFullEqual:`≇`,NotTildeTilde:`≉`,NotVerticalBar:`∤`,npar:`∦`,nparallel:`∦`,nparsl:`⫽⃥`,npart:`∂̸`,npolint:`⨔`,npr:`⊀`,nprcue:`⋠`,npre:`⪯̸`,nprec:`⊀`,npreceq:`⪯̸`,nrArr:`⇏`,nrarr:`↛`,nrarrc:`⤳̸`,nrarrw:`↝̸`,nRightarrow:`⇏`,nrightarrow:`↛`,nrtri:`⋫`,nrtrie:`⋭`,nsc:`⊁`,nsccue:`⋡`,nsce:`⪰̸`,Nscr:`𝒩`,nscr:`𝓃`,nshortmid:`∤`,nshortparallel:`∦`,nsim:`≁`,nsime:`≄`,nsimeq:`≄`,nsmid:`∤`,nspar:`∦`,nsqsube:`⋢`,nsqsupe:`⋣`,nsub:`⊄`,nsubE:`⫅̸`,nsube:`⊈`,nsubset:`⊂⃒`,nsubseteq:`⊈`,nsubseteqq:`⫅̸`,nsucc:`⊁`,nsucceq:`⪰̸`,nsup:`⊅`,nsupE:`⫆̸`,nsupe:`⊉`,nsupset:`⊃⃒`,nsupseteq:`⊉`,nsupseteqq:`⫆̸`,ntgl:`≹`,Ntilde:`Ñ`,ntilde:`ñ`,ntlg:`≸`,ntriangleleft:`⋪`,ntrianglelefteq:`⋬`,ntriangleright:`⋫`,ntrianglerighteq:`⋭`,Nu:`Ν`,nu:`ν`,num:`#`,numero:`№`,numsp:` `,nvap:`≍⃒`,nVDash:`⊯`,nVdash:`⊮`,nvDash:`⊭`,nvdash:`⊬`,nvge:`≥⃒`,nvgt:`>⃒`,nvHarr:`⤄`,nvinfin:`⧞`,nvlArr:`⤂`,nvle:`≤⃒`,nvlt:`<⃒`,nvltrie:`⊴⃒`,nvrArr:`⤃`,nvrtrie:`⊵⃒`,nvsim:`∼⃒`,nwarhk:`⤣`,nwArr:`⇖`,nwarr:`↖`,nwarrow:`↖`,nwnear:`⤧`,Oacute:`Ó`,oacute:`ó`,oast:`⊛`,ocir:`⊚`,Ocirc:`Ô`,ocirc:`ô`,Ocy:`О`,ocy:`о`,odash:`⊝`,Odblac:`Ő`,odblac:`ő`,odiv:`⨸`,odot:`⊙`,odsold:`⦼`,OElig:`Œ`,oelig:`œ`,ofcir:`⦿`,Ofr:`𝔒`,ofr:`𝔬`,ogon:`˛`,Ograve:`Ò`,ograve:`ò`,ogt:`⧁`,ohbar:`⦵`,ohm:`Ω`,oint:`∮`,olarr:`↺`,olcir:`⦾`,olcross:`⦻`,oline:`‾`,olt:`⧀`,Omacr:`Ō`,omacr:`ō`,Omega:`Ω`,omega:`ω`,Omicron:`Ο`,omicron:`ο`,omid:`⦶`,ominus:`⊖`,Oopf:`𝕆`,oopf:`𝕠`,opar:`⦷`,OpenCurlyDoubleQuote:`“`,OpenCurlyQuote:`‘`,operp:`⦹`,oplus:`⊕`,Or:`⩔`,or:`∨`,orarr:`↻`,ord:`⩝`,order:`ℴ`,orderof:`ℴ`,ordf:`ª`,ordm:`º`,origof:`⊶`,oror:`⩖`,orslope:`⩗`,orv:`⩛`,oS:`Ⓢ`,Oscr:`𝒪`,oscr:`ℴ`,Oslash:`Ø`,oslash:`ø`,osol:`⊘`,Otilde:`Õ`,otilde:`õ`,Otimes:`⨷`,otimes:`⊗`,otimesas:`⨶`,Ouml:`Ö`,ouml:`ö`,ovbar:`⌽`,OverBar:`‾`,OverBrace:`⏞`,OverBracket:`⎴`,OverParenthesis:`⏜`,par:`∥`,para:`¶`,parallel:`∥`,parsim:`⫳`,parsl:`⫽`,part:`∂`,PartialD:`∂`,Pcy:`П`,pcy:`п`,percnt:`%`,period:`.`,permil:`‰`,perp:`⊥`,pertenk:`‱`,Pfr:`𝔓`,pfr:`𝔭`,Phi:`Φ`,phi:`φ`,phiv:`ϕ`,phmmat:`ℳ`,phone:`☎`,Pi:`Π`,pi:`π`,pitchfork:`⋔`,piv:`ϖ`,planck:`ℏ`,planckh:`ℎ`,plankv:`ℏ`,plus:`+`,plusacir:`⨣`,plusb:`⊞`,pluscir:`⨢`,plusdo:`∔`,plusdu:`⨥`,pluse:`⩲`,PlusMinus:`±`,plusmn:`±`,plussim:`⨦`,plustwo:`⨧`,pm:`±`,Poincareplane:`ℌ`,pointint:`⨕`,Popf:`ℙ`,popf:`𝕡`,pound:`£`,Pr:`⪻`,pr:`≺`,prap:`⪷`,prcue:`≼`,prE:`⪳`,pre:`⪯`,prec:`≺`,precapprox:`⪷`,preccurlyeq:`≼`,Precedes:`≺`,PrecedesEqual:`⪯`,PrecedesSlantEqual:`≼`,PrecedesTilde:`≾`,preceq:`⪯`,precnapprox:`⪹`,precneqq:`⪵`,precnsim:`⋨`,precsim:`≾`,Prime:`″`,prime:`′`,primes:`ℙ`,prnap:`⪹`,prnE:`⪵`,prnsim:`⋨`,prod:`∏`,Product:`∏`,profalar:`⌮`,profline:`⌒`,profsurf:`⌓`,prop:`∝`,Proportion:`∷`,Proportional:`∝`,propto:`∝`,prsim:`≾`,prurel:`⊰`,Pscr:`𝒫`,pscr:`𝓅`,Psi:`Ψ`,psi:`ψ`,puncsp:` `,Qfr:`𝔔`,qfr:`𝔮`,qint:`⨌`,Qopf:`ℚ`,qopf:`𝕢`,qprime:`⁗`,Qscr:`𝒬`,qscr:`𝓆`,quaternions:`ℍ`,quatint:`⨖`,quest:`?`,questeq:`≟`,QUOT:`"`,quot:`"`,rAarr:`⇛`,race:`∽̱`,Racute:`Ŕ`,racute:`ŕ`,radic:`√`,raemptyv:`⦳`,Rang:`⟫`,rang:`⟩`,rangd:`⦒`,range:`⦥`,rangle:`⟩`,raquo:`»`,Rarr:`↠`,rArr:`⇒`,rarr:`→`,rarrap:`⥵`,rarrb:`⇥`,rarrbfs:`⤠`,rarrc:`⤳`,rarrfs:`⤞`,rarrhk:`↪`,rarrlp:`↬`,rarrpl:`⥅`,rarrsim:`⥴`,Rarrtl:`⤖`,rarrtl:`↣`,rarrw:`↝`,rAtail:`⤜`,ratail:`⤚`,ratio:`∶`,rationals:`ℚ`,RBarr:`⤐`,rBarr:`⤏`,rbarr:`⤍`,rbbrk:`❳`,rbrace:`}`,rbrack:`]`,rbrke:`⦌`,rbrksld:`⦎`,rbrkslu:`⦐`,Rcaron:`Ř`,rcaron:`ř`,Rcedil:`Ŗ`,rcedil:`ŗ`,rceil:`⌉`,rcub:`}`,Rcy:`Р`,rcy:`р`,rdca:`⤷`,rdldhar:`⥩`,rdquo:`”`,rdquor:`”`,rdsh:`↳`,Re:`ℜ`,real:`ℜ`,realine:`ℛ`,realpart:`ℜ`,reals:`ℝ`,rect:`▭`,REG:`®`,reg:`®`,ReverseElement:`∋`,ReverseEquilibrium:`⇋`,ReverseUpEquilibrium:`⥯`,rfisht:`⥽`,rfloor:`⌋`,Rfr:`ℜ`,rfr:`𝔯`,rHar:`⥤`,rhard:`⇁`,rharu:`⇀`,rharul:`⥬`,Rho:`Ρ`,rho:`ρ`,rhov:`ϱ`,RightAngleBracket:`⟩`,RightArrow:`→`,Rightarrow:`⇒`,rightarrow:`→`,RightArrowBar:`⇥`,RightArrowLeftArrow:`⇄`,rightarrowtail:`↣`,RightCeiling:`⌉`,RightDoubleBracket:`⟧`,RightDownTeeVector:`⥝`,RightDownVector:`⇂`,RightDownVectorBar:`⥕`,RightFloor:`⌋`,rightharpoondown:`⇁`,rightharpoonup:`⇀`,rightleftarrows:`⇄`,rightleftharpoons:`⇌`,rightrightarrows:`⇉`,rightsquigarrow:`↝`,RightTee:`⊢`,RightTeeArrow:`↦`,RightTeeVector:`⥛`,rightthreetimes:`⋌`,RightTriangle:`⊳`,RightTriangleBar:`⧐`,RightTriangleEqual:`⊵`,RightUpDownVector:`⥏`,RightUpTeeVector:`⥜`,RightUpVector:`↾`,RightUpVectorBar:`⥔`,RightVector:`⇀`,RightVectorBar:`⥓`,ring:`˚`,risingdotseq:`≓`,rlarr:`⇄`,rlhar:`⇌`,rlm:``,rmoust:`⎱`,rmoustache:`⎱`,rnmid:`⫮`,roang:`⟭`,roarr:`⇾`,robrk:`⟧`,ropar:`⦆`,Ropf:`ℝ`,ropf:`𝕣`,roplus:`⨮`,rotimes:`⨵`,RoundImplies:`⥰`,rpar:`)`,rpargt:`⦔`,rppolint:`⨒`,rrarr:`⇉`,Rrightarrow:`⇛`,rsaquo:`›`,Rscr:`ℛ`,rscr:`𝓇`,Rsh:`↱`,rsh:`↱`,rsqb:`]`,rsquo:`’`,rsquor:`’`,rthree:`⋌`,rtimes:`⋊`,rtri:`▹`,rtrie:`⊵`,rtrif:`▸`,rtriltri:`⧎`,RuleDelayed:`⧴`,ruluhar:`⥨`,rx:`℞`,Sacute:`Ś`,sacute:`ś`,sbquo:`‚`,Sc:`⪼`,sc:`≻`,scap:`⪸`,Scaron:`Š`,scaron:`š`,sccue:`≽`,scE:`⪴`,sce:`⪰`,Scedil:`Ş`,scedil:`ş`,Scirc:`Ŝ`,scirc:`ŝ`,scnap:`⪺`,scnE:`⪶`,scnsim:`⋩`,scpolint:`⨓`,scsim:`≿`,Scy:`С`,scy:`с`,sdot:`⋅`,sdotb:`⊡`,sdote:`⩦`,searhk:`⤥`,seArr:`⇘`,searr:`↘`,searrow:`↘`,sect:`§`,semi:`;`,seswar:`⤩`,setminus:`∖`,setmn:`∖`,sext:`✶`,Sfr:`𝔖`,sfr:`𝔰`,sfrown:`⌢`,sharp:`♯`,SHCHcy:`Щ`,shchcy:`щ`,SHcy:`Ш`,shcy:`ш`,ShortDownArrow:`↓`,ShortLeftArrow:`←`,shortmid:`∣`,shortparallel:`∥`,ShortRightArrow:`→`,ShortUpArrow:`↑`,shy:``,Sigma:`Σ`,sigma:`σ`,sigmaf:`ς`,sigmav:`ς`,sim:`∼`,simdot:`⩪`,sime:`≃`,simeq:`≃`,simg:`⪞`,simgE:`⪠`,siml:`⪝`,simlE:`⪟`,simne:`≆`,simplus:`⨤`,simrarr:`⥲`,slarr:`←`,SmallCircle:`∘`,smallsetminus:`∖`,smashp:`⨳`,smeparsl:`⧤`,smid:`∣`,smile:`⌣`,smt:`⪪`,smte:`⪬`,smtes:`⪬︀`,SOFTcy:`Ь`,softcy:`ь`,sol:`/`,solb:`⧄`,solbar:`⌿`,Sopf:`𝕊`,sopf:`𝕤`,spades:`♠`,spadesuit:`♠`,spar:`∥`,sqcap:`⊓`,sqcaps:`⊓︀`,sqcup:`⊔`,sqcups:`⊔︀`,Sqrt:`√`,sqsub:`⊏`,sqsube:`⊑`,sqsubset:`⊏`,sqsubseteq:`⊑`,sqsup:`⊐`,sqsupe:`⊒`,sqsupset:`⊐`,sqsupseteq:`⊒`,squ:`□`,Square:`□`,square:`□`,SquareIntersection:`⊓`,SquareSubset:`⊏`,SquareSubsetEqual:`⊑`,SquareSuperset:`⊐`,SquareSupersetEqual:`⊒`,SquareUnion:`⊔`,squarf:`▪`,squf:`▪`,srarr:`→`,Sscr:`𝒮`,sscr:`𝓈`,ssetmn:`∖`,ssmile:`⌣`,sstarf:`⋆`,Star:`⋆`,star:`☆`,starf:`★`,straightepsilon:`ϵ`,straightphi:`ϕ`,strns:`¯`,Sub:`⋐`,sub:`⊂`,subdot:`⪽`,subE:`⫅`,sube:`⊆`,subedot:`⫃`,submult:`⫁`,subnE:`⫋`,subne:`⊊`,subplus:`⪿`,subrarr:`⥹`,Subset:`⋐`,subset:`⊂`,subseteq:`⊆`,subseteqq:`⫅`,SubsetEqual:`⊆`,subsetneq:`⊊`,subsetneqq:`⫋`,subsim:`⫇`,subsub:`⫕`,subsup:`⫓`,succ:`≻`,succapprox:`⪸`,succcurlyeq:`≽`,Succeeds:`≻`,SucceedsEqual:`⪰`,SucceedsSlantEqual:`≽`,SucceedsTilde:`≿`,succeq:`⪰`,succnapprox:`⪺`,succneqq:`⪶`,succnsim:`⋩`,succsim:`≿`,SuchThat:`∋`,Sum:`∑`,sum:`∑`,sung:`♪`,Sup:`⋑`,sup:`⊃`,sup1:`¹`,sup2:`²`,sup3:`³`,supdot:`⪾`,supdsub:`⫘`,supE:`⫆`,supe:`⊇`,supedot:`⫄`,Superset:`⊃`,SupersetEqual:`⊇`,suphsol:`⟉`,suphsub:`⫗`,suplarr:`⥻`,supmult:`⫂`,supnE:`⫌`,supne:`⊋`,supplus:`⫀`,Supset:`⋑`,supset:`⊃`,supseteq:`⊇`,supseteqq:`⫆`,supsetneq:`⊋`,supsetneqq:`⫌`,supsim:`⫈`,supsub:`⫔`,supsup:`⫖`,swarhk:`⤦`,swArr:`⇙`,swarr:`↙`,swarrow:`↙`,swnwar:`⤪`,szlig:`ß`,Tab:` `,target:`⌖`,Tau:`Τ`,tau:`τ`,tbrk:`⎴`,Tcaron:`Ť`,tcaron:`ť`,Tcedil:`Ţ`,tcedil:`ţ`,Tcy:`Т`,tcy:`т`,tdot:`⃛`,telrec:`⌕`,Tfr:`𝔗`,tfr:`𝔱`,there4:`∴`,Therefore:`∴`,therefore:`∴`,Theta:`Θ`,theta:`θ`,thetasym:`ϑ`,thetav:`ϑ`,thickapprox:`≈`,thicksim:`∼`,ThickSpace:` `,thinsp:` `,ThinSpace:` `,thkap:`≈`,thksim:`∼`,THORN:`Þ`,thorn:`þ`,Tilde:`∼`,tilde:`˜`,TildeEqual:`≃`,TildeFullEqual:`≅`,TildeTilde:`≈`,times:`×`,timesb:`⊠`,timesbar:`⨱`,timesd:`⨰`,tint:`∭`,toea:`⤨`,top:`⊤`,topbot:`⌶`,topcir:`⫱`,Topf:`𝕋`,topf:`𝕥`,topfork:`⫚`,tosa:`⤩`,tprime:`‴`,TRADE:`™`,trade:`™`,triangle:`▵`,triangledown:`▿`,triangleleft:`◃`,trianglelefteq:`⊴`,triangleq:`≜`,triangleright:`▹`,trianglerighteq:`⊵`,tridot:`◬`,trie:`≜`,triminus:`⨺`,TripleDot:`⃛`,triplus:`⨹`,trisb:`⧍`,tritime:`⨻`,trpezium:`⏢`,Tscr:`𝒯`,tscr:`𝓉`,TScy:`Ц`,tscy:`ц`,TSHcy:`Ћ`,tshcy:`ћ`,Tstrok:`Ŧ`,tstrok:`ŧ`,twixt:`≬`,twoheadleftarrow:`↞`,twoheadrightarrow:`↠`,Uacute:`Ú`,uacute:`ú`,Uarr:`↟`,uArr:`⇑`,uarr:`↑`,Uarrocir:`⥉`,Ubrcy:`Ў`,ubrcy:`ў`,Ubreve:`Ŭ`,ubreve:`ŭ`,Ucirc:`Û`,ucirc:`û`,Ucy:`У`,ucy:`у`,udarr:`⇅`,Udblac:`Ű`,udblac:`ű`,udhar:`⥮`,ufisht:`⥾`,Ufr:`𝔘`,ufr:`𝔲`,Ugrave:`Ù`,ugrave:`ù`,uHar:`⥣`,uharl:`↿`,uharr:`↾`,uhblk:`▀`,ulcorn:`⌜`,ulcorner:`⌜`,ulcrop:`⌏`,ultri:`◸`,Umacr:`Ū`,umacr:`ū`,uml:`¨`,UnderBar:`_`,UnderBrace:`⏟`,UnderBracket:`⎵`,UnderParenthesis:`⏝`,Union:`⋃`,UnionPlus:`⊎`,Uogon:`Ų`,uogon:`ų`,Uopf:`𝕌`,uopf:`𝕦`,UpArrow:`↑`,Uparrow:`⇑`,uparrow:`↑`,UpArrowBar:`⤒`,UpArrowDownArrow:`⇅`,UpDownArrow:`↕`,Updownarrow:`⇕`,updownarrow:`↕`,UpEquilibrium:`⥮`,upharpoonleft:`↿`,upharpoonright:`↾`,uplus:`⊎`,UpperLeftArrow:`↖`,UpperRightArrow:`↗`,Upsi:`ϒ`,upsi:`υ`,upsih:`ϒ`,Upsilon:`Υ`,upsilon:`υ`,UpTee:`⊥`,UpTeeArrow:`↥`,upuparrows:`⇈`,urcorn:`⌝`,urcorner:`⌝`,urcrop:`⌎`,Uring:`Ů`,uring:`ů`,urtri:`◹`,Uscr:`𝒰`,uscr:`𝓊`,utdot:`⋰`,Utilde:`Ũ`,utilde:`ũ`,utri:`▵`,utrif:`▴`,uuarr:`⇈`,Uuml:`Ü`,uuml:`ü`,uwangle:`⦧`,vangrt:`⦜`,varepsilon:`ϵ`,varkappa:`ϰ`,varnothing:`∅`,varphi:`ϕ`,varpi:`ϖ`,varpropto:`∝`,vArr:`⇕`,varr:`↕`,varrho:`ϱ`,varsigma:`ς`,varsubsetneq:`⊊︀`,varsubsetneqq:`⫋︀`,varsupsetneq:`⊋︀`,varsupsetneqq:`⫌︀`,vartheta:`ϑ`,vartriangleleft:`⊲`,vartriangleright:`⊳`,Vbar:`⫫`,vBar:`⫨`,vBarv:`⫩`,Vcy:`В`,vcy:`в`,VDash:`⊫`,Vdash:`⊩`,vDash:`⊨`,vdash:`⊢`,Vdashl:`⫦`,Vee:`⋁`,vee:`∨`,veebar:`⊻`,veeeq:`≚`,vellip:`⋮`,Verbar:`‖`,verbar:`|`,Vert:`‖`,vert:`|`,VerticalBar:`∣`,VerticalLine:`|`,VerticalSeparator:`❘`,VerticalTilde:`≀`,VeryThinSpace:` `,Vfr:`𝔙`,vfr:`𝔳`,vltri:`⊲`,vnsub:`⊂⃒`,vnsup:`⊃⃒`,Vopf:`𝕍`,vopf:`𝕧`,vprop:`∝`,vrtri:`⊳`,Vscr:`𝒱`,vscr:`𝓋`,vsubnE:`⫋︀`,vsubne:`⊊︀`,vsupnE:`⫌︀`,vsupne:`⊋︀`,Vvdash:`⊪`,vzigzag:`⦚`,Wcirc:`Ŵ`,wcirc:`ŵ`,wedbar:`⩟`,Wedge:`⋀`,wedge:`∧`,wedgeq:`≙`,weierp:`℘`,Wfr:`𝔚`,wfr:`𝔴`,Wopf:`𝕎`,wopf:`𝕨`,wp:`℘`,wr:`≀`,wreath:`≀`,Wscr:`𝒲`,wscr:`𝓌`,xcap:`⋂`,xcirc:`◯`,xcup:`⋃`,xdtri:`▽`,Xfr:`𝔛`,xfr:`𝔵`,xhArr:`⟺`,xharr:`⟷`,Xi:`Ξ`,xi:`ξ`,xlArr:`⟸`,xlarr:`⟵`,xmap:`⟼`,xnis:`⋻`,xodot:`⨀`,Xopf:`𝕏`,xopf:`𝕩`,xoplus:`⨁`,xotime:`⨂`,xrArr:`⟹`,xrarr:`⟶`,Xscr:`𝒳`,xscr:`𝓍`,xsqcup:`⨆`,xuplus:`⨄`,xutri:`△`,xvee:`⋁`,xwedge:`⋀`,Yacute:`Ý`,yacute:`ý`,YAcy:`Я`,yacy:`я`,Ycirc:`Ŷ`,ycirc:`ŷ`,Ycy:`Ы`,ycy:`ы`,yen:`¥`,Yfr:`𝔜`,yfr:`𝔶`,YIcy:`Ї`,yicy:`ї`,Yopf:`𝕐`,yopf:`𝕪`,Yscr:`𝒴`,yscr:`𝓎`,YUcy:`Ю`,yucy:`ю`,Yuml:`Ÿ`,yuml:`ÿ`,Zacute:`Ź`,zacute:`ź`,Zcaron:`Ž`,zcaron:`ž`,Zcy:`З`,zcy:`з`,Zdot:`Ż`,zdot:`ż`,zeetrf:`ℨ`,ZeroWidthSpace:``,Zeta:`Ζ`,zeta:`ζ`,Zfr:`ℨ`,zfr:`𝔷`,ZHcy:`Ж`,zhcy:`ж`,zigrarr:`⇝`,Zopf:`ℤ`,zopf:`𝕫`,Zscr:`𝒵`,zscr:`𝓏`,zwj:``,zwnj:``}),e.entityMap=e.HTML_ENTITIES})),yV=o((e=>{var t=mV(),n=gV(),r=hV(),i=t.isHTMLEscapableRawTextElement,a=t.isHTMLMimeType,o=t.isHTMLRawTextElement,s=t.hasOwn,c=t.NAMESPACE,l=r.ParseError,u=r.DOMException,d=0,f=1,p=2,m=3,h=4,g=5,_=6,v=7;function y(){}y.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),E(t,t=Object.create(null)),x(e,t,n,r,this.errorHandler),r.endDocument()}};var b=/&#?\w+;?/g;function x(e,r,i,o,c){var d=a(o.mimeType);e.indexOf(n.UNICODE_REPLACEMENT_CHARACTER)>=0&&c.warning(`Unicode replacement character detected, source encoding issues?`);function f(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function p(e){var t=e[e.length-1]===`;`?e:e+`;`;if(!d&&t!==e)return c.error(`EntityRef: expecting ;`),e;var r=n.Reference.exec(t);if(!r||r[0].length!==t.length)return c.error(`entity not matching Reference production: `+e),e;var a=t.slice(1,-1);return s(i,a)?i[a]:a.charAt(0)===`#`?f(parseInt(a.substring(1).replace(`x`,`0x`))):(c.error(`entity not found:`+e),e)}function m(t){if(t>D){var n=e.substring(D,t).replace(b,p);v&&y(D),o.characters(n,0,t-D),D=t}}var h=0,g=0,_=/\r\n?|\n|$/g,v=o.locator;function y(t,n){for(;t>=g&&(n=_.exec(e));)h=g,g=n.index+n[0].length,v.lineNumber++;v.columnNumber=t-h+1}for(var x=[{currentNSMap:r}],E=[],D=0;;){try{var O=e.indexOf(`<`,D);if(O<0){if(!d&&E.length>0)return c.fatalError(`unclosed xml tag(s): `+E.join(`, `));if(!e.substring(D).match(/^\s*$/)){var M=o.doc,N=M.createTextNode(e.substring(D));if(M.documentElement)return c.error(`Extra content at the end of the document`);M.appendChild(N),o.currentElement=N}return}if(O>D){var P=e.substring(D,O);!d&&E.length===0&&(P=P.replace(new RegExp(n.S_OPT.source,`g`),``),P&&c.error(`Unexpected content outside root element: '`+P+`'`)),m(O)}switch(e.charAt(O+1)){case`/`:var F=e.indexOf(`>`,O+2),I=e.substring(O+2,F>0?F:void 0);if(!I)return c.fatalError(`end tag name missing`);var L=n.reg(`^`,n.QName_group,n.S_OPT,`$`),R=F>0&&L.exec(I);if(!R){var z=F>0&&n.reg(`^`,n.QName_group).exec(I);if(d&&z)c.warning(`end tag name contains invalid trailing characters: "`+I+`"`),R=z;else if(z&&new RegExp(L.source,L.flags+`m`).test(I))c.error(`end tag name is followed by a line break and trailing content: "`+I+`"`),R=z;else return c.fatalError(`end tag name contains invalid characters: "`+I+`"`)}if(!o.currentElement&&!o.doc.documentElement)return;var ee=E[E.length-1]||o.currentElement.tagName||o.doc.documentElement.tagName||``;if(ee!==R[1]){var te=R[1].toLowerCase();if(!d||ee.toLowerCase()!==te)return c.fatalError(`Opening and ending tag mismatch: "`+ee+`" != "`+I+`"`)}var B=x.pop();E.pop();var ne=B.localNSMap;if(o.endElement(B.uri,B.localName,ee),ne)for(var re in ne)s(ne,re)&&o.endPrefixMapping(re);F++;break;case`?`:v&&y(O),F=A(e,O,o,c);break;case`!`:v&&y(O),F=k(e,O,o,c,d);break;default:v&&y(O);var V=new j,ie=x[x.length-1].currentNSMap,F=C(e,O,V,ie,p,c,d),ae=V.length;if(V.closed||(d&&t.isHTMLVoidElement(V.tagName)?V.closed=!0:E.push(V.tagName)),v&&ae){for(var oe=S(v,{}),H=0;H<ae;H++){var se=V[H];y(se.offset),se.locator=S(v,{})}o.locator=oe,w(V,o,ie)&&x.push(V),o.locator=v}else w(V,o,ie)&&x.push(V);d&&!V.closed?F=T(e,F,V.tagName,p,o):F++}}catch(e){if(e instanceof l)throw e;if(e instanceof u)return c.fatalError(`Error constructing the DOM: `+e.name+`: `+e.message,e);c.error(`element parse error: `+e),F=-1}F>D?D=F:m(Math.max(O,D)+1)}}function S(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function C(e,t,n,r,i,a,o){function c(e,t,r){if(s(n.attributeNames,e))return a.fatalError(`Attribute `+e+` redefined`);if(!o&&t.indexOf(`<`)>=0)return a.fatalError(`Unescaped '<' not allowed in attributes values`);n.addValue(e,t.replace(/[\t\n\r]/g,` `).replace(b,i),r)}for(var l,u,y=++t,x=d;;){var S=e.charAt(y);if(x===d&&S===`<`)throw Error(`unexpected < in tag name: `+e.slice(t,y));switch(S){case`=`:if(x===f)l=e.slice(t,y),x=m;else if(x===p)x=m;else throw Error(`attribute equal must after attrName`);break;case`'`:case`"`:if(x===m||x===f){if(x===f&&(a.warning(`attribute value must after "="`),l=e.slice(t,y)),t=y+1,y=e.indexOf(S,t),y>0)u=e.slice(t,y),c(l,u,t-1),x=g;else throw Error(`attribute value no end '`+S+`' match`)}else if(x==h)u=e.slice(t,y),c(l,u,t),a.warning(`attribute "`+l+`" missed start quot(`+S+`)!!`),t=y+1,x=g;else throw Error(`attribute value must after "="`);break;case`/`:switch(x){case d:n.setTagName(e.slice(t,y));case g:case _:case v:x=v,n.closed=!0;case h:case f:break;case p:n.closed=!0;break;default:throw Error(`attribute invalid close char('/')`)}break;case``:return a.error(`unexpected end of input`),x==d&&n.setTagName(e.slice(t,y)),y;case`>`:switch(x){case d:n.setTagName(e.slice(t,y));case g:case _:case v:break;case h:case f:u=e.slice(t,y),u.slice(-1)===`/`&&(n.closed=!0,u=u.slice(0,-1));case p:x===p&&(u=l),x==h?(a.warning(`attribute "`+u+`" missed quot(")!`),c(l,u,t)):(o||a.warning(`attribute "`+u+`" missed value!! "`+u+`" instead!!`),c(u,u,t));break;case m:if(!o)return a.fatalError(`AttValue: ' or " expected`)}return y;case``:S=` `;default:if(S<=` `)switch(x){case d:n.setTagName(e.slice(t,y)),x=_;break;case f:l=e.slice(t,y),x=p;break;case h:var u=e.slice(t,y);a.warning(`attribute "`+u+`" missed quot(")!!`),c(l,u,t);case g:x=_}else switch(x){case p:o||a.warning(`attribute "`+l+`" missed value!! "`+l+`" instead2!!`),c(l,l,t),t=y,x=f;break;case g:a.warning(`attribute space is required"`+l+`"!!`);case _:x=f,t=y;break;case m:x=h,t=y;break;case v:throw Error(`elements closed character '/' and '>' must be connected to`)}}y++}}function w(e,t,n){for(var r=e.tagName,i=null,a=e.length;a--;){var o=e[a],l=o.qName,u=o.value,d=l.indexOf(`:`);if(d>0)var f=o.prefix=l.slice(0,d),p=l.slice(d+1),m=f===`xmlns`&&p;else p=l,f=null,m=l===`xmlns`&&``;o.localName=p,m!==!1&&(i??(i=Object.create(null),n=Object.create(n)),n[m]=i[m]=u,o.uri=c.XMLNS,t.startPrefixMapping(m,u))}for(var a=e.length;a--;)o=e[a],o.prefix&&(o.prefix===`xml`&&(o.uri=c.XML),o.prefix!==`xmlns`&&(o.uri=n[o.prefix]));var d=r.indexOf(`:`);d>0?(f=e.prefix=r.slice(0,d),p=e.localName=r.slice(d+1)):(f=null,p=e.localName=r);var h=e.uri=n[f||``];if(t.startElement(h,p,r,e),e.closed){if(t.endElement(h,p,r),i)for(f in i)s(i,f)&&t.endPrefixMapping(f)}else return e.currentNSMap=n,e.localNSMap=i,!0}function T(e,t,n,r,a){var s=i(n);if(s||o(n)){var c=RegExp(`</`+n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)+`>`,`ig`);c.lastIndex=t;var l=c.exec(e),u=l?l.index:-1;if(u<0)return t+1;var d=e.substring(t+1,u);return s&&(d=d.replace(b,r)),a.characters(d,0,d.length),u}return t+1}function E(e,t){for(var n in e)s(e,n)&&(t[n]=e[n])}function D(e,t){var r=t;function i(t){return t||=0,e.charAt(r+t)}function a(e){e||=1,r+=e}function o(){for(var t=0;r<e.length;){var n=i();if(n!==` `&&n!==`
|
|
85
|
-
`&&n!==` `&&n!==`\r`)return t;t++,a()}return-1}function s(){return e.substring(r)}function c(t){return e.substring(r,r+t.length)===t}function l(t){return e.substring(r,r+t.length).toUpperCase()===t.toUpperCase()}function u(e){var t=n.reg(`^`,e).exec(s());return t?(a(t[0].length),t[0]):null}return{char:i,getIndex:function(){return r},getMatch:u,getSource:function(){return e},skip:a,skipBlanks:o,substringFromIndex:s,substringStartsWith:c,substringStartsWithCaseInsensitive:l}}function O(e,t){function r(e,t){var r=n.PI.exec(e.substringFromIndex());return r?r[1].toLowerCase()===`xml`?t.fatalError(`xml declaration is only allowed at the start of the document, but found at position `+e.getIndex()):(e.skip(r[0].length),r[0]):t.fatalError(`processing instruction is not well-formed at position `+e.getIndex())}var i=e.getSource();if(e.char()===`[`){e.skip(1);for(var a=e.getIndex();e.getIndex()<i.length;){if(e.skipBlanks(),e.char()===`]`){var o=i.substring(a,e.getIndex());return e.skip(1),o}var s=null;if(e.char()===`<`&&e.char(1)===`!`)switch(e.char(2)){case`E`:e.char(3)===`L`?s=e.getMatch(n.elementdecl):e.char(3)===`N`&&(s=e.getMatch(n.EntityDecl));break;case`A`:s=e.getMatch(n.AttlistDecl);break;case`N`:s=e.getMatch(n.NotationDecl);break;case`-`:s=e.getMatch(n.Comment)}else if(e.char()===`<`&&e.char(1)===`?`)s=r(e,t);else if(e.char()===`%`)s=e.getMatch(n.PEReference);else return t.fatalError(`Error detected in Markup declaration`);if(!s)return t.fatalError(`Error in internal subset at position `+e.getIndex())}return t.fatalError(`doctype internal subset is not well-formed, missing ]`)}}function k(e,t,r,i,a){var o=D(e,t);switch(a?o.char(2).toUpperCase():o.char(2)){case`-`:var s=o.getMatch(n.Comment);return s?(r.comment(s,n.COMMENT_START.length,s.length-n.COMMENT_START.length-n.COMMENT_END.length),o.getIndex()):i.fatalError(`comment is not well-formed at position `+o.getIndex());case`[`:var c=o.getMatch(n.CDSect);return c?!a&&!r.currentElement?i.fatalError(`CDATA outside of element`):(r.startCDATA(),r.characters(c,n.CDATA_START.length,c.length-n.CDATA_START.length-n.CDATA_END.length),r.endCDATA(),o.getIndex()):i.fatalError(`Invalid CDATA starting at position `+t);case`D`:if(r.doc&&r.doc.documentElement)return i.fatalError(`Doctype not allowed inside or after documentElement at position `+o.getIndex());if(a?!o.substringStartsWithCaseInsensitive(n.DOCTYPE_DECL_START):!o.substringStartsWith(n.DOCTYPE_DECL_START))return i.fatalError(`Expected `+n.DOCTYPE_DECL_START+` at position `+o.getIndex());if(o.skip(n.DOCTYPE_DECL_START.length),o.skipBlanks()<1)return i.fatalError(`Expected whitespace after `+n.DOCTYPE_DECL_START+` at position `+o.getIndex());var l={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(l.name=o.getMatch(n.Name),!l.name)return i.fatalError(`doctype name missing or contains unexpected characters at position `+o.getIndex());if(a&&l.name.toLowerCase()!==`html`&&i.warning(`Unexpected DOCTYPE in HTML document at position `+o.getIndex()),o.skipBlanks(),o.substringStartsWith(n.PUBLIC)||o.substringStartsWith(n.SYSTEM)){var u=n.ExternalID_match.exec(o.substringFromIndex());if(!u)return i.fatalError(`doctype external id is not well-formed at position `+o.getIndex());u.groups.SystemLiteralOnly===void 0?(l.systemId=u.groups.SystemLiteral,l.publicId=u.groups.PubidLiteral):l.systemId=u.groups.SystemLiteralOnly,o.skip(u[0].length)}else if(a&&o.substringStartsWithCaseInsensitive(n.SYSTEM)){if(o.skip(n.SYSTEM.length),o.skipBlanks()<1)return i.fatalError(`Expected whitespace after `+n.SYSTEM+` at position `+o.getIndex());if(l.systemId=o.getMatch(n.ABOUT_LEGACY_COMPAT_SystemLiteral),!l.systemId)return i.fatalError(`Expected `+n.ABOUT_LEGACY_COMPAT+` in single or double quotes after `+n.SYSTEM+` at position `+o.getIndex())}return a&&l.systemId&&!n.ABOUT_LEGACY_COMPAT_SystemLiteral.test(l.systemId)&&i.warning(`Unexpected doctype.systemId in HTML document at position `+o.getIndex()),a||(o.skipBlanks(),l.internalSubset=O(o,i)),o.skipBlanks(),o.char()===`>`?(o.skip(1),r.startDTD(l.name,l.publicId,l.systemId,l.internalSubset),r.endDTD(),o.getIndex()):i.fatalError(`doctype not terminated with > at position `+o.getIndex());default:return i.fatalError(`Not well-formed XML starting with "<!" at position `+t)}}function A(e,t,r,i){var a=e.substring(t).match(n.PI);if(!a)return i.fatalError(`Invalid processing instruction starting at position `+t);if(a[1].toLowerCase()===`xml`){if(t>0)return i.fatalError(`processing instruction at position `+t+` is an xml declaration which is only at the start of the document`);if(!n.XMLDecl.test(e.substring(t)))return i.fatalError(`xml declaration is not well-formed`)}return r.processingInstruction(a[1],a[2]),t+a[0].length}function j(){this.attributeNames=Object.create(null)}j.prototype={setTagName:function(e){if(!n.QName_exact.test(e))throw Error(`invalid tagName:`+e);this.tagName=e},addValue:function(e,t,r){if(!n.QName_exact.test(e))throw Error(`invalid attribute:`+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},e.XMLReader=y,e.parseUtils=D,e.parseDoctypeCommentOrCData=k})),bV=o((e=>{var t=mV(),n=_V(),r=hV(),i=vV(),a=yV(),o=n.DOMImplementation,s=t.hasDefaultHTMLNamespace,c=t.isHTMLMimeType,l=t.isValidMimeType,u=t.MIME_TYPE,d=t.NAMESPACE,f=r.ParseError,p=a.XMLReader;function m(e){return e.replace(/\r[\n\u0085]/g,`
|
|
86
|
-
`).replace(/[\r\u0085\u2028\u2029]/g,`
|
|
87
|
-
`)}function h(e){if(e||={},e.locator===void 0&&(e.locator=!0),this.assign=e.assign||t.assign,this.domHandler=e.domHandler||g,this.onError=e.onError||e.errorHandler,e.errorHandler&&typeof e.errorHandler!=`function`)throw TypeError(`errorHandler object is no longer supported, switch to onError!`);e.errorHandler&&e.errorHandler(`warning`,"The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=e.normalizeLineEndings||m,this.locator=!!e.locator,this.xmlns=this.assign(Object.create(null),e.xmlns)}h.prototype.parseFromString=function(e,n){if(!l(n))throw TypeError(`DOMParser.parseFromString: the provided mimeType "`+n+`" is not valid.`);var r=this.assign(Object.create(null),this.xmlns),a=i.XML_ENTITIES,o=r[``]||null;s(n)?(a=i.HTML_ENTITIES,o=d.HTML):n===u.XML_SVG_IMAGE&&(o=d.SVG),r[``]=o,r.xml=r.xml||d.XML;var c=new this.domHandler({mimeType:n,defaultNamespace:o,onError:this.onError}),f=this.locator?{}:void 0;this.locator&&c.setDocumentLocator(f);var m=new p;return m.errorHandler=c,m.domBuilder=c,!t.isHTMLMimeType(n)&&typeof e!=`string`&&m.errorHandler.fatalError(`source is not a string`),m.parse(this.normalizeLineEndings(String(e)),r,a),c.doc.documentElement||m.errorHandler.fatalError(`missing root element`),c.doc};function g(e){var t=e||{};this.mimeType=t.mimeType||u.XML_APPLICATION,this.defaultNamespace=t.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=t.onError}function _(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}g.prototype={startDocument:function(){var e=new o;this.doc=c(this.mimeType)?e.createHTMLDocument(!1):e.createDocument(this.defaultNamespace,``)},startElement:function(e,t,n,r){var i=this.doc,a=i.createElementNS(e,n||t),o=r.length;b(this,a),this.currentElement=a,this.locator&&_(this.locator,a);for(var s=0;s<o;s++){var e=r.getURI(s),c=r.getValue(s),n=r.getQName(s),l=i.createAttributeNS(e,n);this.locator&&_(r.getLocator(s),l),l.value=l.nodeValue=c,a.setAttributeNode(l)}},endElement:function(e,t,n){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&_(this.locator,n),b(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=y.apply(this,arguments),e){if(this.cdata)var r=this.doc.createCDATASection(e);else var r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&_(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){e&&(e.lineNumber=0),this.locator=e},comment:function(e,t,n){e=y.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&_(this.locator,r),b(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n,r){var i=this.doc.implementation;if(i&&i.createDocumentType){var a=i.createDocumentType(e,t,n,r);this.locator&&_(this.locator,a),b(this,a),this.doc.doctype=a}},reportError:function(e,t){if(typeof this.onError==`function`)try{this.onError(e,t,this)}catch(n){throw new f(`Reporting `+e+` "`+t+`" caused `+n,this.locator)}else console.error(`[xmldom `+e+`] `+t,v(this.locator))},warning:function(e){this.reportError(`warning`,e)},error:function(e){this.reportError(`error`,e)},fatalError:function(e,t){throw this.reportError(`fatalError`,e),new f(e,this.locator,t)}};function v(e){if(e)return`
|
|
88
|
-
@#[line:`+e.lineNumber+`,col:`+e.columnNumber+`]`}function y(e,t,n){return typeof e==`string`?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+``:e}`endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl`.replace(/\w+/g,function(e){g.prototype[e]=function(){return null}});function b(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}function x(e){if(e===`error`)throw`onErrorStopParsing`}function S(){throw`onWarningStopParsing`}e.__DOMHandler=g,e.DOMParser=h,e.normalizeLineEndings=m,e.onErrorStopParsing=x,e.onWarningStopParsing=S})),xV=o((e=>{var t=mV();e.assign=t.assign,e.hasDefaultHTMLNamespace=t.hasDefaultHTMLNamespace,e.isHTMLMimeType=t.isHTMLMimeType,e.isValidMimeType=t.isValidMimeType,e.MIME_TYPE=t.MIME_TYPE,e.NAMESPACE=t.NAMESPACE;var n=hV();e.DOMException=n.DOMException,e.DOMExceptionName=n.DOMExceptionName,e.ExceptionCode=n.ExceptionCode,e.ParseError=n.ParseError;var r=_V();e.Attr=r.Attr,e.CDATASection=r.CDATASection,e.CharacterData=r.CharacterData,e.Comment=r.Comment,e.Document=r.Document,e.DocumentFragment=r.DocumentFragment,e.DocumentType=r.DocumentType,e.DOMImplementation=r.DOMImplementation,e.Element=r.Element,e.Entity=r.Entity,e.EntityReference=r.EntityReference,e.LiveNodeList=r.LiveNodeList,e.NamedNodeMap=r.NamedNodeMap,e.Node=r.Node,e.NodeList=r.NodeList,e.Notation=r.Notation,e.ProcessingInstruction=r.ProcessingInstruction,e.Text=r.Text,e.XMLSerializer=r.XMLSerializer;var i=bV();e.DOMParser=i.DOMParser,e.normalizeLineEndings=i.normalizeLineEndings,e.onErrorStopParsing=i.onErrorStopParsing,e.onWarningStopParsing=i.onWarningStopParsing}))(),SV=class{constructor(e){if(CV(e))throw Error(`DataView: Passed buffer type is unsupported.`);this.buffer=e,this.byteLength=this.buffer.length}getUint8(e){return this.buffer.readUInt8(e)}getUint16(e,t){return t?this.buffer.readUInt16LE(e):this.buffer.readUInt16BE(e)}getUint32(e,t){return t?this.buffer.readUInt32LE(e):this.buffer.readUInt32BE(e)}getInt32(e,t){return t?this.buffer.readInt32LE(e):this.buffer.readInt32BE(e)}};function CV(e){return typeof e!=`object`||e.length===void 0||e.readUInt8===void 0||e.readUInt16LE===void 0||e.readUInt16BE===void 0||e.readUInt32LE===void 0||e.readUInt32BE===void 0||e.readInt32LE===void 0||e.readInt32BE===void 0}function wV(e,t,n){try{return new DataView(e,t,n)}catch{return new SV(e,t,n)}}function TV(e,t,n){let r=[];for(let i=0;i<n&&t+i<e.byteLength;i++)r.push(e.getUint8(t+i));return kV(r)}function EV(e,t){let n=[],r=0;for(;t+r<e.byteLength;){let i=e.getUint8(t+r);if(i===0)break;n.push(i),r++}return kV(n)}function DV(e,t,n){let r=[];for(let i=0;i+2<=n&&t+i+2<=e.byteLength;i+=2)r.push(e.getUint16(t+i));return r[r.length-1]===0&&r.pop(),kV(r)}function OV(e,t){let n=e.getUint8(t);return[n,TV(e,t+1,n)]}function kV(e){return e.map(e=>String.fromCharCode(e)).join(``)}function AV(e){let t=jV(e);return t===void 0?e:t}function jV(e){try{return decodeURIComponent(escape(e))}catch{return}}function MV(e,t,n,r){e&&t&&e.push({type:t,start:n,end:r})}function NV(){if(typeof Promise>`u`)throw Error(`Promise is required when async mode is enabled.`)}function PV(){for(let e=1;e<arguments.length;e++)for(let t in arguments[e])FV(arguments[0],t,arguments[e][t]);return arguments[0]}function FV(e,t,n){if(t===`__proto__`){Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0,configurable:!0});return}e[t]=n}function IV(e,t,n){let r=!1;Object.defineProperty(e,t,{get(){return r||(r=!0,Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n.apply(e),writable:!0})),e[t]},configurable:!0,enumerable:!0})}function LV(e){if(typeof btoa<`u`)return btoa(typeof e==`string`?e:Array.prototype.reduce.call(new Uint8Array(e),(e,t)=>e+String.fromCharCode(t),``));if(!(typeof Buffer>`u`))return Buffer.from===void 0?new Buffer(e).toString(`base64`):Buffer.from(e).toString(`base64`)}function RV(e){let t=e.substring(e.indexOf(`,`)+1);if(e.indexOf(`;base64`)!==-1)return typeof atob<`u`?Uint8Array.from(atob(t),e=>e.charCodeAt(0)).buffer:typeof Buffer>`u`?void 0:Buffer.from===void 0?new Buffer(t,`base64`):Buffer.from(t,`base64`);let n=decodeURIComponent(t);return typeof Buffer<`u`?Buffer.from===void 0?new Buffer(n):Buffer.from(n):Uint8Array.from(n,e=>e.charCodeAt(0)).buffer}function zV(e,t,n){return VV(n,Math.max(0,t-e.length))+e}function BV(e,t){return parseInt(e.replace(`.`,``),t)/t**+(e.split(`.`)[1]||``).length}function VV(e,t){return Array(t+1).join(e)}var HV=`brotli`,UV=134217728;function WV(e,t,n,r=`string`,i){let a=GV(i);if(i&&t!==void 0){let o=i[t===0?`deflate`:`brotli`];if(typeof o==`function`){let t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return Promise.resolve(o(t)).then(e=>YV(e)>a?XV(a):r===`dataview`?e instanceof ArrayBuffer?new DataView(e):e.byteOffset===0&&e.byteLength===e.buffer.byteLength?new DataView(e.buffer):new DataView(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)):new TextDecoder(n).decode(e))}}if(t===0&&typeof DecompressionStream==`function`)return KV(e,`deflate`,a).then(e=>JV(e,r,n));if(t===`brotli`){if(typeof DecompressionStream==`function`)try{return KV(e,`brotli`,a).then(e=>JV(e,r,n))}catch{}return Promise.reject(`Brotli decompression is not supported in this environment. Pass in a brotli decompression function via the decompress option.`)}if(t!==void 0)return Promise.reject(`Unknown compression method ${t}.`);if(r===`string`)try{return new TextDecoder(n).decode(e)}catch{let t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return Array.from(t,e=>String.fromCharCode(e)).join(``)}return e}function GV(e){return e&&typeof e.maxDecompressedSize==`number`?e.maxDecompressedSize:UV}function KV(e,t,n){let r=new DecompressionStream(t),i=new Blob([e]).stream().pipeThrough(r).getReader(),a=[],o=0;return s();function s(){return i.read().then(({done:e,value:t})=>e?qV(a,o):(o+=t.byteLength,o>n?i.cancel().then(()=>XV(n)):(a.push(t),s())))}}function qV(e,t){let n=new Uint8Array(t),r=0;for(let t=0;t<e.length;t++)n.set(e[t],r),r+=e[t].byteLength;return n.buffer}function JV(e,t,n){return t===`dataview`?new DataView(e):new TextDecoder(n).decode(e)}function YV(e){return e&&typeof e.byteLength==`number`?e.byteLength:0}function XV(e){return typeof console<`u`&&typeof console.warn==`function`&&console.warn(`ExifReader: skipped a compressed metadata block that would exceed the maximum decompressed size of ${e} bytes.`),Promise.reject(`Decompressed metadata exceeded the maximum allowed size of ${e} bytes.`)}function ZV(e){return typeof e==`string`}function QV(e){return typeof File<`u`&&e instanceof File}function $V(e){return/^data:[^;,]*(;base64)?,/.test(e)}function eH(e,t){return/^\w+:\/\//.test(e)?typeof fetch<`u`?rH(e,nH(t)).then(e=>e.buffer):sH(e,nH(t)).then(e=>e.buffer):$V(e)?Promise.resolve(RV(e)):dH(e,nH(t)).then(e=>e.buffer)}function tH(e,t){return hH(e,nH(t)).then(e=>e.buffer)}function nH(e){return e&&Number.isInteger(e.length)&&e.length>=0?{start:0,end:e.length}:{start:0}}function rH(e,{start:t=0,end:n}={}){let r={method:`GET`};return(t>0||n!==void 0&&n!==1/0)&&(r.headers={range:iH(t,n)}),fetch(e,r).then(e=>{let t=e&&typeof e.status==`number`?e.status:void 0;if(t!==void 0&&!oH(t)){let n=e.statusText||``;return Promise.reject(Error(`Could not fetch file: ${t} ${n}`.trim()))}let n=aH(e);return Promise.resolve(e.arrayBuffer()).then(e=>({buffer:e,totalSize:n,status:t}))})}function iH(e,t){return t===void 0||t===1/0?`bytes=${e}-`:`bytes=${e}-${t-1}`}function aH(e){if(!(!e||!e.headers||typeof e.headers.get!=`function`))return lH(e.headers.get(`Content-Range`),e.headers.get(`Content-Length`))}function oH(e){return e>=200&&e<=299||e===416}function sH(e,{start:t=0,end:n}={}){return new Promise((r,i)=>{let a={};(t>0||n!==void 0&&n!==1/0)&&(a.headers={range:iH(t,n)}),uH(e)(e,a,e=>{if(e.statusCode>=200&&e.statusCode<=299){let t=cH(e),n=[];e.on(`data`,e=>n.push(Buffer.from(e))),e.on(`error`,e=>i(e)),e.on(`end`,()=>r({buffer:Buffer.concat(n),totalSize:t,status:e.statusCode}))}else e.statusCode===416?(e.resume(),r({buffer:Buffer.alloc(0),totalSize:cH(e),status:e.statusCode})):(i(Error(`Could not fetch file: ${e.statusCode} ${e.statusMessage}`)),e.resume())}).on(`error`,e=>i(e))})}function cH(e){if(!(!e||!e.headers))return lH(e.headers[`content-range`],e.headers[`content-length`])}function lH(e,t){if(e){let t=/\/(\d+|\*)$/.exec(e);if(t&&t[1]!==`*`)return parseInt(t[1],10)}if(t){let e=parseInt(t,10);if(Number.isFinite(e))return e}}function uH(e){return/^https:\/\//.test(e)?__non_webpack_require__(`https`).get:__non_webpack_require__(`http`).get}function dH(e,{start:t=0,end:n,totalSize:r}={}){return new Promise((i,a)=>{let o=mH();o.open(e,(s,c)=>{if(s)return a(s);fH(o,e,r,(r,s)=>{if(r)return o.close(c,()=>a(r));let l=n===void 0||n===1/0||n>s?s:n,u=Math.min(Math.max(0,t),l),d=l-u,f=Buffer.alloc(d);if(d===0)return o.close(c,t=>pH(e,t,f,s,i));o.read(c,{buffer:f,length:d,position:u},t=>{if(t)return o.close(c,()=>a(t));o.close(c,t=>pH(e,t,f,s,i))})})})})}function fH(e,t,n,r){if(n!==void 0)return r(null,n);e.stat(t,(e,t)=>r(e,e?void 0:t.size))}function pH(e,t,n,r,i){t&&console.warn(`Could not close file ${e}:`,t),i({buffer:n,totalSize:r})}function mH(){try{return __non_webpack_require__(`fs`)}catch{return}}function hH(e,{start:t=0,end:n}={}){return new Promise((r,i)=>{let a=new FileReader,o=typeof e.size==`number`?e.size:void 0;if(a.onload=e=>r({buffer:e.target.result,totalSize:o}),a.onerror=()=>i(a.error),e&&typeof e.slice==`function`&&(t>0||n!==void 0&&n!==1/0)){let r=n===void 0||n===1/0?o:n;a.readAsArrayBuffer(e.slice(t,r))}else a.readAsArrayBuffer(e)})}function gH(e,t){if(!e)return t;if(!t)return e;if(typeof Buffer<`u`&&Buffer.isBuffer(e)&&Buffer.isBuffer(t))return Buffer.concat([e,t]);let n=_H(e),r=_H(t),i=new Uint8Array(n.byteLength+r.byteLength);return i.set(n,0),i.set(r,n.byteLength),i.buffer}function _H(e){return e instanceof ArrayBuffer?new Uint8Array(e):typeof Buffer<`u`&&Buffer.isBuffer(e)||ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}var vH=131072,yH=4,bH=`length: "auto" could not locate metadata in this file (no metadata blocks found after reading the file — e.g. plain TIFF, bare JPEG XL codestream, or a file with no recognizable metadata).`,xH=`length: "auto" is not supported for this file type (no leading metadata container — e.g. plain TIFF or bare JPEG XL codestream).`;function SH(e){if(e.expanded!==!0||e.includeOffsets!==!0)throw Error(`length: "auto" requires both expanded: true and includeOffsets: true.`)}function CH(e){return function(e,i){NV();let a=PV({},i,{async:!0});return ZV(e)?t(e,a):QV(e)?n(e,a):r(e,a)};function t(e,t){return/^\w+:\/\//.test(e)?i(typeof fetch<`u`?{readRange:(t,n)=>rH(e,{start:t,end:n}),options:t}:{readRange:(t,n)=>sH(e,{start:t,end:n}),options:t}):$V(e)?r(RV(e),t):i({readRange:(t,n,r)=>dH(e,{start:t,end:n,totalSize:r?r.totalSize:void 0}),options:t})}function n(e,t){return i({readRange:(t,n)=>hH(e,{start:t,end:n}),options:t})}function r(t,n){return Promise.resolve().then(()=>e(t,n)).then(e=>{if(!e||!e.metadataRange)throw Error(xH);let n=e.metadataRange.end;return e.metadataRange.buffer=OH(t,n),e.metadataRange.fetched=kH(e.metadataRange.buffer),e.metadataRange.requests=0,e})}function i({readRange:e,options:t}){return a({readRange:e,options:t,buffer:null,fetched:0,requests:0,totalSize:void 0,need:vH,iter:0})}function a(t){return t.iter>=yH||(t.totalSize!==void 0&&(t.need=Math.min(t.need,t.totalSize)),t.need<=t.fetched)?c(t):t.readRange(t.fetched,t.need,{totalSize:t.totalSize}).then(n=>(t.requests++,n.status===416?s(t):(wH(t,n),Promise.resolve(e(t.buffer,t.options)).then(e=>o(t,e)))))}function o(e,t){let n=t&&t.metadataRange;if(n&&n.complete)return TH(t,e.buffer,e.fetched,e.requests);let r=e.totalSize!==void 0&&e.fetched>=e.totalSize;if(!n&&r)throw Error(bH);let i=EH({range:n,totalSize:e.totalSize,fetched:e.fetched});if(i<=e.fetched){if(n)return TH(t,e.buffer,e.fetched,e.requests);throw Error(bH)}return e.need=i,e.iter++,a(e)}function s(t){return t.readRange(0,1/0,{totalSize:void 0}).then(n=>(t.requests++,t.buffer=n.buffer,t.fetched=kH(t.buffer),n.totalSize!==void 0&&(t.totalSize=n.totalSize),Promise.resolve(e(t.buffer,t.options)))).then(e=>{if(!e||!e.metadataRange)throw Error(bH);return TH(e,t.buffer,t.fetched,t.requests)})}function c(t){console.warn(`ExifReader: length:"auto" did not converge in ${yH} iterations; falling back to full read.`);let n;return n=t.totalSize!==void 0&&t.fetched<t.totalSize?t.readRange(t.fetched,t.totalSize,{totalSize:t.totalSize}).then(e=>{t.requests++,wH(t,e)}):t.totalSize===void 0?t.readRange(t.fetched,1/0,{totalSize:t.totalSize}).then(e=>{t.requests++,wH(t,e)}):Promise.resolve(),n.then(()=>Promise.resolve(e(t.buffer,t.options))).then(e=>{if(!e||!e.metadataRange)throw Error(bH);return TH(e,t.buffer,t.fetched,t.requests)})}}function wH(e,t){if(t.status===200&&e.fetched>0){e.buffer=t.buffer,e.fetched=kH(e.buffer),t.totalSize!==void 0&&(e.totalSize=t.totalSize);return}t.totalSize!==void 0&&e.totalSize===void 0&&(e.totalSize=t.totalSize),e.buffer=gH(e.buffer,t.buffer),e.fetched=kH(e.buffer)}function TH(e,t,n,r){let i=e.metadataRange.end;return e.metadataRange.buffer=DH(t,i),e.metadataRange.fetched=n,e.metadataRange.requests=r,e}function EH({range:e,totalSize:t,fetched:n}){return e?Math.min(Math.max(e.end,n*2),t===void 0?1/0:t):t===void 0?n*2:t}function DH(e,t){return!e||typeof t!=`number`||t<0?e:typeof Buffer<`u`&&Buffer.isBuffer(e)?Buffer.from(e.subarray(0,Math.min(t,e.length))):e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer?e.slice(0,Math.min(t,e.byteLength)):e}function OH(e,t){if(typeof Buffer<`u`&&Buffer.isBuffer(e))return Buffer.from(e.subarray(0,t));if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0,t);if(ArrayBuffer.isView(e)){let n=Math.max(0,Math.min(t,e.byteLength));return e.buffer.slice(e.byteOffset,e.byteOffset+n)}return e}function kH(e){return e?typeof e.byteLength==`number`?e.byteLength:typeof e.length==`number`?e.length:0:0}var Q={USE_FILE:!0,USE_JFIF:!0,USE_PNG_FILE:!0,USE_EXIF:!0,USE_IPTC:!0,USE_XMP:!0,USE_ICC:!0,USE_MPF:!0,USE_PHOTOSHOP:!0,USE_THUMBNAIL:!0,USE_TIFF:!0,USE_JPEG:!0,USE_PNG:!0,USE_HEIC:!0,USE_AVIF:!0,USE_JXL:!0,USE_WEBP:!0,USE_GIF:!0,USE_MAKER_NOTES:!0};function AH(e){if(e.length>=8){let t=kV(e.slice(0,8));if(t===`ASCII\0\0\0`)return kV(e.slice(8));if(t===`JIS\0\0\0\0\0`)return`[JIS encoded text]`;if(t===`UNICODE\0`)return`[Unicode encoded text]`;if(t===`\0\0\0\0\0\0\0\0`){let t=kV(e.slice(8));return/[\x20-\x7e]/.test(t)?t:`[Undefined encoding]`}}return`Undefined`}function jH(e){return e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600}var MH=18761,NH=19789,PH={BIG_ENDIAN:NH,LITTLE_ENDIAN:MH,getByteOrder:FH};function FH(e,t){if(e.getUint16(t)===MH)return MH;if(e.getUint16(t)===NH)return NH;throw Error(`Illegal byte order value. Faulty image.`)}function IH(e,t){return e.getUint32(t+4)}function LH(e,t,n){return t+n<=e.byteLength}var RH=1048576;function zH(e,t,n,r,i,a){let{offsets:o,sizes:s}=BH(n,r+3),c=e.getUint8(o.offsetSize)>>4;s.item.extent.extentOffset=c;let l=e.getUint8(o.lengthSize)&15;s.item.extent.extentLength=l;let u=e.getUint8(o.baseOffsetSize)>>4;s.item.baseOffset=u;let d=VH(e,o.indexSize,n);s.item.extent.extentIndex=d===void 0?0:d;let f=HH(e,o.itemCount,n);return{type:`iloc`,items:UH(e,Math.min(t+i,a),n,o,s,c,l,d,f),length:i}}function BH(e,t){let n={item:{dataReferenceIndex:2,extentCount:2,extent:{}}};e<2?(n.itemCount=2,n.item.itemId=2):e===2&&(n.itemCount=4,n.item.itemId=4),e===1||e===2?n.item.constructionMethod=2:n.item.constructionMethod=0;let r={offsetSize:t,lengthSize:t,baseOffsetSize:t+1,indexSize:t+1};return r.itemCount=t+2,r.items=r.itemCount+n.itemCount,r.item={itemId:0},r.item.constructionMethod=r.item.itemId+n.item.itemId,r.item.dataReferenceIndex=r.item.constructionMethod+n.item.constructionMethod,{offsets:r,sizes:n}}function VH(e,t,n){if(n===1||n===2)return e.getUint8(t)&15}function HH(e,t,n){if(n<2)return e.getUint16(t);if(n===2)return e.getUint32(t)}function UH(e,t,n,r,i,a,o,s,c){if(c===void 0)return[];let l=[],u=r.items,d=i.item.extent.extentIndex+i.item.extent.extentOffset+i.item.extent.extentLength,f=i.item.itemId+i.item.constructionMethod+i.item.dataReferenceIndex+i.item.baseOffset+i.item.extentCount,p=0;for(let r=0;r<c&&!(u+f>t);r++){let r={extents:[]};r.itemId=GH(e,u,n),u+=i.item.itemId,r.constructionMethod=n===1||n===2?e.getUint16(u)&15:void 0,u+=i.item.constructionMethod,r.dataReferenceIndex=e.getUint16(u),u+=i.item.dataReferenceIndex,r.baseOffset=qH(e,u,i.item.baseOffset),u+=i.item.baseOffset,r.extentCount=e.getUint16(u),u+=i.item.extentCount;let c=WH(r.extentCount,d,u,t,RH-p);for(let t=0;t<c;t++){let t={};t.extentIndex=KH(e,n,u,s),u+=i.item.extent.extentIndex,t.extentOffset=qH(e,u,a),u+=i.item.extent.extentOffset,t.extentLength=qH(e,u,o),u+=i.item.extent.extentLength,r.extents.push(t)}if(p+=c,l.push(r),(r.extentCount-c)*d>0)break}return l}function WH(e,t,n,r,i){if(t===0)return 0;let a=Math.floor((r-n)/t);return Math.max(0,Math.min(e,a,i))}function GH(e,t,n){if(n<2)return e.getUint16(t);if(n===2)return e.getUint32(t)}function KH(e,t,n,r){if((t===1||t===2)&&r>0)return qH(e,n,r)}function qH(e,t,n){return n===4?e.getUint32(t):n===8?(console.warn(`This file uses an 8-bit offset which is currently not supported by ExifReader. Contact the maintainer to get it fixed.`),IH(e,t)):0}var JH=1718909296,YH=1768977008,XH=1835365473,ZH=1768714083,QH=1768186228,$H=1768517222,eU=1768842853,tU=1768973167,nU=1668246642,rU=1165519206,iU=1835625829,aU=1970432288;function oU(e,t,n=e.byteLength){if(LH(e,t,8))try{let{length:r,contentOffset:i}=cU(e,t);if(r<8)return;let a=e.getUint32(t+4);if(a===JH)return EU(e,i,r);if(a===YH)return DU(e,t,i,r,n);if(a===tU)return OU(e,t,i,r,n);if(a===nU)return kU(e,i,r);if(a===QH)return MU(i,r);if(!LH(e,i,1))return;let o=e.getUint8(i);return a===XH?jU(e,t,i+1,r,n):a===ZH?zH(e,t,o,i+1,r,n):a===$H?PU(e,t,o,i+1,r,n):a===eU?FU(e,t,o,i+1,r):{type:void 0,length:r}}catch{return}}function sU(e,t){if(!e)return!1;try{let n=oU(e,0);return n!==void 0&&t.indexOf(n.majorBrand)!==-1}catch{return!1}}function cU(e,t){let n=e.getUint32(t);if(lU(n))return{length:e.byteLength-t,contentOffset:t+4+4};if(uU(n)){if(!LH(e,t,16))return{length:0,contentOffset:t+4+4};if(dU(e,t))return{length:e.getUint32(t+12),contentOffset:t+4+4+8}}return{length:n,contentOffset:t+4+4}}function lU(e){return e===0}function uU(e){return e===1}function dU(e,t){return e.getUint32(t+8)===0}function fU(e,t){if(Q.USE_EXIF||Q.USE_XMP||Q.USE_ICC){let n={},r=pU(e);if(!r)return{hasAppMarkers:!1};if(Q.USE_EXIF){let i=mU(e,r,t);i!==void 0&&(n.tiffHeaderOffset=i.tiffHeaderOffset,i.dataView!==void 0&&(n.exifDataView=i.dataView))}if(Q.USE_XMP){let i=CU(e,r,t);i!==void 0&&(n.xmpChunks=i.chunks,i.dataView!==void 0&&(n.xmpDataView=i.dataView))}return Q.USE_ICC&&(n.iccChunks=TU(r,t)),n.hasAppMarkers=n.tiffHeaderOffset!==void 0||n.xmpChunks!==void 0||n.iccChunks!==void 0,n}return{}}function pU(e){let t=0;for(;t+4+4<=e.byteLength;){let n=oU(e,t);if(n===void 0)break;if(n.type===`meta`)return n;t+=n.length}}function mU(e,t,n){try{let r=bU(t).itemId,i=xU(t,r);vU(i);let a=_U(t);if(hU(n,i,`exif`,a),i.extents.length>1){let t=yU(e,i,a);return t===void 0?void 0:{tiffHeaderOffset:SU(t,0),dataView:t}}let o=gU(i,i.extents[0],a);return o===void 0?void 0:{tiffHeaderOffset:SU(e,o)}}catch{return}}function hU(e,t,n,r){if(e)for(let i=0;i<t.extents.length;i++){let a=t.extents[i],o=gU(t,a,r);o!==void 0&&MV(e,n,o,o+a.extentLength)}}function gU(e,t,n){let r=e.constructionMethod;if(r===void 0||r===0)return e.baseOffset+t.extentOffset;if(r===1&&n!==void 0)return n+e.baseOffset+t.extentOffset}function _U(e){let t=e.subBoxes.find(e=>e.type===`idat`);return t?t.contentOffset:void 0}function vU(e){e.constructionMethod===2&&console.warn(`This file uses iloc constructionMethod 2 (item_offset) which is currently not supported by ExifReader. Contact the maintainer to get it fixed.`)}function yU(e,t,n){let r=[],i=0;for(let a=0;a<t.extents.length;a++){let o=t.extents[a],s=gU(t,o,n);if(s===void 0||s+o.extentLength>e.byteLength||(r.push({start:s,length:o.extentLength}),i+=o.extentLength,i>e.byteLength))return}let a=new Uint8Array(i),o=0;for(let t=0;t<r.length;t++){let{start:n,length:i}=r[t];for(let t=0;t<i;t++)a[o+t]=e.getUint8(n+t);o+=i}return new DataView(a.buffer)}function bU(e){return e.subBoxes.find(e=>e.type===`iinf`).itemInfos.find(e=>e.itemType===rU)}function xU(e,t){return e.subBoxes.find(e=>e.type===`iloc`).items.find(e=>e.itemId===t)}function SU(e,t){return t+4+e.getUint32(t)}function CU(e,t,n){try{let r=wU(t).itemId,i=xU(t,r);vU(i);let a=_U(t);if(hU(n,i,`xmp`,a),i.extents.length>1){let t=yU(e,i,a);return t===void 0?void 0:{chunks:[{dataOffset:0,length:t.byteLength}],dataView:t}}let o=i.extents[0],s=gU(i,o,a);return s===void 0?void 0:{chunks:[{dataOffset:s,length:o.extentLength}]}}catch{return}}function wU(e){return e.subBoxes.find(e=>e.type===`iinf`).itemInfos.find(e=>e.itemType===1835625829&&e.contentType===`application/rdf+xml`)}function TU(e,t){try{let n=e.subBoxes.find(e=>e.type===`iprp`).subBoxes.find(e=>e.type===`ipco`).properties.find(e=>e.type===`colr`).icc;if(n)return MV(t,`icc`,n.offset,n.offset+n.length),[n]}catch{}}function EU(e,t,n){return{type:`ftyp`,majorBrand:TV(e,t,4),length:n}}function DU(e,t,n,r,i){return{type:`iprp`,subBoxes:NU(e,n,r-(n-t),i),length:r}}function OU(e,t,n,r,i){return{type:`ipco`,properties:NU(e,n,r-(n-t),i),length:r}}function kU(e,t,n){return{type:`colr`,icc:AU(e,t),length:n}}function AU(e,t){let n=TV(e,t,4);if(n===`prof`||n===`rICC`)return{offset:t+4,length:e.getUint32(t+4),chunkNumber:1,chunksTotal:1}}function jU(e,t,n,r,i){return{type:`meta`,subBoxes:NU(e,n+3,r-(n+3-t),i),length:r}}function MU(e,t){return{type:`idat`,contentOffset:e,length:t}}function NU(e,t,n,r){let i=[rU,iU],a=Math.min(t+n,r),o=[],s=t;for(;s+8<=a;){let t=oU(e,s,a);if(t===void 0)break;t.type!==void 0&&(t.itemType===void 0||i.indexOf(t.itemType)!==-1)&&o.push(t),s+=t.length}return o}function PU(e,t,n,r,i,a){let o=n===0?2:4,s=r+3+o;return{type:`iinf`,itemInfos:NU(e,s,i-(s-t),a),length:i}}function FU(e,t,n,r,i){r+=3;let a={type:`infe`,length:i};return(n===0||n===1)&&(a.itemId=e.getUint16(r),r+=2,a.itemProtectionIndex=e.getUint16(r),r+=2,a.itemName=EV(e,r),r+=a.itemName.length+1),n>=2&&(n===2?(a.itemId=e.getUint16(r),r+=2):n===3&&(a.itemId=e.getUint32(r),r+=4),a.itemProtectionIndex=e.getUint16(r),r+=2,a.itemType=e.getUint32(r),r+=4,a.itemName=EV(e,r),r+=a.itemName.length+1,a.itemType===1835625829?(a.contentType=EV(e,r),r+=a.contentType.length+1,t+i>r&&(a.contentEncoding=EV(e,r),r+=a.contentEncoding.length+1)):a.itemType===aU&&(a.itemUri=EV(e,r),r+=a.itemUri.length+1)),a}var IU={isTiffFile:LU,findTiffOffsets:zU};function LU(e){return!!e&&e.byteLength>=4&&RU(e)}function RU(e){let t=e.getUint16(0)===PH.LITTLE_ENDIAN;return e.getUint16(2,t)===42}function zU(){return Q.USE_EXIF?{hasAppMarkers:!0,tiffHeaderOffset:0}:{}}var BU={isJpegFile:CW,findJpegOffsets:wW},VU=2,HU=65496,UU=2,WU=4,GU=2,KU=2,qU=10,JU=18,YU=33,XU=79,ZU=18,QU=8,$U=`ICC_PROFILE\0`,eW=16,tW=17,nW=255,rW=`MPF\0`,iW=65472,aW=65474,oW=65476,sW=65499,cW=65501,lW=65498,uW=65504,dW=65505,fW=65506,pW=65517,mW=65519,hW=65534,gW=65535,_W=`JFIF`,vW=`Exif`,yW=`http://ns.adobe.com/xap/1.0/\0`,bW=`http://ns.adobe.com/xmp/extension/\0`,xW=`Photoshop 3.0`,SW=`8BIM`;function CW(e){return!!e&&e.byteLength>=VU&&e.getUint16(0)===HU}function wW(e,t){let n=UU,r,i,a,o,s,c,l,u,d,f=0,p,m=!1;for(;n+WU+5<=e.byteLength;){let h;if(e.getUint16(n)===lW&&(m=!0),Q.USE_FILE&&TW(e,n))r=e.getUint16(n+GU),i=n+GU,h=`file`;else if(Q.USE_FILE&&EW(e,n))r=e.getUint16(n+GU),a=n+GU,h=`file`;else if(Q.USE_JFIF&&kW(e,n))r=e.getUint16(n+GU),o=n+KU,h=`jfif`;else if(Q.USE_EXIF&&AW(e,n)){r=e.getUint16(n+GU),f++;let t=n+qU;if(f===1)p={appMarkerPosition:n,fieldLength:r,tiffHeaderOffset:t,score:void 0};else{p.score===void 0&&(p.score=BW(e,p.appMarkerPosition,p.fieldLength,p.tiffHeaderOffset));let i=BW(e,n,r,t);i>p.score&&(p={appMarkerPosition:n,fieldLength:r,tiffHeaderOffset:t,score:i})}s=p.tiffHeaderOffset,h=`exif`}else if(Q.USE_XMP&&jW(e,n))l||=[],r=e.getUint16(n+GU),l.push(FW(n,r)),h=`xmp`;else if(Q.USE_XMP&&NW(e,n))l||=[],r=e.getUint16(n+GU),l.push(IW(n,r)),h=`xmp`;else if(Q.USE_IPTC&&LW(e,n))r=e.getUint16(n+GU),c=n+JU,h=`iptc`;else if(Q.USE_ICC&&DW(e,n)){if(r=e.getUint16(n+GU),u||=[],u.length<nW){let t=n+ZU,i=r-16,a=e.getUint8(n+eW),o=e.getUint8(n+tW);u.push({offset:t,length:i,chunkNumber:a,chunksTotal:o})}h=`icc`}else if(Q.USE_MPF&&OW(e,n))r=e.getUint16(n+GU),d=n+QU,h=`mpf`;else if(RW(e,n))r=e.getUint16(n+GU);else if(zW(e,n)){n++;continue}else break;MV(t,h,n,n+GU+r),n+=GU+r}return f>1&&HW(f),t&&(!m&&n+GU<=e.byteLength&&e.getUint16(n)===lW&&(m=!0),t.truncated=!m),{hasAppMarkers:n>UU,fileDataOffset:i||a,jfifDataOffset:o,tiffHeaderOffset:s,iptcDataOffset:c,xmpChunks:l,iccChunks:u,mpfDataOffset:d}}function TW(e,t){return e.getUint16(t)===iW}function EW(e,t){return e.getUint16(t)===aW}function DW(e,t){return e.getUint16(t)===fW&&t+tW<e.byteLength&&TV(e,t+WU,12)===$U}function OW(e,t){return e.getUint16(t)===fW&&TV(e,t+WU,4)===rW}function kW(e,t){return e.getUint16(t)===uW&&TV(e,t+WU,4)===_W&&e.getUint8(t+WU+4)===0}function AW(e,t){return e.getUint16(t)===dW&&TV(e,t+WU,4)===vW&&e.getUint8(t+WU+4)===0}function jW(e,t){return e.getUint16(t)===dW&&MW(e,t)}function MW(e,t){return TV(e,t+WU,29)===yW}function NW(e,t){return e.getUint16(t)===dW&&PW(e,t)}function PW(e,t){return TV(e,t+WU,35)===bW}function FW(e,t){return{dataOffset:e+YU,length:t-31}}function IW(e,t){return{dataOffset:e+XU,length:t-77}}function LW(e,t){let n=t+WU+13+1;return n+4<=e.byteLength&&e.getUint16(t)===pW&&TV(e,t+WU,13)===xW&&e.getUint8(t+WU+13)===0&&TV(e,n,4)===SW}function RW(e,t){let n=e.getUint16(t);return n>=uW&&n<=mW||n===hW||n===iW||n===aW||n===oW||n===sW||n===cW||n===lW}function zW(e,t){return e.getUint16(t)===gW}function BW(e,t,n,r){let i=VW(e,r,t+GU+n);if(!i)return 0;let a=Number.isInteger(i.ifdEntries)?i.ifdEntries:0;return(i.isValid?1e9:0)+a*1e6+n}function VW(e,t,n){try{if(t+8>n)return;let r=e.getUint16(t+0),i=r===PH.LITTLE_ENDIAN;if(!i&&r!==PH.BIG_ENDIAN||e.getUint16(t+2,i)!==42)return;let a=t+e.getUint32(t+4,i);if(a+2>n)return;let o=e.getUint16(a,i);return{ifdEntries:o,isValid:a+(2+o*12+4)<=n&&o>0}}catch{return}}function HW(e){typeof console>`u`||typeof console.warn!=`function`||console.warn(`ExifReader: Found ${e} Exif segments (APP1). Will pick the best candidate segment.`)}var UW={isPngFile:ZW,findPngOffsets:QW},WW=`PNG\r
|
|
89
|
-
|
|
90
|
-
`,GW=4,KW=`XML:com.adobe.xmp\0`,qW=`pHYs`,JW=`tIME`,YW=`eXIf`,XW=`iCCP`;function ZW(e){return!!e&&TV(e,0,8)===WW}function QW(e,t,n){let r={hasAppMarkers:!1},i=8,a=!1;for(;i+GW+4<=e.byteLength;){let o,s=e.getUint32(i+0);if(n&&TV(e,i+4,4)===`IEND`&&(a=!0),Q.USE_PNG_FILE&&$W(e,i))r.hasAppMarkers=!0,r.pngHeaderOffset=i+8,o=`file`;else if(Q.USE_XMP&&eG(e,i)){let t=aG(e,i);t!==void 0&&(r.hasAppMarkers=!0,r.xmpChunks=[{dataOffset:t,length:s-(t-(i+8))}],o=`xmp`)}else if(tG(e,i,t)){r.hasAppMarkers=!0;let t=TV(e,i+4,4);r.pngTextChunks||=[],r.pngTextChunks.push({length:s,type:t,offset:i+8}),o=`png`}else if(nG(e,i))r.hasAppMarkers=!0,r.tiffHeaderOffset=i+8,o=`exif`;else if(Q.USE_ICC&&t&&rG(e,i)){let t=i+8,n=oG(e,t);n!==void 0&&(r.hasAppMarkers=!0,r.iccChunks||=[],r.iccChunks.push({offset:n.compressedProfileOffset,length:s-(n.compressedProfileOffset-t),chunkNumber:1,chunksTotal:1,profileName:n.profileName,compressionMethod:n.compressionMethod}),o=`icc`)}else iG(e,i)&&(r.hasAppMarkers=!0,r.pngChunkOffsets||=[],r.pngChunkOffsets.push(i+0),o=`png`);let c=s+GW+4+4;MV(n,o,i,i+c),i+=c}return n&&(n.truncated=!a),r}function $W(e,t){return TV(e,t+4,4)===`IHDR`}function eG(e,t){return TV(e,t+4,4)===`iTXt`&&TV(e,t+8,18)===KW}function tG(e,t,n){let r=TV(e,t+4,4);return r===`tEXt`||r===`iTXt`||r===`zTXt`&&n}function nG(e,t){return TV(e,t+4,4)===YW}function rG(e,t){return TV(e,t+4,4)===XW}function iG(e,t){let n=[qW,JW],r=TV(e,t+4,4);return n.includes(r)}function aG(e,t){t+=28;let n=0;for(;n<2&&t<e.byteLength;)e.getUint8(t)===0&&n++,t++;if(!(n<2))return t}function oG(e,t){let n=EV(e,t);if(t+=n.length+1,t+1>e.byteLength)return;let r=e.getUint8(t);return t+=1,{profileName:n,compressionMethod:r,compressedProfileOffset:t}}var sG={isHeicFile:lG,findHeicOffsets:uG},cG=[`heic`,`heix`,`hevc`,`hevx`,`heim`,`heis`,`hevm`,`hevs`,`mif1`];function lG(e){return sU(e,cG)}function uG(e,t){return fU(e,t)}var dG={isAvifFile:pG,findAvifOffsets:mG},fG=[`avif`];function pG(e){return sU(e,fG)}function mG(e,t){return fU(e,t)}var hG={isJxlFile:TG,findJxlOffsets:OG},gG=[0,0,0,12,74,88,76,32,13,10,135,10],_G=[255,10],vG=1165519206,yG=2020437024,bG=1651666786,xG=1786276963,SG=1786276976,CG=4,wG=4;function TG(e){try{return EG(e)||DG(e)}catch{return!1}}function EG(e){if(!e||e.byteLength<gG.length)return!1;for(let t=0;t<gG.length;t++)if(e.getUint8(t)!==gG[t])return!1;return!0}function DG(e){return!e||e.byteLength<_G.length?!1:e.getUint8(0)===_G[0]&&e.getUint8(1)===_G[1]}function OG(e,t){let n=0,r,i,a,o,s;if(DG(e))return{hasAppMarkers:!0,tiffHeaderOffset:void 0,xmpChunks:void 0,brobExifChunk:void 0,brobXmpChunk:void 0,jxlCodestreamOffset:0};for(;n+8<=e.byteLength;){let{length:c,contentOffset:l}=cU(e,n);if(c<8)break;let u=e.getUint32(n+4),d;if(Q.USE_EXIF&&u===vG){try{r=SU(e,l)}catch{}d=`exif`}if(Q.USE_XMP&&u===yG&&(i=[{dataOffset:l,length:c-(l-n)}],d=`xmp`),u===xG&&s===void 0&&(s=l),u===SG&&s===void 0&&l+CG<=e.byteLength&&(e.getUint32(l)&2147483647||(s=l+CG)),u===bG&&l+wG<=e.byteLength){let t=e.getUint32(l),s=l+wG,u=c-(s-n);Q.USE_EXIF&&t===vG&&(d=`exif`,r===void 0&&!a&&(a={dataOffset:s,length:u})),Q.USE_XMP&&t===yG&&(d=`xmp`,!i&&!o&&(o={dataOffset:s,length:u}))}MV(t,d,n,n+c),n+=c}return{hasAppMarkers:r!==void 0||i!==void 0||a!==void 0||o!==void 0||s!==void 0,tiffHeaderOffset:r,xmpChunks:i,brobExifChunk:a,brobXmpChunk:o,jxlCodestreamOffset:s}}var kG={isWebpFile:AG,findOffsets:jG};function AG(e){return!!e&&TV(e,0,4)===`RIFF`&&TV(e,8,4)===`WEBP`}function jG(e,t){let n=12,r=!1,i,a,o,s;for(;n+8<e.byteLength;){let c=TV(e,n,4),l=e.getUint32(n+4,!0),u;Q.USE_EXIF&&c===`EXIF`?(r=!0,i=TV(e,n+8,6)===`Exif\0\0`?n+8+6:n+8,u=`exif`):Q.USE_XMP&&c===`XMP `?(r=!0,a=[{dataOffset:n+8,length:l}],u=`xmp`):Q.USE_ICC&&c===`ICCP`?(r=!0,o=[{offset:n+8,length:l,chunkNumber:1,chunksTotal:1}],u=`icc`):c===`VP8X`&&(r=!0,s=n+8,u=`riff`);let d=8+(l%2==0?l:l+1);MV(t,u,n,n+d),n+=d}return{hasAppMarkers:r,tiffHeaderOffset:i,xmpChunks:a,iccChunks:o,vp8xChunkOffset:s}}var MG={isGifFile:IG,findOffsets:LG},NG=6,PG=[`GIF87a`,`GIF89a`],FG=13;function IG(e){return!!e&&PG.includes(TV(e,0,NG))}function LG(e,t){return MV(t,`gif`,0,FG),{gifHeaderOffset:0}}var RG={isXMLFile:HG,findOffsets:UG},zG=0,BG=`<?xpacket begin`,VG=[`<?xpacket end=`,`</x:xmpmeta>`];function HG(e){return!!e&&TV(e,zG,15)===BG}function UG(e,t){let n=[];return n.push({dataOffset:zG,length:e.byteLength}),MV(t,`xmp`,0,e.byteLength),t&&(t.truncated=!WG(e)),{xmpChunks:n}}function WG(e){let t=TV(e,0,e.byteLength);for(let e=0;e<VG.length;e++)if(t.indexOf(VG[e])!==-1)return!0;return!1}var GG={parseAppMarkers:KG};function KG(e,t,n){let r=n?[]:void 0;if(Q.USE_TIFF&&IU.isTiffFile(e))return qG(IU.findTiffOffsets(),`tiff`,`TIFF`,r);if(Q.USE_JPEG&&BU.isJpegFile(e))return qG(BU.findJpegOffsets(e,r),`jpeg`,`JPEG`,r);if(Q.USE_PNG&&UW.isPngFile(e))return qG(UW.findPngOffsets(e,t,r),`png`,`PNG`,r);if(Q.USE_HEIC&&sG.isHeicFile(e))return qG(sG.findHeicOffsets(e,r),`heic`,`HEIC`,r);if(Q.USE_AVIF&&dG.isAvifFile(e))return qG(dG.findAvifOffsets(e,r),`avif`,`AVIF`,r);if(Q.USE_JXL&&hG.isJxlFile(e))return qG(hG.findJxlOffsets(e,r),`jxl`,`JPEG XL`,r);if(Q.USE_WEBP&&kG.isWebpFile(e))return qG(kG.findOffsets(e,r),`webp`,`WebP`,r);if(Q.USE_GIF&&MG.isGifFile(e))return qG(MG.findOffsets(e,r),`gif`,`GIF`,r);if(Q.USE_XMP&&RG.isXMLFile(e))return qG(RG.findOffsets(e,r),`xml`,`XML`,r);throw Error(`Invalid image format`)}function qG(e,t,n,r){let i=PV({},e,{fileType:{value:t,description:n}});return r!==void 0&&(i.metadataBlocks=r,i.metadataTruncated=!!r.truncated),i}var JG={ApertureValue:e=>(Math.sqrt(2)**+(e[0]/e[1])).toFixed(2),ColorSpace(e){return e===1?`sRGB`:e===65535?`Uncalibrated`:`Unknown`},ComponentsConfiguration(e){return e.map(e=>{if(e===49)return`Y`;if(e===50)return`Cb`;if(e===51)return`Cr`;if(e===52)return`R`;if(e===53)return`G`;if(e===54)return`B`}).join(``)},Contrast(e){return e===0?`Normal`:e===1?`Soft`:e===2?`Hard`:`Unknown`},CustomRendered(e){return e===0?`Normal process`:e===1?`Custom process`:`Unknown`},ExposureMode(e){return e===0?`Auto exposure`:e===1?`Manual exposure`:e===2?`Auto bracket`:`Unknown`},ExposureProgram(e){return e===0?`Undefined`:e===1?`Manual`:e===2?`Normal program`:e===3?`Aperture priority`:e===4?`Shutter priority`:e===5?`Creative program`:e===6?`Action program`:e===7?`Portrait mode`:e===8?`Landscape mode`:e===9?`Bulb`:`Unknown`},ExposureTime(e){if(e[0]/e[1]>.25){let t=e[0]/e[1];return Number.isInteger(t)?``+t:t.toFixed(1)}return e[0]===0?`0/${e[1]}`:`1/${Math.round(e[1]/e[0])}`},FNumber:e=>`f/${Number(e[0]/e[1]).toFixed(1)}`,FocalLength:e=>e[0]/e[1]+` mm`,FocalPlaneResolutionUnit(e){return e===2?`inches`:e===3?`centimeters`:e===4?`millimeters`:`Unknown`},LightSource:e=>e===1?`Daylight`:e===2?`Fluorescent`:e===3?`Tungsten (incandescent light)`:e===4?`Flash`:e===9?`Fine weather`:e===10?`Cloudy weather`:e===11?`Shade`:e===12?`Daylight fluorescent (D 5700 – 7100K)`:e===13?`Day white fluorescent (N 4600 – 5400K)`:e===14?`Cool white fluorescent (W 3900 – 4500K)`:e===15?`White fluorescent (WW 3200 – 3700K)`:e===17?`Standard light A`:e===18?`Standard light B`:e===19?`Standard light C`:e===20?`D55`:e===21?`D65`:e===22?`D75`:e===23?`D50`:e===24?`ISO studio tungsten`:e===255?`Other light source`:`Unknown`,MeteringMode(e){return e===1?`Average`:e===2?`CenterWeightedAverage`:e===3?`Spot`:e===4?`MultiSpot`:e===5?`Pattern`:e===6?`Partial`:e===255?`Other`:`Unknown`},ResolutionUnit(e){return e===2?`inches`:e===3?`centimeters`:`Unknown`},Saturation(e){return e===0?`Normal`:e===1?`Low saturation`:e===2?`High saturation`:`Unknown`},FocalLengthIn35mmFilm(e){return e===0?`Unknown`:e+` mm`},SceneCaptureType(e){return e===0?`Standard`:e===1?`Landscape`:e===2?`Portrait`:e===3?`Night scene`:`Unknown`},Sharpness(e){return e===0?`Normal`:e===1?`Soft`:e===2?`Hard`:`Unknown`},ShutterSpeedValue(e){let t=2**(e[0]/e[1]);return t<=1?`${Math.round(1/t)}`:`1/${Math.round(t)}`},WhiteBalance(e){return e===0?`Auto white balance`:e===1?`Manual white balance`:`Unknown`},XResolution:e=>``+Math.round(e[0]/e[1]),YResolution:e=>``+Math.round(e[0]/e[1])},YG={11:`ProcessingSoftware`,254:{name:`SubfileType`,description:e=>({0:`Full-resolution image`,1:`Reduced-resolution image`,2:`Single page of multi-page image`,3:`Single page of multi-page reduced-resolution image`,4:`Transparency mask`,5:`Transparency mask of reduced-resolution image`,6:`Transparency mask of multi-page image`,7:`Transparency mask of reduced-resolution multi-page image`,65537:`Alternate reduced-resolution image`,4294967295:`Invalid`})[e]||`Unknown`},255:{name:`OldSubfileType`,description:e=>({0:`Full-resolution image`,1:`Reduced-resolution image`,2:`Single page of multi-page image`})[e]||`Unknown`},256:`ImageWidth`,257:`ImageLength`,258:`BitsPerSample`,259:`Compression`,262:`PhotometricInterpretation`,263:{name:`Thresholding`,description:e=>({1:`No dithering or halftoning`,2:`Ordered dither or halfton`,3:`Randomized dither`})[e]||`Unknown`},264:`CellWidth`,265:`CellLength`,266:{name:`FillOrder`,description:e=>({1:`Normal`,2:`Reversed`})[e]||`Unknown`},269:`DocumentName`,270:`ImageDescription`,271:`Make`,272:`Model`,273:`StripOffsets`,274:{name:`Orientation`,description:e=>e===1?`top-left`:e===2?`top-right`:e===3?`bottom-right`:e===4?`bottom-left`:e===5?`left-top`:e===6?`right-top`:e===7?`right-bottom`:e===8?`left-bottom`:`Undefined`},277:`SamplesPerPixel`,278:`RowsPerStrip`,279:`StripByteCounts`,280:`MinSampleValue`,281:`MaxSampleValue`,282:{name:`XResolution`,description:JG.XResolution},283:{name:`YResolution`,description:JG.YResolution},284:`PlanarConfiguration`,285:`PageName`,286:{name:`XPosition`,description:e=>``+Math.round(e[0]/e[1])},287:{name:`YPosition`,description:e=>``+Math.round(e[0]/e[1])},290:{name:`GrayResponseUnit`,description:e=>({1:`0.1`,2:`0.001`,3:`0.0001`,4:`1e-05`,5:`1e-06`})[e]||`Unknown`},296:{name:`ResolutionUnit`,description:JG.ResolutionUnit},297:`PageNumber`,301:`TransferFunction`,305:`Software`,306:`DateTime`,315:`Artist`,316:`HostComputer`,317:`Predictor`,318:{name:`WhitePoint`,description:e=>e.map(e=>`${e[0]}/${e[1]}`).join(`, `)},319:{name:`PrimaryChromaticities`,description:e=>e.map(e=>`${e[0]}/${e[1]}`).join(`, `)},321:`HalftoneHints`,322:`TileWidth`,323:`TileLength`,330:`A100DataOffset`,332:{name:`InkSet`,description:e=>({1:`CMYK`,2:`Not CMYK`})[e]||`Unknown`},337:`TargetPrinter`,338:{name:`ExtraSamples`,description:e=>({0:`Unspecified`,1:`Associated Alpha`,2:`Unassociated Alpha`})[e]||`Unknown`},339:{name:`SampleFormat`,description:e=>{let t={1:`Unsigned`,2:`Signed`,3:`Float`,4:`Undefined`,5:`Complex int`,6:`Complex float`};return Array.isArray(e)?e.map(e=>t[e]||`Unknown`).join(`, `):`Unknown`}},513:`JPEGInterchangeFormat`,514:`JPEGInterchangeFormatLength`,529:{name:`YCbCrCoefficients`,description:e=>e.map(e=>``+e[0]/e[1]).join(`/`)},530:`YCbCrSubSampling`,531:{name:`YCbCrPositioning`,description:e=>e===1?`centered`:e===2?`co-sited`:`undefined `+e},532:{name:`ReferenceBlackWhite`,description:e=>e.map(e=>``+e[0]/e[1]).join(`, `)},700:`ApplicationNotes`,18246:`Rating`,18249:`RatingPercent`,33432:{name:`Copyright`,description:e=>e.join(`; `)},33550:`PixelScale`,33723:`IPTC-NAA`,33920:`IntergraphMatrix`,33922:`ModelTiePoint`,34118:`SEMInfo`,34264:`ModelTransform`,34377:`PhotoshopSettings`,34665:`Exif IFD Pointer`,34675:`ICC_Profile`,34735:`GeoTiffDirectory`,34736:`GeoTiffDoubleParams`,34737:`GeoTiffAsciiParams`,34853:`GPS Info IFD Pointer`,40091:{name:`XPTitle`,description:XG},40092:{name:`XPComment`,description:XG},40093:{name:`XPAuthor`,description:XG},40094:{name:`XPKeywords`,description:XG},40095:{name:`XPSubject`,description:XG},42112:`GDALMetadata`,42113:`GDALNoData`,50341:`PrintIM`,50707:`DNGBackwardVersion`,50708:`UniqueCameraModel`,50709:`LocalizedCameraModel`,50721:`ColorMatrix1`,50722:`ColorMatrix2`,50723:`CameraCalibration1`,50724:`CameraCalibration2`,50725:`ReductionMatrix1`,50726:`ReductionMatrix2`,50727:`AnalogBalance`,50728:`AsShotNeutral`,50729:`AsShotWhiteXY`,50730:`BaselineExposure`,50731:`BaselineNoise`,50732:`BaselineSharpness`,50734:`LinearResponseLimit`,50735:`CameraSerialNumber`,50736:`DNGLensInfo`,50739:`ShadowScale`,50741:{name:`MakerNoteSafety`,description:e=>({0:`Unsafe`,1:`Safe`})[e]||`Unknown`},50778:{name:`CalibrationIlluminant1`,description:JG.LightSource},50779:{name:`CalibrationIlluminant2`,description:JG.LightSource},50781:`RawDataUniqueID`,50827:`OriginalRawFileName`,50828:`OriginalRawFileData`,50831:`AsShotICCProfile`,50832:`AsShotPreProfileMatrix`,50833:`CurrentICCProfile`,50834:`CurrentPreProfileMatrix`,50879:`ColorimetricReference`,50885:`SRawType`,50898:`PanasonicTitle`,50899:`PanasonicTitle2`,50931:`CameraCalibrationSig`,50932:`ProfileCalibrationSig`,50933:`ProfileIFD`,50934:`AsShotProfileName`,50936:`ProfileName`,50937:`ProfileHueSatMapDims`,50938:`ProfileHueSatMapData1`,50939:`ProfileHueSatMapData2`,50940:`ProfileToneCurve`,50941:{name:`ProfileEmbedPolicy`,description:e=>({0:`Allow Copying`,1:`Embed if Used`,2:`Never Embed`,3:`No Restrictions`})[e]||`Unknown`},50942:`ProfileCopyright`,50964:`ForwardMatrix1`,50965:`ForwardMatrix2`,50966:`PreviewApplicationName`,50967:`PreviewApplicationVersion`,50968:`PreviewSettingsName`,50969:`PreviewSettingsDigest`,50970:{name:`PreviewColorSpace`,description:e=>({1:`Gray Gamma 2.2`,2:`sRGB`,3:`Adobe RGB`,4:`ProPhoto RGB`})[e]||`Unknown`},50971:`PreviewDateTime`,50972:`RawImageDigest`,50973:`OriginalRawFileDigest`,50981:`ProfileLookTableDims`,50982:`ProfileLookTableData`,51043:`TimeCodes`,51044:`FrameRate`,51058:`TStop`,51081:`ReelName`,51089:`OriginalDefaultFinalSize`,51090:`OriginalBestQualitySize`,51091:`OriginalDefaultCropSize`,51105:`CameraLabel`,51107:{name:`ProfileHueSatMapEncoding`,description:e=>({0:`Linear`,1:`sRGB`})[e]||`Unknown`},51108:{name:`ProfileLookTableEncoding`,description:e=>({0:`Linear`,1:`sRGB`})[e]||`Unknown`},51109:`BaselineExposureOffset`,51110:{name:`DefaultBlackRender`,description:e=>({0:`Auto`,1:`None`})[e]||`Unknown`},51111:`NewRawImageDigest`,51112:`RawToPreviewGain`};function XG(e){return new TextDecoder(`utf-16`).decode(new Uint8Array(e)).replace(/\u0000+$/,``)}var ZG={33434:{name:`ExposureTime`,description:JG.ExposureTime},33437:{name:`FNumber`,description:JG.FNumber},34850:{name:`ExposureProgram`,description:JG.ExposureProgram},34852:`SpectralSensitivity`,34855:`ISOSpeedRatings`,34856:{name:`OECF`,description:()=>`[Raw OECF table data]`},34858:`TimeZoneOffset`,34859:`SelfTimerMode`,34864:{name:`SensitivityType`,description:e=>({1:`Standard Output Sensitivity`,2:`Recommended Exposure Index`,3:`ISO Speed`,4:`Standard Output Sensitivity and Recommended Exposure Index`,5:`Standard Output Sensitivity and ISO Speed`,6:`Recommended Exposure Index and ISO Speed`,7:`Standard Output Sensitivity, Recommended Exposure Index and ISO Speed`})[e]||`Unknown`},34865:`StandardOutputSensitivity`,34866:`RecommendedExposureIndex`,34867:`ISOSpeed`,34868:`ISOSpeedLatitudeyyy`,34869:`ISOSpeedLatitudezzz`,36864:{name:`ExifVersion`,description:e=>kV(e)},36867:`DateTimeOriginal`,36868:`DateTimeDigitized`,36873:`GooglePlusUploadCode`,36880:`OffsetTime`,36881:`OffsetTimeOriginal`,36882:`OffsetTimeDigitized`,37121:{name:`ComponentsConfiguration`,description:JG.ComponentsConfiguration},37122:`CompressedBitsPerPixel`,37377:{name:`ShutterSpeedValue`,description:JG.ShutterSpeedValue},37378:{name:`ApertureValue`,description:JG.ApertureValue},37379:`BrightnessValue`,37380:`ExposureBiasValue`,37381:{name:`MaxApertureValue`,description:e=>(Math.sqrt(2)**+(e[0]/e[1])).toFixed(2)},37382:{name:`SubjectDistance`,description:e=>e[0]/e[1]+` m`},37383:{name:`MeteringMode`,description:JG.MeteringMode},37384:{name:`LightSource`,description:JG.LightSource},37385:{name:`Flash`,description:e=>e===0?`Flash did not fire`:e===1?`Flash fired`:e===5?`Strobe return light not detected`:e===7?`Strobe return light detected`:e===9?`Flash fired, compulsory flash mode`:e===13?`Flash fired, compulsory flash mode, return light not detected`:e===15?`Flash fired, compulsory flash mode, return light detected`:e===16?`Flash did not fire, compulsory flash mode`:e===24?`Flash did not fire, auto mode`:e===25?`Flash fired, auto mode`:e===29?`Flash fired, auto mode, return light not detected`:e===31?`Flash fired, auto mode, return light detected`:e===32?`No flash function`:e===65?`Flash fired, red-eye reduction mode`:e===69?`Flash fired, red-eye reduction mode, return light not detected`:e===71?`Flash fired, red-eye reduction mode, return light detected`:e===73?`Flash fired, compulsory flash mode, red-eye reduction mode`:e===77?`Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected`:e===79?`Flash fired, compulsory flash mode, red-eye reduction mode, return light detected`:e===89?`Flash fired, auto mode, red-eye reduction mode`:e===93?`Flash fired, auto mode, return light not detected, red-eye reduction mode`:e===95?`Flash fired, auto mode, return light detected, red-eye reduction mode`:`Unknown`},37386:{name:`FocalLength`,description:JG.FocalLength},37393:`ImageNumber`,37394:{name:`SecurityClassification`,description:e=>({C:`Confidential`,R:`Restricted`,S:`Secret`,T:`Top Secret`,U:`Unclassified`})[e]||`Unknown`},37395:`ImageHistory`,37396:{name:`SubjectArea`,description:e=>e.length===2?`Location; X: ${e[0]}, Y: ${e[1]}`:e.length===3?`Circle; X: ${e[0]}, Y: ${e[1]}, diameter: ${e[2]}`:e.length===4?`Rectangle; X: ${e[0]}, Y: ${e[1]}, width: ${e[2]}, height: ${e[3]}`:`Unknown`},37500:{name:`MakerNote`,description:()=>`[Raw maker note data]`},37510:{name:`UserComment`,description:AH},37520:`SubSecTime`,37521:`SubSecTimeOriginal`,37522:`SubSecTimeDigitized`,37724:`ImageSourceData`,37888:{name:`AmbientTemperature`,description:e=>e[0]/e[1]+` °C`},37889:{name:`Humidity`,description:e=>e[0]/e[1]+` %`},37890:{name:`Pressure`,description:e=>e[0]/e[1]+` hPa`},37891:{name:`WaterDepth`,description:e=>e[0]/e[1]+` m`},37892:{name:`Acceleration`,description:e=>e[0]/e[1]+` mGal`},37893:{name:`CameraElevationAngle`,description:e=>e[0]/e[1]+` °`},40960:{name:`FlashpixVersion`,description:e=>e.map(e=>String.fromCharCode(e)).join(``)},40961:{name:`ColorSpace`,description:JG.ColorSpace},40962:`PixelXDimension`,40963:`PixelYDimension`,40964:`RelatedSoundFile`,40965:`Interoperability IFD Pointer`,41483:`FlashEnergy`,41484:{name:`SpatialFrequencyResponse`,description:()=>`[Raw SFR table data]`},41486:`FocalPlaneXResolution`,41487:`FocalPlaneYResolution`,41488:{name:`FocalPlaneResolutionUnit`,description:JG.FocalPlaneResolutionUnit},41492:{name:`SubjectLocation`,description:([e,t])=>`X: ${e}, Y: ${t}`},41493:`ExposureIndex`,41495:{name:`SensingMethod`,description:e=>e===1?`Undefined`:e===2?`One-chip color area sensor`:e===3?`Two-chip color area sensor`:e===4?`Three-chip color area sensor`:e===5?`Color sequential area sensor`:e===7?`Trilinear sensor`:e===8?`Color sequential linear sensor`:`Unknown`},41728:{name:`FileSource`,description:e=>e===3?`DSC`:`Unknown`},41729:{name:`SceneType`,description:e=>e===1?`A directly photographed image`:`Unknown`},41730:{name:`CFAPattern`,description:()=>`[Raw CFA pattern table data]`},41985:{name:`CustomRendered`,description:JG.CustomRendered},41986:{name:`ExposureMode`,description:JG.ExposureMode},41987:{name:`WhiteBalance`,description:JG.WhiteBalance},41988:{name:`DigitalZoomRatio`,description:e=>e[0]===0?`Digital zoom was not used`:``+e[0]/e[1]},41989:{name:`FocalLengthIn35mmFilm`,description:JG.FocalLengthIn35mmFilm},41990:{name:`SceneCaptureType`,description:JG.SceneCaptureType},41991:{name:`GainControl`,description:e=>e===0?`None`:e===1?`Low gain up`:e===2?`High gain up`:e===3?`Low gain down`:e===4?`High gain down`:`Unknown`},41992:{name:`Contrast`,description:JG.Contrast},41993:{name:`Saturation`,description:JG.Saturation},41994:{name:`Sharpness`,description:JG.Sharpness},41995:{name:`DeviceSettingDescription`,description:()=>`[Raw device settings table data]`},41996:{name:`SubjectDistanceRange`,description:e=>e===1?`Macro`:e===2?`Close view`:e===3?`Distant view`:`Unknown`},42016:`ImageUniqueID`,42032:`CameraOwnerName`,42033:`BodySerialNumber`,42034:{name:`LensSpecification`,description:e=>{let t=`${parseFloat((e[0][0]/e[0][1]).toFixed(5))}-${parseFloat((e[1][0]/e[1][1]).toFixed(5))} mm`;if(e[3][1]===0)return`${t} f/?`;let n=1/(e[2][1]/e[2][1]/(e[3][0]/e[3][1]));return`${t} f/${parseFloat(n.toFixed(5))}`}},42035:`LensMake`,42036:`LensModel`,42037:`LensSerialNumber`,42080:{name:`CompositeImage`,description:e=>({1:`Not a Composite Image`,2:`General Composite Image`,3:`Composite Image Captured While Shooting`})[e]||`Unknown`},42081:`SourceImageNumberOfCompositeImage`,42082:`SourceExposureTimesOfCompositeImage`,42240:`Gamma`,59932:`Padding`,59933:`OffsetSchema`,65e3:`OwnerName`,65001:`SerialNumber`,65002:`Lens`,65100:`RawFile`,65101:`Converter`,65102:`WhiteBalance`,65105:`Exposure`,65106:`Shadows`,65107:`Brightness`,65108:`Contrast`,65109:`Saturation`,65110:`Sharpness`,65111:`Smoothness`,65112:`MoireFilter`},QG={0:{name:`GPSVersionID`,description:e=>e[0]===2&&e[1]===2&&e[2]===0&&e[3]===0?`Version 2.2`:`Unknown`},1:{name:`GPSLatitudeRef`,description:e=>{let t=e.join(``);return t===`N`?`North latitude`:t===`S`?`South latitude`:`Unknown`}},2:{name:`GPSLatitude`,description:jH},3:{name:`GPSLongitudeRef`,description:e=>{let t=e.join(``);return t===`E`?`East longitude`:t===`W`?`West longitude`:`Unknown`}},4:{name:`GPSLongitude`,description:jH},5:{name:`GPSAltitudeRef`,description:e=>e===0?`Sea level`:e===1?`Sea level reference (negative value)`:`Unknown`},6:{name:`GPSAltitude`,description:e=>e[0]/e[1]+` m`},7:{name:`GPSTimeStamp`,description:e=>e.map(([e,t])=>{let n=e/t;return/^\d(\.|$)/.test(`${n}`)?`0${n}`:n}).join(`:`)},8:`GPSSatellites`,9:{name:`GPSStatus`,description:e=>{let t=e.join(``);return t===`A`?`Measurement in progress`:t===`V`?`Measurement Interoperability`:`Unknown`}},10:{name:`GPSMeasureMode`,description:e=>{let t=e.join(``);return t===`2`?`2-dimensional measurement`:t===`3`?`3-dimensional measurement`:`Unknown`}},11:`GPSDOP`,12:{name:`GPSSpeedRef`,description:e=>{let t=e.join(``);return t===`K`?`Kilometers per hour`:t===`M`?`Miles per hour`:t===`N`?`Knots`:`Unknown`}},13:`GPSSpeed`,14:{name:`GPSTrackRef`,description:e=>{let t=e.join(``);return t===`T`?`True direction`:t===`M`?`Magnetic direction`:`Unknown`}},15:`GPSTrack`,16:{name:`GPSImgDirectionRef`,description:e=>{let t=e.join(``);return t===`T`?`True direction`:t===`M`?`Magnetic direction`:`Unknown`}},17:`GPSImgDirection`,18:`GPSMapDatum`,19:{name:`GPSDestLatitudeRef`,description:e=>{let t=e.join(``);return t===`N`?`North latitude`:t===`S`?`South latitude`:`Unknown`}},20:{name:`GPSDestLatitude`,description:e=>e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600},21:{name:`GPSDestLongitudeRef`,description:e=>{let t=e.join(``);return t===`E`?`East longitude`:t===`W`?`West longitude`:`Unknown`}},22:{name:`GPSDestLongitude`,description:e=>e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600},23:{name:`GPSDestBearingRef`,description:e=>{let t=e.join(``);return t===`T`?`True direction`:t===`M`?`Magnetic direction`:`Unknown`}},24:`GPSDestBearing`,25:{name:`GPSDestDistanceRef`,description:e=>{let t=e.join(``);return t===`K`?`Kilometers`:t===`M`?`Miles`:t===`N`?`Knots`:`Unknown`}},26:`GPSDestDistance`,27:{name:`GPSProcessingMethod`,description:AH},28:{name:`GPSAreaInformation`,description:AH},29:`GPSDateStamp`,30:{name:`GPSDifferential`,description:e=>e===0?`Measurement without differential correction`:e===1?`Differential correction applied`:`Unknown`},31:`GPSHPositioningError`},$G={1:`InteroperabilityIndex`,2:{name:`InteroperabilityVersion`,description:e=>kV(e)},4096:`RelatedImageFileFormat`,4097:`RelatedImageWidth`,4098:`RelatedImageHeight`},eK={45056:{name:`MPFVersion`,description:e=>kV(e)},45057:`NumberOfImages`,45058:`MPEntry`,45059:`ImageUIDList`,45060:`TotalFrames`},tK={1:{name:`CameraSettings`,description:e=>e},4:{name:`ShotInfo`,description:e=>e},149:`LensModel`},nK={0:{name:`PentaxVersion`,description:e=>e.join(`.`)},5:`PentaxModelID`,555:`LevelInfo`},rK=Q.USE_EXIF?PV({},YG,ZG):{},iK=`exif`,aK=`interoperability`,oK=`canon`,sK=`pentax`,cK={"0th":rK,"1st":Q.USE_EXIF?YG:{},[iK]:rK,gps:Q.USE_EXIF?QG:{},[aK]:Q.USE_EXIF?$G:{},mpf:Q.USE_MPF?eK:{},[oK]:Q.USE_MAKER_NOTES?tK:{},[sK]:Q.USE_MAKER_NOTES?nK:{}},lK={1:1,2:1,3:2,4:4,5:8,7:1,9:4,10:8,13:4},uK={BYTE:1,ASCII:2,SHORT:3,LONG:4,RATIONAL:5,UNDEFINED:7,SLONG:9,SRATIONAL:10,IFD:13},$={getAsciiValue:dK,getByteAt:fK,getAsciiAt:pK,getShortAt:mK,getLongAt:hK,getRationalAt:gK,getUndefinedAt:_K,getSlongAt:vK,getSrationalAt:yK,getIfdPointerAt:bK,typeSizes:lK,tagTypes:uK,getTypeSize:xK};function dK(e){return e.map(e=>String.fromCharCode(e))}function fK(e,t){return e.getUint8(t)}function pK(e,t){return e.getUint8(t)}function mK(e,t,n){return e.getUint16(t,n===PH.LITTLE_ENDIAN)}function hK(e,t,n){return e.getUint32(t,n===PH.LITTLE_ENDIAN)}function gK(e,t,n){return[hK(e,t,n),hK(e,t+4,n)]}function _K(e,t){return fK(e,t)}function vK(e,t,n){return e.getInt32(t,n===PH.LITTLE_ENDIAN)}function yK(e,t,n){return[vK(e,t,n),vK(e,t+4,n)]}function bK(e,t,n){return hK(e,t,n)}function xK(e){if(uK[e]===void 0)throw Error(`No such type found.`);return lK[uK[e]]}var SK={exif:!0,iptc:!0,photoshop:!0,mpf:!0,makerNotes:!0},CK={exif:!0,iptc:!0,xmp:!0,icc:!0,photoshop:!0,makerNotes:!0,mpf:!0,file:!0,jfif:!0,png:!0,riff:!0,gif:!0,gps:!0,composite:!0,thumbnail:!0},wK={exifIfdPointer:`Exif IFD Pointer`,gpsInfoIfdPointer:`GPS Info IFD Pointer`,interoperabilityIfdPointer:`Interoperability IFD Pointer`},TK={thumbnail:[`JPEGInterchangeFormat`,`JPEGInterchangeFormatLength`],iptc:[`IPTC-NAA`],xmp:[`ApplicationNotes`],icc:[`ICC_Profile`],photoshop:[`ImageSourceData`,`PhotoshopSettings`],makerNotes:[`MakerNote`,`Make`],gps:[`GPSLatitude`,`GPSLatitudeRef`,`GPSLongitude`,`GPSLongitudeRef`,`GPSAltitude`,`GPSAltitudeRef`]},EK={file:[`Image Width`,`Image Height`],exif:[`FocalLength`,`FocalPlaneXResolution`,`FocalPlaneYResolution`,`FocalPlaneResolutionUnit`,`FocalLengthIn35mmFilm`]};function DK(e){let t=Object.create(null);if(!e)return t;Array.isArray(e.exif)&&e.exif.length>0&&(t[wK.exifIfdPointer]=!0,n(t,e.exif));for(let n in TK)if(OK(e[n])){let e=TK[n];for(let n=0;n<e.length;n++)t[e[n]]=!0;t[wK.exifIfdPointer]=!0}return OK(e.gps)&&(t[wK.gpsInfoIfdPointer]=!0,t[wK.exifIfdPointer]=!0),t;function n(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(typeof r!=`string`)continue;let i=r.toLowerCase();i.indexOf(`gps`)===0&&(e[wK.gpsInfoIfdPointer]=!0),(i.indexOf(`interoperability`)===0||i.indexOf(`relatedimage`)===0)&&(e[wK.interoperabilityIfdPointer]=!0)}}}function OK(e){return e===!0||Array.isArray(e)&&e.length>0}function kK({includeTags:e,excludeTags:t}={}){let n=!!e,r=!!t,i=n||r,a=Object.create(null),o=Object.create(null),s=Object.create(null);if(!i)return AK();let c=n&&(FK(e,`iptc`)||FK(e,`xmp`)||FK(e,`icc`)||FK(e,`photoshop`)||FK(e,`makerNotes`)||FK(e,`thumbnail`)||FK(e,`gps`)||FK(e,`composite`)),l=n&&FK(e,`composite`),u=Object.create(null);n&&(u=MK(e));let d=Object.create(null);n&&l&&(d=VK(EK.file));for(let i in CK){let f=n&&Object.prototype.hasOwnProperty.call(e,i),p=r&&Object.prototype.hasOwnProperty.call(t,i),m;p&&!f&&(m=t[i]);let h=LK({groupKey:i,includeValue:f?e[i]:void 0,excludeValue:m,extraIncludeNames:Object.create(null)});a[i]=!n||f,f&&IK(e[i])&&(a[i]=!1),h.excludeAll&&(a[i]=!1),o[i]=h,s[i]=LK({groupKey:i,includeValue:NK({groupKey:i,hasIncludeTags:n,hasIncludeEntry:f,includeTags:e,shouldParseExif:c,shouldParseFile:l}),excludeValue:m,extraIncludeNames:PK({groupKey:i,hasIncludeTags:n,hasIncludeEntry:f,shouldParseExif:c,shouldParseFile:l,exifIncludeDependencies:u,fileIncludeDependencies:d})})}return{isActive:i,shouldReturnGroup:f,shouldParseGroup:p,shouldReturnTag:m,shouldParseTag:h};function f(e){return!CK[e]||!!a[e]}function p(e){return!CK[e]||f(e)?!0:e===`exif`?c:e===`file`&&l}function m(e,t,n){return CK[e]?f(e)?RK(o[e],t,n):!1:!0}function h(e,t,n){return CK[e]?p(e)?RK(s[e],t,n):!1:!0}}function AK(){return{isActive:!1,shouldReturnGroup:e,shouldParseGroup:e,shouldReturnTag:e,shouldParseTag:e};function e(){return!0}}var jK=AK();function MK(e){let t=DK(e);return FK(e,`composite`)&&HK(t,EK.exif),t}function NK({groupKey:e,hasIncludeTags:t,hasIncludeEntry:n,includeTags:r,shouldParseExif:i,shouldParseFile:a}){if(!t)return!0;if(n)return e===`thumbnail`&&Array.isArray(r[e])?!0:r[e];if(e===`exif`&&i||e===`file`&&a)return[]}function PK({groupKey:e,hasIncludeTags:t,hasIncludeEntry:n,shouldParseExif:r,shouldParseFile:i,exifIncludeDependencies:a,fileIncludeDependencies:o}){return t?e===`exif`&&(r||n&&Object.keys(a).length>0)?a:e===`file`&&i?o:Object.create(null):Object.create(null)}function FK(e,t){if(!e||!Object.prototype.hasOwnProperty.call(e,t))return!1;let n=e[t];return n===!0||Array.isArray(n)&&n.length>0}function IK(e){return Array.isArray(e)&&e.length===0}function LK({groupKey:e,includeValue:t,excludeValue:n,extraIncludeNames:r}){let i=!!SK[e],a={includeAll:!1,includeNames:void 0,includeIds:void 0,excludeAll:!1,excludeNames:void 0,excludeIds:void 0};if(t===!0)a.includeAll=!0;else if(Array.isArray(t)){a.includeNames=Object.create(null),i&&(a.includeIds=Object.create(null));for(let e=0;e<t.length;e++)o(a,t[e]);for(let e in r)a.includeNames[e.toLowerCase()]=!0}else if(r&&Object.keys(r).length>0){a.includeNames=Object.create(null);for(let e in r)a.includeNames[e.toLowerCase()]=!0}if(n===!0)return a.excludeAll=!0,a;if(Array.isArray(n)){a.excludeNames=Object.create(null),i&&(a.excludeIds=Object.create(null));for(let e=0;e<n.length;e++)s(a,n[e])}return a;function o(e,t){if(typeof t==`number`&&e.includeIds){e.includeIds[String(t)]=!0;return}typeof t==`string`&&(e.includeNames[t.toLowerCase()]=!0)}function s(e,t){if(typeof t==`number`&&e.excludeIds){e.excludeIds[String(t)]=!0;return}typeof t==`string`&&(e.excludeNames[t.toLowerCase()]=!0)}}function RK(e,t,n){return e.excludeAll?!1:e.includeAll||!e.includeNames&&!e.includeIds||zK(e,t,n)?!BK(e,t,n):!1}function zK(e,t,n){return!!(n!==void 0&&e.includeIds&&e.includeIds[String(n)]||t&&e.includeNames&&e.includeNames[String(t).toLowerCase()])}function BK(e,t,n){return!!(n!==void 0&&e.excludeIds&&e.excludeIds[String(n)]||t&&e.excludeNames&&e.excludeNames[String(t).toLowerCase()])}function VK(e){let t=Object.create(null);for(let n=0;n<e.length;n++)t[e[n].toLowerCase()]=!0;return t}function HK(e,t){for(let n=0;n<t.length;n++)e[t[n]]=!0}var UK=4,WK={1:$.getByteAt,2:$.getAsciiAt,3:$.getShortAt,4:$.getLongAt,5:$.getRationalAt,7:$.getUndefinedAt,9:$.getSlongAt,10:$.getSrationalAt,13:$.getIfdPointerAt};function GK(e,t,n){let r=t+4;if(!(r+$.getTypeSize(`LONG`)>e.byteLength))return t+$.getLongAt(e,r,n)}function KK(e,t,n,r,i,a,o=!1,s=jK,c=`exif`,l=qK(e)){let u=$.getTypeSize(`SHORT`),d={},f=JK(e,r,i);r+=u;for(let u=0;u<f&&!(r+12>e.byteLength);u++){let u=YK(e,t,n,r,i,a,s,c,l);u!==void 0&&(d[u.name]={id:u.id,value:u.value,description:u.description},o&&(d[u.name].computed=iq(u.tagType,u.value)),(u.name===`MakerNote`||t===`pentax`&&u.name===`LevelInfo`)&&(d[u.name].__offset=u.__offset)),r+=12}if(Q.USE_THUMBNAIL&&r<e.byteLength-$.getTypeSize(`LONG`)){let c=$.getLongAt(e,r,i);c!==0&&t===`0th`&&s.shouldParseGroup(`thumbnail`)&&(d.Thumbnail=KK(e,`1st`,n,n+c,i,a,o,s,`thumbnail`,l))}return d}function qK(e){return{remaining:e.byteLength*UK}}function JK(e,t,n){return t+$.getTypeSize(`SHORT`)<=e.byteLength?$.getShortAt(e,t,n):0}function YK(e,t,n,r,i,a=!1,o=jK,s=`exif`,c){let l=$.getTypeSize(`SHORT`),u=l+$.getTypeSize(`SHORT`),d=u+$.getTypeSize(`LONG`),f=$.getShortAt(e,r,i),p=$.getShortAt(e,r+l,i),m=$.getLongAt(e,r+u,i),h,g;if($.typeSizes[p]===void 0||!a&&cK[t][f]===void 0)return;let _=XK(t,f);if(!o.shouldParseTag(s,_,f))return;if(ZK(p,m))g=r+d,h=QK(e,g,p,m,i);else if(g=$.getLongAt(e,r+d,i),$K(e,n,g,p,m)){let t=f===33723,r=eq(c.remaining,p,m);c.remaining-=r*$.typeSizes[p],h=QK(e,n+g,p,r,i,t)}else h=`<faulty value>`;p===$.tagTypes.ASCII&&(h=tq(h),h=nq(h));let v=h;if(cK[t][f]!==void 0){if(cK[t][f].name!==void 0&&cK[t][f].description!==void 0)try{v=cK[t][f].description(h)}catch{v=rq(h)}else v=p===$.tagTypes.RATIONAL||p===$.tagTypes.SRATIONAL?``+h[0]/h[1]:rq(h)}return{id:f,name:_,value:h,description:v,tagType:p,__offset:g}}function XK(e,t){if(cK[e][t]!==void 0){if(typeof cK[e][t]==`string`)return cK[e][t];if(cK[e][t].name)return cK[e][t].name}return`undefined-${t}`}function ZK(e,t){return $.typeSizes[e]*t<=$.getTypeSize(`LONG`)}function QK(e,t,n,r,i,a=!1){let o=[];a&&(r*=$.typeSizes[n],n=$.tagTypes.BYTE);for(let a=0;a<r;a++)o.push(WK[n](e,t,i)),t+=$.typeSizes[n];return n===$.tagTypes.ASCII?o=$.getAsciiValue(o):o.length===1&&(o=o[0]),o}function $K(e,t,n,r,i){return t+n+$.typeSizes[r]*i<=e.byteLength}function eq(e,t,n){let r=Math.min(n,Math.floor(e/$.typeSizes[t]));return r===1&&n>1?0:r}function tq(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(e[r]===`\0`){n++;continue}t[n]===void 0&&(t[n]=``),t[n]+=e[r]}return t}function nq(e){return e.map(e=>AV(e))}function rq(e){return e instanceof Array?e.join(`, `):e}function iq(e,t){return e===$.tagTypes.ASCII?Array.isArray(t)&&t.length===1?t[0]:t:e===$.tagTypes.RATIONAL||e===$.tagTypes.SRATIONAL?aq(t)?oq(t):Array.isArray(t)?t.map(e=>oq(e)):t:t}function aq(e){return!Array.isArray(e)||e.length!==2?!1:typeof e[0]==`number`&&typeof e[1]==`number`}function oq(e){if(!Array.isArray(e)||e.length!==2)return e;let t=e[0],n=e[1];return!Number.isFinite(t)||!Number.isFinite(n)?e:n===0?null:t/n}var sq=[{pointerKey:`Exif IFD Pointer`,ifdType:iK},{pointerKey:`GPS Info IFD Pointer`,ifdType:`gps`},{pointerKey:`Interoperability IFD Pointer`,ifdType:aK}],cq={read:lq};function lq(e,t,n,r=!1,i=void 0){let a=PH.getByteOrder(e,t),o=qK(e),s=uq(e,t,a,n,r,i,o);for(let c=0;c<sq.length;c++)s=dq(sq[c],s,e,t,a,n,r,i,o);return{tags:s,byteOrder:a}}function uq(e,t,n,r,i,a,o){let s=GK(e,t,n);return s===void 0?{}:KK(e,`0th`,t,s,n,r,i,a,`exif`,o)}function dq(e,t,n,r,i,a,o,s,c){let l=t[e.pointerKey];return l===void 0?t:PV(t,KK(n,e.ifdType,r,r+l.value,i,a,o,s,`exif`,c))}var fq={read:hq},pq=16,mq=8;function hq(e,t,n,r=!1,i=void 0){try{let a=PH.getByteOrder(e,t),o=GK(e,t,a);return o===void 0?{}:gq(e,t,KK(e,`mpf`,t,o,a,n,r,i,`mpf`),a)}catch{return{}}}function gq(e,t,n,r){if(!n.MPEntry)return n;let i=e.byteLength,a=e.byteOffset||0,o=i*mq,s=[];for(let c=0;c<Math.ceil(n.MPEntry.value.length/pq);c++){s[c]={};let l=_q(n.MPEntry.value,c*pq,$.getTypeSize(`LONG`),r);s[c].ImageFlags=vq(l),s[c].ImageFormat=yq(l),s[c].ImageType=bq(l);let u=_q(n.MPEntry.value,c*pq+4,$.getTypeSize(`LONG`),r);s[c].ImageSize={value:u,description:``+u};let d=xq(c,n.MPEntry,r,t);s[c].ImageOffset={value:d,description:``+d};let f=_q(n.MPEntry.value,c*pq+12,$.getTypeSize(`SHORT`),r);s[c].DependentImage1EntryNumber={value:f,description:``+f};let p=_q(n.MPEntry.value,c*pq+14,$.getTypeSize(`SHORT`),r);s[c].DependentImage2EntryNumber={value:p,description:``+p};let m=Math.min(Math.max(d,0),i),h=Math.min(m+Math.max(u,0),i,m+o);s[c].image=e.buffer.slice(a+m,a+h),o-=h-m,IV(s[c],`base64`,function(){return LV(this.image)})}return n.Images=s,n}function _q(e,t,n,r){if(r===PH.LITTLE_ENDIAN){let r=0;for(let i=0;i<n;i++)r+=e[t+i]<<8*i;return r}let i=0;for(let r=0;r<n;r++)i+=e[t+r]<<8*(n-1-r);return i}function vq(e){let t=[e>>31&1,e>>30&1,e>>29&1],n=[];return t[0]&&n.push(`Dependent Parent Image`),t[1]&&n.push(`Dependent Child Image`),t[2]&&n.push(`Representative Image`),{value:t,description:n.join(`, `)||`None`}}function yq(e){let t=e>>24&7;return{value:t,description:t===0?`JPEG`:`Unknown`}}function bq(e){let t=e&16777215;return{value:t,description:{196608:`Baseline MP Primary Image`,65537:`Large Thumbnail (VGA equivalent)`,65538:`Large Thumbnail (Full HD equivalent)`,131073:`Multi-Frame Image (Panorama)`,131074:`Multi-Frame Image (Disparity)`,131075:`Multi-Frame Image (Multi-Angle)`,0:`Undefined`}[t]||`Unknown`}}function xq(e,t,n,r){return Sq(e)?0:_q(t.value,e*pq+8,$.getTypeSize(`LONG`),n)+r}function Sq(e){return e===0}var Cq={read:wq};function wq(e,t){let n=Tq(e,t),r=kq(e,t,n);return{"Bits Per Sample":Eq(e,t,n),"Image Height":Dq(e,t,n),"Image Width":Oq(e,t,n),"Color Components":r,Subsampling:r&&Aq(e,t,r.value,n)}}function Tq(e,t){return Math.min($.getShortAt(e,t),e.byteLength-t)}function Eq(e,t,n){if(3>n)return;let r=$.getByteAt(e,t+2);return{value:r,description:``+r}}function Dq(e,t,n){if(5>n)return;let r=$.getShortAt(e,t+3);return{value:r,description:`${r}px`}}function Oq(e,t,n){if(7>n)return;let r=$.getShortAt(e,t+5);return{value:r,description:`${r}px`}}function kq(e,t,n){if(8>n)return;let r=$.getByteAt(e,t+7);return{value:r,description:``+r}}function Aq(e,t,n,r){if(8+3*n>r)return;let i=[];for(let r=0;r<n;r++){let n=t+8+r*3;i.push([$.getByteAt(e,n),$.getByteAt(e,n+1),$.getByteAt(e,n+2)])}return{value:i,description:i.length>1?jq(i)+Mq(i):``}}function jq(e){let t={1:`Y`,2:`Cb`,3:`Cr`,4:`I`,5:`Q`};return e.map(e=>t[e[0]]).join(``)}function Mq(e){let t={17:`4:4:4 (1 1)`,18:`4:4:0 (1 2)`,20:`4:4:1 (1 4)`,33:`4:2:2 (2 1)`,34:`4:2:0 (2 2)`,36:`4:2:1 (2 4)`,65:`4:1:1 (4 1)`,66:`4:1:0 (4 2)`};return e.length===0||e[0][1]===void 0||t[e[0][1]]===void 0?``:t[e[0][1]]}var Nq={read:Lq},Pq=2,Fq=[9,13,18,30],Iq=[0,1,12/10,4/3,3/2,16/9,5/4,2];function Lq(e,t){let n={};try{let{height:r,width:i}=Rq(Bq(e,t+Pq));n[`Image Height`]={value:r,description:`${r}px`},n[`Image Width`]={value:i,description:`${i}px`}}catch{}return n}function Rq(e){let t=e.readBits(1),n,r;if(t){n=(e.readBits(5)+1)*8;let t=e.readBits(3);r=t===0?(e.readBits(5)+1)*8:Math.ceil(n*Iq[t])}else{n=zq(e);let t=e.readBits(3);r=t===0?zq(e):Math.ceil(n*Iq[t])}return{height:n,width:r}}function zq(e){let t=e.readBits(2);return 1+e.readBits(Fq[t])}function Bq(e,t){let n=t,r=0;return{readBits(t){let i=0;for(let a=0;a<t;a++){if(n>=e.byteLength)throw Error(`Unexpected end of data`);let t=e.getUint8(n)>>r&1;i|=t<<a,r++,r>=8&&(r=0,n++)}return i}}}var Vq={read:Hq};function Hq(e,t){let n=Uq(e,t),r=Yq(e,t,n),i=Xq(e,t,n),a={"JFIF Version":Wq(e,t,n),"Resolution Unit":Gq(e,t,n),XResolution:qq(e,t,n),YResolution:Jq(e,t,n),"JFIF Thumbnail Width":r,"JFIF Thumbnail Height":i};if(r!==void 0&&i!==void 0){let o=Zq(e,t,3*r.value*i.value,n);o&&(a[`JFIF Thumbnail`]=o)}for(let e in a)a[e]===void 0&&delete a[e];return a}function Uq(e,t){return Math.min($.getShortAt(e,t),e.byteLength-t)}function Wq(e,t,n){if(9>n)return;let r=$.getByteAt(e,t+7),i=$.getByteAt(e,t+7+1);return{value:r*256+i,description:r+`.`+i}}function Gq(e,t,n){if(10>n)return;let r=$.getByteAt(e,t+9);return{value:r,description:Kq(r)}}function Kq(e){return e===0?`None`:e===1?`inches`:e===2?`cm`:`Unknown`}function qq(e,t,n){if(12>n)return;let r=$.getShortAt(e,t+10);return{value:r,description:``+r}}function Jq(e,t,n){if(14>n)return;let r=$.getShortAt(e,t+12);return{value:r,description:``+r}}function Yq(e,t,n){if(15>n)return;let r=$.getByteAt(e,t+14);return{value:r,description:`${r}px`}}function Xq(e,t,n){if(16>n)return;let r=$.getByteAt(e,t+15);return{value:r,description:`${r}px`}}function Zq(e,t,n,r){if(n===0||16+n>r)return;let i=e.byteOffset||0;return{value:e.buffer.slice(i+t+16,i+t+16+n),description:`<24-bit RGB pixel data>`}}var Qq={iptc:{256:{name:`Model Version`,description:e=>((e[0]<<8)+e[1]).toString()},261:{name:`Destination`,repeatable:!0},276:{name:`File Format`,description:e=>((e[0]<<8)+e[1]).toString()},278:{name:`File Format Version`,description:e=>((e[0]<<8)+e[1]).toString()},286:`Service Identifier`,296:`Envelope Number`,306:`Product ID`,316:`Envelope Priority`,326:{name:`Date Sent`,description:$q},336:{name:`Time Sent`,description:eJ},346:{name:`Coded Character Set`,description:tJ,encoding_name:tJ},356:`UNO`,376:{name:`ARM Identifier`,description:e=>((e[0]<<8)+e[1]).toString()},378:{name:`ARM Version`,description:e=>((e[0]<<8)+e[1]).toString()},512:{name:`Record Version`,description:e=>((e[0]<<8)+e[1]).toString()},515:`Object Type Reference`,516:`Object Attribute Reference`,517:`Object Name`,519:`Edit Status`,520:{name:`Editorial Update`,description:e=>kV(e)===`01`?`Additional Language`:`Unknown`},522:`Urgency`,524:{name:`Subject Reference`,repeatable:!0,description:e=>{let t=kV(e).split(`:`);return t[2]+(t[3]?`/`+t[3]:``)+(t[4]?`/`+t[4]:``)}},527:`Category`,532:{name:`Supplemental Category`,repeatable:!0},534:`Fixture Identifier`,537:{name:`Keywords`,repeatable:!0},538:{name:`Content Location Code`,repeatable:!0},539:{name:`Content Location Name`,repeatable:!0},542:`Release Date`,547:`Release Time`,549:`Expiration Date`,550:`Expiration Time`,552:`Special Instructions`,554:{name:`Action Advised`,description:e=>{let t=kV(e);return t===`01`?`Object Kill`:t===`02`?`Object Replace`:t===`03`?`Object Append`:t===`04`?`Object Reference`:`Unknown`}},557:{name:`Reference Service`,repeatable:!0},559:{name:`Reference Date`,repeatable:!0},562:{name:`Reference Number`,repeatable:!0},567:{name:`Date Created`,description:$q},572:{name:`Time Created`,description:eJ},574:{name:`Digital Creation Date`,description:$q},575:{name:`Digital Creation Time`,description:eJ},577:`Originating Program`,582:`Program Version`,587:{name:`Object Cycle`,description:e=>{let t=kV(e);return t===`a`?`morning`:t===`p`?`evening`:t===`b`?`both`:`Unknown`}},592:{name:`By-line`,repeatable:!0},597:{name:`By-line Title`,repeatable:!0},602:`City`,604:`Sub-location`,607:`Province/State`,612:`Country/Primary Location Code`,613:`Country/Primary Location Name`,615:`Original Transmission Reference`,617:`Headline`,622:`Credit`,627:`Source`,628:`Copyright Notice`,630:{name:`Contact`,repeatable:!0},632:`Caption/Abstract`,634:{name:`Writer/Editor`,repeatable:!0},637:{name:`Rasterized Caption`,description:e=>e},642:`Image Type`,643:{name:`Image Orientation`,description:e=>{let t=kV(e);return t===`P`?`Portrait`:t===`L`?`Landscape`:t===`S`?`Square`:`Unknown`}},647:`Language Identifier`,662:{name:`Audio Type`,description:e=>{let t=kV(e),n=t.charAt(0),r=t.charAt(1),i=``;return n===`1`?i+=`Mono`:n===`2`&&(i+=`Stereo`),r===`A`?i+=`, actuality`:r===`C`?i+=`, question and answer session`:r===`M`?i+=`, music, transmitted by itself`:r===`Q`?i+=`, response to a question`:r===`R`?i+=`, raw sound`:r===`S`?i+=`, scener`:r===`V`?i+=`, voicer`:r===`W`&&(i+=`, wrap`),i===``?t:i}},663:{name:`Audio Sampling Rate`,description:e=>parseInt(kV(e),10)+` Hz`},664:{name:`Audio Sampling Resolution`,description:e=>{let t=parseInt(kV(e),10);return t+(t===1?` bit`:` bits`)}},665:{name:`Audio Duration`,description:e=>{let t=kV(e);return t.length>=6?t.substr(0,2)+`:`+t.substr(2,2)+`:`+t.substr(4,2):t}},666:`Audio Outcue`,698:`Short Document ID`,699:`Unique Document ID`,700:`Owner ID`,712:{name:e=>e.length===2?`ObjectData Preview File Format`:`Record 2 destination`,description:e=>{if(e.length===2){let t=(e[0]<<8)+e[1];return t===0?`No ObjectData`:t===1?`IPTC-NAA Digital Newsphoto Parameter Record`:t===2?`IPTC7901 Recommended Message Format`:t===3?`Tagged Image File Format (Adobe/Aldus Image data)`:t===4?`Illustrator (Adobe Graphics data)`:t===5?`AppleSingle (Apple Computer Inc)`:t===6?`NAA 89-3 (ANPA 1312)`:t===7?`MacBinary II`:t===8?`IPTC Unstructured Character Oriented File Format (UCOFF)`:t===9?`United Press International ANPA 1312 variant`:t===10?`United Press International Down-Load Message`:t===11?`JPEG File Interchange (JFIF)`:t===12?`Photo-CD Image-Pac (Eastman Kodak)`:t===13?`Microsoft Bit Mapped Graphics File [*.BMP]`:t===14?`Digital Audio File [*.WAV] (Microsoft & Creative Labs)`:t===15?`Audio plus Moving Video [*.AVI] (Microsoft)`:t===16?`PC DOS/Windows Executable Files [*.COM][*.EXE]`:t===17?`Compressed Binary File [*.ZIP] (PKWare Inc)`:t===18?`Audio Interchange File Format AIFF (Apple Computer Inc)`:t===19?`RIFF Wave (Microsoft Corporation)`:t===20?`Freehand (Macromedia/Aldus)`:t===21?`Hypertext Markup Language "HTML" (The Internet Society)`:t===22?`MPEG 2 Audio Layer 2 (Musicom), ISO/IEC`:t===23?`MPEG 2 Audio Layer 3, ISO/IEC`:t===24?`Portable Document File (*.PDF) Adobe`:t===25?`News Industry Text Format (NITF)`:t===26?`Tape Archive (*.TAR)`:t===27?`Tidningarnas Telegrambyrå NITF version (TTNITF DTD)`:t===28?`Ritzaus Bureau NITF version (RBNITF DTD)`:t===29?`Corel Draw [*.CDR]`:`Unknown format ${t}`}return kV(e)}},713:{name:`ObjectData Preview File Format Version`,description:(e,t)=>{let n={"00":{"00":`1`},"01":{"01":`1`,"02":`2`,"03":`3`,"04":`4`},"02":{"04":`4`},"03":{"01":`5.0`,"02":`6.0`},"04":{"01":`1.40`},"05":{"01":`2`},"06":{"01":`1`},11:{"01":`1.02`},20:{"01":`3.1`,"02":`4.0`,"03":`5.0`,"04":`5.5`},21:{"02":`2.0`}},r=kV(e);if(t[`ObjectData Preview File Format`]){let e=kV(t[`ObjectData Preview File Format`].value);if(n[e]&&n[e][r])return n[e][r]}return r}},714:`ObjectData Preview Data`,1802:{name:`Size Mode`,description:e=>e[0].toString()},1812:{name:`Max Subfile Size`,description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}},1882:{name:`ObjectData Size Announced`,description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}},1887:{name:`Maximum ObjectData Size`,description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}}}};function $q(e){let t=kV(e);return t.length>=8?t.substr(0,4)+`-`+t.substr(4,2)+`-`+t.substr(6,2):t}function eJ(e){let t=kV(e),n=t;return t.length>=6&&(n=t.substr(0,2)+`:`+t.substr(2,2)+`:`+t.substr(4,2),t.length===11&&(n+=t.substr(6,1)+t.substr(7,2)+`:`+t.substr(9,2))),n}function tJ(e){let t=kV(e);return t===`\x1B%G`?`UTF-8`:t===`\x1B%5`?`Windows-1252`:t===`\x1B%/G`?`UTF-8 Level 1`:t===`\x1B%/H`?`UTF-8 Level 2`:t===`\x1B%/I`?`UTF-8 Level 3`:t===`\x1B/A`?`ISO-8859-1`:t===`\x1B/B`?`ISO-8859-2`:t===`\x1B/C`?`ISO-8859-3`:t===`\x1B/D`?`ISO-8859-4`:t===`\x1B/@`?`ISO-8859-5`:t===`\x1B/G`?`ISO-8859-6`:t===`\x1B/F`?`ISO-8859-7`:t===`\x1B/H`?`ISO-8859-8`:`Unknown`}var nJ={get:rJ};function rJ(){if(typeof TextDecoder<`u`)return TextDecoder}var iJ=5,aJ={128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},oJ={decode:sJ,TAG_HEADER_SIZE:iJ};function sJ(e,t){if(typeof t==`string`)return AV(t);let n=nJ.get();if(n!==void 0&&e!==void 0)try{return new n(e).decode(t instanceof DataView?t.buffer:Uint8Array.from(t))}catch{}let r=t.map(e=>String.fromCharCode(e)).join(``);try{return decodeURIComponent(escape(r))}catch{return cJ(t)}}function cJ(e){let t=e instanceof DataView,n=t?e.byteLength:e.length,r=t?t=>e.getUint8(t):t=>e[t],i=Array(n);for(let e=0;e<n;e++){let t=r(e),n=aJ[t];i[e]=n===void 0?t:n}return String.fromCharCode.apply(null,i)}var lJ=943868237,uJ=4,dJ=2,fJ=1,pJ=4,mJ=12,hJ=1028,gJ=5,_J={read:vJ};function vJ(e,t,n,r=jK){try{if(Array.isArray(e))return CJ(new DataView(Uint8Array.from(e).buffer),{size:e.length},0,n,r);let{naaBlock:i,dataOffset:a}=yJ(e,t);return CJ(e,i,a,n,r)}catch{return{}}}function yJ(e,t){for(;t+mJ<=e.byteLength;){let n=bJ(e,t);if(xJ(n))return{naaBlock:n,dataOffset:t+n.headerSize};t+=n.headerSize+n.size+SJ(n)}throw Error(`No IPTC NAA resource block.`)}function bJ(e,t){if(e.getUint32(t,!1)!==lJ)throw Error(`Not an IPTC resource block.`);let n=e.getUint8(t+uJ+dJ),r=(n%2==0?n+1:n)+fJ;return{headerSize:6+r+pJ,type:e.getUint16(t+uJ),size:e.getUint32(t+uJ+dJ+r)}}function xJ(e){return e.type===hJ}function SJ(e){return e.size%2==0?0:1}function CJ(e,t,n,r,i){let a={},o,s=n+t.size;for(;n<s&&n<e.byteLength;){let{tag:t,tagSize:s}=wJ(e,n,a,o,r,i);if(t===null)break;t&&(`encoding`in t&&(o=t.encoding),a[t.name]===void 0||t.repeatable===void 0?a[t.name]={id:t.id,value:t.value,description:t.description}:(a[t.name]instanceof Array||(a[t.name]=[{id:a[t.name].id,value:a[t.name].value,description:a[t.name].description}]),a[t.name].push({id:t.id,value:t.value,description:t.description}))),n+=gJ+s}return a}function wJ(e,t,n={},r=void 0,i=!1,a=jK){if(EJ(e,t))return{tag:null,tagSize:0};let o=e.getUint16(t+1),s=e.getUint16(t+3);if(!i&&!Qq.iptc[o]||!a.shouldParseTag(`iptc`,TJ(o,i),o))return{tag:void 0,tagSize:s};let c=DJ(e,t+gJ,s),l={id:o,name:OJ(Qq.iptc[o],o,c),value:c,description:jJ(Qq.iptc[o],c,n,r)};return PJ(o)&&(l.repeatable=!0),FJ(o)&&(l.encoding=Qq.iptc[o].encoding_name(c)),{tag:l,tagSize:s}}function TJ(e,t){let n=Qq.iptc[e];if(!n)return t?`undefined-${e}`:void 0;if(typeof n==`string`)return n;if(n&&typeof n.name==`string`)return n.name}function EJ(e,t){return e.getUint8(t)!==28}function DJ(e,t,n){let r=[];for(let i=0;i<n;i++)r.push(e.getUint8(t+i));return r}function OJ(e,t,n){return e?kJ(e)?e:AJ(e)?e.name(n):e.name:`undefined-${t}`}function kJ(e){return typeof e==`string`}function AJ(e){return typeof e.name==`function`}function jJ(e,t,n,r){if(NJ(e))try{return e.description(t,n)}catch{}return MJ(e,t)?oJ.decode(r,t):t}function MJ(e,t){return e&&t instanceof Array}function NJ(e){return e&&e.description!==void 0}function PJ(e){return Qq.iptc[e]&&Qq.iptc[e].repeatable}function FJ(e){return Qq.iptc[e]&&Qq.iptc[e].encoding_name!==void 0}var IJ={"tiff:Orientation"(e){return e===`1`?`Horizontal (normal)`:e===`2`?`Mirror horizontal`:e===`3`?`Rotate 180`:e===`4`?`Mirror vertical`:e===`5`?`Mirror horizontal and rotate 270 CW`:e===`6`?`Rotate 90 CW`:e===`7`?`Mirror horizontal and rotate 90 CW`:e===`8`?`Rotate 270 CW`:e},"tiff:ResolutionUnit":e=>JG.ResolutionUnit(parseInt(e,10)),"tiff:XResolution":e=>LJ(JG.XResolution,e),"tiff:YResolution":e=>LJ(JG.YResolution,e),"exif:ApertureValue":e=>LJ(JG.ApertureValue,e),"exif:GPSLatitude":BJ,"exif:GPSLongitude":BJ,"exif:FNumber":e=>LJ(JG.FNumber,e),"exif:FocalLength":e=>LJ(JG.FocalLength,e),"exif:FocalPlaneResolutionUnit":e=>JG.FocalPlaneResolutionUnit(parseInt(e,10)),"exif:ColorSpace":e=>JG.ColorSpace(RJ(e)),"exif:ComponentsConfiguration"(e,t){if(/^\d, \d, \d, \d$/.test(t)){let e=t.split(`, `).map(e=>e.charCodeAt(0));return JG.ComponentsConfiguration(e)}return t},"exif:Contrast":e=>JG.Contrast(parseInt(e,10)),"exif:CustomRendered":e=>JG.CustomRendered(parseInt(e,10)),"exif:ExposureMode":e=>JG.ExposureMode(parseInt(e,10)),"exif:ExposureProgram":e=>JG.ExposureProgram(parseInt(e,10)),"exif:ExposureTime"(e){return zJ(e)?JG.ExposureTime(e.split(`/`).map(e=>parseInt(e,10))):e},"exif:MeteringMode":e=>JG.MeteringMode(parseInt(e,10)),"exif:Saturation":e=>JG.Saturation(parseInt(e,10)),"exif:SceneCaptureType":e=>JG.SceneCaptureType(parseInt(e,10)),"exif:Sharpness":e=>JG.Sharpness(parseInt(e,10)),"exif:ShutterSpeedValue":e=>LJ(JG.ShutterSpeedValue,e),"exif:WhiteBalance":e=>JG.WhiteBalance(parseInt(e,10))};function LJ(e,t){return zJ(t)?e(t.split(`/`)):t}function RJ(e){return e.substring(0,2)===`0x`?parseInt(e.substring(2),16):parseInt(e,10)}function zJ(e){return/^-?\d+\/-?\d+$/.test(e)}function BJ(e){let[t,n]=e.split(`,`);if(t!==void 0&&n!==void 0){let e=parseFloat(t),r=parseFloat(n),i=n.charAt(n.length-1);if(!Number.isNaN(e)&&!Number.isNaN(r))return``+(e+r/60)+i}return e}var VJ={get:HJ};function HJ(e){if(e)return e;if(typeof DOMParser<`u`)return new DOMParser;try{let{DOMParser:e,onErrorStopParsing:t}=__non_webpack_require__(`@xmldom/xmldom`);return new e({onError:t})}catch{return}}function UJ(e){let t=[`prefix is non-null and namespace is null`,`prefix not bound to a namespace`,`prefix inte bundet till en namnrymd`,/Namespace prefix .+ is not defined/];for(let n=0;n<t.length;n++)if(new RegExp(t[n]).test(e.message))return!0;return!1}function WJ(e){let t=GJ(e);if(t===-1)return e;let{insertionIndex:n,attributeValueSpans:r}=KJ(e,t+1);if(n===-1)return e;let i=YJ(e,t,n,r),a=ZJ(e).filter(e=>i[e]===void 0);if(a.length===0)return e;let o=$J(a);return e.slice(0,n)+o+e.slice(n)}function GJ(e){let t=0;for(;t<e.length;){if(t=e.indexOf(`<`,t),t===-1)return-1;if(/[A-Za-z_]/.test(e.charAt(t+1)))return t;qJ(e,`<!--`,t)?t=JJ(e,t+4,`-->`):qJ(e,`<![CDATA[`,t)?t=JJ(e,t+9,`]]>`):e.charAt(t+1)===`?`?t=JJ(e,t+2,`?>`):t++}return-1}function KJ(e,t){let n=[],r,i;for(let a=t;a<e.length;a++){let t=e.charAt(a);if(r!==void 0)t===r&&(n.push({start:i,end:a}),r=void 0);else if(t===`"`||t===`'`)r=t,i=a+1;else if(t===`>`)return e.charAt(a-1)===`/`?{insertionIndex:a-1,attributeValueSpans:n}:{insertionIndex:a,attributeValueSpans:n}}return{insertionIndex:-1,attributeValueSpans:n}}function qJ(e,t,n){return e.slice(n,n+t.length)===t}function JJ(e,t,n){let r=e.indexOf(n,t);return r===-1?e.length:r+n.length}function YJ(e,t,n,r){let i=Object.create(null),a=/xmlns:([A-Za-z_][A-Za-z0-9._-]*)\s*=\s*["']([^"']*)["']/g,o,s=0;for(;(o=a.exec(e))!==null;){for(;s<r.length&&r[s].end<=o.index;)s++;if(s<r.length&&r[s].start<=o.index){a.lastIndex=r[s].end;continue}(o[2]!==``||XJ(o.index,t,n))&&(i[o[1]]=!0)}return i}function XJ(e,t,n){return e>t&&e<n}function ZJ(e){let t=[],n=Object.create(null),r=/(?:^|[^A-Za-z0-9._-])([A-Za-z_][A-Za-z0-9._-]*):[A-Za-z_][A-Za-z0-9._-]*/g,i;for(;(i=r.exec(e))!==null;){let e=i[1];e!==`xmlns`&&e!==`xml`&&n[e]===void 0&&(n[e]=!0,t.push(e))}return t}var QJ={xmp:`http://ns.adobe.com/xap/1.0/`,tiff:`http://ns.adobe.com/tiff/1.0/`,exif:`http://ns.adobe.com/exif/1.0/`,dc:`http://purl.org/dc/elements/1.1/`,xmpMM:`http://ns.adobe.com/xap/1.0/mm/`,stEvt:`http://ns.adobe.com/xap/1.0/sType/ResourceEvent#`,stRef:`http://ns.adobe.com/xap/1.0/sType/ResourceRef#`,photoshop:`http://ns.adobe.com/photoshop/1.0/`};function $J(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];t.push(` xmlns:`+r+`="`+eY(r)+`"`)}return t.join(``)}function eY(e){return Object.prototype.hasOwnProperty.call(QJ,e)?QJ[e]:`http://fallback.namespace/`+e}var tY={read:rY},nY=class extends Error{constructor(e){super(e),this.name=`ParseError`}};function rY(e,t,n){let r={};if(typeof e==`string`)return sY(r,e,n),r;let[i,a]=iY(e,t),o=sY(r,i,n);if(a){let i=sY(r,a,n);!o&&!i&&(delete r._raw,sY(r,aY(e,t),n))}return r}function iY(e,t){if(t.length===0)return[];let n=[aY(e,t.slice(0,1))];return t.length>1&&n.push(aY(e,t.slice(1))),n}function aY(e,t){let n=t.map(t=>oY(e,t)),r=n.reduce((e,t)=>e+t.length,0),i=new Uint8Array(r),a=0;for(let e=0;e<n.length;e++)i.set(n[e],a),a+=n[e].length;return new DataView(i.buffer)}function oY(e,t){let n=e.byteLength,r=e.byteOffset||0,i=Math.min(Math.max(t.dataOffset,0),n),a=Math.min(i+Math.max(t.length,0),n);return new Uint8Array(e.buffer.slice(r+i,r+a))}function sY(e,t,n){try{let{doc:r,raw:i,decodeValue:a}=cY(t,n);return e._raw=(e._raw||``)+i,PV(e,CY(hY(mY(r),!0,a))),!0}catch{return!1}}function cY(e,t){let n=VJ.get(t);if(!n)throw console.warn(`Warning: DOMParser is not available. It is needed to be able to parse XMP tags.`),Error();let{xmlString:r,decodeValue:i}=lY(e);return{doc:pY(n,fY(r)),raw:r,decodeValue:i}}function lY(e){if(typeof e==`string`)return uY(e);let t=nJ.get();if(t!==void 0)try{return{xmlString:new t(`utf-8`,{fatal:!0}).decode(e),decodeValue:dY}}catch{}return uY(TV(e,0,e.byteLength))}function uY(e){let t=jV(e);return t===void 0?{xmlString:e,decodeValue:AV}:{xmlString:t,decodeValue:dY}}function dY(e){return e}function fY(e){return e.replace(/^.+(<\?xpacket begin)/,`$1`).replace(/(<\?xpacket end=".*"\?>).+$/,`$1`)}function pY(e,t,n=!1){try{let n=e.parseFromString(t,`application/xml`),r=n.getElementsByTagName(`parsererror`);if(r.length>0)throw new nY(r[0].textContent);return n}catch(r){if(r.name===`ParseError`&&UJ(r)&&!n)return pY(e,WJ(t),!0);throw r}}function mY(e){for(let t=0;t<e.childNodes.length;t++){if(e.childNodes[t].tagName===`x:xmpmeta`)return mY(e.childNodes[t]);if(e.childNodes[t].tagName===`rdf:RDF`)return e.childNodes[t]}throw Error()}function hY(e,t,n){let r=gY(e);return _Y(r)?t?{}:n(vY(r[0])):yY(r,n)}function gY(e){let t=[];for(let n=0;n<e.childNodes.length;n++)t.push(e.childNodes[n]);return t}function _Y(e){return e.length===1&&e[0].nodeName===`#text`}function vY(e){return e.nodeValue}function yY(e,t){let n=Object.create(null);return e.forEach(e=>{if(bY(e)){let r=xY(e,t);n[e.nodeName]===void 0?n[e.nodeName]=r:(Array.isArray(n[e.nodeName])||(n[e.nodeName]=[n[e.nodeName]]),n[e.nodeName].push(r))}}),n}function bY(e){return e.nodeName&&e.nodeName!==`#text`}function xY(e,t){return{attributes:SY(e,t),value:hY(e,!1,t)}}function SY(e,t){let n={};for(let r=0;r<e.attributes.length;r++)FV(n,e.attributes[r].nodeName,t(e.attributes[r].value));return n}function CY(e){let t={};if(typeof e==`string`)return e;for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]),r.forEach(e=>{PV(t,wY(e.attributes)),typeof e.value==`object`&&PV(t,NY(e.value))})}return t}function wY(e){let t={};for(let n in e)try{TY(n)&&FV(t,DY(n),{value:e[n],attributes:{},description:OY(e[n],n)})}catch{}return t}function TY(e){return e!==`rdf:parseType`&&!EY(e)}function EY(e){return e.split(`:`)[0]===`xmlns`}function DY(e){return/^MicrosoftPhoto(_\d+_)?:Rating$/i.test(e)?`RatingPercent`:e.split(`:`)[1]}function OY(e,t=void 0){if(Array.isArray(e)){let n=kY(e);if(AY(t))try{let r=IJ[t](e,n);if(typeof r==`string`)return r}catch{}return n}if(typeof e==`object`)return jY(e);if(AY(t))try{return IJ[t](e)}catch{return e}return e}function kY(e){return e.map(e=>e.value===void 0?OY(e):OY(e.value)).join(`, `)}function AY(e){return Object.prototype.hasOwnProperty.call(IJ,e)&&typeof IJ[e]==`function`}function jY(e){let t=[];for(let n in e)t.push(`${MY(n)}: ${OY(e[n].value)}`);return t.join(`; `)}function MY(e){return e===`CiAdrCity`?`CreatorCity`:e===`CiAdrCtry`?`CreatorCountry`:e===`CiAdrExtadr`?`CreatorAddress`:e===`CiAdrPcode`?`CreatorPostalCode`:e===`CiAdrRegion`?`CreatorRegion`:e===`CiEmailWork`?`CreatorWorkEmail`:e===`CiTelWork`?`CreatorWorkPhone`:e===`CiUrlWork`?`CreatorWorkUrl`:e}function NY(e,t={}){for(let n in e)try{EY(n)||FV(t,DY(n),PY(e[n],n))}catch{}return t}function PY(e,t){return IY(e)?LY(e,t):FY(e)?{value:``,attributes:{},description:``}:RY(e)?zY(e,t):GY(e)?KY(e,t):qY(e)?JY(e,t):YY(e)?ZY(e,t):$Y(e,t)}function FY(e){return e.attributes[`rdf:parseType`]===`Resource`&&typeof e.value==`string`&&e.value.trim()===``}function IY(e){return Array.isArray(e)}function LY(e,t){return $Y(e[e.length-1],t)}function RY(e){return e.attributes[`rdf:parseType`]===`Resource`&&e.value[`rdf:value`]!==void 0||e.value[`rdf:Description`]!==void 0&&e.value[`rdf:Description`].value[`rdf:value`]!==void 0}function zY(e,t){let n=BY(e);e.value[`rdf:Description`]!==void 0&&(e=e.value[`rdf:Description`]),PV(n,BY(e),VY(e));let r=HY(e);return{value:r,attributes:n,description:OY(r,t)}}function BY(e){let t={};for(let n in e.attributes)n!==`rdf:parseType`&&n!==`rdf:resource`&&!EY(n)&&FV(t,DY(n),e.attributes[n]);return t}function VY(e){let t={};for(let n in e.value)n!==`rdf:value`&&!EY(n)&&FV(t,DY(n),e.value[n].value);return t}function HY(e){let t=UY(e.value[`rdf:value`]);return eX(t)||WY(t)}function UY(e){return IY(e)?e[e.length-1]:e}function WY(e){return YY(e)?ZY(e).value:typeof e.value==`object`?NY(e.value,Object.create(null)):e.value}function GY(e){return e.attributes[`rdf:parseType`]===`Resource`||e.value[`rdf:Description`]!==void 0&&e.value[`rdf:Description`].value[`rdf:value`]===void 0}function KY(e,t){let n={value:{},attributes:{}};return e.value[`rdf:Description`]!==void 0&&(PV(n.value,wY(e.value[`rdf:Description`].attributes)),PV(n.attributes,BY(e)),e=e.value[`rdf:Description`]),PV(n.value,NY(e.value)),n.description=OY(n.value,t),n}function qY(e){return Object.keys(e.value).length===0&&e.attributes[`xml:lang`]===void 0&&e.attributes[`rdf:resource`]===void 0}function JY(e,t){let n=wY(e.attributes);return{value:n,attributes:{},description:OY(n,t)}}function YY(e){return XY(e.value)!==void 0}function XY(e){return UY(e[`rdf:Bag`]||e[`rdf:Seq`]||e[`rdf:Alt`])}function ZY(e,t){let n=XY(e.value).value[`rdf:li`],r=BY(e),i=[];return n===void 0?n=[]:Array.isArray(n)||(n=[n]),n.forEach(e=>{i.push(QY(e))}),{value:i,attributes:r,description:OY(i,t)}}function QY(e){return RY(e)?zY(e):GY(e)?KY(e).value:qY(e)?JY(e).value:$Y(e)}function $Y(e,t){let n=eX(e)||CY(e.value);return{value:n,attributes:BY(e),description:OY(n,t)}}function eX(e){return e.attributes&&e.attributes[`rdf:resource`]}var tX={CLOSED_SUBPATH_LENGTH:0,CLOSED_SUBPATH_BEZIER_LINKED:1,CLOSED_SUBPATH_BEZIER_UNLINKED:2,OPEN_SUBPATH_LENGTH:3,OPEN_SUBPATH_BEZIER_LINKED:4,OPEN_SUBPATH_BEZIER_UNLINKED:5,FILL_RULE:6,CLIPBOARD:7,INITIAL_FILL_RULE:8},nX=24,rX={2e3:{name:`PathInformation`,description:iX},2999:{name:`ClippingPathName`,description(e){let[,t]=OV(e,0);return t}}};function iX(e){let t={},n=[];for(let r=0;r<e.byteLength;r+=26){let i=$.getShortAt(e,r);aX[i]&&(t[i]||(t[i]=aX[i].description),n.push({type:i,path:aX[i].path(e,r+2)}))}return JSON.stringify({types:t,paths:n})}var aX={[tX.CLOSED_SUBPATH_LENGTH]:{description:`Closed subpath length`,path:(e,t)=>[$.getShortAt(e,t)]},[tX.CLOSED_SUBPATH_BEZIER_LINKED]:{description:`Closed subpath Bezier knot, linked`,path:oX},[tX.CLOSED_SUBPATH_BEZIER_UNLINKED]:{description:`Closed subpath Bezier knot, unlinked`,path:oX},[tX.OPEN_SUBPATH_LENGTH]:{description:`Open subpath length`,path:(e,t)=>[$.getShortAt(e,t)]},[tX.OPEN_SUBPATH_BEZIER_LINKED]:{description:`Open subpath Bezier knot, linked`,path:oX},[tX.OPEN_SUBPATH_BEZIER_UNLINKED]:{description:`Open subpath Bezier knot, unlinked`,path:oX},[tX.FILL_RULE]:{description:`Path fill rule`,path:()=>[]},[tX.INITIAL_FILL_RULE]:{description:`Initial fill rule`,path:(e,t)=>[$.getShortAt(e,t)]},[tX.CLIPBOARD]:{description:`Clipboard`,path:cX}};function oX(e,t){let n=[];for(let r=0;r<nX;r+=8)n.push(sX(e,t+r));return n}function sX(e,t){let n=lX(e,t,8);return[lX(e,t+4,8),n]}function cX(e,t){return[[lX(e,t,8),lX(e,t+4,8),lX(e,t+8,8),lX(e,t+12,8)],lX(e,t+16,8)]}function lX(e,t,n){let r=$.getLongAt(e,t),i=r>>>31?-1:1,a=(r&2130706432)>>>32-n,o=r&parseInt(VV(`1`,32-n),2);return i*BV(a.toString(2)+`.`+zV(o.toString(2),32-n,`0`),2)}var uX={read:gX},dX=`8BIM`,fX=2,pX=4,mX=4,hX=12;function gX(e,t,n=jK){if(!Array.isArray(e))return{};let r=wV(new Uint8Array(e).buffer),i={},a=0;for(;a+hX<=r.byteLength;){let e=TV(r,a,mX);a+=mX;let o=$.getShortAt(r,a);a+=fX;let{tagName:s,tagNameSize:c}=vX(r,a);if(a+=c,a+pX>r.byteLength)break;let l=$.getLongAt(r,a);a+=pX;let u=Math.min(l,r.byteLength-a);if(e===dX){let e=_X(o,s,t);if(!n.shouldParseTag(`photoshop`,e,o)){a+=u+u%2;continue}let c=wV(r.buffer,a,u),l={id:o,value:TV(c,0,u)};if(rX[o]){try{l.description=rX[o].description(c)}catch{l.description=`<no description formatter>`}i[s||rX[o].name]=l}else t&&(i[`undefined-${o}`]=l)}a+=u+u%2}return i}function _X(e,t,n){if(t)return t;if(rX[e]&&rX[e].name)return rX[e].name;if(n)return`undefined-${e}`}function vX(e,t){let[n,r]=OV(e,t);return{tagName:r,tagNameSize:1+n+ +(n%2==0)}}var yX={desc:{name:`ICC Description`},cprt:{name:`ICC Copyright`},dmdd:{name:`ICC Device Model Description`},vued:{name:`ICC Viewing Conditions Description`},dmnd:{name:`ICC Device Manufacturer for Display`},tech:{name:`Technology`}},bX={4:{name:`Preferred CMM type`,value:(e,t)=>TV(e,t,4),description:e=>e===null?``:wX(e)},8:{name:`Profile Version`,value:(e,t)=>e.getUint8(t).toString(10)+`.`+(e.getUint8(t+1)>>4).toString(10)+`.`+(e.getUint8(t+1)%16).toString(10)},12:{name:`Profile/Device class`,value:(e,t)=>TV(e,t,4),description:e=>{switch(e.toLowerCase()){case`scnr`:return`Input Device profile`;case`mntr`:return`Display Device profile`;case`prtr`:return`Output Device profile`;case`link`:return`DeviceLink profile`;case`abst`:return`Abstract profile`;case`spac`:return`ColorSpace profile`;case`nmcl`:return`NamedColor profile`;case`cenc`:return`ColorEncodingSpace profile`;case`mid `:return`MultiplexIdentification profile`;case`mlnk`:return`MultiplexLink profile`;case`mvis`:return`MultiplexVisualization profile`;default:return e}}},16:{name:`Color Space`,value:(e,t)=>TV(e,t,4)},20:{name:`Connection Space`,value:(e,t)=>TV(e,t,4)},24:{name:`ICC Profile Date`,value:(e,t)=>xX(e,t).toISOString()},36:{name:`ICC Signature`,value:(e,t)=>CX(e.buffer.slice(t,t+4))},40:{name:`Primary Platform`,value:(e,t)=>TV(e,t,4),description:e=>wX(e)},48:{name:`Device Manufacturer`,value:(e,t)=>TV(e,t,4),description:e=>wX(e)},52:{name:`Device Model Number`,value:(e,t)=>TV(e,t,4)},64:{name:`Rendering Intent`,value:(e,t)=>e.getUint32(t),description:e=>{switch(e){case 0:return`Perceptual`;case 1:return`Relative Colorimetric`;case 2:return`Saturation`;case 3:return`Absolute Colorimetric`;default:return e}}},80:{name:`Profile Creator`,value:(e,t)=>TV(e,t,4)}};function xX(e,t){let n=e.getUint16(t),r=e.getUint16(t+2)-1,i=e.getUint16(t+4),a=e.getUint16(t+6),o=e.getUint16(t+8),s=e.getUint16(t+10);return new Date(Date.UTC(n,r,i,a,o,s))}var SX=8192;function CX(e){let t=new Uint8Array(e),n=[];for(let e=0;e<t.length;e+=SX)n.push(String.fromCharCode.apply(null,t.subarray(e,e+SX)));return n.join(``)}function wX(e){switch(e.toLowerCase()){case`appl`:return`Apple`;case`adbe`:return`Adobe`;case`msft`:return`Microsoft`;case`sunw`:return`Sun Microsystems`;case`sgi`:return`Silicon Graphics`;case`tgnt`:return`Taligent`;default:return e}}var TX={read:BX},EX=84,DX=128,OX=`acsp`,kX=`desc`,AX=`mluc`,jX=`text`,MX=`sig `,NX=12,PX=12,FX=12,IX=16,LX=1e3,RX=1e3,zX=1048576;function BX(e,t,n,r){return n&&t[0].compressionMethod!==void 0?VX(e,t,r):UX(e,t)}function VX(e,t,n){if(!HX(t[0].compressionMethod))return{};let r=e.byteOffset||0,i=e.buffer.slice(r+t[0].offset,r+t[0].offset+t[0].length);return WV(new DataView(new Uint8Array(i).buffer),t[0].compressionMethod,`utf-8`,`dataview`,n).then(JX).catch(()=>({}))}function HX(e){return e===0}function UX(e,t){try{let n=WX(e),r=e.byteOffset||0,i=t.reduce((e,t)=>e+t.length,0),a=Math.min(i,n.byteLength),o=new Uint8Array(a),s=0,c=GX(t);for(let e=1;e<=t.length;e++){let t=c[e];if(!t)throw Error(`ICC chunk ${e} not found`);let i=n.slice(r+t.offset,r+t.offset+t.length),a=new Uint8Array(i);o.set(a,s),s+=a.length}return JX(new DataView(o.buffer))}catch{return{}}}function WX(e){return Array.isArray(e)?new DataView(Uint8Array.from(e).buffer).buffer:e.buffer}function GX(e){let t=Object.create(null);for(let n=0;n<e.length;n++)t[e[n].chunkNumber]===void 0&&(t[e[n].chunkNumber]=e[n]);return t}function KX(e){return e.byteLength<132}function qX(e,t){return e.byteLength<t+NX}function JX(e){let t=e.buffer,n=e.getUint32();if(e.byteLength!==n)throw Error(`ICC profile length not matching`);if(e.byteLength<EX)throw Error(`ICC profile too short`);let r={},i=Object.keys(bX);for(let t=0;t<i.length;t++){let n=i[t],a=bX[n],o=a.value(e,parseInt(n,10)),s=o;a.description&&(s=a.description(o)),r[a.name]={value:o,description:s}}if(CX(t.slice(36,40))!==OX)throw Error(`ICC profile: missing signature`);if(KX(e))return r;let a=Math.min(e.getUint32(DX),RX),o=132,s={remaining:Math.min(e.byteLength,zX)};for(let n=0;n<a;n++){if(qX(e,o))return r;let n=TV(e,o,4),i=e.getUint32(o+4),a=e.getUint32(o+8);if(i>e.byteLength)return r;let c=TV(e,i,4);if(c===kX){if(i+PX>e.byteLength)return r;let t=e.getUint32(i+8);if(t>a)return r;XX(r,n,YX(e,i+12,t-1,s))}else if(c===AX){if(i+IX>e.byteLength)return r;let t=e.getUint32(i+8),o=e.getUint32(i+12);if(o<FX||t>LX)return r;let c=t*o;if(c>e.byteLength-i-IX||c>s.remaining)return r;s.remaining-=c;let l=Math.min(a,e.byteLength-i),u=i+IX,d=[];for(let n=0;n<t;n++){let t=TV(e,u+0,2),n=TV(e,u+2,2),r=e.getUint32(u+4),a=e.getUint32(u+8),c=Math.max(0,l-a),f=Math.min(r,c,s.remaining);s.remaining-=f;let p=DV(e,i+a,f);d.push({languageCode:t,countryCode:n,text:p}),u+=o}if(t===1)XX(r,n,d[0].text);else{let e={};for(let t=0;t<d.length;t++)e[`${d[t].languageCode}-${d[t].countryCode}`]=d[t].text;XX(r,n,e)}}else if(c===jX){let t=YX(e,i+8,a-8,s),o=t.indexOf(`\0`);XX(r,n,o===-1?t:t.slice(0,o))}else c===MX&&XX(r,n,CX(t.slice(i+8,i+12)));o+=12}return r}function YX(e,t,n,r){let i=Math.max(0,Math.min(n,e.byteLength-t,r.remaining));return r.remaining-=i,CX(e.buffer.slice(t,t+i))}function XX(e,t,n){yX[t]?e[yX[t].name]={value:n,description:n}:e[t]={value:n,description:n}}var ZX=27,QX=22,$X={read:eZ,SHOT_INFO_AUTO_ROTATE:ZX,CAMERA_SETTINGS_LENS_TYPE:QX};function eZ(e,t,n,r,i,a=!1,o=void 0){let s=KK(e,oK,t,t+n,r,i,a,o,`makerNotes`);return s.ShotInfo&&(s=PV({},s,tZ(s.ShotInfo.value)),delete s.ShotInfo),s.CameraSettings&&(s=PV({},s,nZ(s.CameraSettings.value)),delete s.CameraSettings),s}function tZ(e){let t={};return e[ZX]!==void 0&&(t.AutoRotate={value:e[ZX],description:rZ(e[ZX])}),t}function nZ(e){let t={};if(!Array.isArray(e))return t;let n=e[QX];return Number.isFinite(n)&&(t.LensType={value:n,description:`${n}`}),t}function rZ(e){return e===0?`None`:e===1?`Rotate 90 CW`:e===2?`Rotate 180`:e===3?`Rotate 270 CW`:`Unknown`}var iZ=8,aZ=10,oZ={K3_III:78420},sZ={CAMERA_ORIENTATION:1,ROLL_ANGLE:3,PITCH_ANGLE:5},cZ={read:lZ,PENTAX_IFD_OFFSET:aZ,MODEL_ID:oZ,LIK3III:sZ};function lZ(e,t,n,r,i=!1,a=void 0){try{let o=PH.getByteOrder(e,t+n+iZ),s=t+n,c=KK(e,sK,s,s+aZ,o,r,i,a,`makerNotes`);return uZ(c)&&(c=PV({},c,dZ(e,s+c.LevelInfo.__offset,o)),delete c.LevelInfo),c}catch{return{}}}function uZ(e){return e.PentaxModelID&&e.PentaxModelID.value===oZ.K3_III&&e.LevelInfo}function dZ(e,t,n){let r={};if(t+7>e.byteLength)return r;let i=e.getInt8(t+sZ.CAMERA_ORIENTATION);r.CameraOrientation={value:i,description:fZ(i)};let a=e.getInt16(t+sZ.ROLL_ANGLE,n===PH.LITTLE_ENDIAN);r.RollAngle={value:a,description:pZ(a)};let o=e.getInt16(t+sZ.PITCH_ANGLE,n===PH.LITTLE_ENDIAN);return r.PitchAngle={value:o,description:mZ(o)},r}function fZ(e){return e===0?`Horizontal (normal)`:e===1?`Rotate 270 CW`:e===2?`Rotate 180`:e===3?`Rotate 90 CW`:e===4?`Upwards`:e===5?`Downwards`:`Unknown`}function pZ(e){return``+e*-.5}function mZ(e){return``+e*-.5}var hZ={read:yZ},gZ={0:`Grayscale`,2:`RGB`,3:`Palette`,4:`Grayscale with Alpha`,6:`RGB with Alpha`},_Z={0:`Noninterlaced`,1:`Adam7 Interlace`},vZ=[{name:`Image Width`,offset:0,size:4,read:$.getLongAt,description:e=>`${e}px`},{name:`Image Height`,offset:4,size:4,read:$.getLongAt,description:e=>`${e}px`},{name:`Bit Depth`,offset:8,size:1,read:$.getByteAt,description:e=>`${e}`},{name:`Color Type`,offset:9,size:1,read:$.getByteAt,description:e=>gZ[e]||`Unknown`},{name:`Compression`,offset:10,size:1,read:$.getByteAt,description:e=>e===0?`Deflate/Inflate`:`Unknown`},{name:`Filter`,offset:11,size:1,read:$.getByteAt,description:e=>e===0?`Adaptive`:`Unknown`},{name:`Interlace`,offset:12,size:1,read:$.getByteAt,description:e=>_Z[e]||`Unknown`}];function yZ(e,t){let n={};for(let r=0;r<vZ.length;r++)n[vZ[r].name]=bZ(e,t,vZ[r]);return n}function bZ(e,t,n){if(t+n.offset+n.size>e.byteLength)return;let r=n.read(e,t+n.offset);return{value:r,description:n.description(r)}}var xZ={read:AZ},SZ=`STATE_KEYWORD`,CZ=`STATE_COMPRESSION`,wZ=`STATE_LANG`,TZ=`STATE_TRANSLATED_KEYWORD`,EZ=`STATE_TEXT`,DZ=1,OZ=1,kZ=6;function AZ(e,t,n,r,i=!1,a=jK,o){let s={},c=[];for(let l=0;l<t.length;l++){let{offset:u,length:d,type:f}=t[l],p=jZ(e,u,d,f,n,o);if(p instanceof Promise)c.push(p.then(({name:e,value:t,description:n})=>{try{if(Q.USE_EXIF&&zZ(e,t))return a.shouldParseGroup(`exif`)?{__exif:cq.read(VZ(t),kZ,r,i,a).tags}:{};if(Q.USE_IPTC&&BZ(e,t))return a.shouldParseGroup(`iptc`)?{__iptc:_J.read(VZ(t),0,r,a)}:{};if(e&&!zZ(e,t)&&!BZ(e,t))return a.shouldParseGroup(`png`)?{[e]:{value:t,description:n}}:{}}catch{}return{}}));else{let{name:e,value:t,description:n}=p;e&&a.shouldParseGroup(`png`)&&(s[e]={value:t,description:n})}}return{readTags:s,readTagsPromise:c.length>0?Promise.all(c):void 0}}function jZ(e,t,n,r,i,a){let o=[],s=[],c=[],l,u=SZ,d,f=e.byteOffset||0;for(let i=0;i<n&&t+i<e.byteLength;i++){if(u===CZ){d=MZ({type:r,dataView:e,offset:t+i}),r===`iTXt`&&(i+=DZ),u=NZ(r,u);continue}if(u===EZ){let r=e.buffer.slice(f+t+i,f+t+n);l=new DataView(new Uint8Array(r).buffer);break}let a=e.getUint8(t+i);a===0?u=NZ(r,u):u===SZ?o.push(a):u===wZ?s.push(a):u===TZ&&c.push(a)}if(d!==void 0&&!i)return{};let p=WV(l,d,PZ(r),`string`,a);return p instanceof Promise?p.then(e=>FZ(e,r,s,o)).catch(()=>FZ(`<text using unknown compression>`.split(``),r,s,o)):FZ(p,r,s,o)}function MZ({type:e,dataView:t,offset:n}){if(e===`iTXt`){if(n+1<t.byteLength&&t.getUint8(n)===OZ)return t.getUint8(n+1)}else if(e===`zTXt`)return t.getUint8(n)}function NZ(e,t){return t===SZ&&[`iTXt`,`zTXt`].includes(e)?CZ:t===CZ?e===`iTXt`?wZ:EZ:t===wZ?TZ:EZ}function PZ(e){return e===`tEXt`||e===`zTXt`?`latin1`:`utf-8`}function FZ(e,t,n,r){let i=LZ(e);return{name:IZ(t,n,r),value:i,description:t===`iTXt`?RZ(e):i}}function IZ(e,t,n){let r=kV(n);return e===`tEXt`||t.length===0?r:`${r} (${kV(t)})`}function LZ(e){return e instanceof DataView?TV(e,0,e.byteLength):e}function RZ(e){return oJ.decode(`UTF-8`,e)}function zZ(e,t){return e.toLowerCase()===`raw profile type exif`&&t.substring(1,5)===`exif`}function BZ(e,t){return e.toLowerCase()===`raw profile type iptc`&&t.substring(1,5)===`iptc`}function VZ(e){return HZ(e.match(/\n(exif|iptc)\n\s*\d+\n([\s\S]*)$/)[2].replace(/\n/g,``))}function HZ(e){let t=new DataView(new ArrayBuffer(e.length/2));for(let n=0;n<e.length;n+=2)t.setUint8(n/2,parseInt(e.substring(n,n+2),16));return t}var UZ={read:WZ};function WZ(e,t){let n={};for(let r=0;r<t.length;r++){let i=$.getLongAt(e,t[r]+0),a=TV(e,t[r]+4,4);a===`pHYs`?(n[`Pixels Per Unit X`]=GZ(e,t[r],i),n[`Pixels Per Unit Y`]=KZ(e,t[r],i),n[`Pixel Units`]=qZ(e,t[r],i)):a===`tIME`&&(n[`Modify Date`]=JZ(e,t[r],i))}return n}function GZ(e,t,n){if(!YZ(e,t,n,0,4))return;let r=$.getLongAt(e,t+8+0);return{value:r,description:``+r}}function KZ(e,t,n){if(!YZ(e,t,n,4,4))return;let r=$.getLongAt(e,t+8+4);return{value:r,description:``+r}}function qZ(e,t,n){if(!YZ(e,t,n,8,1))return;let r=$.getByteAt(e,t+8+8);return{value:r,description:r===1?`meters`:`Unknown`}}function JZ(e,t,n){if(!YZ(e,t,n,0,7))return;let r=$.getShortAt(e,t+8),i=$.getByteAt(e,t+8+2),a=$.getByteAt(e,t+8+3),o=$.getByteAt(e,t+8+4),s=$.getByteAt(e,t+8+5),c=$.getByteAt(e,t+8+6);return{value:[r,i,a,o,s,c],description:`${XZ(r,4)}-${XZ(i,2)}-${XZ(a,2)} ${XZ(o,2)}:${XZ(s,2)}:${XZ(c,2)}`}}function YZ(e,t,n,r,i){return r+i<=n&&t+8+r+i<=e.byteLength}function XZ(e,t){return zV(``+e,t,`0`)}var ZZ={read:tQ},QZ=4,$Z=7,eQ=10;function tQ(e,t){let n={};if(t+eQ>e.byteLength)return n;let r=$.getByteAt(e,t);return n.Alpha=nQ(r),n.Animation=rQ(r),n.ImageWidth=iQ(e,t+QZ),n.ImageHeight=iQ(e,t+$Z),n}function nQ(e){let t=e&16;return{value:+!!t,description:t?`Yes`:`No`}}function rQ(e){let t=e&2;return{value:+!!t,description:t?`Yes`:`No`}}function iQ(e,t){let n=$.getByteAt(e,t)+256*$.getByteAt(e,t+1)+65536*$.getByteAt(e,t+2)+1;return{value:n,description:n+`px`}}var aQ={read:cQ},oQ=e=>`${e} ${e===1?`bit`:`bits`}`,sQ=[{name:`GIF Version`,offset:3,size:3,getValue:(e,t)=>TV(e,t,3),description:e=>e},{name:`Image Width`,offset:6,size:2,getValue:(e,t)=>e.getUint16(t,!0),description:e=>`${e}px`},{name:`Image Height`,offset:8,size:2,getValue:(e,t)=>e.getUint16(t,!0),description:e=>`${e}px`},{name:`Global Color Map`,offset:10,size:1,getValue:(e,t)=>(e.getUint8(t)&128)>>>7,description:e=>e===1?`Yes`:`No`},{name:`Bits Per Pixel`,offset:10,size:1,getValue:(e,t)=>(e.getUint8(t)&7)+1,description:oQ},{name:`Color Resolution Depth`,offset:10,size:1,getValue:(e,t)=>((e.getUint8(t)&112)>>>4)+1,description:oQ}];function cQ(e){let t={};for(let n=0;n<sQ.length;n++)t[sQ[n].name]=lQ(e,sQ[n]);return t}function lQ(e,t){if(t.offset+t.size>e.byteLength)return;let n=t.getValue(e,t.offset);return{value:n,description:t.description(n)}}var uQ=[6,7,99],dQ={get:fQ};function fQ(e,t,n){if(pQ(t)){let r=n+t.JPEGInterchangeFormat.value,i=t.JPEGInterchangeFormatLength.value;if(mQ(e,r,i)){t.type=`image/jpeg`;let n=e.byteOffset||0;t.image=e.buffer.slice(n+r,n+r+i),IV(t,`base64`,function(){return LV(this.image)})}}return t}function pQ(e){return e&&(e.Compression===void 0||uQ.includes(e.Compression.value))&&e.JPEGInterchangeFormat&&e.JPEGInterchangeFormat.value&&e.JPEGInterchangeFormatLength&&e.JPEGInterchangeFormatLength.value}function mQ(e,t,n){return hQ(t)&&hQ(n)&&t+n<=e.byteLength}function hQ(e){return typeof e==`number`&&e>=0&&e%1==0}var gQ={INCHES:2,CENTIMETERS:3,MILLIMETERS:4},_Q={INCHES_TO_MM:25.4,CM_TO_MM:10,MM_TO_MM:1},vQ={get:yQ};function yQ(e,t){let n={},r=!1,i=bQ(e,`exif`,`FocalLength`,t),a=bQ(e,`exif`,`FocalPlaneXResolution`,t),o=bQ(e,`exif`,`FocalPlaneYResolution`,t),s=bQ(e,`exif`,`FocalPlaneResolutionUnit`,t),c=bQ(e,`file`,`Image Width`,t),l=bQ(e,`file`,`Image Height`,t),u=bQ(e,`exif`,`FocalLengthIn35mmFilm`,t)||xQ(a,o,s,c,l,i);u&&(n.FocalLength35efl={value:u,description:JG.FocalLengthIn35mmFilm(u)},r=!0);let d=SQ(i,u);d&&(n.ScaleFactorTo35mmEquivalent=d,r=!0);let f=CQ(u);if(f&&(n.FieldOfView=f,r=!0),r)return n}function bQ(e,t,n,r){if(r&&e[t]&&e[t][n])return e[t][n].value;if(!r&&e[n])return e[n].value}function xQ(e,t,n,r,i,a){if(e&&t&&n&&r&&i&&a)try{let o;switch(n){case gQ.INCHES:o=_Q.INCHES_TO_MM;break;case gQ.CENTIMETERS:o=_Q.CM_TO_MM;break;case gQ.MILLIMETERS:o=_Q.MM_TO_MM;break;default:return}let s=e[0]/e[1]*o,c=t[0]/t[1]*o,l=r/s,u=i/c,d=Math.sqrt(l**2+u**2);return a[0]/a[1]*(43.27/d)}catch{}}function SQ(e,t){if(e&&t)try{let n=t/(e[0]/e[1]);return{value:n,description:n.toFixed(1)}}catch{}}function CQ(e){if(e)try{let t=2*Math.atan(36/(2*e))*(180/Math.PI);return{value:t,description:t.toFixed(1)+` deg`}}catch{}}function wQ({mergeSteps:e,deferredResults:t,parsedGroups:n,expanded:r,tagFilter:i,dataView:a,tiffHeaderOffset:o,exifDataView:s,fileType:c,pngTextChunks:l,pngTextIsAsync:u,thumbnailIfdTags:d,deps:f}){let p={};for(let l=0;l<e.length;l++)p=TQ({step:e[l],deferredResults:t,parsedGroups:n,expanded:r,tagFilter:i,dataView:a,tiffHeaderOffset:o,exifDataView:s,fileType:c,thumbnailIfdTags:d,tags:p,deps:f});return Q.USE_PNG&&r&&u&&i.shouldReturnGroup(`png`)&&p.png&&(p.pngText=f.objectAssign({},p.png)),Q.USE_PNG&&r&&i.shouldReturnGroup(`png`)&&f.hasPngTextData(l)&&p.png&&!p.pngText&&(p.pngText=f.objectAssign({},p.png)),p}function TQ({step:e,deferredResults:t,parsedGroups:n,expanded:r,tagFilter:i,dataView:a,tiffHeaderOffset:o,exifDataView:s,fileType:c,thumbnailIfdTags:l,tags:u,deps:d}){if(e.type===`mergeGroupAssign`){let t=d.filterTagsForReturn(e.groupKey,e.parsedTags,i);return EQ(u,e.groupKey,t,r,d)}if(e.type===`mergeGroupMerge`){let t=d.filterTagsForReturn(e.groupKey,e.parsedTags,i);return OQ(u,e.groupKey,t,r,d)}if(Q.USE_XMP&&e.type===`mergeXmpGroupAssign`){let t=d.filterTagsForReturn(`xmp`,e.parsedTags,i);return DQ(u,t,r,d)}if(Q.USE_ICC&&e.type===`mergeIccDeferred`){let a=t[e.deferredKey],o=d.filterTagsForParse(`icc`,a,i);if(n.icc=o,!i.shouldReturnGroup(`icc`))return u;let s=d.filterTagsForReturn(`icc`,o,i);return EQ(u,`icc`,s,r,d)}if(Q.USE_JXL&&e.type===`mergeBrobExifDeferred`){let a=t[e.deferredKey];if(!a||Object.keys(a).length===0)return u;let o=d.filterTagsForParse(`exif`,a,i);if(n.exif=n.exif?d.objectAssign({},n.exif,o):o,!i.shouldReturnGroup(`exif`))return u;let s=d.filterTagsForReturn(`exif`,o,i);return EQ(u,`exif`,s,r,d)}if(Q.USE_JXL&&e.type===`mergeBrobXmpDeferred`){let a=t[e.deferredKey];if(!a||Object.keys(a).length===0)return u;let o=d.filterTagsForParse(`xmp`,a,i);if(n.xmp=o,!i.shouldReturnGroup(`xmp`))return u;let s=d.filterTagsForReturn(`xmp`,o,i);return DQ(u,s,r,d)}if(Q.USE_PNG&&e.type===`mergePngFile`){let t=d.filterTagsForReturn(`png`,e.parsedTags,i);return i.shouldReturnGroup(`png`)?r?(u.png=u.png?d.objectAssign({},u.png,t):t,u.pngFile=t,u):d.objectAssign({},u,t):u}if(Q.USE_PNG&&e.type===`mergePngChunk`){let t=d.filterTagsForReturn(`png`,e.parsedTags,i);return i.shouldReturnGroup(`png`)?r?(u.png=u.png?d.objectAssign({},u.png,t):t,u):d.objectAssign({},u,t):u}if(Q.USE_PNG&&e.type===`processPngTextReadTags`)return kQ({readTags:e.readTags,parsedGroups:n,expanded:r,tagFilter:i,tags:u,deps:d});if(Q.USE_PNG&&e.type===`processPngTextReadTagsDeferredList`){let a=t[e.deferredKey]||[];for(let e=0;e<a.length;e++)u=kQ({readTags:a[e],parsedGroups:n,expanded:r,tagFilter:i,tags:u,deps:d});return u}if(Q.USE_EXIF&&e.type===`gps`){if(r&&i.shouldReturnGroup(`gps`)&&n.exif){let e=d.getGpsGroupFromExifTags(n.exif);if(e){let t=d.filterTagsForReturn(`gps`,e,i);u.gps=t}}return u}if((Q.USE_EXIF||Q.USE_XMP)&&e.type===`composite`){if(!i.shouldReturnGroup(`composite`))return u;let e=u,t=r;i.isActive&&(e={exif:n.exif,file:n.file},t=!0);let a=d.Composite.get(e,t);if(!a)return u;let o=d.filterTagsForReturn(`composite`,a,i);return EQ(u,`composite`,o,r,d)}if(e.type===`thumbnail`){if(!i.shouldReturnGroup(`thumbnail`)||!i.shouldReturnTag(`thumbnail`,`Thumbnail`))return delete u.Thumbnail,u;if(!l)return u;let e=d.filterTagsForParse(`thumbnail`,l,i),t=Q.USE_EXIF&&Q.USE_THUMBNAIL&&d.Thumbnail.get(s||a,e,o);return t?u.Thumbnail=t:delete u.Thumbnail,u}if(e.type===`metadataRange`){if(!r)return u;let t=jQ(e.metadataBlocks,e.metadataTruncated,a,n);return t&&(u.metadataRange=t),u}return e.type===`fileType`&&c&&i.shouldReturnGroup(`file`)&&i.shouldReturnTag(`file`,`FileType`)&&(r?(u.file||(u.file={}),u.file.FileType=c):u.FileType=c),u}function EQ(e,t,n,r,i){return r?(e[t]=n,e):i.objectAssign({},e,n)}function DQ(e,t,n,r){if(n)return e.xmp=t,e;let i=r.objectAssign({},t);return delete i._raw,r.objectAssign({},e,i)}function OQ(e,t,n,r,i){return r?(e[t]=e[t]?i.objectAssign({},e[t],n):n,e):i.objectAssign({},e,n)}function kQ({readTags:e,parsedGroups:t,expanded:n,tagFilter:r,tags:i,deps:a}){let o=e.__exif,s=e.__iptc;if(delete e.__exif,delete e.__iptc,o){let e=a.filterTagsForParse(`exif`,o,r);if(t.exif=t.exif?a.objectAssign({},t.exif,e):e,r.shouldReturnGroup(`exif`)){let t=a.filterTagsForReturn(`exif`,e,r);if(n)i.exif=i.exif?a.objectAssign({},i.exif,t):t;else{let e=a.objectAssign({},t);delete e.Thumbnail,i=a.objectAssign({},i,e)}}}if(s){let e=a.filterTagsForParse(`iptc`,s,r);if(t.iptc=t.iptc?a.objectAssign({},t.iptc,e):e,r.shouldReturnGroup(`iptc`)){let t=a.filterTagsForReturn(`iptc`,e,r);n?i.iptc=i.iptc?a.objectAssign({},i.iptc,t):t:i=a.objectAssign({},i,t)}}if(r.shouldReturnGroup(`png`)){let o=a.filterTagsForParse(`png`,e,r),s=a.filterTagsForReturn(`png`,o,r);t.pngText=o,n?(i.png=i.png?a.objectAssign({},i.png,s):s,s&&Object.keys(s).length>0&&(i.pngText=i.pngText?a.objectAssign({},i.pngText,s):s)):i=a.objectAssign({},i,s)}return i}function AQ(e){return!!e&&typeof e.then==`function`}function jQ(e,t,n,r){let i=(e||[]).slice(),a=!!t;if(r&&r.mpf&&Array.isArray(r.mpf.Images))for(let e=0;e<r.mpf.Images.length;e++){let t=r.mpf.Images[e];if(!t||!t.ImageOffset||!t.ImageSize)continue;let n=t.ImageOffset.value,a=t.ImageSize.value;typeof n!=`number`||n<=0||typeof a!=`number`||a<=0||i.push({type:`mpfImage`,start:n,end:n+a})}if(i.length===0)return;i.sort((e,t)=>e.start-t.start);let o=i[0].start,s=i[0].end;for(let e=1;e<i.length;e++)i[e].end>s&&(s=i[e].end);let c=n&&typeof n.byteLength==`number`?n.byteLength:0;return{start:o,end:s,complete:!a&&s<=c,blocks:i}}function MQ(e){this.name=`MetadataMissingError`,this.message=e||`No Exif data`,this.stack=Error().stack}MQ.prototype=Error();var NQ={MetadataMissingError:MQ},PQ={load:FQ,loadView:RQ,errors:NQ};function FQ(e,t={}){if(t.length===`auto`)return SH(t),CH(IQ)(e,t);if(ZV(e)||QV(e)){NV();let n=ZV(e)?eH:tH,r=PV({},t,{async:!0});return n(e,r).then(e=>IQ(e,r))}return IQ(e,t)}function IQ(e,t){return LQ(e)&&(e=new Uint8Array(e).buffer),RQ(wV(e),t)}function LQ(e){try{return Buffer.isBuffer(e)}catch{return!1}}function RQ(e,{expanded:t=!1,async:n=!1,computed:r=!1,includeUnknown:i=!1,includeOffsets:a=!1,domParser:o=void 0,includeTags:s=void 0,excludeTags:c=void 0,decompress:l=void 0}={}){e=zQ(e);let u=kK({includeTags:s,excludeTags:c}),d=Object.create(null),f=[],p=Object.create(null),m=[],h=!1,g,_,{fileType:v,fileDataOffset:y,jfifDataOffset:b,tiffHeaderOffset:x,iptcDataOffset:S,xmpChunks:C,iccChunks:w,mpfDataOffset:T,pngHeaderOffset:E,pngTextChunks:D,pngChunkOffsets:O,vp8xChunkOffset:k,gifHeaderOffset:A,brobExifChunk:j,brobXmpChunk:M,jxlCodestreamOffset:N,metadataBlocks:P,metadataTruncated:F,exifDataView:I,xmpDataView:L}=GG.parseAppMarkers(e,n,t&&a),R=qQ({fileType:v,fileDataOffset:y,jfifDataOffset:b,tiffHeaderOffset:x,iptcDataOffset:S,xmpChunks:C,iccChunks:w,mpfDataOffset:T,pngHeaderOffset:E,pngTextChunks:D,pngChunkOffsets:O,vp8xChunkOffset:k,gifHeaderOffset:A,jxlCodestreamOffset:N});if(Q.USE_JPEG&&Q.USE_FILE&&y!==void 0&&u.shouldParseGroup(`file`)&&ee(s)){let t=WQ(`file`,Cq.read(e,y),u);d.file=t,u.shouldReturnGroup(`file`)&&f.push({type:`mergeGroupAssign`,groupKey:`file`,parsedTags:t})}if(Q.USE_JPEG&&Q.USE_JFIF&&b!==void 0&&u.shouldParseGroup(`jfif`)){let t=WQ(`jfif`,Vq.read(e,b),u);d.jfif=t,u.shouldReturnGroup(`jfif`)&&f.push({type:`mergeGroupAssign`,groupKey:`jfif`,parsedTags:t})}if(Q.USE_EXIF&&x!==void 0&&u.shouldParseGroup(`exif`)){let{tags:n,byteOrder:a}=UQ(I||e,x,i,r,u);n.Thumbnail&&(g=n.Thumbnail,delete n.Thumbnail);let s=WQ(`exif`,n,u);if(d.exif=s,Q.USE_IPTC&&s[`IPTC-NAA`]&&S===void 0&&u.shouldParseGroup(`iptc`)){let e=WQ(`iptc`,_J.read(s[`IPTC-NAA`].value,0,i,u),u);d.iptc=e,u.shouldReturnGroup(`iptc`)&&f.push({type:`mergeGroupAssign`,groupKey:`iptc`,parsedTags:e})}if(Q.USE_XMP&&s.ApplicationNotes&&Array.isArray(s.ApplicationNotes.value)&&!YQ(C)&&u.shouldParseGroup(`xmp`)){let e=WQ(`xmp`,tY.read(kV(s.ApplicationNotes.value),void 0,o),u);if(d.xmp=e,u.shouldReturnGroup(`xmp`)){let n={type:`mergeXmpGroupAssign`,parsedTags:e};t?f.push(n):_=n}}if(Q.USE_PHOTOSHOP&&s.ImageSourceData&&s.PhotoshopSettings&&Array.isArray(s.PhotoshopSettings.value)&&u.shouldParseGroup(`photoshop`)){let e=WQ(`photoshop`,uX.read(s.PhotoshopSettings.value,i,u),u);d.photoshop=e,u.shouldReturnGroup(`photoshop`)&&f.push({type:`mergeGroupAssign`,groupKey:`photoshop`,parsedTags:e})}if(Q.USE_ICC&&s.ICC_Profile&&!XQ(w)&&u.shouldParseGroup(`icc`)){let e=WQ(`icc`,TX.read(s.ICC_Profile.value,[{offset:0,length:s.ICC_Profile.value.length,chunkNumber:1,chunksTotal:1}]),u);d.icc=e,u.shouldReturnGroup(`icc`)&&f.push({type:`mergeGroupAssign`,groupKey:`icc`,parsedTags:e})}if(Q.USE_MAKER_NOTES&&s.MakerNote&&u.shouldParseGroup(`makerNotes`)){if(ZQ(s)){let t=$X.read(I||e,x,s.MakerNote.__offset,a,i,r,u);d.makerNotes=t,u.shouldReturnGroup(`makerNotes`)&&f.push({type:`mergeGroupAssign`,groupKey:`makerNotes`,parsedTags:t})}else if(QQ(s)){let t=cZ.read(I||e,x,s.MakerNote.__offset,i,r,u);d.makerNotes=t,u.shouldReturnGroup(`makerNotes`)&&f.push({type:`mergeGroupAssign`,groupKey:`makerNotes`,parsedTags:t})}}s.MakerNote&&delete s.MakerNote.__offset,u.shouldReturnGroup(`exif`)&&f.push({type:`mergeGroupAssign`,groupKey:`exif`,parsedTags:s}),!t&&_&&(f.push(_),_=void 0)}if(Q.USE_JPEG&&Q.USE_IPTC&&S!==void 0&&u.shouldParseGroup(`iptc`)){let t=WQ(`iptc`,_J.read(e,S,i,u),u);d.iptc=t,u.shouldReturnGroup(`iptc`)&&f.push({type:`mergeGroupAssign`,groupKey:`iptc`,parsedTags:t})}if(Q.USE_XMP&&YQ(C)&&u.shouldParseGroup(`xmp`)){let t=WQ(`xmp`,tY.read(L||e,C,o),u);d.xmp=t,u.shouldReturnGroup(`xmp`)&&f.push({type:`mergeXmpGroupAssign`,parsedTags:t})}if(Q.USE_JXL&&Q.USE_EXIF&&j&&x===void 0&&u.shouldParseGroup(`exif`)&&n){let t=HQ(e,j);m.push(WV(t,HV,void 0,`dataview`,l).then(e=>{let t=SU(e,0),{tags:n}=cq.read(e,t,i,r,u);n.Thumbnail&&delete n.Thumbnail,p.brobExif=n}).catch(()=>{p.brobExif={}})),f.push({type:`mergeBrobExifDeferred`,deferredKey:`brobExif`})}if(Q.USE_JXL&&Q.USE_XMP&&M&&!YQ(C)&&u.shouldParseGroup(`xmp`)&&n){let t=HQ(e,M);m.push(WV(t,HV,void 0,`dataview`,l).then(e=>{p.brobXmp=tY.read(e,[{dataOffset:0,length:e.byteLength}],o)}).catch(()=>{p.brobXmp={}})),f.push({type:`mergeBrobXmpDeferred`,deferredKey:`brobXmp`})}if(Q.USE_ICC&&XQ(w)&&u.shouldParseGroup(`icc`)){let t=TX.read(e,w,n,l);if(AQ(t)){if(!n)throw Error(`Promise is required when async mode is enabled.`);m.push(t.then(e=>{p.iccApp=e})),f.push({type:`mergeIccDeferred`,deferredKey:`iccApp`})}else{let e=WQ(`icc`,t,u);d.icc=e,u.shouldReturnGroup(`icc`)&&f.push({type:`mergeGroupAssign`,groupKey:`icc`,parsedTags:e})}}if(Q.USE_MPF&&T!==void 0&&u.shouldParseGroup(`mpf`)){let t=WQ(`mpf`,fq.read(e,T,i,r,u),u);d.mpf=t,u.shouldReturnGroup(`mpf`)&&f.push({type:`mergeGroupAssign`,groupKey:`mpf`,parsedTags:t})}if(Q.USE_PNG&&Q.USE_PNG_FILE&&E!==void 0&&u.shouldParseGroup(`png`)){let t=WQ(`png`,hZ.read(e,E),u);d.pngFile=t,u.shouldReturnGroup(`png`)&&f.push({type:`mergePngFile`,parsedTags:t})}if(Q.USE_PNG&&$Q(D)&&(u.shouldParseGroup(`png`)||u.shouldParseGroup(`exif`)||u.shouldParseGroup(`iptc`))){let{readTags:t,readTagsPromise:a}=xZ.read(e,D,n,i,r,u,l);h=!!a,f.push({type:`processPngTextReadTags`,readTags:t}),a&&(m.push(a.then(e=>{p.pngTextTagList=e})),f.push({type:`processPngTextReadTagsDeferredList`,deferredKey:`pngTextTagList`}))}if(Q.USE_PNG&&O!==void 0&&u.shouldParseGroup(`png`)){let t=WQ(`png`,UZ.read(e,O),u);d.pngChunk=t,u.shouldReturnGroup(`png`)&&f.push({type:`mergePngChunk`,parsedTags:t})}if(Q.USE_WEBP&&k!==void 0&&u.shouldParseGroup(`riff`)){let t=WQ(`riff`,ZZ.read(e,k),u);d.riff=t,u.shouldReturnGroup(`riff`)&&f.push({type:`mergeGroupMerge`,groupKey:`riff`,parsedTags:t})}if(Q.USE_GIF&&A!==void 0&&u.shouldParseGroup(`gif`)){let t=WQ(`gif`,aQ.read(e,A),u);d.gif=t,u.shouldReturnGroup(`gif`)&&f.push({type:`mergeGroupMerge`,groupKey:`gif`,parsedTags:t})}if(Q.USE_JXL&&N!==void 0&&u.shouldParseGroup(`file`)){let t=WQ(`file`,Nq.read(e,N),u);d.file=t,u.shouldReturnGroup(`file`)&&f.push({type:`mergeGroupAssign`,groupKey:`file`,parsedTags:t})}if(Q.USE_EXIF&&f.push({type:`gps`}),(Q.USE_EXIF||Q.USE_XMP)&&f.push({type:`composite`}),f.push({type:`thumbnail`}),f.push({type:`fileType`}),t&&a&&f.push({type:`metadataRange`,metadataBlocks:P,metadataTruncated:!!F}),!R)throw new NQ.MetadataMissingError;let z={objectAssign:PV,hasPngTextData:$Q,filterTagsForParse:WQ,filterTagsForReturn:GQ,getGpsGroupFromExifTags:Q.USE_EXIF?JQ:void 0,Composite:Q.USE_EXIF||Q.USE_XMP?vQ:void 0,Thumbnail:dQ};if(n)return NV(),Promise.all(m).then(()=>wQ({mergeSteps:f,deferredResults:p,parsedGroups:d,expanded:t,tagFilter:u,dataView:e,tiffHeaderOffset:x,exifDataView:I,fileType:v,pngTextChunks:D,pngTextIsAsync:h,thumbnailIfdTags:g,deps:z}));return wQ({mergeSteps:f,deferredResults:p,parsedGroups:d,expanded:t,tagFilter:u,dataView:e,tiffHeaderOffset:x,exifDataView:I,fileType:v,pngTextChunks:D,pngTextIsAsync:h,thumbnailIfdTags:g,deps:z});function ee(e){if(!e)return!0;let{composite:t,file:n}=e;return t===!0||Array.isArray(t)&&t.length>0?!0:!(Array.isArray(n)&&n.length===1&&n[0]===`FileType`)}}function zQ(e){return BQ(e)?wV(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)):e}function BQ(e){return VQ(e)&&(e.byteOffset>0||e.byteLength<e.buffer.byteLength)}function VQ(e){return!!e&&typeof e.getUint8==`function`&&typeof e.byteOffset==`number`&&typeof e.byteLength==`number`&&!!e.buffer&&typeof e.buffer.slice==`function`}function HQ(e,t){let n=Math.max(0,Math.min(t.length,e.byteLength-t.dataOffset));return new DataView(e.buffer,e.byteOffset+t.dataOffset,n)}function UQ(e,t,n,r,i){try{return cq.read(e,t,n,r,i)}catch{return{tags:{},byteOrder:PH.BIG_ENDIAN}}}function WQ(e,t,n){return n.isActive?KQ(e,t,n.shouldParseTag):t}function GQ(e,t,n){return n.isActive?KQ(e,t,n.shouldReturnTag):t}function KQ(e,t,n){if(!t)return t;let r={};for(let a in t){let o=t[a];n(e,a,i(o))&&(r[a]=o)}return r;function i(e){if(e)return Array.isArray(e)?e.length===0?void 0:e[0].id:e.id}}function qQ({fileType:e,fileDataOffset:t,jfifDataOffset:n,tiffHeaderOffset:r,iptcDataOffset:i,xmpChunks:a,iccChunks:o,mpfDataOffset:s,pngHeaderOffset:c,pngTextChunks:l,pngChunkOffsets:u,vp8xChunkOffset:d,gifHeaderOffset:f,jxlCodestreamOffset:p}){return!!e||Q.USE_JPEG&&Q.USE_FILE&&t!==void 0||Q.USE_JPEG&&Q.USE_JFIF&&n!==void 0||Q.USE_EXIF&&r!==void 0||Q.USE_JPEG&&Q.USE_IPTC&&i!==void 0||Q.USE_XMP&&YQ(a)||Q.USE_ICC&&XQ(o)||Q.USE_MPF&&s!==void 0||Q.USE_PNG&&Q.USE_PNG_FILE&&c!==void 0||Q.USE_PNG&&$Q(l)||Q.USE_PNG&&u!==void 0||Q.USE_WEBP&&d!==void 0||Q.USE_GIF&&f!==void 0||Q.USE_JXL&&p!==void 0}function JQ(e){let t;if(e.GPSLatitude&&e.GPSLatitudeRef){t||={};try{t.Latitude=jH(e.GPSLatitude.value),e.GPSLatitudeRef.value.join(``)===`S`&&(t.Latitude=-t.Latitude)}catch{}}if(e.GPSLongitude&&e.GPSLongitudeRef){t||={};try{t.Longitude=jH(e.GPSLongitude.value),e.GPSLongitudeRef.value.join(``)===`W`&&(t.Longitude=-t.Longitude)}catch{}}if(e.GPSAltitude&&e.GPSAltitudeRef){t||={};try{t.Altitude=e.GPSAltitude.value[0]/e.GPSAltitude.value[1],e.GPSAltitudeRef.value===1&&(t.Altitude=-t.Altitude)}catch{}}if(t)return t}function YQ(e){return Array.isArray(e)&&e.length>0}function XQ(e){return Array.isArray(e)&&e.length>0}function ZQ(e){return e.Make&&e.Make.value&&Array.isArray(e.Make.value)&&e.Make.value[0]===`Canon`&&e.MakerNote&&e.MakerNote.__offset}function QQ(e){return Array.isArray(e.MakerNote.value)&&e.MakerNote.value.length>7&&kV(e.MakerNote.value.slice(0,7))===`PENTAX `&&e.MakerNote.__offset}function $Q(e){return Array.isArray(e)&&e.length>0}var e$=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18]);new Uint32Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,32769,49153,65537,98305,131073,196609,262145,393217,524289,786433])[39]+(1<<e$[39])-1;var t$=new Uint8Array([24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112]);(()=>{let e=new Map;for(let t=0;t<120;t++)e.set(t$[t],t+1);return e})(),new Int32Array([17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15]);var n$=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10]);new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073])[23]+(1<<n$[23])-1;function r$(e){if(e.length<12)throw Error(`Invalid RIFF file: shorter than 12-byte container header`);let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e[0]!==82||e[1]!==73||e[2]!==70||e[3]!==70)throw Error(`Invalid RIFF file: missing RIFF signature`);if(e[8]!==87||e[9]!==69||e[10]!==66||e[11]!==80)throw Error(`Invalid WebP file: missing WEBP signature`);let n=[],r=12;for(;r+8<=e.length;){let i=String.fromCharCode(e[r],e[r+1],e[r+2],e[r+3]),a=t.getUint32(r+4,!0),o=r+8,s=Math.min(o+a,e.length);n.push({fourCC:i,size:a,data:e.subarray(o,s),offset:o});let c=a+(a&1),l=r+8+c;if(l<=r)break;r=l}return n}function i$(e){let t=4;for(let n of e){let e=n.data.length+(n.data.length&1);t+=8+e}let n=new Uint8Array(8+t),r=new DataView(n.buffer);n[0]=82,n[1]=73,n[2]=70,n[3]=70,r.setUint32(4,t,!0),n[8]=87,n[9]=69,n[10]=66,n[11]=80;let i=12;for(let t of e){n[i]=t.fourCC.charCodeAt(0),n[i+1]=t.fourCC.charCodeAt(1),n[i+2]=t.fourCC.charCodeAt(2),n[i+3]=t.fourCC.charCodeAt(3),r.setUint32(i+4,t.data.length,!0),n.set(t.data,i+8);let e=t.data.length+(t.data.length&1);i+=8+e}return n}new Uint8Array([0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0]),new Uint8Array([0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15]),new Uint8Array([173,148,140,0]),new Uint8Array([176,155,140,135,0]),new Uint8Array([180,157,141,134,130,0]),new Uint8Array([254,254,243,230,196,177,153,140,133,130,129,0]),(()=>{let e=new Uint8Array(1056),t=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],n=0;for(let r=0;r<4;r++)for(let i=0;i<8;i++)for(let a=0;a<3;a++)for(let o=0;o<11;o++)e[n++]=t[r][i][a][o];return e})(),(()=>{let e=new Uint8Array(1056),t=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],n=0;for(let r=0;r<4;r++)for(let i=0;i<8;i++)for(let a=0;a<3;a++)for(let o=0;o<11;o++)e[n++]=t[r][i][a][o];return e})(),new Uint16Array([4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284]),new Uint16Array([4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157]),new Int8Array([-10,2,4,6,-0,-2,-3,-1]),new Uint8Array([145,156,163,128]),new Int8Array([-0,2,-2,4,-3,-1]),new Uint8Array([142,114,183]),new Int8Array([-0,2,-1,4,-2,6,8,12,-3,10,-4,-5,-6,14,-7,16,-8,-9]),(()=>{let e=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],t=new Uint8Array(900),n=0;for(let r=0;r<10;r++)for(let i=0;i<10;i++)for(let a=0;a<9;a++)t[n++]=e[r][i][a];return t})(),new Uint16Array([0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396]),new Uint8Array([7,6,6,5,5,5,5,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0]),new Uint8Array([127,127,191,127,159,191,223,127,143,159,175,191,207,223,239,127,135,143,151,159,167,175,183,191,199,207,215,223,231,239,247,127,131,135,139,143,147,151,155,159,163,167,171,175,179,183,187,191,195,199,203,207,211,215,219,223,227,231,235,239,243,247,251,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,185,187,189,191,193,195,197,199,201,203,205,207,209,211,213,215,217,219,221,223,225,227,229,231,233,235,237,239,241,243,245,247,249,251,253,127]);var a$;(function(e){e[e.Literal=0]=`Literal`,e[e.Backref=1]=`Backref`,e[e.Cache=2]=`Cache`})(a$||={});var o$=o((e=>{(function(t){typeof DO_NOT_EXPORT_CRC>`u`?typeof e==`object`?t(e):typeof define==`function`&&define.amd?define(function(){var e={};return t(e),e}):t({}):t({})})(function(e){e.version=`0.3.0`;function t(){for(var e=0,t=Array(256),n=0;n!=256;++n)e=n,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,t[n]=e;return typeof Int32Array<`u`?new Int32Array(t):t}var n=t(),r=typeof Buffer<`u`;function i(e){if(e.length>32768&&r)return o(new Buffer(e));for(var t=-1,i=e.length-1,a=0;a<i;)t=n[(t^e.charCodeAt(a++))&255]^t>>>8,t=n[(t^e.charCodeAt(a++))&255]^t>>>8;return a===i&&(t=t>>>8^n[(t^e.charCodeAt(a))&255]),t^-1}function a(e){if(e.length>1e4)return o(e);for(var t=-1,r=0,i=e.length-3;r<i;)t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255];for(;r<i+3;)t=t>>>8^n[(t^e[r++])&255];return t^-1}function o(e){for(var t=-1,r=0,i=e.length-7;r<i;)t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255];for(;r<i+7;)t=t>>>8^n[(t^e[r++])&255];return t^-1}function s(e){for(var t=-1,r=0,i=e.length,a,o;r<i;)a=e.charCodeAt(r++),a<128?t=t>>>8^n[(t^a)&255]:a<2048?(t=t>>>8^n[(t^(192|a>>6&31))&255],t=t>>>8^n[(t^(128|a&63))&255]):a>=55296&&a<57344?(a=(a&1023)+64,o=e.charCodeAt(r++)&1023,t=t>>>8^n[(t^(240|a>>8&7))&255],t=t>>>8^n[(t^(128|a>>2&63))&255],t=t>>>8^n[(t^(128|o>>6&15|a&3))&255],t=t>>>8^n[(t^(128|o&63))&255]):(t=t>>>8^n[(t^(224|a>>12&15))&255],t=t>>>8^n[(t^(128|a>>6&63))&255],t=t>>>8^n[(t^(128|a&63))&255]);return t^-1}e.table=n,e.bstr=i,e.buf=a,e.str=s})})),s$=o(((e,t)=>{var n=o$();t.exports=o;var r=new Uint8Array(4),i=new Int32Array(r.buffer),a=new Uint32Array(r.buffer);function o(e){if(e[0]!==137||e[1]!==80||e[2]!==78||e[3]!==71)throw Error(`Invalid .png file header`);if(e[4]!==13||e[5]!==10)throw Error(`Invalid .png file header: possibly caused by DOS-Unix line ending conversion?`);if(e[6]!==26)throw Error(`Invalid .png file header`);if(e[7]!==10)throw Error(`Invalid .png file header: possibly caused by DOS-Unix line ending conversion?`);for(var t=!1,o=[],s=8;s<e.length;){r[3]=e[s++],r[2]=e[s++],r[1]=e[s++],r[0]=e[s++];var c=a[0]+4,l=new Uint8Array(c);l[0]=e[s++],l[1]=e[s++],l[2]=e[s++],l[3]=e[s++];var u=String.fromCharCode(l[0])+String.fromCharCode(l[1])+String.fromCharCode(l[2])+String.fromCharCode(l[3]);if(!o.length&&u!==`IHDR`)throw Error(`IHDR header missing`);if(u===`IEND`){t=!0,o.push({name:u,data:new Uint8Array});break}for(var d=4;d<c;d++)l[d]=e[s++];r[3]=e[s++],r[2]=e[s++],r[1]=e[s++],r[0]=e[s++];var f=i[0];if(n.buf(l)!==f)throw Error(`CRC values for `+u+` header do not match, PNG file is likely corrupted`);var p=new Uint8Array(l.buffer.slice(4));o.push({name:u,data:p})}if(!t)throw Error(`.png file ended prematurely: no IEND header was found`);return o}})),c$=o(((e,t)=>{t.exports=function(e,t,n){var r=[],i=e.length;if(i===0)return r;var a=t<0?Math.max(0,t+i):t||0;for(n!==void 0&&(i=n<0?n+i:n);i-->a;)r[i-a]=e[i];return r}})),l$=o(((e,t)=>{var n=c$(),r=o$();t.exports=s;var i=new Uint8Array(4),a=new Int32Array(i.buffer),o=new Uint32Array(i.buffer);function s(e){var t=8,s=t,c;for(c=0;c<e.length;c++)t+=e[c].data.length,t+=12;var l=new Uint8Array(t);for(l[0]=137,l[1]=80,l[2]=78,l[3]=71,l[4]=13,l[5]=10,l[6]=26,l[7]=10,c=0;c<e.length;c++){var u=e[c],d=u.name,f=u.data,p=f.length,m=[d.charCodeAt(0),d.charCodeAt(1),d.charCodeAt(2),d.charCodeAt(3)];o[0]=p,l[s++]=i[3],l[s++]=i[2],l[s++]=i[1],l[s++]=i[0],l[s++]=m[0],l[s++]=m[1],l[s++]=m[2],l[s++]=m[3];for(var h=0;h<p;)l[s++]=f[h++];var g=m.concat(n(f));a[0]=r.buf(g),l[s++]=i[3],l[s++]=i[2],l[s++]=i[1],l[s++]=i[0]}return l}})),u$=l(s$(),1),d$=l(l$(),1);function f$(e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t}function p$(e,t){let n=new TextEncoder().encode(t);return e.length>=n.length&&n.every((t,n)=>e[n]===t)}function m$(e,t){let n=(0,u$.default)(e),r=`XML:com.adobe.xmp\0`,i=n.filter(e=>!([`iTXt`,`tEXt`,`zTXt`].includes(e.name)&&p$(e.data,r))),a=i.findIndex(e=>e.name===`IDAT`);if(a<0)throw Error(`PNG has no image data`);return i.splice(a,0,{name:`iTXt`,data:f$([new TextEncoder().encode(r),new Uint8Array(4),new TextEncoder().encode(t)])}),(0,d$.default)(i)}var h$=`http://ns.adobe.com/xap/1.0/\0`,g$=`http://ns.adobe.com/xmp/extension/\0`;function _$(e,t){let n=e,r=new DataView(e.buffer,e.byteOffset,e.byteLength);if(n.length<4||r.getUint16(0)!==65496||r.getUint16(n.length-2)!==65497)throw Error(`Invalid JPEG envelope`);let i=new TextEncoder().encode(`${h$}${t}`);if(i.length>65533)throw Error(`XMP exceeds one JPEG APP1 segment`);let a=new Uint8Array(4),o=new DataView(a.buffer);o.setUint16(0,65505),o.setUint16(2,i.length+2);let s=f$([a,i]),c=[n.subarray(0,2)],l=1,u=!0,d=!1,f=2;for(;f+4<=n.length;){let e=f;if(n[f]!==255)throw Error(`Invalid JPEG marker`);for(;n[f]===255;)f++;let t=n[f];if(t===void 0||t===0||t===216||t===217)throw Error(`JPEG ended before its scan`);if(t===1||t>=208&&t<=215){c.push(n.subarray(e,f+1)),f++,u=!1;continue}if(f+3>n.length)throw Error(`Truncated JPEG length`);let i=r.getUint16(f+1),a=f+1+i;if(i<2||a>n.length)throw Error(`Truncated JPEG segment`);if(t>=192&&t<=207&&![196,200,204].includes(t)&&(d=!0),t===218){if(!d)throw Error(`JPEG has no frame`);return c.splice(l,0,s),c.push(n.subarray(e)),f$(c)}let o=n.subarray(f+3,a);t===225&&[h$,g$].some(e=>p$(o,e))||(c.push(n.subarray(e,a)),u&&(t===224||t===225&&p$(o,`Exif\0\0`))?l=c.length:u=!1),f=a}throw Error(`JPEG has no scan`)}var v$=`https://fungi.computer/ns/provenance/1.0/`,y$=`http://iptc.org/std/Iptc4xmpExt/2008-02-29/`,b$=`http://www.w3.org/1999/02/22-rdf-syntax-ns#`;function x$(e){let t=new xV.DOMParser({onError:()=>{throw Error(`Invalid provenance XML`)}}),n=e?t.parseFromString(e,`application/xml`):void 0,r=(e,t)=>{let r=n?.getElementsByTagNameNS(e,t).item(0);if(r?.textContent)return r.textContent;let i=n?.getElementsByTagNameNS(b$,`Description`);if(i)for(let n=0;n<i.length;n++){let r=i.item(n)?.getAttributeNS(e,t);if(r)return r}},i=t.parseFromString(`<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about=""/></rdf:RDF></x:xmpmeta>`,`application/xml`),a=i.getElementsByTagNameNS(b$,`Description`).item(0);if(!a)throw Error(`Missing provenance description`);let o=[{namespace:v$,name:`printId`,qualified:`fungi:printId`},{namespace:y$,name:`DigitalSourceType`,qualified:`Iptc4xmpExt:DigitalSourceType`}];for(let{namespace:e,name:t,qualified:n}of o){let o=r(e,t);if(o===void 0)continue;let s=i.createElementNS(e,n);s.textContent=o,a.appendChild(s)}return new xV.XMLSerializer().serializeToString(i)}var S$=33554432,C$=class extends Error{reason;name=`ProvenanceExportError`;constructor(e,t){super(`Print export refused: ${e}`,t),this.reason=e}};function w$(e,t){let n=r$(e);if(n.some(e=>e.size!==e.data.length)||n.reduce((e,t)=>e+8+t.size+t.size%2,12)!==e.length)throw Error(`Incomplete extended WebP`);if(!n.some(e=>e.fourCC===`XMP `))return e;if(!n.some(e=>e.fourCC===`VP8X`))throw Error(`XMP without extended WebP header`);let r=!1;return i$(n.flatMap(e=>e.fourCC===`XMP `?r?[]:(r=!0,[{fourCC:`XMP `,data:new TextEncoder().encode(t)}]):[{fourCC:e.fourCC,data:e.data}]))}async function T$(e){if(e.length>33554432)throw new C$(`too-large`);let t=new TextDecoder(`latin1`).decode(e);if(t.includes(`c2pa`)||t.includes(`caBX`))throw new C$(`signed-image`);try{let t=await PQ.loadView(new DataView(e.buffer,e.byteOffset,e.byteLength),{expanded:!0,async:!0,domParser:new xV.DOMParser,includeTags:{xmp:!0,png:!0,file:!0},decompress:{maxDecompressedSize:S$}}),n=t.file?.FileType?.value;if(n!==`png`&&n!==`jpeg`&&n!==`webp`&&n!==`gif`)throw new C$(`unsupported-format`);let r={type:`image/${n}`,extension:n===`jpeg`?`jpg`:n};if(n===`gif`&&!t.xmp)return{bytes:e,...r};let i=x$(t.xmp?._raw??t.pngText?.[`XML:com.adobe.xmp`]?.value),a=n===`png`?m$(e,i):n===`jpeg`?_$(e,i):n===`webp`?w$(e,i):void 0;if(!a)throw new C$(`unsupported-format`);if(a.length>33554432)throw new C$(`too-large`);return{bytes:a,...r}}catch(e){throw e instanceof C$?e:new C$(`invalid-image`,{cause:e})}}function E$(e){return/\.mp4$/iu.test(e)}async function D$(e,t){if(E$(e.name)){let n=document.createElement(`video`);return n.preload=`metadata`,n.muted=!0,await new Promise((e,r)=>{n.addEventListener(`loadedmetadata`,()=>{e()},{once:!0}),n.addEventListener(`error`,()=>{r(Error(`MP4 metadata could not be read`))},{once:!0}),n.src=t}),{file:e,url:t,width:n.videoWidth,height:n.videoHeight}}let n=new Image;return n.src=t,await n.decode(),{file:e,url:t,width:n.naturalWidth,height:n.naturalHeight}}var O$={title:`Image too large`,message:`Download supports images up to 32 MiB. Choose a smaller image.`};async function k$(e,t){let n=()=>{if(t.throwIfAborted(),e.kind===`computer`&&e.connection.app.context.get().computerId!==e.computerId)throw new Y(`Print Computer changed`,{code:`SELECTION_CHANGED`,retryable:!1})};if(n(),e.file.size>33554432)throw new C$(`too-large`);let r=e.kind===`computer`?await cV(e.connection.app.capabilities,{path:e.path},{signal:t}):e.file;if(n(),r.size>33554432)throw new C$(`too-large`);let i=e.kind===`computer`?e.path:r.name,a=(i.split(`/`).at(-1)??`print`).replace(/\.[^.]*$/,``)||`print`;if(E$(i))return n(),new File([r],`${a}.mp4`,{type:`video/mp4`});let o=await T$(new Uint8Array(await r.arrayBuffer()));return n(),new File([Uint8Array.from(o.bytes)],`${a}.${o.extension}`,{type:o.type})}function A$(e){return e instanceof C$?{...{"too-large":O$,"signed-image":{title:`Download unavailable`,message:`This image has signed metadata that Prints cannot safely remove.`},"invalid-image":{title:`Couldn't prepare the image`,message:`Prints couldn't remove this image's private details. Choose another image.`},"unsupported-format":{title:`Download unavailable`,message:`Prints cannot safely export this file format yet.`}}[e.reason],retryable:!1}:Ow(e,{FILE_TOO_LARGE:O$})}function j$(e){return{...{"no-user-gesture":{title:`Click to download`,message:`Click Download in Prints to save this image.`},"too-large":O$,"invalid-request":{title:`Download unavailable`,message:`The prepared image could not be saved. Reopen its information and try again.`},unavailable:{title:`Download unavailable`,message:`The host cannot save files right now. Reopen Prints and try again.`},denied:{title:`Download denied`,message:`Your browser did not allow this download. Check its download settings and try again.`},busy:{title:`Download busy`,message:`Wait for the current browser action to finish, then try again.`}}[e.reason],retryable:!1}}function M$(e,t){console.error(`Prints operation failed`,JSON.stringify({operation:e,errorKind:t instanceof Error?`error`:`non-error`,stage:t instanceof eP?t.stage:null,provider:t instanceof eP?t.provider:void 0}),cv(t))}var N$=Uc({print:Uc({kind:dl([`image`,`video`]),model:fs(),width:uc().nullable(),height:uc().nullable(),steps:uc().nullable(),createdAt:uc()}),typed:Uc({prompt:fs(),references:uc()}),references:Bc(Uc({path:fs()})),characters:Bc(fs())}),P$=(e,t)=>({style:t,kind:e.print.kind,model:e.print.model,typed:e.typed,references:e.references,steps:e.print.steps,width:e.print.width,height:e.print.height}),F$=(e,t)=>t===0?e:F$(t,e%t),I$=(e,t)=>{let n=F$(e,t);return`${String(e/n)}:${String(t/n)}`},L$=new Intl.DateTimeFormat(`en`,{dateStyle:`medium`,timeStyle:`short`});function R$(e,t){let n=e.source,r=n.kind===`computer`?n.path:null,i=n.kind===`computer`?n.computerId:null;return BT({...wN(t,DN,xN.of(t,`prints`,`output-details`,i,r),async(e,t)=>{let n=await e.call(`getOutput`,JSON.stringify({path:r}));t.throwIfAborted();let i=N$.safeParse(n);return i.success?i.data:null}),enabled:!!(t&&r&&i&&t.capabilities.has(DN)),retry:!1})}function z$(e,t){let n=(0,K.useRef)(null),r=HT({gcTime:0,mutationFn:async t=>{let n=await k$(e,t.signal),r=new Uint8Array(await n.arrayBuffer());return t.signal.throwIfAborted(),{kind:`saveFile`,name:n.name,mime:n.type,bytes:r}},onError:(e,t)=>{t.signal.aborted||M$(`prepare-print-download`,e)}}),{mutate:i,reset:a}=r;(0,K.useEffect)(()=>{let r=new AbortController;n.current=r;let o=()=>{r.abort(),a()},s=t?.context.subscribe(t=>{e.kind===`computer`&&t.computerId!==e.computerId&&o()}),c=t?.lifecycle.subscribe(e=>{(e===`disconnected`||e===`disposing`||e===`disposed`)&&o()});return i(r),()=>{s?.(),c?.(),r.abort(),n.current===r&&(n.current=null)}},[e,t,i,a]);let o=HT({gcTime:0,mutationFn:e=>e,onError:e=>{M$(`download-print`,e)}}),s=r.error??o.error,c=s?A$(s):o.data?.kind===`refused`?j$(o.data):null;return{preparing:r.isIdle||r.isPending,isPending:o.isPending,disabled:!r.data||o.isPending,failure:c,start:()=>{if(r.data&&!o.isPending&&!n.current?.signal.aborted){let e=t?t.ui.requestBrowserAction(r.data):Promise.resolve({kind:`refused`,reason:`unavailable`});o.mutate(e)}}}}function B$({sigil:e,label:t,children:n}){return(0,X.jsxs)(hz,{children:[(0,X.jsxs)(`span`,{className:`prints-info-label`,children:[(0,X.jsx)(Wz,{name:e,size:16}),t]}),(0,X.jsx)(`span`,{className:`prints-info-value`,children:n})]})}function V$({name:e}){let t=e.length>H$?e.slice(-H$):``;return(0,X.jsxs)(`span`,{className:`prints-info-file`,title:e,"data-print-file":!0,children:[(0,X.jsx)(`span`,{className:`prints-info-file-head`,children:e.slice(0,e.length-t.length)}),t?(0,X.jsx)(`span`,{className:`prints-info-file-tail`,children:t}):null]})}var H$=10;function U$({image:e,app:t,referenceImages:n,models:r,canAnimate:i,onIterate:a,onClose:o}){let[s,c]=(0,K.useState)(null),l=(0,K.useRef)(null),u=z$(e.source,t),d=u.failure,f=BT(Mre(t,e.source.kind===`computer`?e.source.path:null)),p=R$(e,t).data,m=p?P$(p,f.data?.style??null):null,h=p?FB(r,p.print.model):null;return(0,K.useEffect)(()=>{let e=document.activeElement;return l.current?.focus(),()=>{e instanceof HTMLElement&&e.isConnected&&e.focus()}},[]),(0,X.jsxs)(fz,{ref:l,className:`prints-info-drawer`,role:`region`,"aria-label":`Image information`,tabIndex:-1,onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),o())},children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-sm`,children:[(0,X.jsx)(`h2`,{className:`text-base font-semibold`,children:`Image info`}),(0,X.jsx)(dz,{"aria-label":`Close image information`,icon:(0,X.jsx)(mB,{}),onClick:o})]}),(0,X.jsxs)(mz,{density:`compact`,className:`prints-info-facts`,children:[(0,X.jsx)(B$,{sigil:`list`,label:`File`,children:(0,X.jsx)(V$,{name:e.file.name})}),(0,X.jsxs)(B$,{sigil:`prints`,label:`Size`,children:[e.width,` × `,e.height,` · `,I$(e.width,e.height)]}),f.data?.style?(0,X.jsx)(B$,{sigil:`write`,label:`Style`,children:f.data.style}):null,p?(0,X.jsx)(B$,{sigil:`sendPrompts`,label:`Prompt`,children:(0,X.jsx)(`span`,{className:`whitespace-pre-wrap`,"data-print-prompt":!0,children:p.typed.prompt})}):null,p?(0,X.jsx)(B$,{sigil:`generateMedia`,label:`Model`,children:(0,X.jsx)(`span`,{"data-print-model":!0,children:h?PB(h):`${p.print.model} (no longer available)`})}):null,p&&p.characters.length>0?(0,X.jsx)(B$,{sigil:`members`,label:`Characters`,children:(0,X.jsx)(`span`,{"data-print-characters":!0,children:p.characters.map(e=>`@${e}`).join(`, `)})}):null,p&&p.references.length>0?(0,X.jsx)(B$,{sigil:`read`,label:`References`,children:(0,X.jsx)(`ul`,{className:`prints-info-references`,"data-print-references":!0,"aria-label":`${String(p.references.length)} references`,children:p.references.map((e,t)=>{let r=e.path.split(`/`).at(-1),i=n.find(t=>t.path===e.path);return(0,X.jsx)(`li`,{title:e.path,children:i?(0,X.jsx)(`img`,{src:i.url,alt:r}):r},`${String(t)}:${e.path}`)})})}):null,p?(0,X.jsx)(B$,{sigil:`schedule`,label:`Made`,children:L$.format(p.print.createdAt)}):null]}),(0,X.jsxs)(`div`,{className:`prints-info-actions`,role:`group`,"aria-label":`Image actions`,children:[m&&e.source.kind===`computer`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(nI,{label:`Reuse`,icon:(0,X.jsx)(lB,{}),disabled:f.isPending,onClick:()=>{c(a(`reuse`,m))}}),(0,X.jsx)(nI,{label:`Remix`,icon:(0,X.jsx)(uB,{}),disabled:f.isPending,onClick:()=>{c(a(`remix`,m))}}),i&&m.kind===`image`?(0,X.jsx)(nI,{label:`Animate`,icon:(0,X.jsx)($z,{}),disabled:f.isPending,onClick:()=>{c(a(`animate`,m))}}):null]}):null,(0,X.jsx)(nI,{label:`Download`,icon:(0,X.jsx)(eB,{}),title:u.preparing?`Preparing download…`:u.isPending?`Downloading…`:void 0,onClick:u.start,disabled:u.disabled,"aria-busy":u.preparing||u.isPending})]}),s?(0,X.jsx)(`p`,{role:`alert`,className:`text-sm`,children:s}):null,d?(0,X.jsxs)(`p`,{role:`alert`,className:`text-sm`,children:[d.title,`. `,d.message]}):null]})}var W$=24,G$={all:e=>xN.of(e,`prints`,`gallery`),listings:e=>[...G$.all(e),`listing`],listing:(e,t)=>[...G$.listings(e),t],file:(e,t)=>[...G$.all(e),`file`,t]};function K$(e,t){let n=e?.context.get().computerId;return bne({queryKey:G$.listing(e,t),initialPageParam:0,enabled:!!(n&&t&&e.capabilities.has(XB)&&e.capabilities.has(sV)),queryFn:async({pageParam:r,signal:i})=>{if(!e||!n||!t)throw new Y(`No Computer folder selected`,{code:`SELECTION_CHANGED`,retryable:!1});let a=[],o=r;do{if(i.throwIfAborted(),e.context.get().computerId!==n)throw new Y(`Computer selection changed`,{code:`SELECTION_CHANGED`,retryable:!1});let r=await lV(e.capabilities,{path:t,limit:W$-a.length,offset:o});if(i.throwIfAborted(),r.nextOffset!==null&&r.nextOffset<=o)throw new Y(`Directory pagination did not advance`,{code:`PROTOCOL`,retryable:!1});a.push(...r.entries.filter(e=>e.type===`file`&&/\.(avif|gif|jpe?g|png|svg|webp|mp4)$/i.test(e.name)).map(e=>({...e,path:`${r.path.replace(/\/$/,``)}/${e.name}`}))),o=r.nextOffset}while(a.length<W$&&o!==null);return{entries:a,nextOffset:o}},getNextPageParam:e=>e.nextOffset})}function q$(e,t,n){return{...wN(e,sV,[...G$.file(e,t.path),t.modifiedAt,t.size],async(n,r)=>{if(!e)throw new Y(`Prints disconnected`,{code:`DISCONNECTED`,retryable:!0});let i=await cV(e.capabilities,{path:t.path},{signal:r});return new File([i],i.name,{type:i.type,lastModified:t.modifiedAt})}),enabled:!!(n&&e?.context.get().computerId&&e.capabilities.has(sV)),structuralSharing:!1}}function J$(e,t){let n=e?.app??null,r=XM(n),i=Nw(),[a,o]=(0,K.useState)(()=>new Set),s=(0,K.useCallback)(e=>{if(!r)return;let t=`${r}:${e}`;o(e=>e.has(t)?e:new Set([...e,t]))},[r]),c=K$(n,t),l=UT(c),u=(0,K.useMemo)(()=>c.enabled?l.data?.pages.flatMap(e=>e.entries)??[]:[],[l.data,c.enabled]),d=(0,K.useCallback)(e=>({files:e.flatMap((e,t)=>e.data?[{path:u[t].path,file:e.data}]:[]),failures:e.flatMap((e,t)=>e.isError?[u[t].name]:[]),loading:e.some(e=>e.isLoading)}),[u]),f=RT({queries:u.map(e=>q$(n,e,!!(r&&a.has(`${r}:${e.path}`)))),combine:d});return(0,K.useEffect)(()=>{if(!n)return;let e=G$.all(n),t=G$.listings(n),a=!0;i.invalidateQueries({queryKey:e});let o=()=>{i.cancelQueries({queryKey:e})},s=n.context.subscribe(e=>{e.computerId!==r&&o()}),c=n.lifecycle.subscribe(e=>{(e===`disconnected`||e===`disposing`||e===`disposed`)&&o()}),l=n.capabilities.subscribe(()=>{queueMicrotask(()=>{!a||n.context.get().computerId!==r||i.resetQueries({queryKey:t})})});return()=>{a=!1,s(),c(),l(),o()}},[n,r,e,i]),{entries:u,loadFile:s,files:f.files,failures:f.failures,error:l.error,loading:l.isFetching||f.loading,hasNextPage:l.hasNextPage,nextPageReady:l.hasNextPage&&!l.isFetching&&!l.error,refresh:()=>{l.refetch({cancelRefetch:!1})},loadMore:()=>{l.isFetching||l.fetchNextPage({cancelRefetch:!1})}}}function Y$(e){return e.replace(/\s/gu,` `).replace(/ +/g,` `).trim()}function X$(e,t){let[n,r]=(0,K.useState)([]),i=(0,K.useRef)(new Map),a=(0,K.useRef)(Promise.resolve()),[o,s]=(0,K.useState)(null),c=(0,K.useRef)(new Map),l=(0,K.useRef)(e);l.current=e;let u=(0,K.useRef)(t);u.current=t;let d=(e,t,n)=>{let a=i.current.get(e);a&&i.current.set(e,{...a,status:t,message:n}),r([...i.current.values()])},f=(0,K.useCallback)(async(e,t)=>{let n=()=>t.signal.aborted;if(n()){d(e.id,`cancelled`,`Cancelled before sending`),c.current.delete(e.id);return}let r=e.dimensions;if(!r)try{let t=await D$(e.file,e.previewUrl);r={width:t.width,height:t.height},e.dimensions=r;let n=i.current.get(e.id);n&&i.current.set(e.id,{...n,dimensions:r})}catch(t){M$(`decode-upload-image`,t),d(e.id,`error`,`Could not decode this image. No upload was sent.`),c.current.delete(e.id);return}try{if(n()){d(e.id,`cancelled`,`Cancelled before sending`);return}if(e.app.context.get().computerId!==e.computerId){d(e.id,`error`,`Computer changed. Select the original Computer and retry. No upload was sent.`);return}u.current({id:e.id,path:e.path,computerId:e.computerId,app:e.app,width:r.width,height:r.height}),d(e.id,`sending`,`Sending; awaiting Computer completion`),await pV(e.app.capabilities,{path:e.path,content:e.file.slice()},{signal:t.signal}),d(e.id,`complete`,`Written to Computer`);try{await l.current(e.path,e.app,e.computerId)}catch(t){M$(`refresh-upload-preview`,t),d(e.id,`complete`,`Written; fresh preview unavailable`)}}catch(t){n()||M$(`write-computer-upload`,t),d(e.id,n()?`cancelled`:`error`,n()?`Cancelled request; check Computer before retrying`:`Completion not confirmed; check Computer or retry`)}finally{c.current.delete(e.id)}},[]),p=e=>{let t=new AbortController;c.current.set(e.id,t),d(e.id,`queued`,`Queued`),a.current=a.current.then(()=>f(e,t))},m=(0,K.useCallback)(()=>{for(let e of c.current.values())e.abort()},[]);return(0,K.useEffect)(()=>()=>{m();for(let e of i.current.values())URL.revokeObjectURL(e.previewUrl)},[m]),{items:n,error:o,cancelAll:m,add(e,t,n){s(null);let r=[...i.current.values()].reduce((e,t)=>e+t.file.size,0);for(let a of e){if(!a.type.startsWith(`image/`)){s(`Only image files can be uploaded here`);continue}if(i.current.size>=8||r+a.size>67108864){s(`Upload queue limit: eight files and 64 MiB. Remove finished rows before adding more.`);break}let e=n.context.get().computerId;if(!e){s(`Select a Computer before uploading images.`);continue}let o=`${t.replace(/\/$/,``)}/upload-${lN(8)}-${Y$(a.name)}`;if(i.current.has(o)){s(`This path is already in the queue. Retry or remove its existing row.`);continue}let c={computerId:e,id:o,file:a,previewUrl:URL.createObjectURL(a),app:n,path:o,status:`queued`,message:`Queued`};i.current.set(c.id,c),r+=a.size,p(c)}},cancel(e){c.current.get(e)?.abort()},retry(e){let t=n.find(t=>t.id===e);t&&!c.current.has(e)&&p(t)},remove(e){if(!c.current.has(e)){let t=i.current.get(e);t&&URL.revokeObjectURL(t.previewUrl),i.current.delete(e),r([...i.current.values()])}}}}function Z$(e,t){let n=t.path,r=XM(e?.app),i=(0,K.useRef)(new Set),a=(0,K.useRef)(0),o=(0,K.useRef)(e);o.current=e;let s=e?.app.capabilities.has(XB)===!0,c=e?.app.capabilities.has(sV)===!0,l=e?.app.capabilities.has(uV)===!0,u=J$(e,t.galleryPath),[d,f]=(0,K.useState)([]),[p,m]=(0,K.useState)([]),[h,g]=(0,K.useState)([]),[_,v]=(0,K.useState)([]);(0,K.useEffect)(()=>{v([])},[e]);let y=e=>{v(t=>t.some(t=>t.key===e.key)?t.map(t=>t.key===e.key?e:t):[...t,e])},[b,x]=(0,K.useState)(!1),S=(0,K.useMemo)(()=>[...u.error?[`Could not refresh the Media gallery`]:[],...u.failures],[u.error,u.failures]),C=(0,K.useRef)(new WeakMap),w=(0,K.useMemo)(()=>{if(!c||!s)return d.filter(e=>e.kind===`local`);let t=r?u.files.map(({file:t,path:n})=>({kind:`computer`,computerId:r,connection:e,file:t,path:n})):[],i=d.filter(t=>t.kind===`local`||t.computerId===r&&t.connection===e&&t.path.slice(0,t.path.lastIndexOf(`/`))===n?.replace(/\/$/,``));return[...t.filter(e=>!i.some(t=>t.kind===`computer`&&e.kind===`computer`&&t.path===e.path)),...i]},[e,r,n,u.files,d,c,s]),T=(0,K.useCallback)(()=>{a.current+=1;for(let e of i.current)e.abort();i.current.clear()},[]);(0,K.useEffect)(()=>{if(!e)return()=>{T()};let t=e.app.lifecycle.subscribe(e=>{(e===`disconnected`||e===`disposing`||e===`disposed`)&&T()});return()=>{t(),T()}},[e,T]),(0,K.useEffect)(()=>{if(e)return e.app.context.subscribe(e=>{e.computerId!==r&&T()})},[e,r,T]),(0,K.useEffect)(()=>{v([]),f(e=>e.filter(e=>e.kind===`local`))},[r]);let E=async(e,t,n,r)=>{let s=r??n.app.context.get().computerId;if(!s){g([`The selected Computer is unavailable`]);return}if(t===`open`){try{await(o.current??n).app.ui.openNavigation({computerId:s,path:e})}catch(t){M$(`open-computer-file`,t),g([`Could not open ${e} in Inkcap`])}return}if(o.current!==n){g([`Computer selection changed`]);return}if(n.app.context.get().computerId!==s){g([`Computer selection changed before the preview was loaded`]);return}let c=a.current,l=new AbortController;i.current.add(l);try{let t=await cV(n.app.capabilities,{path:e},{signal:l.signal});if(l.signal.aborted||c!==a.current)return;v(n=>n.map(n=>n.key===`${s}:${e}`?{...n,previewFile:t}:n)),f(r=>[...r.filter(t=>t.kind!==`computer`||t.path!==e||t.computerId!==s),{kind:`computer`,computerId:s,file:t,path:e,connection:n}])}catch(t){l.signal.aborted||(M$(`read-computer-file`,t),g([`Could not read ${e}`]),v(t=>t.map(t=>t.key===`${s}:${e}`?{...t,error:`Saved; preview unavailable. Retry loading it.`}:t)))}finally{i.current.delete(l)}},D=(0,K.useRef)(new Set),O=(0,K.useRef)(new Set),k=(0,K.useCallback)(e=>{URL.revokeObjectURL(e),D.current.delete(e)},[]);(0,K.useEffect)(()=>{let e=!0,t=new Set,n=new Map,r=new Set,i=[...w].sort((e,t)=>t.file.lastModified-e.file.lastModified||e.file.name.localeCompare(t.file.name)).map(e=>{let t=URL.createObjectURL(e.file);return D.current.add(t),{source:e,file:e.file,url:t}}),a=i.length;return g(S),x(a>0),a===0&&m([]),i.forEach(({file:o,url:s,source:c},l)=>{let u=C.current.get(o);u||(u=(async()=>{let e=URL.createObjectURL(o);try{let{width:t,height:n}=await D$(o,e);return{width:t,height:n}}finally{URL.revokeObjectURL(e)}})(),C.current.set(o,u)),u.then(r=>{e&&(n.set(l,{...r,file:o,url:s,source:c}),t.add(s),m(i.flatMap((e,t)=>{let r=n.get(t);return r?[r]:[]})),v(e=>e.map(e=>e.previewFile===o?{...e,resolved:!0,previewFile:void 0,error:void 0}:e)))}).catch(t=>{e&&(M$(`decode-gallery-image`,t),k(s),r.add(o.name),g([...S,...r]),c.kind===`computer`&&v(e=>e.map(e=>e.key===`${c.computerId}:${c.path}`?{...e,error:`Could not decode the saved image.`}:e)))}).finally(()=>{--a,e&&a===0&&(x(!1),m(i.flatMap((e,t)=>{let r=n.get(t);return r?[r]:[]})))})}),()=>{e=!1;for(let{url:e}of i)t.has(e)||k(e)}},[w,S,k]),(0,K.useEffect)(()=>{let e=new Set(p.map(e=>e.url));for(let t of O.current)e.has(t)||k(t);O.current=e},[p,k]),(0,K.useEffect)(()=>{let e=D.current;return()=>{for(let t of e)URL.revokeObjectURL(t);e.clear()}},[]);let A=X$(async(e,t,n)=>{let r=o.current,i=r?.app===t&&t.context.get().computerId===n?r:null;i&&await E(e,`add`,i,n)},e=>{o.current?.app===e.app&&e.app.context.get().computerId===e.computerId&&y({key:`${e.computerId}:${e.path}`,path:e.path,computerId:e.computerId,width:e.width,height:e.height,uploadId:e.id})});return(0,K.useEffect)(()=>{let t=A.cancelAll,n=e?.app.lifecycle.subscribe(e=>{(e===`disposing`||e===`disconnected`||e===`disposed`)&&t()});return()=>{n?.(),t()}},[e,A.cancelAll]),{images:p,failed:h,loading:b,gallery:u,gallerySlots:_,canBrowse:s,canRead:c,canWrite:l,reserveSlot:y,openComputerFile:E,uploads:A,uploadFiles:async i=>{if(!e||!l||n===null)return;let a=e,s=r,c=await t.ensureCreated();if(c){g([c]);return}o.current===a&&a.app.context.get().computerId===s&&A.add(i,n,a.app)},failSlot:(e,t)=>{v(n=>n.map(n=>n.key===e?{...n,error:t}:n))},clearSlotError:e=>{v(t=>t.map(t=>t.key===e?{...t,error:void 0}:t))},removeSlot:e=>{v(t=>t.filter(t=>t.key!==e))}}}var Q$=e=>XC.pipe(J(yw(1)),J(xw(e))),$$=ZC.pipe(J(_w()),J(cw(Number.isSafeInteger,{message:`Expected a safe integer`}))),e1=$$.pipe(J(pw(0))),t1=q({bytes:e1,costMilliunits:$$.pipe(J(mw(0))),destination:q({computerId:Q$(256),path:Q$(4096)}),format:rw([`png`,`jpeg`,`gif`,`webp`,`mp4`]),height:e1,model:Q$(256),width:e1}),n1=q({operation:KC(`complete-generation`),reference:nP,result:t1,derivedFrom:GC(Q$(256)),references:GC(ew(iw(Q$(256))))}),r1=q({reference:nP,input:vP,typed:q({prompt:Cw,references:vw.pipe(J(mw(0)))}),style:GC(VP),characters:GC(ew(iF))});nw([q({operation:KC(`remember-generation`),record:r1}),q({operation:KC(`forget-generation`),reference:nP}),q({operation:KC(`list-generations`),after:iw(XC)})]);function i1(e){return{reference:e.reference,input:DP(e.input),typed:e.typed,style:e.style,characters:e.characters}}async function a1(e,t){let n=i1(HC(r1,{onExcessProperty:`error`})(t)),r=i1(HC(r1,{onExcessProperty:`error`})(await e.require(EN).request(JSON.stringify({operation:`remember-generation`,record:n}))));if(JSON.stringify(r)!==JSON.stringify(n))throw new Y(`Prints did not confirm the original generation command`,{code:`PROTOCOL`,retryable:!1});return r}async function o1(e,t){HC(q({removed:QC}))(await e.require(EN).request(JSON.stringify({operation:`forget-generation`,reference:t})))}async function s1(e,t=null){let n=HC(q({records:ew(r1),next:iw(XC)}),{onExcessProperty:`error`})(await e.require(EN).request(JSON.stringify({operation:`list-generations`,after:t})));return{records:n.records.map(i1),next:n.next}}async function c1(e,t,n){let r=HC(n1,{onExcessProperty:`error`})({operation:`complete-generation`,reference:t,result:n}),i=HC(q({printId:XC,computerId:XC}))(await e.require(EN).request(JSON.stringify(r)));if(i.printId!==t.requestId||i.computerId!==t.computerId)throw new Y(`Prints did not confirm the saved generation`,{code:`PROTOCOL`,retryable:!1})}var l1=BC(q({reference:nP}));function u1({connection:e,folder:t,effects:n,styles:r,characters:i}){let a=e?.app??null,o=XM(a),s=(0,K.useRef)(e);s.current=e;let c=(0,K.useRef)(n);c.current=n;let l=Nw(),u=xN.of(a,`prints`,`generation`),d=[...u,`recovery`],f=BT(Ore(a)),p=f.isError?void 0:f.data,m=p?.models??[],h=a?.capabilities.has(CP)===!0,g=p?.canGenerate??!1,_=f.error?Ow(f.error).message:p?.models.length===0?`The granted Media model registry is empty.`:null,v=UT({queryKey:d,enabled:a!==null&&o!==null,initialPageParam:null,queryFn:async({pageParam:e,signal:t})=>{if(!a)throw new Y(`Prints disconnected`,{code:`DISCONNECTED`,retryable:!0});if(a.context.get().computerId!==o)throw new Y(`Computer selection changed`,{code:`SELECTION_CHANGED`,retryable:!1});let n=await s1(a.capabilities,e);return t.throwIfAborted(),n},getNextPageParam:e=>e.next}),y=(0,K.useMemo)(()=>Array.from(new Map(v.data?.pages.flatMap(e=>e.records).map(e=>[e.reference.requestId,e])??[]).values()),[v.data]),b=(0,K.useRef)(new Map),x=(0,K.useRef)(0),S=(0,K.useRef)(null),[C,w]=(0,K.useState)(null),[T,E]=(0,K.useState)(null),D=e=>s.current===e.connection&&e.connection.app.context.get().computerId===e.reference.computerId,O=(e,t)=>{l.setQueryData(e,e=>e&&{...e,pages:e.pages.map(e=>({...e,records:e.records.filter(e=>e.reference.requestId!==t)}))})},k=HT({mutationKey:[...u,`run`],mutationFn:async e=>{e.controller.signal.throwIfAborted();let t=i1({reference:e.reference,input:e.input,typed:e.typed,style:e.style,characters:e.characters});await a1(e.connection.app.capabilities,t),e.controller.signal.throwIfAborted();let n=await e.session.restoreAttempt(e.reference),r;try{r=await n.generate(t.input,{signal:e.controller.signal})}finally{n[Symbol.dispose]()}return await c1(e.connection.app.capabilities,t.reference,r),{input:e.input,result:r}},onMutate:e=>{!D(e)||e.controller.signal.aborted||c.current.reserve({key:`${e.reference.computerId}:${e.input.destination.path}`,computerId:e.reference.computerId,path:e.input.destination.path,width:e.draft.width,height:e.draft.height,pendingLabel:TB(FB(e.session.models,e.input.settings.model))})},onSuccess:(e,t)=>{O(t.recoveryKey,t.reference.requestId),S.current?.reference.requestId===t.reference.requestId&&(S.current=null),!(!D(t)||t.controller.signal.aborted)&&c.current.saved(e,t.connection)},onError:(e,n)=>{M$(`generate-media`,e),!(!D(n)||n.controller.signal.aborted)&&(t.recheck(),c.current.failed(`${n.reference.computerId}:${n.input.destination.path}`,bB(e).message))},onSettled:(e,t,n)=>{b.current.get(n.reference.requestId)===n.controller&&b.current.delete(n.reference.requestId)}}),A=HT({mutationKey:[...u,`discard`],mutationFn:async e=>{await o1(e.connection.app.capabilities,e.reference)},onSuccess:(e,t)=>{O(t.recoveryKey,t.reference.requestId),S.current?.reference.requestId===t.reference.requestId&&(S.current=null)},onError:(e,t)=>{D(t)&&E(Ow(e).message)},onSettled:(e,t,n)=>{b.current.get(n.reference.requestId)===n.controller&&b.current.delete(n.reference.requestId)}}),j=xne({filters:{mutationKey:u,status:`pending`},select:e=>Tee(l1(e.state.variables))?.reference.requestId}),M=new Set(j.filter(e=>e!==void 0));(0,K.useEffect)(()=>{w(null),E(null),S.current=null;let e=xN.of(a,`prints`,`generation`,`recovery`),t=a?.capabilities.subscribe(()=>{queueMicrotask(()=>{l.resetQueries({queryKey:e,exact:!0})})}),n=()=>{x.current+=1;for(let e of b.current.values())e.abort();b.current.clear(),l.cancelQueries({queryKey:e})},r=a?.context.subscribe(e=>{e.computerId!==o&&n()}),i=a?.lifecycle.subscribe(e=>{(e===`disposing`||e===`disposed`||e===`disconnected`)&&n()});return()=>{r?.(),i?.(),t?.(),n()}},[a,o,e,l]);let N=e=>{let t=e.reference.requestId;if(b.current.has(t))return!1;if(!D(e))return E(`Select the original Computer to retry this generation.`),!1;if(p?.computerId!==e.reference.computerId)return E(`Media access is unavailable for the original Computer.`),!1;let n=new AbortController;return b.current.set(t,n),S.current=e,w(null),E(null),x.current+=1,k.mutate({...e,session:p,controller:n,ticket:x.current,recoveryKey:d}),!0},P=async n=>{if(!e?.app.capabilities.has(uV)||!g)return!1;if(t.path===null)return t.setEditing(!0),!1;S.current=null;let a=FB(m,n.model);if(a===void 0)return w({kind:`error`,message:`Choose a model from the granted registry.`}),!1;let o=_F({prompt:n.prompt,saved:i,references:n.references,model:{label:a.label,maxReferences:a.input.maxReferences}});if(o.kind===`refused`)return w({kind:`error`,message:o.message}),!1;let c=GB({...n,references:o.references},a);if(c)return w({kind:`error`,message:c}),!1;let l=n.style===void 0?void 0:r.find(e=>e.name===n.style);if(n.style!==void 0&&l===void 0)return w({kind:`error`,message:`The "${n.style}" style no longer exists. Pick another or none.`}),!1;let u=o.characters.map(e=>e.name),d=qP(l?.text,o.prompt),f=YP(d,JP(a),l?.name,u);if(f!==void 0)return w({kind:`error`,message:f}),!1;if(!h||!p)return w(null),!1;let _=e,v=_.app.context.get().computerId,y=x.current,b={...n,prompt:d,references:o.references,destination:CB(n,t.path,a)},C=HB(b,a),T;try{let e=await t.ensureCreated();if(e)return w({kind:`error`,message:e}),!1;if(x.current!==y||s.current!==_||_.app.context.get().computerId!==v)return!1;let n=await p.createAttempt();T=n.reference,n[Symbol.dispose]()}catch(e){return x.current===y&&s.current===_&&_.app.context.get().computerId===v&&w({kind:`error`,...bB(e)}),!1}return x.current!==y||s.current!==_||_.app.context.get().computerId!==v?!1:N({connection:_,reference:T,input:C,draft:b,typed:{prompt:n.prompt.trim(),references:n.references.length},style:l?.name,characters:u})},F=k.variables;return{state:C??(F&&D(F)&&F.ticket===x.current?k.isPending?{kind:`pending`,draft:F.draft}:k.isError?{kind:`error`,...bB(k.error)}:{kind:`completed`,record:k.data}:null)??(!e||!h||o===null?{kind:`unavailable`,reason:`Image creation is unavailable for this Computer right now.`}:_?{kind:`unavailable`,reason:_}:p?{kind:`ready`}:{kind:`loading`}),models:m,modelsLoading:f.isFetching,modelsError:_,canGenerate:g,mediaCapability:h,retryModels:()=>{f.refetch()},submit:P,isRunning:()=>b.current.size>0,activeGenerations:M,pendingGenerations:y,recoveryError:T??(v.error?Ow(v.error).message:null),reportRecoveryError:e=>{E(Ow(e).message)},hasMore:v.hasNextPage,loadMore:()=>{v.isFetching||v.fetchNextPage()},resume:t=>{if(!e||p?.computerId!==t.reference.computerId){E(`Select the original Computer to retry this generation.`);return}N({connection:e,...t,draft:{...t.input.settings,references:t.input.settings.references??[],destination:t.input.destination.path}})},discard:t=>{if(!e||b.current.has(t.reference.requestId))return;let n=new AbortController;b.current.set(t.reference.requestId,n),A.mutate({...t,connection:e,controller:n,draft:{...t.input.settings,references:t.input.settings.references??[]},recoveryKey:d})},retryPath:e=>{let t=S.current;return t?.input.destination.path!==e||!D(t)?!1:(N(t),!0)},retry:S.current&&D(S.current)?()=>{S.current&&N(S.current)}:void 0,errorKey:`generation:${S.current?.reference.requestId??`draft`}:${String(x.current)}`}}function d1({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 f1(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 p1=[],m1=0,{link:h1,unlink:g1,propagate:_1,checkDirty:v1,shallowPropagate:y1}=d1({update(e){return e._update()},notify(e){p1[x1++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,T1(e))}}),b1=0,x1=0,S1,C1=0;function w1(e){try{++C1,e()}finally{--C1||E1()}}function T1(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=g1(n,e)}function E1(){if(!(C1>0)){for(;b1<x1;){let e=p1[b1];p1[b1++]=void 0,e.notify()}b1=0,x1=0}}function D1(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return S1!==void 0&&h1(i,S1,m1),i._snapshot},subscribe(e){let t=f1(e),n={current:!1},r=O1(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=S1,o=t?.compare??Object.is;if(n)S1=i,++m1,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{S1=a,n&&(i.flags&=-5),T1(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&v1(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&y1(e)}}else e&32&&(i.flags=e&-33);return S1!==void 0&&h1(i,S1,m1),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(_1(e),y1(e),E1())}},i}function O1(e){let t=()=>{let t=S1;S1=n,++m1,n.depsTail=void 0,n.flags=6;try{return e()}finally{S1=t,n.flags&=-5,T1(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&v1(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,T1(this)}};return t(),n}var k1=class{constructor(e,t){this.atom=D1(e),this.get=this.get.bind(this),this.setState=this.setState.bind(this),this.subscribe=this.subscribe.bind(this),t&&(this.actions=t(this))}setState(e){this.atom.set(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(f1(e))}},A1=class{constructor(e){this.atom=D1(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(f1(e))}};function j1(e,t){return typeof e==`function`?new A1(e):t?new k1(e,t):new k1(e)}var M1=class{constructor(e,t){this.fn=e,this.options=t,this.lastExecutionTime=0,this.isPending=!1,this.maybeExecute=(...e)=>{let t=Date.now()-this.lastExecutionTime;if(this.options.leading&&t>=this.options.wait)this.execute(...e);else if(this.lastArgs=e,!this.timeoutId&&this.options.trailing){let e=this.options.wait-t;this.isPending=!0,this.timeoutId=setTimeout(()=>{this.lastArgs!==void 0&&this.execute(...this.lastArgs)},e)}},this.execute=(...e)=>{this.fn(...e),this.options.onExecute?.(e,this),this.lastExecutionTime=Date.now(),this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.flush=()=>{this.isPending&&this.lastArgs&&this.execute(...this.lastArgs)},this.cancel=()=>{this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.clearTimeout=()=>{this.timeoutId&&=(clearTimeout(this.timeoutId),void 0)},this.options.leading===void 0&&this.options.trailing===void 0&&(this.options.leading=!0,this.options.trailing=!0)}};function N1(e,t){return new M1(e,t).maybeExecute}var P1=class{#e=!0;#t;#n;#r;#i;#a;#o;#s;#c=0;#l=5;#u=!1;#d=!1;#f=null;#p=()=>{this.debugLog(`Connected to event bus`),this.#a=!0,this.#u=!1,this.debugLog(`Emitting queued events`,this.#i),this.#i.forEach(e=>this.emitEventToBus(e)),this.#i=[],this.stopConnectLoop(),this.#n().removeEventListener(`tanstack-connect-success`,this.#p)};#m=()=>{if(this.#c<this.#l){this.#c++,this.dispatchCustomEvent(`tanstack-connect`,{});return}this.#n().removeEventListener(`tanstack-connect`,this.#m),this.#d=!0,this.debugLog(`Max retries reached, giving up on connection`),this.stopConnectLoop()};#h=()=>{this.#u||(this.#u=!0,this.#n().addEventListener(`tanstack-connect-success`,this.#p),this.#m())};constructor({pluginId:e,debug:t=!1,enabled:n=!0,reconnectEveryMs:r=300}){this.#t=e,this.#e=n,this.#n=this.getGlobalTarget,this.#r=t,this.debugLog(` Initializing event subscription for plugin`,this.#t),this.#i=[],this.#a=!1,this.#d=!1,this.#o=null,this.#s=r}startConnectLoop(){this.#o!==null||this.#a||(this.debugLog(`Starting connect loop (every ${this.#s}ms)`),this.#o=setInterval(this.#m,this.#s))}stopConnectLoop(){this.#u=!1,this.#o!==null&&(clearInterval(this.#o),this.#o=null,this.#i=[],this.debugLog(`Stopped connect loop`))}debugLog(...e){this.#r&&console.log(`🌴 [tanstack-devtools:${this.#t}-plugin]`,...e)}getGlobalTarget(){if(typeof globalThis<`u`&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog(`Using global event target`),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<`u`&&window.addEventListener!==void 0)return this.debugLog(`Using window as event target`),window;let e=typeof EventTarget<`u`?new EventTarget:void 0;return e===void 0||e.addEventListener===void 0?(this.debugLog(`No event mechanism available, running in non-web environment`),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog(`Using new EventTarget as fallback`),e)}getPluginId(){return this.#t}dispatchCustomEventShim(e,t){try{let n=new Event(e,{detail:t});this.#n().dispatchEvent(n)}catch{this.debugLog(`Failed to dispatch shim event`)}}dispatchCustomEvent(e,t){try{this.#n().dispatchEvent(new CustomEvent(e,{detail:t}))}catch{this.dispatchCustomEventShim(e,t)}}emitEventToBus(e){this.debugLog(`Emitting event to client bus`,e),this.dispatchCustomEvent(`tanstack-dispatch-event`,e)}createEventPayload(e,t){return{type:`${this.#t}:${e}`,payload:t,pluginId:this.#t}}emit(e,t){if(!this.#e){this.debugLog(`Event bus client is disabled, not emitting event`,e,t);return}if(this.#f&&(this.debugLog(`Emitting event to internal event target`,e,t),this.#f.dispatchEvent(new CustomEvent(`${this.#t}:${e}`,{detail:this.createEventPayload(e,t)}))),this.#d){this.debugLog(`Previously failed to connect, not emitting to bus`);return}if(!this.#a){this.debugLog(`Bus not available, will be pushed as soon as connected`),this.#i.push(this.createEventPayload(e,t)),typeof CustomEvent<`u`&&!this.#u&&(this.#h(),this.startConnectLoop());return}return this.emitEventToBus(this.createEventPayload(e,t))}on(e,t,n){let r=n?.withEventTarget??!1,i=`${this.#t}:${e}`;if(r&&(this.#f||=new EventTarget,this.#f.addEventListener(i,e=>{t(e.detail)})),!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`,i),()=>{};let a=e=>{this.debugLog(`Received event from bus`,e.detail),t(e.detail)};return this.#n().addEventListener(i,a),this.debugLog(`Registered event to bus`,i),()=>{r&&this.#f?.removeEventListener(i,a),this.#n().removeEventListener(i,a)}}onAll(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}onAllPluginEvents(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;this.#t&&n.pluginId!==this.#t||e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}},F1=new class extends P1{constructor(){super({pluginId:`form-devtools`,reconnectEveryMs:1e3})}};function I1(e,t){return typeof e==`function`?e(t):e}function L1(e,t){return G1(t).reduce((e,t)=>{if(e===null)return null;if(e!==void 0)return e[t]},e)}function R1(e,t,n){let r=G1(t);function i(e){if(!r.length)return I1(n,e);let t=r.shift();if(typeof t==`string`||typeof t==`number`&&!Array.isArray(e))return typeof e==`object`?(e===null&&(e={}),{...e,[t]:i(e[t])}):{[t]:i()};if(Array.isArray(e)&&typeof t==`number`){let n=e.slice(0,t);return[...n.length?n:Array(t),i(e[t]),...e.slice(t+1)]}return[...Array(t),i()]}return i(e)}function z1(e,t){let n=G1(t);function r(e){if(!e)return;if(n.length===1){let t=n[0];if(Array.isArray(e)&&typeof t==`number`)return e.filter((e,n)=>n!==t);let{[t]:r,...i}=e;return i}let t=n.shift();if((typeof t==`string`||typeof t==`number`&&!Array.isArray(e))&&typeof e==`object`)return{...e,[t]:r(e[t])};if(typeof t==`number`&&Array.isArray(e)){if(t>=e.length)return e;let n=e.slice(0,t);return[...n.length?n:Array(t),r(e[t]),...e.slice(t+1)]}throw Error(`It seems we have created an infinite loop in deleteBy. `)}return r(e)}var B1=46,V1=91,H1=93,U1=48,W1=57;function G1(e){if(Array.isArray(e))return[...e];if(typeof e!=`string`)throw Error(`Path must be a string.`);let t=e.length,n=[],r=+(t>0&&e.charCodeAt(0)===V1),i=!0,a=-1;for(let o=r;o<=t;o++){let s=o<t?e.charCodeAt(o):-1;if(o===t||s===B1||s===V1||s===H1){let t=o-r;if(t>0){let a=i&&(t===1||e.charCodeAt(r)!==U1),s=e.slice(r,o);if(a){let e=parseInt(s,10);t<=15||String(e)===s?n.push(e):n.push(s)}else n.push(s)}else a!==H1&&(a!==-1||s!==H1)&&(a!==s||s!==B1&&s!==V1)&&n.push(``);r=o+1,i=!0}else(s<U1||s>W1)&&(i=!1);a=s}return n.length||n.push(``),n}function K1(e){return!(Array.isArray(e)&&e.length===0)}function q1(e,t){return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!1},runValidation:e=>e.validators.filter(Boolean).map(e=>({cause:e.cause,validate:e.fn}))})}function J1(e,t){let{asyncDebounceMs:n}=t,{onBlurAsyncDebounceMs:r,onChangeAsyncDebounceMs:i,onDynamicAsyncDebounceMs:a}=t.validators||{},o=n??0;return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!0},runValidation:t=>t.validators.filter(Boolean).map(t=>{let n=t?.cause||e,s=o;switch(n){case`change`:s=i??o;break;case`blur`:s=r??o;break;case`dynamic`:s=a??o;break;case`submit`:s=0}return e===`submit`&&(s=0),{cause:n,validate:t.fn,debounceMs:s}})})}var Y1=e=>!!e&&typeof e==`object`&&`fields`in e;function X1(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||n.length===0&&!Array.isArray(e)&&!Array.isArray(t)&&(Object.getPrototypeOf(e)!==Object.prototype||Object.getPrototypeOf(t)!==Object.prototype))return!1;for(let i of n)if(!r.includes(i)||!X1(e[i],t[i]))return!1;return!0}var Z1=({newFormValidatorError:e,isPreviousErrorFromFormValidator:t,previousErrorValue:n})=>e?{newErrorValue:e,newSource:`form`}:t?{newErrorValue:void 0,newSource:void 0}:n?{newErrorValue:n,newSource:`field`}:{newErrorValue:void 0,newSource:void 0},Q1=({formLevelError:e,fieldLevelError:t})=>t?{newErrorValue:t,newSource:`field`}:e?{newErrorValue:e,newSource:`form`}:{newErrorValue:void 0,newSource:void 0};function $1(e,t){return e==null?t:{...e,...t}}for(var e0=256,t0=[],n0;e0--;)t0[e0]=(e0+256).toString(16).substring(1);function r0(){let e=0,t,n=``;if(!n0||e0+16>256){for(n0=Array(256),e=256;e--;)n0[e]=256*Math.random()|0;e=0,e0=0}for(;e<16;e++)t=n0[e0+e],n+=e===6?t0[t&15|64]:e===8?t0[t&63|128]:t0[t],e&1&&e>1&&e<11&&(n+=`-`);return e0++,n}var i0=N1(e=>F1.emit(`form-state`,{id:e.formId,state:e.store.state}),{wait:300});function a0(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++)t[n]=a0(e[n]);return t}if(e instanceof Map){let t=new Map;return e.forEach((e,n)=>{t.set(n,a0(e))}),t}if(e instanceof Set){let t=new Set;return e.forEach(e=>{t.add(a0(e))}),t}let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=a0(e[n]));return t}function o0(e,t){return t===e||t.startsWith(`${e}.`)||t.startsWith(`${e}[`)}var s0=e=>{if(!e.validators)return e.runValidation({validators:[],form:e.form});let t=e.event.async,n=t?void 0:{fn:e.validators.onMount,cause:`mount`},r={fn:t?e.validators.onChangeAsync:e.validators.onChange,cause:`change`},i={fn:t?e.validators.onBlurAsync:e.validators.onBlur,cause:`blur`},a={fn:t?e.validators.onSubmitAsync:e.validators.onSubmit,cause:`submit`},o=t?void 0:{fn:()=>void 0,cause:`server`};switch(e.event.type){case`mount`:return e.runValidation({validators:[n],form:e.form});case`submit`:return e.runValidation({validators:[r,i,a,o],form:e.form});case`server`:return e.runValidation({validators:[],form:e.form});case`blur`:return e.runValidation({validators:[i,o],form:e.form});case`change`:return e.runValidation({validators:[r,o],form:e.form});default:throw Error(`Unknown validation event type: ${e.event.type}`)}};function c0(e,t){let n=new Map;for(let r of e){let e=r.path??[],i=t,a=``;for(let t=0;t<e.length;t++){let n=e[t];if(n===void 0)continue;let r=typeof n==`object`?n.key:n,o=Number(r);a+=Array.isArray(i)&&!Number.isNaN(o)?`[${o}]`:(t>0?`.`:``)+String(r),i=typeof i==`object`&&i?i[r]:void 0}n.set(a,(n.get(a)??[]).concat(r))}return Object.fromEntries(n)}var l0=(e,t)=>{let n=c0(e,t);return{form:n,fields:n}},u0={validate({value:e,validationSource:t},n){let r=n[`~standard`].validate(e);if(r instanceof Promise)throw Error(`async function passed to sync validator`);if(r.issues)return t===`field`?r.issues:l0(r.issues,e)},async validateAsync({value:e,validationSource:t},n){let r=await n[`~standard`].validate(e);if(r.issues)return t===`field`?r.issues:l0(r.issues,e)}},d0=e=>!!e&&`~standard`in e,f0={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{},_arrayVersion:0,_pendingValidationsCount:0};function p0(e){function t(t){let n=e.getFieldMeta(t)??f0;e.setFieldMeta(t,{...n,_arrayVersion:(n._arrayVersion||0)+1})}function n(n,r,i){t(n);let a=s(n,r,`move`,i),c=Math.min(r,i),u=Math.max(r,i);for(let e=c;e<=u;e++)a.push(o(n,e));let d=Object.keys(e.fieldInfo).reduce((t,i)=>(i.startsWith(o(n,r))&&t.set(i,e.getFieldMeta(i)),t),new Map);l(a,r<i?`up`:`down`),Object.keys(e.fieldInfo).filter(e=>e.startsWith(o(n,i))).forEach(t=>{let a=t.replace(o(n,i),o(n,r)),s=d.get(a);s&&e.setFieldMeta(t,s)})}function r(e,n){t(e),l(s(e,n,`remove`),`up`)}function i(n,r,i){t(n),s(n,r,`swap`,i).forEach(t=>{if(!t.toString().startsWith(o(n,r)))return;let a=t.toString().replace(o(n,r),o(n,i)),[s,c]=[e.getFieldMeta(t),e.getFieldMeta(a)];s&&e.setFieldMeta(a,s),c&&e.setFieldMeta(t,c)})}function a(n,r){t(n);let i=s(n,r,`insert`);l(i,`down`),i.forEach(t=>{t.toString().startsWith(o(n,r))&&e.setFieldMeta(t,u())})}function o(e,t){return`${e}[${t}]`}function s(t,n,r,i){let a=[o(t,n)];switch(r){case`swap`:a.push(o(t,i));break;case`move`:{let[e,r]=[Math.min(n,i),Math.max(n,i)];for(let n=e;n<=r;n++)a.push(o(t,n));break}default:{let r=e.getFieldValue(t),i=Array.isArray(r)?r.length:0;for(let e=n+1;e<i;e++)a.push(o(t,e));break}}return Object.keys(e.fieldInfo).filter(e=>a.some(t=>e.startsWith(t)))}function c(e,t){return e.replace(/\[(\d+)\]/,(e,n)=>{let r=parseInt(n,10);return`[${t===`up`?r+1:Math.max(0,r-1)}]`})}function l(t,n){(n===`up`?t:[...t].reverse()).forEach(t=>{let r=c(t.toString(),n),i=e.getFieldMeta(r);i?e.setFieldMeta(t,i):e.setFieldMeta(t,u())})}let u=()=>f0;return{bumpArrayVersion:t,handleArrayMove:n,handleArrayRemove:r,handleArraySwap:i,handleArrayInsert:a}}function m0(e){return{values:e.values??{},errorMap:e.errorMap??{},fieldMetaBase:e.fieldMetaBase??{},formGroupStateBase:e.formGroupStateBase??{},isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}}}var h0=class{constructor(e){this.options={},this.fieldInfo={},this.formGroupApis=new Set,this.mount=()=>{let e=this.store.subscribe(()=>{i0(this)}),t=F1.on(`request-form-state`,e=>{e.payload.id===this._formId&&F1.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}),n=F1.on(`request-form-reset`,e=>{e.payload.id===this._formId&&this.reset()}),r=F1.on(`request-form-force-submit`,e=>{e.payload.id===this._formId&&(this._devtoolsSubmissionOverride=!0,this.handleSubmit(),this._devtoolsSubmissionOverride=!1)}),i=()=>{r(),n(),t(),e.unsubscribe(),F1.emit(`form-unmounted`,{id:this._formId})};this.options.listeners?.onMount?.({formApi:this});let{onMount:a}=this.options.validators||{};return F1.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options}),a&&this.validateSync(`mount`),i},this.update=e=>{if(!e)return;let t=this.options;this.options=e;let n=e.defaultValues&&!X1(e.defaultValues,t.defaultValues)&&!this.state.isTouched,r=!X1(e.defaultState,t.defaultState)&&!this.state.isTouched;if(!(!n&&!r)){if(w1(()=>{this.baseStore.setState(()=>m0(Object.assign({},this.state,r?e.defaultState:{},n?{values:e.defaultValues}:{})))}),n){let e=p0(this);for(let t of Object.keys(this.fieldInfo))Array.isArray(this.getFieldValue(t))&&e.bumpArrayVersion(t)}F1.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}},this.reset=(e,t)=>{let{fieldMeta:n}=this.state,r=this.resetFieldMeta(n);e&&!t?.keepDefaultValues&&(this.options={...this.options,defaultValues:e}),this.baseStore.setState(()=>{let t=e??this.options.defaultValues??this.options.defaultState?.values;return e||Object.values(this.fieldInfo).forEach(e=>{e.instance&&e.instance.options.defaultValue!==void 0&&(t=R1(t,e.instance.name,e.instance.options.defaultValue))}),m0({...this.options.defaultState,values:t,fieldMetaBase:r})})},this.validateAllFields=async e=>{let t=[];return w1(()=>{Object.values(this.fieldInfo).forEach(n=>{if(!n.instance)return;let r=n.instance;t.push(Promise.resolve().then(()=>r.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.instance.store.state.meta.isTouched||n.instance.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null,a=[`${e}[${t}]`];for(let n=t+1;n<=(i??0);n++)a.push(`${e}[${n}]`);let o=Object.keys(this.fieldInfo).filter(e=>a.some(t=>e.startsWith(t))),s=[];return w1(()=>{o.forEach(e=>{s.push(Promise.resolve().then(()=>this.validateField(e,n)))})}),(await Promise.all(s)).flat()},this.validateField=(e,t)=>{let n=this.fieldInfo[e]?.instance;if(!n){let{hasErrored:n}=this.validateSync(t);return n&&!this.options.asyncAlways?this.getFieldMeta(e)?.errors??[]:this.validateAsync(t).then(()=>this.getFieldMeta(e)?.errors??[])}return n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0})),n.validate(t)},this.validateSync=(e,t)=>{let n=q1(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||s0}),r=!1,i={};return w1(()=>{for(let e of n){if(!e.validate)continue;let{formError:n,fieldErrors:a}=g0(this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`},type:`validate`})),o=_0(e.cause),s=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(a||{})]);t?.filterFieldNames&&(s=new Set([...s].filter(t.filterFieldNames)));for(let e of s){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!a?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??f0,r=a?.[e],{newErrorValue:s,newSource:c}=Z1({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[o]===`form`,previousErrorValue:t?.[o]});c===`form`&&(i[e]={...i[e],[o]:r}),t?.[o]!==s&&this.setFieldMeta(e,(e=f0)=>({...e,errorMap:{...e.errorMap,[o]:s},errorSourceMap:{...e.errorSourceMap,[o]:c}}))}t?.dontUpdateFormErrorMap||this.state.errorMap?.[o]!==n&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:n}})),(n||a)&&(r=!0)}if(t?.dontUpdateFormErrorMap)return;let a=_0(`submit`);this.state.errorMap?.[a]&&e!==`submit`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[a]:void 0}}));let o=_0(`server`);this.state.errorMap?.[o]&&e!==`server`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:void 0}}))}),{hasErrored:r,fieldsErrorMap:i}},this.validateAsync=async(e,t)=>{let n=J1(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||s0});this.state.isFormValidating||this.baseStore.setState(e=>({...e,isFormValidating:!0}));let r=[],i;for(let e of n){if(!e.validate)continue;let n=_0(e.cause);this.state.validationMetaMap[n]?.lastAbortController.abort();let a=new AbortController;this.state.validationMetaMap[n]={lastAbortController:a},r.push(new Promise(async n=>{let r;try{r=await new Promise((t,n)=>{setTimeout(async()=>{if(a.signal.aborted)return t(void 0);try{t(await this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`,signal:a.signal},type:`validateAsync`}))}catch(e){n(e)}},e.debounceMs)})}catch(e){r=e}let{formError:o,fieldErrors:s}=g0(r);s&&(i=i?{...i,...s}:s);let c=_0(e.cause),l=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(i||{})]),u=Array.from(l);t?.filterFieldNames&&(u=u.filter(t.filterFieldNames));for(let e of u){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!i?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??f0,r=i?.[e],{newErrorValue:a,newSource:o}=Z1({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[c]===`form`,previousErrorValue:t?.[c]});t?.[c]!==a&&this.setFieldMeta(e,(e=f0)=>({...e,errorMap:{...e.errorMap,[c]:a},errorSourceMap:{...e.errorSourceMap,[c]:o}}))}t?.dontUpdateFormErrorMap||this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[c]:o}})),n(i?{fieldErrors:i,errorMapKey:c}:void 0)}))}let a=[],o={};if(r.length){a=await Promise.all(r);for(let e of a)if(e?.fieldErrors){let{errorMapKey:t}=e;for(let[n,r]of Object.entries(e.fieldErrors))o[n]={...o[n]||{},[t]:r}}}return this.baseStore.setState(e=>({...e,isFormValidating:!1})),o},this.validate=(e,t)=>{let{hasErrored:n,fieldsErrorMap:r}=this.validateSync(e,t);return n&&!this.options.asyncAlways?r:this.validateAsync(e,t)},this._handleSubmit=async e=>{this.baseStore.setState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),w1(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance&&(e.instance.store.state.meta.isTouched||e.instance.setMeta(e=>({...e,isTouched:!0})))})});let t=e??this.options.onSubmitMeta;if(!this.state.canSubmit&&!this._devtoolsSubmissionOverride&&this.baseStore.state.submissionAttempts<=1){this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t});return}this.baseStore.setState(e=>({...e,isSubmitting:!0}));let n=()=>{this.baseStore.setState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.state.isFieldsValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),F1.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validateAllFields`,errors:Object.values(this.state.fieldMeta).map(e=>e.errors).flat()});return}if(await this.validate(`submit`),!this.state.isValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),F1.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validate`,errors:this.state.errors});return}w1(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance?.triggerOnSubmitListener()})}),this.options.listeners?.onSubmit?.({formApi:this,meta:t});try{await this.options.onSubmit?.({value:this.state.values,formApi:this,meta:t}),w1(()=>{this.baseStore.setState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),F1.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),n()})}catch(e){throw this.baseStore.setState(e=>({...e,isSubmitSuccessful:!1})),F1.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`inflight`,onError:e}),n(),e}},this.getFieldValue=e=>L1(this.state.values,e),this.getFieldMeta=e=>this.state.fieldMeta[e],this.getFormGroupMeta=e=>this.formGroupMetaDerived.state[e],this.getFieldInfo=e=>this.fieldInfo[e]||={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.setFieldMeta=(e,t)=>{this.baseStore.setState(n=>({...n,fieldMetaBase:{...n.fieldMetaBase,[e]:I1(t,n.fieldMetaBase[e])}}))},this.resetFieldMeta=e=>Object.keys(e).reduce((e,t)=>{let n=t;return e[n]=f0,e},{}),this.setFieldValue=(e,t,n)=>{let r=n?.dontUpdateMeta??!1,i=n?.dontRunListeners??!1,a=n?.dontValidate??!1;w1(()=>{r||this.setFieldMeta(e,e=>({...e,isTouched:!0,isDirty:!0,errorMap:{...e?.errorMap,onMount:void 0}})),this.baseStore.setState(n=>({...n,values:R1(n.values,e,t)}))}),i||this.getFieldInfo(e).instance?.triggerOnChangeListener(),a||this.validateField(e,`change`)},this.deleteField=e=>{let t=[...Object.keys(this.fieldInfo).filter(t=>{let n=e.toString();return t!==n&&t.startsWith(n)}),e];this.baseStore.setState(e=>{let n={...e};return t.forEach(e=>{n.values=z1(n.values,e),delete this.fieldInfo[e],delete n.fieldMetaBase[e]}),n})},this.pushFieldValue=(e,t,n)=>{this.setFieldValue(e,e=>[...Array.isArray(e)?e:[],t],n),p0(this).bumpArrayVersion(e)},this.insertFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>[...e.slice(0,t),n,...e.slice(t)],$1(r,{dontValidate:!0}));let i=r?.dontValidate??!1;i||await this.validateField(e,`change`),p0(this).handleArrayInsert(e,t),i||await this.validateArrayFieldsStartingFrom(e,t,`change`)},this.replaceFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>e.map((e,r)=>r===t?n:e),$1(r,{dontValidate:!0})),p0(this).bumpArrayVersion(e),(r?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.removeFieldValue=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null;if(this.setFieldValue(e,e=>e.filter((e,n)=>n!==t),$1(n,{dontValidate:!0})),p0(this).handleArrayRemove(e,t),i!==null){let t=`${e}[${i}]`;this.deleteField(t)}(n?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.swapFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=e[t],i=e[n];return R1(R1(e,`${t}`,i),`${n}`,r)},$1(r,{dontValidate:!0})),p0(this).handleArraySwap(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.moveFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=[...e];return r.splice(n,0,r.splice(t,1)[0]),r},$1(r,{dontValidate:!0})),p0(this).handleArrayMove(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.clearFieldValues=(e,t)=>{let n=this.getFieldValue(e),r=Array.isArray(n)?Math.max(n.length-1,0):null;if(this.setFieldValue(e,[],$1(t,{dontValidate:!0})),p0(this).bumpArrayVersion(e),r!==null)for(let t=0;t<=r;t++){let n=`${e}[${t}]`;this.deleteField(n)}(t?.dontValidate??!1)||this.validateField(e,`change`)},this.resetField=e=>{this.baseStore.setState(t=>{let n=this.getFieldInfo(e).instance?.options.defaultValue,r=L1(this.options.defaultValues,e),i=n??r;return{...t,fieldMetaBase:{...t.fieldMetaBase,[e]:f0},values:i===void 0?t.values:R1(t.values,e,i)}})},this.setErrorMap=e=>{w1(()=>{Object.entries(e).forEach(([e,t])=>{let n=e;if(Y1(t)){let{formError:e,fieldErrors:r}=g0(t);for(let e of Object.keys(this.fieldInfo))this.getFieldMeta(e)&&this.setFieldMeta(e,t=>({...t,errorMap:{...t.errorMap,[n]:r?.[e]},errorSourceMap:{...t.errorSourceMap,[n]:`form`}}));this.baseStore.setState(t=>({...t,errorMap:{...t.errorMap,[n]:e}}))}else this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[n]:t}}))})})},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((e,[t,n])=>(Object.keys(n).length&&n.errors.length&&(e[t]={errors:n.errors,errorMap:n.errorMap}),e),{})}),this.parseValuesWithSchema=e=>u0.validate({value:this.state.values,validationSource:`form`},e),this.parseValuesWithSchemaAsync=e=>u0.validateAsync({value:this.state.values,validationSource:`form`},e),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=e?.formId??r0(),this._devtoolsSubmissionOverride=!1;let t=m0({...e?.defaultState,values:e?.defaultValues??e?.defaultState?.values});if(e?.transform){t=e.transform({state:t}).state;for(let e of Object.keys(t.errorMap)){let n=t.errorMap[e];if(!(n===void 0||!Y1(n)))for(let r of Object.keys(n.fields)){let i=n.fields[r];if(i===void 0)continue;let a=t.fieldMetaBase[r];t.fieldMetaBase[r]={isTouched:!1,isValidating:!1,isBlurred:!1,isDirty:!1,_arrayVersion:0,_pendingValidationsCount:0,...a??{},errorSourceMap:{...a?.errorSourceMap??{},onChange:`form`},errorMap:{...a?.errorMap??{},[e]:i}}}}}this.baseStore=j1(t);let n;this.fieldMetaDerived=j1(e=>{let t=this.baseStore.get(),r=0,i={};for(let a of Object.keys(t.fieldMetaBase)){let o=t.fieldMetaBase[a],s=n?.fieldMetaBase[a],c=e?.[a],l=L1(t.values,a),u=c?.errors;if(!s||o.errorMap!==s.errorMap){u=Object.values(o.errorMap??{}).filter(e=>e!==void 0);let e=this.getFieldInfo(a)?.instance;(!e||!e.options.disableErrorFlat)&&(u=u.flat(1))}let d=!K1(u),f=!o.isDirty,p=X1(l,this.getFieldInfo(a)?.instance?.options.defaultValue??L1(this.options.defaultValues,a));if(c&&c.isPristine===f&&c.isValid===d&&c.isDefaultValue===p&&c.errors===u&&o===s){i[a]=c,r++;continue}i[a]={...o,errors:u??[],isPristine:f,isValid:d,isDefaultValue:p}}return Object.keys(t.fieldMetaBase).length?e&&r===Object.keys(t.fieldMetaBase).length?e:(n=this.baseStore.get(),i):i}),this.formGroupMetaDerived=j1(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),r={};for(let i of this.formGroupApis){let a=i.name,o=t.formGroupStateBase[a]??{isSubmitted:!1,isSubmitting:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1},s=n[a],c=!1,l=!0,u=!1,d=!1,f=!0,p=!1;for(let e in n){if(e===a||!o0(a,e))continue;let t=n[e];t&&(t.isValidating&&(c=!0),t.isValid||(l=!1),t.isTouched&&(u=!0),t.isBlurred&&(d=!0),t.isDefaultValue||(f=!1),t.isDirty&&(p=!0))}let m=!p,h=!!c||o.isValidating,g=s?.errorMap??{},_=s?.errorSourceMap??{},v=!!(g.onMount||Object.entries(n).some(([e,t])=>t&&e!==a&&o0(a,e)&&t.errorMap.onMount)),y=e?.[a],b=y?.errors??[];(!y||y.__srcErrorMap!==g)&&(b=Object.values(g).reduce((e,t)=>{if(t===void 0)return e;if(t&&typeof t==`object`&&`fields`in t){let n=t.group;return n!==void 0&&e.push(n),e}return e.push(t),e},[]));let x=b.length===0,S=l&&x,C=i.options.canSubmitWhenInvalid??!1,w=o.submissionAttempts===0&&!u&&!v||!h&&!o.isSubmitting&&S||C;if(y&&y.errorMap===g&&y.errorSourceMap===_&&y.errors===b&&y.isFieldsValidating===c&&y.isFieldsValid===l&&y.isGroupValid===x&&y.isValid===S&&y.canSubmit===w&&y.isTouched===u&&y.isBlurred===d&&y.isPristine===m&&y.isDefaultValue===f&&y.isDirty===p&&y.isValidating===h&&y.isSubmitting===o.isSubmitting&&y.isSubmitted===o.isSubmitted&&y.submissionAttempts===o.submissionAttempts&&y.isSubmitSuccessful===o.isSubmitSuccessful){r[a]=y;continue}let T={...o,errorMap:g,errorSourceMap:_,_arrayVersion:s?._arrayVersion??0,isTouched:u,isBlurred:d,isDirty:p,isPristine:m,isDefaultValue:f,isValid:S,errors:b,isValidating:h,isFieldsValidating:c,isFieldsValid:l,isGroupValid:x,canSubmit:w};Object.defineProperty(T,"__srcErrorMap",{value:g,enumerable:!1,configurable:!0}),r[a]=T}return r});let r;this.store=j1(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),i=Object.values(n).filter(Boolean),a=i.some(e=>e.isValidating),o=i.every(e=>e.isValid),s=i.some(e=>e.isTouched),c=i.some(e=>e.isBlurred),l=i.every(e=>e.isDefaultValue),u=s&&t.errorMap?.onMount,d=i.some(e=>e.isDirty),f=!d,p=!!(t.errorMap?.onMount||i.some(e=>e?.errorMap?.onMount)),m=!!a,h=e?.errors??[];(!r||t.errorMap!==r.errorMap)&&(h=Object.values(t.errorMap).reduce((e,t)=>t===void 0?e:t&&Y1(t)?(e.push(t.form),e):(e.push(t),e),[]));let g=h.length===0,_=o&&g,v=this.options.canSubmitWhenInvalid??!1,y=t.submissionAttempts===0&&!s&&!p||!m&&!t.isSubmitting&&_||v,b=t.errorMap;if(u&&(h=h.filter(e=>e!==t.errorMap.onMount),b=Object.assign(b,{onMount:void 0})),e&&r&&e.errorMap===b&&e.fieldMeta===this.fieldMetaDerived.state&&e.errors===h&&e.isFieldsValidating===a&&e.isFieldsValid===o&&e.isFormValid===g&&e.isValid===_&&e.canSubmit===y&&e.isTouched===s&&e.isBlurred===c&&e.isPristine===f&&e.isDefaultValue===l&&e.isDirty===d&&X1(r,t))return e;let x={...t,errorMap:b,fieldMeta:this.fieldMetaDerived.state,errors:h,isFieldsValidating:a,isFieldsValid:o,isFormValid:g,isValid:_,canSubmit:y,isTouched:s,isBlurred:c,isPristine:f,isDefaultValue:l,isDirty:d};return r=this.baseStore.get(),x}),this.handleSubmit=this.handleSubmit.bind(this),this.update(e||{})}get state(){return this.store.state}get formId(){return this._formId}runValidator(e){return d0(e.validate)?u0[e.type](e.value,e.validate):e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function g0(e){return e?Y1(e)?{formError:g0(e.form).formError,fieldErrors:e.fields}:{formError:e}:{formError:void 0}}function _0(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}var v0=class e{constructor(t){this.options={},this.mount=()=>{this.options.defaultValue!==void 0&&!this.getMeta().isTouched&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});let e=this.getInfo();e.instance=this,this.update(this.options);let{onMount:t}=this.options.validators||{};if(t){let e=this.runValidator({validate:t,value:{value:this.state.value,fieldApi:this,validationSource:`field`},type:`validate`});e&&this.setMeta(t=>({...t,errorMap:{...t?.errorMap,onMount:e},errorSourceMap:{...t?.errorSourceMap,onMount:`field`}}))}return this.options.listeners?.onMount?.({value:this.state.value,fieldApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);let e=this.form.fieldInfo[this.name];if(e&&e.instance===this){for(let[t,n]of Object.entries(e.validationMetaMap))n?.lastAbortController.abort(),e.validationMetaMap[t]=void 0;this.form.baseStore.setState(e=>({...e,fieldMetaBase:{...e.fieldMetaBase,[this.name]:{...f0,isTouched:e.fieldMetaBase[this.name]?.isTouched??f0.isTouched,isBlurred:e.fieldMetaBase[this.name]?.isBlurred??f0.isBlurred,isDirty:e.fieldMetaBase[this.name]?.isDirty??f0.isDirty}}})),e.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,fieldApi:this}),this.form.options.listeners?.onFieldUnmount?.({formApi:this.form,fieldApi:this})}}},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(X1(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,$1(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(e,t)=>{this.form.pushFieldValue(this.name,e,$1(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(e,t,n)=>{this.form.insertFieldValue(this.name,e,t,$1(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(e,t,n)=>{this.form.replaceFieldValue(this.name,e,t,$1(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(e,t)=>{this.form.removeFieldValue(this.name,e,$1(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(e,t,n)=>{this.form.swapFieldValues(this.name,e,t,$1(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(e,t,n)=>{this.form.moveFieldValues(this.name,e,t,$1(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=e=>{this.form.clearFieldValues(this.name,$1(e,{dontRunListeners:!0})),e?.dontRunListeners||this.triggerOnChangeListener()},this.getLinkedFields=t=>{let n=Object.values(this.form.fieldInfo),r=[];for(let i of n){if(!i.instance||!(i.instance instanceof e))continue;let{onChangeListenTo:n,onBlurListenTo:a}=i.instance.options.validators||{};t===`change`&&n?.includes(this.name)&&r.push(i.instance),t===`blur`&&a?.includes(this.name)&&r.push(i.instance)}return r},this.validateSync=(e,t)=>{let n=q1(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||s0}),r=this.getLinkedFields(e).reduce((t,n)=>{let r=q1(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||s0});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),i=!1;w1(()=>{let e=(e,n)=>{let r=b0(n.cause),a=n.validate?y0(e.runValidator({validate:n.validate,value:{value:e.store.state.value,validationSource:`field`,fieldApi:e},type:`validate`})):void 0,o=t[r],{newErrorValue:s,newSource:c}=Q1({formLevelError:o,fieldLevelError:a});e.state.meta.errorMap?.[r]!==s&&e.setMeta(e=>({...e,errorMap:{...e.errorMap,[r]:s},errorSourceMap:{...e.errorSourceMap,[r]:c}})),s&&(i=!0)};for(let t of n)e(this,t);for(let t of r)t.validate&&e(t.field,t)});let a=b0(`submit`);return this.state.meta.errorMap?.[a]&&e!==`submit`&&!i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[a]:void 0},errorSourceMap:{...e.errorSourceMap,[a]:void 0}})),{hasErrored:i}},this.validateAsync=async(e,t)=>{let n=J1(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||s0}),r=await t,i=this.getLinkedFields(e).reduce((t,n)=>{let r=J1(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||s0});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),a=[],o=[],s=n.some(e=>e.validate),c=Array.from(new Set(i.filter(e=>e.validate).map(e=>e.field)));w1(()=>{s&&this.startValidation();for(let e of c)e.startValidation()});let l=(e,t,n)=>{let i=b0(t.cause),a=e.getInfo();a.validationMetaMap[i]?.lastAbortController.abort();let o=new AbortController;a.validationMetaMap[i]={lastAbortController:o},n.push(new Promise(async n=>{let a;try{a=await new Promise((n,r)=>{e.timeoutIds.validations[t.cause]&&(clearTimeout(e.timeoutIds.validations[t.cause]),e.endValidation()),e.timeoutIds.validations[t.cause]=setTimeout(async()=>{if(o.signal.aborted)return n(void 0);try{n(await this.runValidator({validate:t.validate,value:{value:e.store.state.value,fieldApi:e,signal:o.signal,validationSource:`field`},type:`validateAsync`}))}catch(e){r(e)}},t.debounceMs)})}catch(e){a=e}if(o.signal.aborted)return n(void 0);let s=y0(a),c=r[e.name]?.[i],{newErrorValue:l,newSource:u}=Q1({formLevelError:c,fieldLevelError:s});if(e.getInfo().instance!==e)return n(void 0);e.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:l},errorSourceMap:{...e.errorSourceMap,[i]:u}})),n(l)}))};for(let e of n)e.validate&&l(this,e,a);for(let e of i)e.validate&&l(e.field,e,o);let u=[];return(a.length||o.length)&&(u=await Promise.all(a),await Promise.all(o)),w1(()=>{s&&this.endValidation();for(let e of c)e.endValidation()}),u.filter(Boolean)},this.validate=(e,t)=>{if(!this.state.meta.isTouched)return[];let n=t?.skipGroupValidation?[]:Array.from(this.form.formGroupApis).filter(e=>this.name.startsWith(e.name)),r=(t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e)).fieldsErrorMap[this.name]??{};if(!t?.skipFormValidation)for(let t of n){if(t.state.meta.submissionAttempts===0)continue;let{fieldsErrorMap:n}=this.form.validateSync(e,{group:t,dontUpdateFormErrorMap:!0,filterFieldNames:e=>o0(t.name,e)});r={...r,...n[this.name]??{}}}let{hasErrored:i}=this.validateSync(e,r),a=new WeakMap;for(let t of n){let{hasErrored:n}=t.validateSync(e,{},{skipRelatedFieldValidation:!0});a.set(t,n)}if(i&&!this.options.asyncAlways){this.getInfo().validationMetaMap[b0(e)]?.lastAbortController.abort();let t=[];for(let r of n)r.getInfo().validationMetaMap[b0(e)]?.lastAbortController.abort(),t.push(r.state.meta.errors);return[...this.state.meta.errors,...t.flat()]}let o=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e),s=this.validateAsync(e,o),c=[];for(let t of n)a.get(t)&&!t.options.asyncAlways||c.push(t.validateAsync(e,o,{skipRelatedFieldValidation:!0}));return c.length===0?s:Promise.all([s,...c]).then(e=>e.flat())},this.handleChange=e=>{this.setValue(e)},this.handleBlur=()=>{this.state.meta.isTouched||this.setMeta(e=>({...e,isTouched:!0})),this.state.meta.isBlurred||this.setMeta(e=>({...e,isBlurred:!0})),this.validate(`blur`),this.triggerOnBlurListener()},this.setErrorMap=e=>{this.setMeta(t=>({...t,errorMap:{...t.errorMap,...e}}))},this.parseValueWithSchema=e=>u0.validate({value:this.state.value,validationSource:`field`},e),this.parseValueWithSchemaAsync=e=>u0.validateAsync({value:this.state.value,validationSource:`field`},e),this.triggerOnBlurListener=()=>{let e=this.form.options.listeners?.onBlurDebounceMs;e&&e>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onBlurDebounceMs;t&&t>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this});for(let e of this.form.formGroupApis)o0(e.name,this.name)&&e.triggerOnChangeListener()},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,fieldApi:this})},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=j1(e=>{this.form.store.get();let n=this.form.getFieldMeta(this.name)??{...f0,...t.defaultMeta},r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!X1(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}})}get state(){return this.store.state}runValidator(e){return d0(e.validate)?u0[e.type](e.value,e.validate):e.validate(e.value)}startValidation(){this.setMeta(e=>{let t=e._pendingValidationsCount+1;return{...e,_pendingValidationsCount:t,isValidating:t>0&&!e.isValidating||e.isValidating}})}endValidation(){this.setMeta(e=>{let t=Math.max(0,e._pendingValidationsCount-1);return{...e,_pendingValidationsCount:t,isValidating:t===0&&e.isValidating?!1:e.isValidating}})}};function y0(e){if(e)return e}function b0(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function x0(e){return{isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1}}function S0(e){return{...f0,...e,errors:[],isPristine:!0,isValid:!0,isDefaultValue:!0,isFieldsValidating:!1,isFieldsValid:!0,isGroupValid:!0,canSubmit:!0,isSubmitting:!1,isSubmitted:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1}}var C0=class e{constructor(t){this.options={},this.setFormGroupState=e=>{this.form.baseStore.setState(t=>{let n=t.formGroupStateBase[this.name]??x0({});return{...t,formGroupStateBase:{...t.formGroupStateBase,[this.name]:e(n)}}})},this._lastDistributedFieldNames={},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(X1(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,{...f0,...this.options.defaultMeta})},this.mount=()=>{this.update(this.options),this.form.formGroupApis.add(this),this.fieldInfo.instance=this,this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:e.formGroupStateBase[this.name]??x0({...this.options.defaultState})}}));let{onMount:e}=this.options.validators||{};if(e){let t=this.runValidator({validate:e,value:{value:this.state.value,groupApi:this,validationSource:`form`},type:`validate`}),n=t,r;T0(t)&&(n=t.group,r=t.fields);let i=w0(n);i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,onMount:i},errorSourceMap:{...e.errorSourceMap,onMount:`field`}})),this.distributeFieldErrors(`onMount`,r)}return this.options.listeners?.onMount?.({value:this.state.value,groupApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);if(this.fieldInfo.instance===this){for(let[e,t]of Object.entries(this.fieldInfo.validationMetaMap))t?.lastAbortController.abort(),this.fieldInfo.validationMetaMap[e]=void 0;this.form.formGroupApis.delete(this),this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:x0({})}})),this.fieldInfo.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,groupApi:this})}}},this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,$1(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.fieldInfo,this.getRelatedFields=()=>{let e=Object.values(this.form.fieldInfo),t=[];for(let n of e)n.instance&&n.instance instanceof v0&&n.instance.name.startsWith(this.name)&&t.push(n.instance);return t},this.getRelatedFieldMetasDerived=()=>{let e=Object.entries(this.form.fieldMetaDerived.state),t=[];for(let[n,r]of e)n!==this.name&&o0(this.name,n)&&t.push({...r,name:n});return t},this.buildChildFieldName=e=>e===``?this.name:e.startsWith(`[`)?`${this.name}${e}`:`${this.name}.${e}`,this.distributeFieldErrors=(e,t)=>{let n=this._lastDistributedFieldNames[e]??new Set,r=new Set;if(t)for(let[e,n]of Object.entries(t))n!=null&&n!==!1&&r.add(this.buildChildFieldName(e));let i=new Set([...n,...r]),a=!1;for(let n of i){let r=n.startsWith(this.name+`[`)?n.slice(this.name.length):n.slice(this.name.length+1),i=t?.[r],o=this.form.getFieldMeta(n);if(!o&&!i)continue;let s=o?.errorMap[e],{newErrorValue:c,newSource:l}=Z1({newFormValidatorError:i,isPreviousErrorFromFormValidator:o?.errorSourceMap[e]===`form`,previousErrorValue:s});c&&(a=!0),(s!==c||o?.errorSourceMap[e]!==l)&&this.form.setFieldMeta(n,(t=f0)=>({...t,errorMap:{...t.errorMap,[e]:c},errorSourceMap:{...t.errorSourceMap,[e]:l}}))}return this._lastDistributedFieldNames[e]=r,a},this.validateSync=(t,n,r={})=>{let i=q1(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||s0}),a=(r.skipRelatedFieldValidation?[]:this.getRelatedFields()).reduce((e,n)=>{let r=q1(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||s0});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),o=!1;w1(()=>{let t=(t,r)=>{let i=D0(r.cause),a=t===this,s;r.validate&&(s=t.runValidator({validate:r.validate,value:{value:t.store.state.value,validationSource:a?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validate`}));let c=s,l;a&&T0(s)&&(c=s.group,l=s.fields);let u=w0(c),d=n[i],{newErrorValue:f,newSource:p}=Q1({formLevelError:d,fieldLevelError:u});t.state.meta.errorMap?.[i]!==f&&t.setMeta(e=>({...e,errorMap:{...e.errorMap,[i]:f},errorSourceMap:{...e.errorSourceMap,[i]:p}})),f&&(o=!0),a&&this.distributeFieldErrors(i,l)&&(o=!0)};for(let e of i)t(this,e);for(let e of a)e.validate&&t(e.field,e)});let s=D0(`submit`);return this.state.meta.errorMap?.[s]&&t!==`submit`&&!o&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[s]:void 0},errorSourceMap:{...e.errorSourceMap,[s]:void 0}})),{hasErrored:o}},this.validateAsync=async(t,n,r={})=>{let i=J1(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||s0}),a=await n,o=r.skipRelatedFieldValidation?[]:this.getRelatedFields(),s=o.reduce((e,n)=>{let r=J1(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||s0});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),c=[],l=[],u=i.some(e=>e.validate)||s.some(e=>e.validate);if(u){this.state.meta.isValidating||this.setMeta(e=>({...e,isValidating:!0}));for(let e of o)e.setMeta(e=>({...e,isValidating:!0}))}let d=(t,n,r)=>{let i=D0(n.cause),o=t.getInfo();o.validationMetaMap[i]?.lastAbortController.abort();let s=new AbortController;o.validationMetaMap[i]={lastAbortController:s};let c=t===this;r.push(new Promise(async r=>{let o;try{o=await new Promise((r,i)=>{t.timeoutIds.validations[n.cause]&&clearTimeout(t.timeoutIds.validations[n.cause]),t.timeoutIds.validations[n.cause]=setTimeout(async()=>{if(s.signal.aborted)return r(void 0);try{r(await this.runValidator({validate:n.validate,value:{value:t.store.state.value,signal:s.signal,validationSource:c?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validateAsync`}))}catch(e){i(e)}},n.debounceMs)})}catch(e){o=e}if(s.signal.aborted)return r(void 0);let l=o,u;c&&T0(o)&&(l=o.group,u=o.fields);let d=w0(l),f=a[t.name]?.[i],{newErrorValue:p,newSource:m}=Q1({formLevelError:f,fieldLevelError:d});if(t.getInfo().instance!==t)return r(void 0);t.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:p},errorSourceMap:{...e.errorSourceMap,[i]:m}})),c&&this.distributeFieldErrors(i,u),r(p)}))};for(let e of i)e.validate&&d(this,e,c);for(let e of s)e.validate&&d(e.field,e,l);let f=[];if((c.length||l.length)&&(f=await Promise.all(c),await Promise.all(l)),u){this.setMeta(e=>({...e,isValidating:!1}));for(let e of o)e.setMeta(e=>({...e,isValidating:!1}))}return f.filter(Boolean)},this.validateAllFields=async e=>{let t=[];return w1(()=>{Object.values(this.getRelatedFields()).forEach(n=>{t.push(Promise.resolve().then(()=>n.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=(e,t,n)=>this.form.validateArrayFieldsStartingFrom(e,t,n),this.validateField=(e,t)=>this.form.validateField(e,t),this.getFieldValue=e=>this.form.getFieldValue(e),this.getFieldMeta=e=>this.form.getFieldMeta(e),this.setFieldMeta=(e,t)=>this.form.setFieldMeta(e,t),this.setFieldValue=(e,t)=>this.form.setFieldValue(e,t),this.deleteField=e=>this.form.deleteField(e),this.pushFieldValue=(e,t)=>this.form.pushFieldValue(e,t),this.insertFieldValue=(e,t,n)=>this.form.insertFieldValue(e,t,n),this.replaceFieldValue=(e,t,n)=>this.form.replaceFieldValue(e,t,n),this.swapFieldValues=(e,t,n)=>this.form.swapFieldValues(e,t,n),this.moveFieldValues=(e,t,n)=>this.form.moveFieldValues(e,t,n),this.clearFieldValues=e=>this.form.clearFieldValues(e),this.resetField=e=>this.form.resetField(e),this.removeFieldValue=(e,t)=>this.form.removeFieldValue(e,t),this.areRelatedFieldsValid=()=>Object.values(this.getRelatedFields()).every(e=>e.state.meta.isValid),this.validate=(e,t)=>{let{fieldsErrorMap:n}=t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>o0(this.name,e)}),{hasErrored:r}=this.validateSync(e,n[this.name]??{},{skipRelatedFieldValidation:t?.skipRelatedFieldValidation});if(r&&!this.options.asyncAlways)return this.getInfo().validationMetaMap[D0(e)]?.lastAbortController.abort(),this.state.meta.errors;let i=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>o0(this.name,e)});return this.validateAsync(e,i,{skipRelatedFieldValidation:t?.skipRelatedFieldValidation})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeGroupDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this})},e)):this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,groupApi:this})},this._handleSubmit=async e=>{this.setFormGroupState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),w1(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.state.meta.isTouched||e.setMeta(e=>({...e,isTouched:!0}))})});let t=e??this.options.onSubmitMeta;this.setFormGroupState(e=>({...e,isSubmitting:!0}));let n=()=>{this.setFormGroupState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.areRelatedFieldsValid()){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}if(await this.validate(`submit`,{skipRelatedFieldValidation:!0}),!this.areRelatedFieldsValid()||!this.state.meta.isValid){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}w1(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.options.listeners?.onGroupSubmit?.({value:e.state.value,fieldApi:e})})}),this.options.listeners?.onSubmit?.({groupApi:this,value:this.state.value});try{await this.options.onGroupSubmit?.({value:this.state.value,groupApi:this,meta:t}),w1(()=>{this.setFormGroupState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),n()})}catch(e){throw this.setFormGroupState(e=>({...e,isSubmitSuccessful:!1})),n(),e}},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.fieldInfo={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.store=j1(e=>{this.form.formGroupMetaDerived.get(),this.form.baseStore.get();let n=this.form.getFormGroupMeta(this.name)??S0(t.defaultMeta),r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!X1(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}}),this.handleSubmit=this.handleSubmit.bind(this)}get state(){return this.store.state}runValidator(e){if(d0(e.validate)){let t=u0[e.type](e.value,e.validate);return e.type===`validate`?E0(t):t.then(E0)}return e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function w0(e){if(e)return e}function T0(e){return!!e&&typeof e==`object`&&`fields`in e}function E0(e){if(!e||typeof e!=`object`||!(`form`in e)&&!(`fields`in e))return e;let{form:t,fields:n,...r}=e;return{...r,group:t,fields:n}}function D0(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function O0(e,t){if(!t)return;let n=Object.assign({},e,{state:a0(e.state)});t(n),n.fieldInfo!==e.fieldInfo&&(e.fieldInfo=n.fieldInfo),n.options!==e.options&&(e.options=n.options);let r=Object.keys({values:null,validationMetaMap:null,fieldMetaBase:null,formGroupStateBase:null,isSubmitting:null,isSubmitted:null,isValidating:null,submissionAttempts:null,isSubmitSuccessful:null,_force_re_eval:null}).reduce((t,r)=>(e.state[r]!==n.state[r]&&(t[r]=n.state[r]),t),{});return w1(()=>{Object.keys(r).length&&e.baseStore.setState(e=>({...e,...r})),n.state.errorMap!==e.state.errorMap&&e.setErrorMap(n.state.errorMap)}),n}var k0=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),A0=o(((e,t)=>{t.exports=k0()})),j0=o((e=>{var t=d(),n=A0();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}})),M0=o(((e,t)=>{t.exports=j0()}))();function N0(e,t){return e===t}function P0(e,t=e=>e,n){let r=n?.compare??N0,i=(0,K.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,K.useCallback)(()=>e.get(),[e]);return(0,M0.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var F0=typeof window<`u`?K.useLayoutEffect:K.useEffect;function I0(e){let[t,n]=(0,K.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,K.useState)(()=>new v0({...e})),a=r;(t.form!==e.form||t.name!==e.name)&&(a=new v0({...e}),i(a),n({form:e.form,name:e.name}));let o=P0(a.store,e.mode===`array`?e=>e.meta._arrayVersion||0:e=>e.value),s=P0(a.store,e=>e.meta.isTouched),c=P0(a.store,e=>e.meta.isBlurred),l=P0(a.store,e=>e.meta.isDirty),u=P0(a.store,e=>e.meta.errorMap),d=P0(a.store,e=>e.meta.errorSourceMap),f=P0(a.store,e=>e.meta.isValidating),p=(0,K.useMemo)(()=>({...a,get state(){return{value:e.mode===`array`?a.state.value:o,get meta(){return{...a.state.meta,isTouched:s,isBlurred:c,isDirty:l,errorMap:u,errorSourceMap:d,isValidating:f}}}}}),[a,e.mode,o,s,c,l,u,d,f]);return F0(a.mount,[a]),F0(()=>{a.update(e)}),p}var L0=(({children:e,...t})=>{let n=I0(t),r=(0,K.useMemo)(()=>I1(e,n),[e,n]);return(0,X.jsx)(X.Fragment,{children:r})});function R0(){return(0,K.useState)(()=>r0())[0]}var z0=K,B0=`18.3.1`.split(`.`)[0]===`17`?R0:z0.useId;function V0(e){let[t,n]=(0,K.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,K.useState)(()=>new C0({...e}));(t.form!==e.form||t.name!==e.name)&&(i(new C0({...e})),n({form:e.form,name:e.name}));let a=P0(r.store,e=>e.value),o=P0(r.store,e=>e.meta.isTouched),s=P0(r.store,e=>e.meta.isBlurred),c=P0(r.store,e=>e.meta.isDirty),l=P0(r.store,e=>e.meta.errorMap),u=P0(r.store,e=>e.meta.errorSourceMap),d=P0(r.store,e=>e.meta.isValidating),f=P0(r.store,e=>e.meta.isSubmitting),p=P0(r.store,e=>e.meta.isSubmitted),m=P0(r.store,e=>e.meta.submissionAttempts),h=P0(r.store,e=>e.meta.isSubmitSuccessful),g=P0(r.store,e=>e.meta.canSubmit),_=P0(r.store,e=>e.meta.isValid),v=P0(r.store,e=>e.meta.isFieldsValid),y=P0(r.store,e=>e.meta.isFieldsValidating),b=P0(r.store,e=>e.meta.isGroupValid),x=(0,K.useMemo)(()=>({...r,handleSubmit:((...e)=>r._handleSubmit(...e)),get state(){return{...r.state,value:a,get meta(){return{...r.state.meta,isTouched:o,isBlurred:s,isDirty:c,errorMap:l,errorSourceMap:u,isValidating:d,isSubmitting:f,isSubmitted:p,submissionAttempts:m,isSubmitSuccessful:h,canSubmit:g,isValid:_,isFieldsValid:v,isFieldsValidating:y,isGroupValid:b}}}}}),[r,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b]);return F0(r.mount,[r]),F0(()=>{r.update(e)}),x}var H0=(({children:e,...t})=>{let n=V0(t),r=(0,K.useMemo)(()=>I1(e,n),[e,n]);return(0,X.jsx)(X.Fragment,{children:r})});function U0({form:e,selector:t=e=>e,children:n}){let r=P0(e.store,t);return(0,X.jsx)(X.Fragment,{children:I1(n,r)})}function W0(e){let t=B0(),[n,r]=(0,K.useState)(e?.formId),[i,a]=(0,K.useState)(()=>new h0({...e,formId:e?.formId??t}));if(n!==e?.formId){let n=e?.formId??t;a(new h0({...e,formId:n})),r(n)}let o=(0,K.useMemo)(()=>{let e={...i,handleSubmit:((...e)=>i._handleSubmit(...e)),get formId(){return i._formId},get state(){return i.store.state}};return e.Field=function(e){return(0,X.jsx)(L0,{...e,form:i})},e.FormGroup=function(e){return(0,X.jsx)(H0,{...e,form:i})},e.Subscribe=function(e){return(0,X.jsx)(U0,{form:i,selector:e.selector,children:e.children})},e},[i]);F0(i.mount,[]),F0(()=>{i.update(e)});let s=(0,K.useRef)(!1);return F0(()=>{s.current&&e?.transform&&O0(i,e.transform)},[i,e?.transform]),F0(()=>{s.current=!0}),o}var G0={...K},K0={};function q0(e,t){let n=K.useRef(K0);return n.current===K0&&(n.current=e(t)),n}var J0=G0.useInsertionEffect,Y0=J0&&J0!==G0.useLayoutEffect?J0:e=>e();function X0(e){let t=q0(Z0).current;return t.next=e,Y0(t.effect),t.trampoline}function Z0(){let e={next:void 0,callback:Q0,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Q0(){}function $0(){}var e2=Object.freeze([]),t2=Object.freeze({});function n2(e){K.useEffect(e,e2)}var r2=0,i2=class e{static create(){return new e}currentId=r2;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=r2,t()},e)}isStarted(){return this.currentId!==r2}clear=()=>{this.currentId!==r2&&(clearTimeout(this.currentId),this.currentId=r2)};disposeEffect=()=>this.clear};function a2(){let e=q0(i2.create).current;return n2(e.disposeEffect),e}function o2(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var s2=o2(`https://base-ui.com/production-error`,`Base UI`),c2=K.createContext(void 0);function l2(){let e=K.useContext(c2);if(e===void 0)throw Error(s2(53));return e}function u2(e,t,n,r){let i=q0(f2).current;return p2(i,e,t,n,r)&&h2(i,[e,t,n,r]),i.callback}function d2(e){let t=q0(f2).current;return m2(t,e)&&h2(t,e),t.callback}function f2(){return{callback:null,cleanup:null,refs:[]}}function p2(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function m2(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function h2(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}}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}}}}}}var Sae=18;function g2(e){return Sae>=e}function _2(e){if(!K.isValidElement(e))return null;let t=e,n=t.props;return(g2(19)?n?.ref:t.ref)??null}function v2(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function y2(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 b2(e,t){return typeof e==`function`?e(t):e}function x2(e,t){return typeof e==`function`?e(t):e}var S2={};function C2(e,t,n,r,i){if(!n&&!r&&!i&&!e)return T2(t);let a=T2(e);return t&&(a=E2(a,t)),n&&(a=E2(a,n)),r&&(a=E2(a,r)),i&&(a=E2(a,i)),a}function w2(e){if(e.length===0)return S2;if(e.length===1)return T2(e[0]);let t=T2(e[0]);for(let n=1;n<e.length;n+=1)t=E2(t,e[n]);return t}function T2(e){return A2(e)?{...e(S2)}:D2(e)}function E2(e,t){return A2(t)?t(e):O2(e,t)}function D2(e){let t={...e};for(let e in t){let n=t[e];k2(e,n)&&(t[e]=M2(n))}return t}function O2(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=v2(e.style,r);break;case`className`:e[n]=P2(e.className,r);break;default:e[n]=k2(n,r)?j2(e[n],r):r}}return e}function k2(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 A2(e){return typeof e==`function`}function j2(e,t){return t?e?(...n)=>{let r=n[0];if(F2(r)){let i=r;N2(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:M2(t):e}function M2(e){return e&&((...t)=>{let n=t[0];return F2(n)&&N2(n),e(...t)})}function N2(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function P2(e,t){return t?e?t+` `+e:t:e}function F2(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function I2(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=B2(r));let i=L2(t,n,r);if(n.enabled===!1)return null;let a=n.state??t2;return V2(e,r,i,a)}function L2(e,t,n){let{className:r,style:i}=e,{state:a=t2,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?b2(r,a):void 0,d=l?x2(i,a):void 0,f=l?y2(a,c):t2,p=l&&s?R2(s):void 0,m=l?v2(f,p)??{}:t2;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?d2([m.ref,_2(n),...o]):u2(m.ref,_2(n),o):u2(null,null)),l?(u!==void 0&&(m.className=P2(m.className,u)),d!==void 0&&(m.style=v2(m.style,d)),m):t2}function R2(e){return Array.isArray(e)?w2(e):C2(void 0,e)}var z2=Symbol.for(`react.lazy`);function B2(e){if(e?.$$typeof!==z2)return e;let t=K.Children.toArray(e)[0];return K.isValidElement(t)?t:e}function V2(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=C2(n,t.props);return e.ref=n.ref,K.cloneElement(t,e)}return H2(e,n)}function H2(e,t){return e===`button`?(0,K.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,K.createElement)(`img`,{alt:``,...t,key:t.key}):K.createElement(e,t)}function U2(e,t,n){if(!e)return 0;let r=getComputedStyle(e),i=`${t}${n===`x`?`Inline`:`Block`}`,a=parseFloat(r[`${i}Start`]);return n===`x`&&t===`margin`?a*2:a+parseFloat(r[`${i}End`])}var W2=`base-ui-disable-scrollbar`,G2={className:W2,getElement(e){return(0,X.jsx)(`style`,{nonce:e,href:W2,precedence:`base-ui:low`,children:`.${W2}{scrollbar-width:none}.${W2}::-webkit-scrollbar{display:none}`})}};function K2(){let[,e]=K.useState({});return K.useCallback(()=>{e({})},[])}var q2=0;function J2(e,t=`mui`){let n=K.useRef(void 0),r=K2(),i=e??n.current;return K.useEffect(()=>{n.current??(q2+=1,n.current=`${t}-${q2}`,e??r())},[e,t,r]),i}var Y2=G0.useId;function X2(e,t){if(Y2!==void 0){let n=Y2();return e??(t?`${t}-${n}`:n)}return J2(e,t)}function Z2(e){return X2(e,`base-ui`)}var Q2=`data-has-overflow-x`,$2=`data-has-overflow-y`,e4=`data-overflow-x-start`,t4=`data-overflow-x-end`,n4=`data-overflow-y-start`,r4=`data-overflow-y-end`,i4=e=>t=>t?{[e]:``}:null,a4={hasOverflowX:i4(Q2),hasOverflowY:i4($2),overflowXStart:i4(e4),overflowXEnd:i4(t4),overflowYStart:i4(n4),overflowYEnd:i4(r4),cornerHidden:()=>null};function o4(){return typeof window<`u`}function s4(e){return u4(e)?(e.nodeName||``).toLowerCase():`#document`}function c4(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function l4(e){return((u4(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function u4(e){return o4()?e instanceof Node||e instanceof c4(e).Node:!1}function d4(e){return o4()?e instanceof Element||e instanceof c4(e).Element:!1}function f4(e){return o4()?e instanceof HTMLElement||e instanceof c4(e).HTMLElement:!1}function p4(e){return!o4()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof c4(e).ShadowRoot}function m4(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=T4(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function h4(e){return/^(table|td|th)$/.test(s4(e))}function g4(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var _4=/transform|translate|scale|rotate|perspective|filter/,v4=/paint|layout|strict|content/,y4=e=>!!e&&e!==`none`,b4;function x4(e){let t=d4(e)?T4(e):e;return y4(t.transform)||y4(t.translate)||y4(t.scale)||y4(t.rotate)||y4(t.perspective)||!C4()&&(y4(t.backdropFilter)||y4(t.filter))||_4.test(t.willChange||``)||v4.test(t.contain||``)}function S4(e){let t=D4(e);for(;f4(t)&&!w4(t);){if(x4(t))return t;if(g4(t))return null;t=D4(t)}return null}function C4(){return b4??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),b4}function w4(e){return/^(html|body|#document)$/.test(s4(e))}function T4(e){return c4(e).getComputedStyle(e)}function E4(e){return d4(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function D4(e){if(s4(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||p4(e)&&e.host||l4(e);return p4(t)?t.host:t}function O4(e){let t=D4(e);return w4(t)?(e.ownerDocument||e).body:f4(t)&&m4(t)?t:O4(t)}function k4(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=O4(e),i=r===e.ownerDocument?.body,a=c4(r);if(i){let e=A4(a);return t.concat(a,a.visualViewport||[],m4(r)?r:[],e&&n?k4(e):[])}return t.concat(r,k4(r,[],n))}function A4(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function j4(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:M4,platform:N4,maxTouchPoints:P4}=j4(),F4=M4.toLowerCase(),I4=N4.toLowerCase(),L4=/^i(os$|p)/.test(I4)||I4===`macintel`&&P4>1,R4=`android`,z4=I4===R4||F4.includes(R4),B4=!L4&&I4.startsWith(`mac`);I4.startsWith(`win`),!z4&&/^(linux|chrome os)/.test(I4);var V4=B4||L4,H4=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!H4&&F4.includes(`firefox`),!H4&&F4.includes(`chrom`);var U4=V4,W4=/jsdom|happydom/.test(F4);function G4(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function K4(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&p4(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function q4(e,t){let n=e;for(;n;){if(d4(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(p4(n)?n.host:null)}return null}function J4(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Y4=`data-base-ui-focusable`,X4=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Z4=`data-starting-style`,Q4=`data-ending-style`,$4={[Z4]:``},e3={[Q4]:``},t3={transitionStatus(e){return e===`starting`?$4:e===`ending`?e3:null}},n3=`data-open`,r3=`data-closed`,i3=`data-anchor-hidden`,a3=`data-popup-open`,o3=`data-pressed`,s3={[a3]:``},c3={[a3]:``,[o3]:``},l3={[n3]:``},u3={[r3]:``},d3={[i3]:``},f3={open(e){return e?s3:null}},p3={open(e){return e?c3:null}},m3={open(e){return e?l3:u3},anchorHidden(e){return e?d3:null}},h3={...m3,...t3},g3=`data-trigger-disabled`;function _3(e,t){if(!d4(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(g3);for(let[,e]of t.entries())if(K4(e,n))return!e.hasAttribute(g3);return!1}function v3(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 y3(e){return e.matches(`html,body`)}function b3(e){return f4(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function x3(e){return q4(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${X4}`)!=null}function S3(e){return e?e.getAttribute(`role`)===`combobox`&&b3(e):!1}function C3(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function w3(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...w3(e,t.id,n)])}function T3(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 E3(e){e.preventDefault(),e.stopPropagation()}function D3(e){return`nativeEvent`in e}function O3(e){return e.pointerType===``&&e.isTrusted?!0:z4&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function k3(e){return W4?!1:!z4&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(z4||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function A3(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function j3(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var M3=Math.min,N3=Math.max,P3=Math.round,F3=Math.floor,I3=e=>({x:e,y:e}),Cae={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function L3(e,t,n){return N3(e,M3(t,n))}function R3(e,t){return typeof e==`function`?e(t):e}function z3(e){return e.split(`-`)[0]}function B3(e){return e.split(`-`)[1]}function V3(e){return e===`x`?`y`:`x`}function H3(e){return e===`y`?`height`:`width`}function U3(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function W3(e){return V3(U3(e))}function wae(e,t,n){n===void 0&&(n=!1);let r=B3(e),i=W3(e),a=H3(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=J3(o)),[o,J3(o)]}function Tae(e){let t=J3(e);return[G3(e),t,G3(t)]}function G3(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var K3=[`left`,`right`],q3=[`right`,`left`],Eae=[`top`,`bottom`],Dae=[`bottom`,`top`];function Oae(e,t,n){switch(e){case`top`:case`bottom`:return n?t?q3:K3:t?K3:q3;case`left`:case`right`:return t?Eae:Dae;default:return[]}}function kae(e,t,n,r){let i=B3(e),a=Oae(z3(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(G3)))),a}function J3(e){let t=z3(e);return Cae[t]+e.slice(t.length)}function Aae(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Y3(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Aae(e)}function X3(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}}function jae(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Z3(e,t=e?T4(e):null){return!e||!e.isConnected||!t||jae(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}function Q3(e){return e?.ownerDocument||document}var Mae=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Nae(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return p4(n)?n.host:null}function $3(e){for(let t of Array.from(e.children))if(s4(t)===`summary`)return t;return null}function Pae(e,t){let n=$3(t);return!!n&&(e===n||K4(n,e))}function e6(e){let t=e?s4(e):``;return e!=null&&e.matches(Mae)&&(t!==`summary`||e.parentElement!=null&&s4(e.parentElement)===`details`&&$3(e.parentElement)===e)&&(t!==`details`||$3(e)==null)&&(t!==`input`||e.type!==`hidden`)}function t6(e){if(!e6(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Nae(t)){let n=t!==e,r=s4(t)===`slot`;if(t.hasAttribute(`inert`)||n&&s4(t)===`details`&&!t.open&&!Pae(e,t)||t.hasAttribute(`hidden`)||!r&&!Fae(t,n))return!1}return!0}function Fae(e,t){let n=T4(e);return t?n.display!==`none`:Z3(e,n)}function n6(e){let t=e.tabIndex;if(t<0){let t=s4(e);if(t===`details`||t===`audio`||t===`video`||f4(e)&&e.isContentEditable)return 0}return t}function r6(e){if(s4(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function i6(e,t){let n=r6(e);if(!n)return!0;let r=t.find(e=>{let t=r6(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=r6(e);return t?.name===n.name&&t.form===n.form})===n}function a6(e){if(f4(e)&&s4(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return f4(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function o6(e,t){a6(e).forEach(e=>{e6(e)&&t.push(e),o6(e,t)})}function s6(e,t,n){a6(e).forEach(e=>{f4(e)&&e.matches(t)&&n.push(e),s6(e,t,n)})}function c6(e){return t6(e)&&n6(e)>=0}function l6(e){let t=[];return o6(e,t),t.filter(t6)}function u6(e){let t=l6(e);return t.filter(e=>n6(e)>=0&&i6(e,t))}function d6(e,t){let n=u6(e),r=n.length;if(r===0)return;let i=G4(Q3(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function f6(e){return d6(Q3(e).body,1)||e}function p6(e){return d6(Q3(e).body,-1)||e}function Iae(e,t,n){if(!e)return null;let r=[];o6(Q3(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(t6);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!K4(n,o)&&c6(o)&&i6(o,a))return o}return r[i]}function m6(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!K4(n,r)}function Lae(e){u6(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function h6(e){let t=[];s6(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var Rae=K.createContext(void 0),zae={disableStyleElements:!1};function Bae(){return K.useContext(Rae)??zae}var g6=`--scroll-area-corner-height`,_6=`--scroll-area-corner-width`,Vae=`data-orientation`,Hae={x:0,y:0},v6={width:0,height:0},Uae={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},Wae={x:!0,y:!0,corner:!0},Gae=K.forwardRef(function(e,t){let{render:n,className:r,overflowEdgeThreshold:i,style:a,...o}=e,{xStart:s,xEnd:c,yStart:l,yEnd:u}=Kae(i),d=Z2(),f=a2(),p=a2(),{nonce:m,disableStyleElements:h}=Bae(),[g,_]=K.useState(!1),[v,y]=K.useState(!1),[b,x]=K.useState(!1),[S,C]=K.useState(!1),[w,T]=K.useState(!1),[E,D]=K.useState(v6),[O,k]=K.useState(v6),[A,j]=K.useState(Uae),[M,N]=K.useState(Wae),P=K.useRef(null),F=K.useRef(null),I=K.useRef(null),L=K.useRef(null),R=K.useRef(null),z=K.useRef(null),ee=K.useRef(null),te=K.useRef(null),B=K.useRef(0),ne=K.useRef(0),re=K.useRef(0),V=K.useRef(0),ie=K.useRef(`vertical`),ae=K.useRef(Hae),oe=K.useRef(null);function H(e){let t=e?x:y,n=e?f:p;t(!0),n.start(500,()=>{t(!1)})}let se=X0(e=>{let t=e.x-ae.current.x,n=e.y-ae.current.y;ae.current=e,n!==0&&H(!0),t!==0&&H(!1)}),ce=X0(()=>{let e=F.current;e&&oe.current===null&&(oe.current=e.style.scrollSnapType,e.style.scrollSnapType=`none`)}),le=X0(e=>{if(e.button!==0||te.current!==null&&(ie.current===`vertical`?R.current:z.current)?.hasPointerCapture(te.current))return;te.current=e.pointerId,B.current=e.clientY,ne.current=e.clientX,ie.current=e.currentTarget.getAttribute(Vae);let t=F.current;t&&(re.current=t.scrollTop,V.current=t.scrollLeft,ce()),(ie.current===`vertical`?R.current:z.current)?.setPointerCapture(e.pointerId)}),U=X0(e=>{if(e.pointerId!==te.current)return;te.current=null,(ie.current===`vertical`?x:y)(!1),oe.current!==null&&(F.current&&(F.current.style.scrollSnapType=oe.current),oe.current=null);let t=ie.current===`vertical`?R.current:z.current;t?.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId)}),ue=X0(e=>{if(e.pointerId!==te.current)return;if(e.buttons%2==0){U(e);return}let t=F.current;if(!t)return;let n=ie.current===`vertical`,r=n?R.current:z.current,i=n?I.current:L.current;if(!r||!i)return;let a=n?`y`:`x`,o=U2(i,`padding`,a),s=U2(r,`margin`,a),c=n?r.offsetHeight:r.offsetWidth,l=(n?i.offsetHeight:i.offsetWidth)-c-o-s,u=n?e.clientY-B.current:e.clientX-ne.current,d=l<=0?0:u/l,f=n?t.scrollHeight:t.scrollWidth,p=n?t.clientHeight:t.clientWidth,m=(n?re.current:V.current)+d*(f-p);n?t.scrollTop=m:t.scrollLeft=m,e.preventDefault(),H(n)});function de(e){C(e.pointerType===`touch`)}function fe(e){if(de(e),e.pointerType!==`touch`){let t=K4(P.current,e.target);_(t)}}let pe=K.useMemo(()=>({scrolling:v||b,hasOverflowX:!M.x,hasOverflowY:!M.y,overflowXStart:A.xStart,overflowXEnd:A.xEnd,overflowYStart:A.yStart,overflowYEnd:A.yEnd,cornerHidden:M.corner}),[v,b,M.x,M.y,M.corner,A]),me={role:`presentation`,onPointerEnter:fe,onPointerMove:fe,onPointerDown:de,onPointerLeave(){_(!1)},style:{position:`relative`,[g6]:`${E.height}px`,[_6]:`${E.width}px`}},he=I2(`div`,e,{state:pe,ref:[t,P],props:[me,o],stateAttributesMapping:a4}),ge=K.useMemo(()=>({handlePointerDown:le,handlePointerMove:ue,handlePointerUp:U,handleScroll:se,disableViewportSnap:ce,cornerSize:E,setCornerSize:D,thumbSize:O,setThumbSize:k,hasMeasuredScrollbar:w,setHasMeasuredScrollbar:T,touchModality:S,cornerRef:ee,scrollingX:v,scrollingY:b,hovering:g,setHovering:_,viewportRef:F,scrollbarYRef:I,scrollbarXRef:L,thumbYRef:R,thumbXRef:z,rootId:d,hiddenState:M,setHiddenState:N,overflowEdges:A,setOverflowEdges:j,viewportState:pe,overflowEdgeThreshold:{xStart:s,xEnd:c,yStart:l,yEnd:u}}),[le,ue,U,se,ce,E,O,w,S,v,b,g,d,M,A,pe,s,c,l,u]);return(0,X.jsxs)(c2.Provider,{value:ge,children:[!h&&G2.getElement(m),he]})});function Kae(e){let t=typeof e==`number`?{xStart:e,xEnd:e,yStart:e,yEnd:e}:e;return{xStart:Math.max(0,t?.xStart||0),xEnd:Math.max(0,t?.xEnd||0),yStart:Math.max(0,t?.yStart||0),yEnd:Math.max(0,t?.yEnd||0)}}var y6=typeof document<`u`?K.useLayoutEffect:()=>{};function b6(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}var x6=K.createContext(void 0);function qae(){let e=K.useContext(x6);if(e===void 0)throw Error(s2(55));return e}var Jae=K.createContext(void 0);function S6(){return K.useContext(Jae)?.direction??`ltr`}function C6(e,t){if(t<=0)return 0;let n=b6(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function w6(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Yae=`--scroll-area-overflow-x-start`,Xae=`--scroll-area-overflow-x-end`,Zae=`--scroll-area-overflow-y-start`,Qae=`--scroll-area-overflow-y-end`,T6=`--scroll-area-thumb-height`,E6=`--scroll-area-thumb-width`,D6=[Yae,Xae,Zae,Qae],O6=!1;function $ae(){O6||H4||(typeof CSS<`u`&&`registerProperty`in CSS&&D6.forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),O6=!0)}var eoe=K.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{viewportRef:o,scrollbarYRef:s,scrollbarXRef:c,thumbYRef:l,thumbXRef:u,cornerRef:d,cornerSize:f,setCornerSize:p,setThumbSize:m,rootId:h,setHiddenState:g,hiddenState:_,setHasMeasuredScrollbar:v,handleScroll:y,touchModality:b,setHovering:x,setOverflowEdges:S,overflowEdgeThreshold:C,viewportState:w}=l2(),T=S6(),E=K.useRef(!0),D=K.useRef([NaN,NaN,NaN,NaN]),O=a2(),k=a2(),A=X0(()=>{let e=o.current,t=s.current,n=c.current,r=l.current,i=u.current,a=d.current;if(!e)return;let h=e.scrollHeight,_=e.scrollWidth,y=e.clientHeight,b=e.clientWidth,x=e.scrollTop,w=e.scrollLeft,E=D.current,O=Number.isNaN(E[0]);if(E[0]=y,E[1]=h,E[2]=b,E[3]=_,O&&v(!0),h===0||_===0)return;let k=toe(e),A=k.y,j=k.x,M=b/_,N=y/h,P=Math.max(0,_-b),F=Math.max(0,h-y),I=0,L=0;j||(I=C6(T===`rtl`?-w:w,P),L=P-I);let R=A?0:C6(x,F),z=A?0:F-R,ee=j?0:b,te=A?0:y,B=0,ne=0;!j&&!A&&(B=t?.offsetWidth||0,ne=n?.offsetHeight||0);let re=f.width===0&&f.height===0,V=re?B:0,ie=re?ne:0,ae=U2(n,`padding`,`x`),oe=U2(t,`padding`,`y`),H=U2(i,`margin`,`x`),se=U2(r,`margin`,`y`),ce=ee-ae-H,le=te-oe-se,U=n?Math.min(n.offsetWidth-V,ce):ce,ue=t?Math.min(t.offsetHeight-ie,le):le,de=Math.max(16,U*M),fe=Math.max(16,ue*N);if(m(e=>k6(e,{width:de,height:fe})),t&&r){let e=A6(r,T6,x,F,h,fe,t.offsetHeight-fe-oe-se);r.style.transform=`translate3d(0,${e}px,0)`}if(n&&i){let e=n.offsetWidth-de-ae-H,t=A6(i,E6,T===`rtl`?-w:w,P,_,de,e);i.style.transform=`translate3d(${T===`rtl`?-t:t}px,0,0)`}let pe=[I,L,R,z];D6.forEach((t,n)=>{e.style.setProperty(t,`${pe[n]}px`)}),a&&p(e=>k6(e,{width:B,height:ne})),g(e=>k6(e,k));let me={xStart:!j&&I>C.xStart,xEnd:!j&&L>C.xEnd,yStart:!A&&R>C.yStart,yEnd:!A&&z>C.yEnd};S(e=>k6(e,me))});y6(()=>{$ae()},[]),y6(()=>{queueMicrotask(A)},[A,_,T,C.xStart,C.xEnd,C.yStart,C.yEnd]),y6(()=>{o.current?.matches(`:hover`)&&x(!0)},[o,x]),y6(()=>{let e=o.current;if(typeof ResizeObserver>`u`||!e)return;let t=!1,n=new ResizeObserver(()=>{if(!t){t=!0;let n=D.current;if(n[0]===e.clientHeight&&n[1]===e.scrollHeight&&n[2]===e.clientWidth&&n[3]===e.scrollWidth)return}A()});return n.observe(e),k.start(0,()=>{let t=w6(e,{subtree:!0});t.length!==0&&Promise.allSettled(t.map(e=>e.finished.then($0))).then(A).catch(()=>{})}),()=>{n.disconnect(),k.clear()}},[A,o,k]);function j(){E.current=!1}let M={...h&&{"data-id":`${h}-viewport`},tabIndex:_.x&&_.y?-1:0,className:G2.className,style:{overflow:`scroll`},onScroll(){o.current&&(A(),(b||!E.current)&&y({x:o.current.scrollLeft,y:o.current.scrollTop}),O.start(100,()=>{E.current=!0}))},onWheel:j,onPointerMove:j,onPointerEnter:j,onKeyDown:j},N=I2(`div`,e,{ref:[t,o],state:w,props:[M,a],stateAttributesMapping:a4}),P=K.useMemo(()=>({computeThumbPosition:A}),[A]);return(0,X.jsx)(x6.Provider,{value:P,children:N})});function toe(e){let t=e.clientHeight>=e.scrollHeight,n=e.clientWidth>=e.scrollWidth;return{y:t,x:n,corner:t||n}}function k6(e,t){for(let n in t)if(e[n]!==t[n])return t;return e}function A6(e,t,n,r,i,a,o){let s=b6(n,0,r),c=n-s,l=Math.max(16,a*i/(i+Math.abs(c)));return e.style.setProperty(t,c?`${l}px`:``),(r?s/r*o:0)+(c>0?a-l:0)}function j6(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}var M6=K.createContext(void 0);function noe(){let e=K.useContext(M6);if(e===void 0)throw Error(s2(54));return e}var roe=K.forwardRef(function(e,t){let{render:n,className:r,orientation:i=`vertical`,keepMounted:a=!1,style:o,...s}=e,{hovering:c,scrollingX:l,scrollingY:u,hiddenState:d,scrollbarYRef:f,scrollbarXRef:p,viewportRef:m,thumbYRef:h,thumbXRef:g,handlePointerDown:_,handlePointerUp:v,handleScroll:y,disableViewportSnap:b,rootId:x,thumbSize:S,hasMeasuredScrollbar:C,viewportState:w}=l2(),T=i===`vertical`,E={...w,hovering:c,scrolling:T?u:l,orientation:i},D=S6(),O=!C&&!a,k=T?d.y:d.x,A=a||!k;K.useEffect(()=>{if(!A)return;let e=m.current,t=T?f.current:p.current;if(!t)return;function n(t){if(!e||t.ctrlKey)return;let n=!T,r=n?`scrollLeft`:`scrollTop`,i=n?t.deltaX:t.deltaY;if(i===0)return;let a=n?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight,o=n&&D===`rtl`?-a:0,s=n&&D===`rtl`?0:a,c=e[r];c<=o&&i<0||c>=s&&i>0||(t.preventDefault(),e[r]=Math.min(s,Math.max(o,c+i)),y({x:e.scrollLeft,y:e.scrollTop}))}return j6(t,`wheel`,n,{passive:!1})},[D,y,T,p,f,A,m]);let j={...x&&{"data-id":`${x}-scrollbar`},"aria-hidden":!0,onPointerDown(e){if(e.button!==0)return;let t=J4(e.nativeEvent),n=T?h.current:g.current;if(n&&K4(n,t))return;let r=m.current;if(!r)return;let i=T?f.current:p.current;if(!n||!i)return;let a=T?`y`:`x`,o=U2(n,`margin`,a),s=U2(i,`padding`,a),c=T?n.offsetHeight:n.offsetWidth,l=i.getBoundingClientRect(),u=T?e.clientY-l.top-c/2-s+o/2:e.clientX-l.left-c/2-s+o/2,d=T?r.scrollHeight:r.scrollWidth,v=T?r.clientHeight:r.clientWidth,x=(T?i.offsetHeight:i.offsetWidth)-c-s-o;if(x<=0)return;let S=u/x,C=d-v;b(),T?r.scrollTop=S*C:r.scrollLeft=D===`rtl`?-(1-S)*C:S*C,y({x:r.scrollLeft,y:r.scrollTop}),_(e)},onMouseDown(e){e.preventDefault()},onPointerUp:v,onPointerCancel:v,style:{position:`absolute`,touchAction:`none`,WebkitUserSelect:`none`,userSelect:`none`,visibility:O?`hidden`:void 0,...T?{top:0,bottom:`var(${g6})`,insetInlineEnd:0,[T6]:`${S.height}px`}:{insetInlineStart:0,insetInlineEnd:`var(${_6})`,bottom:0,[E6]:`${S.width}px`}}},M=I2(`div`,e,{ref:[t,T?f:p],state:E,props:[j,s],stateAttributesMapping:a4});return A?(0,X.jsx)(M6.Provider,{value:i,children:M}):null}),ioe=K.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{computeThumbPosition:o}=qae(),{hasMeasuredScrollbar:s,viewportState:c}=l2(),l=K.useRef(null),u=K.useRef(s);return y6(()=>{if(typeof ResizeObserver>`u`)return;let e=!1,t=new ResizeObserver(()=>{!e&&(e=!0,!u.current)||o()});return l.current&&t.observe(l.current),()=>{t.disconnect()}},[o]),I2(`div`,e,{ref:[t,l],state:c,stateAttributesMapping:a4,props:[{role:`presentation`,style:{minWidth:`fit-content`}},a]})}),aoe=K.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{thumbYRef:o,thumbXRef:s,handlePointerDown:c,handlePointerMove:l,handlePointerUp:u,scrollingX:d,scrollingY:f,hasMeasuredScrollbar:p}=l2(),m=noe(),h=m===`vertical`;return I2(`div`,e,{ref:[t,h?o:s],state:{scrolling:h?f:d,orientation:m},props:[{onPointerDown:c,onPointerMove:l,onPointerUp:u,onPointerCancel:u,style:{visibility:p?void 0:`hidden`,...h?{height:`var(--scroll-area-thumb-height)`}:{width:`var(--scroll-area-thumb-width)`}}},a]})}),N6=Object.freeze({ease:`linear`,duration:0});function P6(e,t){let n=qie(e,t.duration);return n<=0?N6:e.steps>0?{ease:zR(e.steps),duration:n}:{ease:RR({bounce:Kie(e,t.bounce),duration:n}),duration:n}}function F6(e,t){let n=dI(e,t.duration);return{ease:e.steps>0?zR(e.steps):t.ease,duration:n}}function ooe(e,t,n){let r=(Math.abs(t)-Math.abs(e))/Math.max(16,n);if(Math.abs(r)<.035)return null;let i=Math.min(.04,Math.abs(r)*.3),a=r>0,o=Math.sign(t||e);return{scaleY:1+(a?i:-i),scaleX:1+(a?-i/2:i/2),origin:(a?o>0:o<0)?`center top`:`center bottom`}}function soe(e,t,n){if(t<=0||Math.abs(n)<4)return null;let r=e<=0&&n<0,i=e>=t-1&&n>0;if(!r&&!i)return null;let a=Math.min(.06,Math.abs(n)/120*.06);return{scaleY:1-a,scaleX:1+a/2,origin:r?`center top`:`center bottom`}}var coe=(0,K.forwardRef)(function({children:e,className:t,surface:n=!1,surfaceSize:r,surfaceDepth:i,screen:a=!1,...o},s){let c=(0,K.useRef)(null),l=(0,K.useRef)(null),u=hI();(0,K.useEffect)(()=>{let e=c.current,t=e?.querySelector(`.caps-scroll-viewport`);if(!t||!e)return;let n=null,r,i=t.scrollTop,a=performance.now(),o=0,s=e=>{let t=l.current;if(!e||u||!t)return;n?.cancel(),t.style.transformOrigin=e.origin;let r=lI(t),i=F6(r,{ease:`outQuad`,duration:45}),a=P6(r,{bounce:.18,duration:180});n=FR(t,{scaleY:[{to:e.scaleY,...i},{to:1,...a}],scaleX:[{to:e.scaleX,...i},{to:1,...a}]})},d=(e,t)=>{let n=ooe(o,e,t);o=e,s(n)},f=e=>{if(e.ctrlKey||Math.abs(e.deltaX)>Math.abs(e.deltaY))return;let n=e.deltaMode===1?16:e.deltaMode===2?t.clientHeight:1,i=soe(t.scrollTop,t.scrollHeight-t.clientHeight,e.deltaY*n);i&&(clearTimeout(r),o=0,s(i))},p=()=>{let e=performance.now(),n=e-a,s=n>100?16:Math.max(16,n),c=t.scrollTop-i;n>100&&(o=0),d(c/s,s),i=t.scrollTop,a=e,clearTimeout(r),r=setTimeout(()=>{d(0,32)},64)};return t.addEventListener(`scroll`,p,{passive:!0}),e.addEventListener(`wheel`,f,{passive:!0}),()=>{clearTimeout(r),n?.cancel(),l.current&&(l.current.style.transform=`none`),t.removeEventListener(`scroll`,p),e.removeEventListener(`wheel`,f)}},[a,n,u]);let d=(0,X.jsx)(eoe,{render:a?(0,X.jsx)(pz,{}):(0,X.jsx)(`div`,{}),...o,ref:s,className:`caps-scroll-viewport`,children:(0,X.jsx)(ioe,{style:{minWidth:0},children:e})});return(0,X.jsxs)(Gae,{render:n?(0,X.jsx)(fz,{size:r??`md`,depth:i??`shallow`}):(0,X.jsx)(`div`,{}),ref:c,className:Z(`caps-scroll-area`,t),children:[a?(0,X.jsx)(`div`,{className:`caps-display-gasket caps-scroll-display`,children:d}):d,(0,X.jsx)(fz,{size:`sm`,depth:`deep`,placement:`embedded`,className:`caps-scroll-track-surface`,children:(0,X.jsx)(roe,{className:`caps-scroll-track`,children:(0,X.jsx)(aoe,{className:`caps-scroll-thumb`,children:(0,X.jsx)(`span`,{className:`caps-scroll-thumb-surface`,ref:l})})})})]})}),I6=(0,K.forwardRef)(function({className:e,invalid:t,...n},r){return(0,X.jsx)(`input`,{...n,"aria-invalid":t?!0:n[`aria-invalid`]===!1?void 0:n[`aria-invalid`],className:Z(`input caps-input w-full`,e),ref:r})});(0,K.forwardRef)(function({leading:e,className:t,...n},r){return(0,X.jsxs)(`span`,{className:`caps-search-input`,"data-leading":e?`true`:void 0,children:[e?(0,X.jsx)(`span`,{className:`caps-search-leading`,"aria-hidden":`true`,children:e}):null,(0,X.jsx)(I6,{...n,type:`search`,className:t,ref:r})]})});var loe=(0,K.forwardRef)(function({children:e,className:t,optional:n,required:r,...i},a){return(0,X.jsxs)(`label`,{...i,className:Z(`label caps-label cursor-pointer justify-start gap-sm text-sm font-semibold text-base-content`,t),ref:a,children:[e,r?(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`text-error`,children:`*`}):null,n&&!r?(0,X.jsx)(`span`,{className:`caps-label-optional`,children:`Optional`}):null]})}),L6=(0,K.forwardRef)(function({children:e,className:t,...n},r){return(0,X.jsx)(`div`,{...n,className:Z(`caps-input-group join flex w-full items-stretch [&>*]:join-item [&>*:first-child]:rounded-e-none [&>*:last-child]:rounded-s-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>.btn]:shrink-0 [&>.input]:min-w-0 [&>.input]:flex-1 [&>.select]:min-w-0 [&>.select]:flex-1`,t),ref:r,children:K.Children.map(e,e=>(0,K.isValidElement)(e)?(0,K.cloneElement)(e,{className:Z(`join-item caps-input-group-control`,e.props.className)}):e)})}),R6=(0,K.forwardRef)(function({className:e,...t},n){return(0,X.jsx)(`div`,{...t,className:Z(`join-item flex items-center border border-base-300 bg-base-200 px-md text-sm text-base-content`,e),ref:n})});function uoe(e){let t=e.parentElement;if(!t||e.previousElementSibling===null)return 0;let n=getComputedStyle(t);if(!(n.display.includes(`grid`)||n.display.includes(`flex`)&&n.flexDirection.startsWith(`column`)))return 0;let r=Number.parseFloat(n.rowGap);return Number.isFinite(r)?r:0}(0,K.forwardRef)(function({show:e,appear:t=!1,children:n,className:r,...i},a){let o=(0,K.useRef)(null);(0,K.useImperativeHandle)(a,()=>o.current);let s=hI(),[c,l]=(0,K.useState)(e),u=(0,K.useRef)(!0);return e&&!c&&l(!0),(0,K.useLayoutEffect)(()=>{let n=o.current,r=u.current;if(u.current=!1,!n||r&&!t)return;if(!pI(n)){e||l(!1);return}let i=lI(n),a=`translateY(${String(i.distance)}px)`,c=fI(i,i.ease),d=n.getBoundingClientRect().height,f=uoe(n),p=(e,t)=>{n.style.overflow=`clip`;let r=e=>({height:`${String(e)}px`,marginBlockStart:`${String(e===0?-f:0)}px`}),a=n.animate([r(e),r(t)],{duration:i.normal,easing:c}),o=()=>{n.style.removeProperty(`overflow`)};return a.addEventListener(`finish`,o),a.addEventListener(`cancel`,o),a};if(e){let e=[n.animate([{opacity:0,transform:a},{opacity:1,transform:`none`}],{duration:i.normal,easing:c})];return!s&&d>0&&e.push(p(0,d)),()=>{for(let t of e)t.cancel()}}let m=n.animate([{opacity:1,transform:`none`},{opacity:0,transform:a}],{duration:i.fast,easing:fI(i,i.easeExit),fill:`forwards`}),h=!s&&d>0?p(d,0):m;return h!==m&&h.effect?.updateTiming({fill:`forwards`}),h.addEventListener(`finish`,()=>{l(!1)}),()=>{m.cancel(),h.cancel()}},[e,t,s]),c?(0,X.jsx)(`div`,{...i,ref:o,className:Z(`caps-presence`,r),"data-present":e,"aria-hidden":!e||void 0,children:n}):null});var doe=(0,K.forwardRef)(function({open:e,children:t,className:n,...r},i){return(0,X.jsx)(`div`,{...r,ref:i,className:Z(`caps-collapse`,n),"data-open":e,"aria-hidden":!e||void 0,children:(0,X.jsx)(`div`,{className:`caps-collapse-clip`,children:t})})});(0,K.forwardRef)(function({swapKey:e,anchor:t=`start`,children:n,className:r,...i},a){let o=(0,K.useRef)(null);(0,K.useImperativeHandle)(a,()=>o.current);let s=hI(),[c,l]=(0,K.useState)({key:e,content:n}),[u,d]=(0,K.useState)([]);c.key===e?c.content!==n&&l({key:e,content:n}):(d([...u.filter(t=>t.key!==e&&t.key!==c.key),c]),l({key:e,content:n}));let f=(0,K.useRef)(null);return(0,K.useLayoutEffect)(()=>{let e=o.current;if(!e||!(`ResizeObserver`in globalThis))return;f.current=e.getBoundingClientRect();let t=new ResizeObserver(()=>{e.getAnimations().length===0&&(f.current=e.getBoundingClientRect())});return t.observe(e),()=>{t.disconnect()}},[]),(0,K.useLayoutEffect)(()=>{let e=o.current;if(!e)return;let t=[...e.querySelectorAll(`:scope > [data-swap-leaving]`)],n=e.querySelector(`:scope > [data-swap-current]`);if(n===null||t.length===0)return;if(!pI(e)){d([]);return}let r=f.current,i=e.getBoundingClientRect(),a=lI(e),c=[n.animate([{opacity:0,filter:`blur(${String(a.blur)}px)`,transform:`translateY(${String(a.distance/2)}px)`},{opacity:1,filter:`blur(0px)`,transform:`none`}],{duration:a.normal,easing:fI(a,a.ease)})];for(let e of t){let t=e.animate([{opacity:1,filter:`blur(0px)`,transform:`none`},{opacity:0,filter:`blur(${String(a.blur)}px)`,transform:`translateY(${String(-a.distance/2)}px)`}],{duration:a.fast,easing:fI(a,a.easeExit),fill:`forwards`}),n=e.dataset.swapLeaving;t.onfinish=()=>{d(e=>e.filter(e=>e.key!==n))},c.push(t)}let l=r!==null&&(Math.abs(r.height-i.height)>.5||Math.abs(r.width-i.width)>.5);return!s&&l&&c.push(e.animate([{width:`${String(r.width)}px`,height:`${String(r.height)}px`},{width:`${String(i.width)}px`,height:`${String(i.height)}px`}],{duration:a.normal,easing:fI(a,a.ease)})),()=>{for(let e of c)e.cancel()}},[e,s]),(0,X.jsx)(`div`,{...i,ref:o,className:Z(`caps-swap`,r),"data-anchor":t,children:[...u.map(e=>(0,X.jsx)(`div`,{className:`caps-swap-layer`,"data-swap-leaving":e.key,"aria-hidden":`true`,children:e.content},e.key)),(0,X.jsx)(`div`,{className:`caps-swap-layer`,"data-swap-current":``,children:n},e)]})});function z6({children:e,...t}){let[n,r]=(0,K.useState)(e);return e&&e!==n&&r(e),(0,X.jsx)(doe,{...t,className:Z(`caps-field-error-reveal`,t.className),open:!!e,children:(0,X.jsx)(`div`,{className:`caps-field-error`,role:`alert`,"aria-hidden":!e,children:n})})}function B6({children:e,divider:t=!0,error:n,layout:r=`end`,status:i,...a}){return(0,X.jsxs)(`footer`,{...a,className:Z(`caps-form-footer`,a.className),"data-divider":t,"data-layout":r,children:[(0,X.jsx)(z6,{children:n}),(0,X.jsxs)(`div`,{className:`caps-form-footer-row`,children:[i?(0,X.jsx)(`div`,{className:`caps-form-footer-status`,role:`status`,children:i}):null,(0,X.jsx)(`div`,{className:`caps-form-footer-actions`,children:e})]})]})}var foe=(0,K.forwardRef)(function({busy:e=!1,children:t,className:n,...r},i){return(0,X.jsx)(`form`,{...r,"aria-busy":e||void 0,className:Z(`caps-form`,n),ref:i,children:(0,X.jsx)(`fieldset`,{className:`caps-form-body`,disabled:e,children:t})})}),poe={2:`h2`,3:`h3`,4:`h4`},moe=(0,K.forwardRef)(function({children:e,className:t,description:n,level:r=3,title:i,...a},o){let s=(0,K.useId)(),c=poe[r];return(0,X.jsxs)(`section`,{...a,"aria-labelledby":`${s}-title`,className:Z(`caps-form-section`,t),ref:o,children:[(0,X.jsxs)(`header`,{className:`caps-form-section-copy`,children:[(0,X.jsx)(c,{className:`caps-form-section-title`,id:`${s}-title`,children:i}),n?(0,X.jsx)(`p`,{className:`caps-form-section-description`,children:n}):null]}),(0,X.jsx)(`div`,{className:`caps-form-section-fields`,children:e})]})}),V6=(0,K.forwardRef)(function({children:e,className:t,description:n,error:r,legend:i,...a},o){let s=(0,K.useId)(),c=[n?`${s}-description`:a[`aria-describedby`],r?`${s}-error`:null].filter(Boolean).join(` `)||void 0;return(0,X.jsxs)(`fieldset`,{...a,"aria-describedby":c,"aria-invalid":r?!0:a[`aria-invalid`],className:Z(`caps-fieldset`,t),ref:o,children:[(0,X.jsx)(`legend`,{className:`caps-fieldset-legend`,children:i}),n?(0,X.jsx)(`p`,{className:`caps-fieldset-description`,id:`${s}-description`,children:n}):null,(0,X.jsx)(`div`,{className:`caps-fieldset-fields`,children:e}),r===void 0?null:(0,X.jsx)(z6,{id:`${s}-error`,children:r})]})});function hoe(e){let t=[];return K.Children.forEach(e.props.children,e=>{(0,K.isValidElement)(e)&&e.type!==R6&&t.push(e)}),t[0]??null}var H6=(0,K.forwardRef)(function({children:e,className:t,description:n,error:r,icon:i,label:a,optional:o,orientation:s=`vertical`,readout:c=!1,required:l,...u},d){let f=(0,K.useId)(),p=(0,K.isValidElement)(e)?e:null,m=p?.type===L6,h=m?hoe(p):p,g=h?.props.id??f,_=`${g}-description`,v=`${g}-error`,y=[h?.props[`aria-describedby`],n?_:null,r?v:null].filter(Boolean).join(` `)||void 0,b=l===!0||h?.props.required,x=r?!0:h?.props[`aria-invalid`],S=l===!0||h?.props[`aria-required`],C={id:g};b!==void 0&&(C.required=b),y!==void 0&&(C[`aria-describedby`]=y),x!==void 0&&(C[`aria-invalid`]=x),S!==void 0&&(C[`aria-required`]=S);let w=p&&h&&!c?m?(0,K.cloneElement)(p,void 0,K.Children.map(p.props.children,e=>e===h?(0,K.cloneElement)(h,C):e)):(0,K.cloneElement)(p,C):e,T=a?(0,X.jsx)(loe,{htmlFor:c?void 0:g,className:s===`inline`?`font-normal`:void 0,...l===void 0?{}:{required:l},...o===void 0?{}:{optional:o},children:a}):null,E=a||n?(0,X.jsxs)(`div`,{className:`caps-field-copy`,children:[T,n?(0,X.jsx)(`p`,{className:`caps-field-description`,id:_,children:n}):null]}):null,D=i?(0,X.jsxs)(`div`,{className:`caps-field-lead`,children:[(0,X.jsx)(`span`,{className:`caps-field-icon`,"aria-hidden":`true`,children:i}),E]}):E;return(0,X.jsxs)(`div`,{...u,className:Z(`caps-field`,t),"data-orientation":s,ref:d,children:[s===`horizontal`?(0,X.jsxs)(`div`,{className:`caps-field-row`,children:[D,w]}):s===`inline`?(0,X.jsxs)(`div`,{className:`caps-field-row`,children:[w,D]}):(0,X.jsxs)(X.Fragment,{children:[D,w]}),(0,X.jsx)(z6,{id:v,children:r})]})});function goe(e){let t=String(e),n=t.indexOf(`.`);return n===-1?0:t.length-n-1}var U6=`M 9.86 38.14 A 20 20 0 1 1 38.14 38.14`,_oe=6,voe=new Map([[`ArrowUp`,1],[`ArrowDown`,-1],[`PageUp`,10],[`PageDown`,-10]]),yoe=(0,K.forwardRef)(function({className:e,decrementLabel:t=`Decrease`,defaultValue:n=null,disabled:r,incrementLabel:i=`Increase`,invalid:a,max:o,min:s,onBlur:c,onKeyDown:l,onValueChange:u,step:d=1,unit:f,value:p,wrap:m=!1,...h},g){let[_,v]=(0,K.useState)(n),[y,b]=(0,K.useState)(null),x=p===void 0?_:p,S=goe(d),C=e=>{let t=Number(e.toFixed(S));return s!==void 0&&t<s?s:o!==void 0&&t>o?o:t},w=e=>{let t=e===null?null:C(e);v(t),b(null),t!==x&&u?.(t)},T=()=>{if(y===null)return;let e=Number(y);w(y.trim()===``||!Number.isFinite(e)?null:e)},E=e=>{let t=(x??s??0)+e*d;if(m&&s!==void 0&&o!==void 0){if(t>o){w(s);return}if(t<s){w(o);return}}w(t)},D=s!==void 0&&x!==null&&x<=s,O=o!==void 0&&x!==null&&x>=o,k=r===!0,A=(0,K.useRef)(null),j=s!==void 0&&o!==void 0&&o>s?((x??s)-s)/(o-s):null,M=e=>{k||(e.currentTarget.setPointerCapture(e.pointerId),A.current={y:e.clientY,value:x??s??0})},N=e=>{if(!A.current)return;let t=Math.trunc((A.current.y-e.clientY)/_oe),n=C(A.current.value+t*d);n!==x&&w(n)},P=()=>{A.current=null};return(0,X.jsxs)(`span`,{className:Z(`caps-number-field`,e),"data-at-max":O||void 0,"data-at-min":D||void 0,"data-disabled":k||void 0,"data-wrap":m||void 0,children:[j===null?null:(0,X.jsxs)(`svg`,{className:`caps-number-field-dial`,viewBox:`0 0 48 48`,"aria-hidden":`true`,focusable:`false`,onPointerDown:M,onPointerMove:N,onPointerUp:P,onPointerCancel:P,children:[(0,X.jsx)(`path`,{className:`caps-number-field-dial-track`,d:U6,pathLength:100}),(0,X.jsx)(`path`,{className:`caps-number-field-dial-level`,d:U6,pathLength:100,strokeDasharray:`${String(Math.max(.5,j*100))} 100`})]}),(0,X.jsx)(rz,{type:`button`,variant:`outline`,size:`icon`,className:`caps-number-field-decrement`,"aria-label":t,"aria-controls":h.id,tabIndex:-1,disabled:k||D&&!m,onClick:()=>{E(-1)},children:(0,X.jsx)(sB,{"aria-hidden":`true`})}),(0,X.jsxs)(`span`,{className:`caps-number-field-readout`,children:[(0,X.jsx)(`input`,{...h,"aria-invalid":a?!0:h[`aria-invalid`]===!1?void 0:h[`aria-invalid`],className:`input caps-input caps-number-field-input`,disabled:r,inputMode:h.inputMode??(S>0?`decimal`:`numeric`),max:o,min:s,onBlur:e=>{T(),c?.(e)},onChange:e=>{b(e.target.value)},onKeyDown:e=>{if(l?.(e),e.defaultPrevented)return;let t=voe.get(e.key);t===void 0?e.key===`Home`&&s!==void 0?(e.preventDefault(),w(s)):e.key===`End`&&o!==void 0?(e.preventDefault(),w(o)):e.key===`Enter`&&T():(e.preventDefault(),E(t))},ref:g,step:d,type:`number`,value:y??(x===null?``:String(x))}),f?(0,X.jsx)(`span`,{className:`caps-number-field-unit`,"aria-hidden":`true`,children:f}):null]}),(0,X.jsx)(rz,{type:`button`,variant:`outline`,size:`icon`,className:`caps-number-field-increment`,"aria-label":i,"aria-controls":h.id,tabIndex:-1,disabled:k||O&&!m,onClick:()=>{E(1)},children:(0,X.jsx)(cB,{"aria-hidden":`true`})})]})}),W6=(0,K.forwardRef)(function({className:e,invalid:t,...n},r){return(0,X.jsxs)(`span`,{className:`caps-select-shell`,children:[(0,X.jsx)(`select`,{...n,"aria-invalid":t?!0:n[`aria-invalid`]===!1?void 0:n[`aria-invalid`],className:Z(`select select-bordered caps-select w-full`,t&&`select-error`,e),ref:r}),!n.multiple&&(!n.size||n.size<=1)?(0,X.jsx)(Qz,{className:`caps-select-chevron`,"aria-hidden":`true`}):null]})});function boe({checked:e}){let t=`caps-switch-${(0,K.useId)().replaceAll(`:`,``)}`,n=(0,K.useRef)(null),r=(0,K.useRef)(null),i=(0,K.useRef)(e).current,a=(0,K.useRef)(e),o=hI();return(0,K.useLayoutEffect)(()=>{if(!n.current||!r.current)return;let t=o||a.current===e;a.current=e;let i=e?16:8,s=lI(n.current),c=P6(s,{bounce:.25,duration:440}),l=F6(s,{ease:`inOutSine`,duration:100}),u=FR(n.current,t?{x:2,y:2,width:i,height:8,duration:0}:{x:[{to:e?2.5:1.5,...l},{to:2,...c}],y:[{to:1.5,...l},{to:2,...c}],height:[{to:9,...l},{to:8,...c}],width:[{to:e?7:16.5,...l},{to:i,...c}]}),d=FR(r.current,{gradientTransform:e?`matrix(2 0 0 1 10 6)`:`matrix(1 0 0 1 6 6)`,...t?{duration:0}:{delay:l.duration,...c}});return()=>{u.cancel(),d.cancel()}},[e,o]),(0,X.jsxs)(`svg`,{className:`caps-switch-visual`,width:`40`,height:`24`,viewBox:`0 0 20 12`,"aria-hidden":`true`,focusable:`false`,children:[(0,X.jsxs)(`defs`,{children:[(0,X.jsx)(VR,{ref:r,id:`${t}-surface`,transform:i?`matrix(2 0 0 1 10 6)`:`matrix(1 0 0 1 6 6)`}),(0,X.jsx)(HR,{id:`${t}-shadow`}),(0,X.jsx)(UR,{id:`${t}-inset`}),(0,X.jsx)(`clipPath`,{id:`${t}-track`,children:(0,X.jsx)(`rect`,{x:`1`,y:`1`,width:`18`,height:`10`,rx:`5`})})]}),(0,X.jsx)(`rect`,{className:`caps-switch-track`,filter:`url(#${t}-inset)`,x:`0.5`,y:`0.5`,width:`19`,height:`11`,rx:`5.5`}),(0,X.jsx)(`g`,{clipPath:`url(#${t}-track)`,children:(0,X.jsx)(`rect`,{ref:n,x:`2`,y:`2`,width:i?16:8,height:`8`,rx:`4`,fill:`url(#${t}-surface)`,filter:`url(#${t}-shadow)`})})]})}var G6=(0,K.forwardRef)(function({className:e,checked:t,defaultChecked:n=!1,onChange:r,onCheckedChange:i,...a},o){let s=(0,K.useRef)(null),[c,l]=(0,K.useState)(n),u=t??c;return(0,K.useImperativeHandle)(o,()=>{if(!s.current)throw Error(`Switch input is not mounted`);return s.current},[]),(0,K.useEffect)(()=>{let e=s.current?.form;if(!e||t!==void 0)return;let r=e=>{queueMicrotask(()=>{!e.defaultPrevented&&s.current&&l(n)})};return e.addEventListener(`reset`,r),()=>{e.removeEventListener(`reset`,r)}},[t,n,a.form]),(0,X.jsxs)(`span`,{className:`caps-switch`,"data-checked":u,children:[(0,X.jsx)(`input`,{...a,checked:u,className:Z(`caps-switch-input`,e),onChange:e=>{t===void 0&&l(e.target.checked),r?.(e),i?.(e.target.checked)},ref:s,role:`switch`,type:`checkbox`}),(0,X.jsx)(boe,{checked:u})]})}),xoe={2:`h2`,3:`h3`,4:`h4`};function Soe(e,t){let{reduced:n}=t,r=e&&!n,i=dI(t,600),[a,o]=(0,K.useState)(r);return(0,K.useEffect)(()=>{if(o(r),!r)return;let e=globalThis.setTimeout(()=>{o(!1)},i);return()=>{globalThis.clearTimeout(e)}},[r,i]),a}var K6=(0,K.forwardRef)(function({actions:e,className:t,description:n,headingLevel:r=2,suggestions:i,thinking:a=!1,title:o,visual:s,renderVisual:c,variant:l=`plain`,...u},d){let f=(0,K.useId)(),p=(0,K.useRef)(null),m=uI(p),h=Soe(l===`speech`,m)&&!a,g=xoe[r],_=c?c({speaking:h,thinking:a}):s,v=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(g,{ref:p,className:`empty-state-title`,id:u[`aria-labelledby`]?void 0:f,children:o}),(0,X.jsx)(`p`,{children:n}),i&&i.length>0?(0,X.jsx)(`ul`,{"aria-label":`Try one of these`,className:`empty-state-suggestions`,children:i.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsx)(rz,{size:`sm`,variant:`outline`,onClick:e.onSelect,children:e.label})},e.label))}):null,e?(0,X.jsx)(`div`,{className:`empty-state-actions`,children:e}):null]});return(0,X.jsxs)(`section`,{...u,"aria-labelledby":u[`aria-labelledby`]??f,className:Z(`empty-state`,l!==`plain`&&`empty-state-${l}`,t),ref:d,children:[_?(0,X.jsx)(`div`,{"aria-hidden":`true`,className:`empty-state-visual`,children:_}):null,l===`speech`?(0,X.jsx)(`div`,{className:`empty-state-bubble`,children:v}):v]})});function Coe(e,t){return{kind:`button`,id:`folder`,text:t.checking?`Checking…`:`prints`,icon:`folder`,title:e===null?`Choose where Prints saves images`:mD(`Save prints to ${e}`,1024),opens:`dialog`,expanded:t.editing}}var woe=TF(`card caps-card`,{variants:{variant:{surface:`caps-card-surface`,outline:`caps-card-outline`,interactive:`caps-card-interactive`,game:`caps-card-game caps-card-interactive`,fit:`caps-card-fit`},density:{regular:``,compact:`caps-card-compact`}},defaultVariants:{variant:`surface`,density:`regular`}}),q6=(0,K.forwardRef)(function({className:e,density:t,featured:n=!1,state:r,variant:i,...a},o){return(0,X.jsx)(`div`,{...a,className:Z(woe({density:t,variant:i}),n&&`caps-card-featured`,e),"data-state":r,ref:o})});(0,K.forwardRef)(function({className:e,density:t,variant:n,width:r=`default`,...i},a){return(0,X.jsx)(`main`,{className:`caps-centered-card-stage`,children:(0,X.jsx)(q6,{...i,className:Z(`caps-centered-card`,r===`wide`&&`caps-centered-card-wide`,e),ref:a,variant:n??`surface`,...t?{density:t}:{}})})}),(0,K.forwardRef)(function({alignment:e=`start`,className:t,...n},r){return(0,X.jsx)(`div`,{...n,className:Z(`caps-card-header`,e===`center`&&`caps-card-header-centered`,t),ref:r})}),(0,K.forwardRef)(function({className:e,level:t=3,...n},r){return(0,X.jsx)(t===2?`h2`:`h3`,{...n,className:Z(`caps-card-title`,e),ref:r})}),(0,K.forwardRef)(function({className:e,...t},n){return(0,X.jsx)(`p`,{...t,className:Z(`caps-card-description`,e),ref:n})}),(0,K.forwardRef)(function({className:e,...t},n){return(0,X.jsx)(`div`,{...t,className:Z(`caps-card-content`,e),ref:n})}),(0,K.forwardRef)(function({className:e,...t},n){return(0,X.jsx)(`div`,{...t,className:Z(`caps-card-footer`,e),ref:n})});var Toe=(0,K.forwardRef)(function({action:e,attachments:t,className:n,input:r,toolbar:i,...a},o){return(0,X.jsxs)(`div`,{...a,ref:o,className:Z(`caps-composer`,n),children:[t===void 0?null:(0,X.jsx)(`div`,{className:`caps-composer-attachments`,children:t}),(0,X.jsx)(`div`,{className:`caps-composer-input`,children:r}),i===void 0&&e===void 0?null:(0,X.jsxs)(`div`,{className:`caps-composer-bar`,children:[(0,X.jsx)(`div`,{className:`caps-composer-toolbar`,children:i}),e]})]})}),J6=(0,K.forwardRef)(function({className:e,...t},n){return(0,X.jsx)(`div`,{...t,ref:n,className:Z(`caps-popover-anchor`,e)})}),Y6=(0,K.forwardRef)(function({className:e,open:t,side:n=`top`,...r},i){return t?(0,X.jsx)(`div`,{...r,ref:i,className:Z(`caps-popover`,e),"data-side":n}):null}),Eoe=(0,K.forwardRef)(function({active:e,className:t,onMouseDown:n,...r},i){return(0,X.jsx)(`div`,{role:`option`,"aria-selected":e,...r,ref:i,className:Z(`caps-popover-option`,t),"data-active":e,onMouseDown:e=>{e.preventDefault(),n?.(e)}})});function Doe(e){let t=XM(e),n=(0,K.useRef)(e);n.current=e;let r=Nw(),i=BT(kre(e)),a=UT(K$(e,i.data?.configured?i.data.path:null)),[o,s]=(0,K.useState)(null),c=n=>n?.app===e&&n.computerId===t,l=HT({mutationKey:xF.folder(e),mutationFn:async({owner:e,id:t,path:r,create:i})=>{let a=()=>{if(n.current!==e||e.context.get().computerId!==t)throw new Y(`Computer selection changed`,{code:`SELECTION_CHANGED`,retryable:!1})};return a(),i&&await e.capabilities.require(uV).mkdir({path:r}),a(),await lV(e.capabilities,{path:r,limit:1,offset:0}),a(),LP(e.capabilities,{operation:`select-folder`,computerId:t,path:r})},onSuccess:(e,t)=>{t.owner===n.current&&t.owner.context.get().computerId===t.id&&s(null)},onSettled:(e,t,n)=>Promise.all([r.invalidateQueries({queryKey:n.queryKey,exact:!0}),r.invalidateQueries({queryKey:G$.listing(n.owner,n.path),exact:!0})])}),u=l.variables?.owner===e&&l.variables.id===t,d=i.isFetching||u&&l.isPending,f=async(n,r)=>{if(!e||!t||d)return`Computer selection changed. Try again.`;let i=n.trim();if(!RC(ZN)(i))return`Enter an absolute Computer folder, such as /media.`;try{return await l.mutateAsync({owner:e,id:t,path:i,create:r,queryKey:xF.folder(e)}),null}catch{return`Could not use this folder. Check its location and your Computer permissions.`}},p=i.isError||a.isError;return{path:p?null:i.data?.path??null,galleryPath:p||!i.data?.configured?null:i.data.path,computerId:t,available:e?.capabilities.has(EN)===!0,writable:e?.capabilities.has(uV)===!0,busy:d,error:p?`Your media folder is unavailable. Choose or create a folder.`:null,editing:c(o),setEditing:n=>{s(n?{app:e,computerId:t}:null)},choose:f,ensureCreated:async()=>i.data?i.data.configured?null:f(i.data.path,!0):`Your Prints library is still loading.`,recheck:()=>{r.invalidateQueries({queryKey:G$.listing(e,i.data?.path??null),exact:!0}),r.invalidateQueries({queryKey:xF.folder(e),exact:!0})}}}var Ooe=BC(XC),koe=BC(q({message:XC}));function Aoe(e){for(let t of e.errors){let e=Eee(wee(Dee(koe(t),e=>e.message),()=>Ooe(t)));if(e!==void 0&&e.length>0)return e}}var X6={dot:{y:-4,height:8,cy:0},pill:{y:-16,height:32,cy:0},bang:{y:-16,height:20,cy:12}};function joe({className:e,glyph:t,motion:n}){let r=`caps-status-${(0,K.useId)().replaceAll(`:`,``)}`,i=(0,K.useRef)(null),a=(0,K.useRef)(null),o=(0,K.useRef)(null),s=(0,K.useRef)(null),c=(0,K.useRef)(null),l=(0,K.useRef)(null),u=(0,K.useRef)(X6[t]).current,d=(0,K.useRef)(t===`dot`?1:4).current,f=(0,K.useRef)(+(t===`bang`)).current,p=(0,K.useRef)(t),m=uI(s),{reduced:h}=m;return(0,K.useLayoutEffect)(()=>{if(!i.current||!a.current||!c.current||!l.current)return;let e=X6[t],n=h||p.current===t;p.current=t;let r=lI(i.current),o=n?{duration:0}:P6(r,{bounce:.3,duration:360}),s=FR(i.current,{y:e.y,height:e.height,...o}),u=FR(a.current,{cy:e.cy,...n?{duration:0}:{delay:dI(r,35),...P6(r,{bounce:.3,duration:420})}}),d=FR(c.current,{gradientTransform:`matrix(1 0 0 ${t===`dot`?`1`:`4`} 0 0)`,...o}),f=FR(l.current,{opacity:+(t===`bang`),...n?N6:F6(r,{ease:`inOutSine`,duration:220})});return()=>{s.cancel(),u.cancel(),d.cancel(),f.cancel()}},[t,h]),(0,K.useLayoutEffect)(()=>{if(!o.current||!s.current||h||n===`none`)return;let e=n===`pulse`?FR(o.current,{opacity:[1,.45],...F6(m,{ease:`inOutSine`,duration:750}),alternate:!0,loop:!0}):FR(o.current,{keyframes:{"0%":{translateY:0,scaleX:1,scaleY:1},"18%":{translateY:.25,scaleX:1.1,scaleY:.91},"42%":{translateY:-1.3,scaleX:.94,scaleY:1.06},"62%":{translateY:-1.65,scaleX:1,scaleY:1},"82%":{translateY:.15,scaleX:1.06,scaleY:.95},"100%":{translateY:0,scaleX:1,scaleY:1}},...F6(m,{ease:`inOutSine`,duration:1e3}),loop:!0}),t=KR(s.current,t=>{t?e.resume():e.pause()});return()=>{t(),e.revert()}},[n,h,m]),(0,X.jsxs)(`svg`,{ref:s,"aria-hidden":`true`,className:`caps-status-bead ${e??``}`,width:`8`,height:`8`,viewBox:`-4 -4 8 8`,focusable:`false`,children:[(0,X.jsxs)(`defs`,{children:[(0,X.jsx)(GR,{id:r,values:WR}),(0,X.jsx)(VR,{ref:c,id:`${r}-surface`,transform:`matrix(1 0 0 ${String(d)} 0 0)`}),(0,X.jsxs)(`radialGradient`,{id:`${r}-drop-light`,gradientUnits:`userSpaceOnUse`,cx:`-1.2`,cy:`10.4`,r:`5.6`,children:[(0,X.jsx)(`stop`,{offset:`0`,stopColor:`var(--color-white)`,style:{stopOpacity:`calc(var(--depth) * 0.5)`}}),(0,X.jsx)(`stop`,{offset:`1`,stopColor:`var(--color-white)`,stopOpacity:`0`})]}),(0,X.jsx)(HR,{id:`${r}-shadow`}),(0,X.jsx)(`mask`,{id:`${r}-silhouette`,maskUnits:`userSpaceOnUse`,x:`-12`,y:`-24`,width:`24`,height:`48`,style:{maskType:`alpha`},children:(0,X.jsxs)(`g`,{fill:`var(--color-white)`,filter:`url(#${r})`,children:[(0,X.jsx)(`rect`,{ref:i,x:`-4`,y:u.y,width:`8`,height:u.height,rx:`4`}),(0,X.jsx)(`circle`,{ref:a,cx:`0`,cy:u.cy,r:`4`})]})})]}),(0,X.jsx)(`g`,{ref:o,filter:`url(#${r}-shadow)`,children:(0,X.jsxs)(`g`,{mask:`url(#${r}-silhouette)`,children:[(0,X.jsx)(`rect`,{x:`-12`,y:`-24`,width:`24`,height:`48`,fill:`url(#${r}-surface)`}),(0,X.jsx)(`rect`,{ref:l,x:`-12`,y:`-24`,width:`24`,height:`48`,fill:`url(#${r}-drop-light)`,opacity:f})]})})]})}var Moe=.28;function Z6(e,t){switch(e){case`ring`:return{dashes:1,track:0,arc:0,sweep:0,disc:0,tick:0,cross:0};case`arc`:return{dashes:0,track:1,arc:1,sweep:t===void 0?Moe:Math.min(1,Math.max(0,t)),disc:0,tick:0,cross:0};case`check`:return{dashes:0,track:0,arc:1,sweep:1,disc:1,tick:1,cross:0};case`cross`:return{dashes:0,track:0,arc:1,sweep:1,disc:1,tick:0,cross:1}}}var Q6=7.25;function Noe({className:e,glyph:t,progress:n}){let r=`caps-status-mark-${(0,K.useId)().replaceAll(`:`,``)}`,i=(0,K.useRef)(null),a=(0,K.useRef)(null),o=(0,K.useRef)(null),s=(0,K.useRef)(null),c=(0,K.useRef)(null),l=(0,K.useRef)(null),u=(0,K.useRef)(null),d=(0,K.useRef)(null),f=(0,K.useRef)(Z6(t,n)).current,p=(0,K.useRef)(t),m=hI();(0,K.useLayoutEffect)(()=>{let e=i.current,r=a.current,c=o.current,f=s.current,h=l.current,g=u.current,_=d.current;if(!e||!r||!c||!f||!h||!g||!_)return;let v=Z6(t,n),y=p.current;p.current=t;let b=lI(e),x=m||y===t&&t!==`arc`,S=x?m?{ease:b.ease,duration:b.fast}:N6:F6(b,{ease:`outQuad`,duration:160}),C=(t===`check`||t===`cross`)&&!x,w=F6(b,{ease:`inOutSine`,duration:220}),T=[FR(r,{opacity:v.dashes,...S}),FR(c,{opacity:v.track*.28,...S}),FR(f,{opacity:v.arc,"stroke-dasharray":`${String(v.sweep)} 1`,...x?m?N6:S:w}),FR(h,{r:v.disc*Q6,...C?{delay:w.duration*.7,...P6(b,{bounce:.35,duration:360})}:m?N6:F6(b,{ease:`inCubic`,duration:140})}),FR(g,{"stroke-dashoffset":1-v.tick,...C&&v.tick>0?{delay:w.duration*.7+b.fast,...F6(b,{ease:`outCubic`,duration:240})}:N6}),FR(_,{"stroke-dashoffset":1-v.cross,...C&&v.cross>0?{delay:w.duration*.7+b.fast,...F6(b,{ease:`outCubic`,duration:240})}:N6})];return t===`cross`&&C&&b.shake>0&&T.push(FR(e,{translateX:[0,-b.shake,b.shake,-b.shake/2,0],delay:w.duration+b.fast,...F6(b,{ease:`linear`,duration:300})})),()=>{for(let e of T)e.cancel()}},[t,n,m]);let h=t===`arc`&&n===void 0&&!m;return(0,K.useLayoutEffect)(()=>{if(!h||!c.current||!i.current)return;let e=lI(i.current),t=FR(c.current,{rotate:[0,360],...F6(e,{ease:`linear`,duration:900}),loop:!0}),n=KR(i.current,e=>{e?t.resume():t.pause()});return()=>{n(),t.revert()}},[h]),(0,X.jsxs)(`svg`,{ref:i,"aria-hidden":`true`,className:`caps-status-mark ${e??``}`,viewBox:`0 0 16 16`,focusable:`false`,children:[(0,X.jsxs)(`defs`,{children:[(0,X.jsx)(VR,{id:`${r}-surface`,transform:`matrix(1.6 0 0 1.6 8 8)`}),(0,X.jsxs)(`mask`,{id:`${r}-knock`,maskUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:`16`,height:`16`,children:[(0,X.jsx)(`rect`,{width:`16`,height:`16`,fill:`var(--color-white)`}),(0,X.jsx)(`path`,{ref:u,d:`M4.9 8.3 7.1 10.5 11.2 5.9`,fill:`none`,stroke:`var(--color-black)`,strokeWidth:`1.9`,strokeLinecap:`round`,strokeLinejoin:`round`,pathLength:1,strokeDasharray:`1 1`,strokeDashoffset:1-f.tick}),(0,X.jsx)(`path`,{ref:d,d:`M5.4 5.4 10.6 10.6 M10.6 5.4 5.4 10.6`,fill:`none`,stroke:`var(--color-black)`,strokeWidth:`1.9`,strokeLinecap:`round`,pathLength:1,strokeDasharray:`1 1`,strokeDashoffset:1-f.cross})]})]}),(0,X.jsx)(`circle`,{ref:a,cx:`8`,cy:`8`,r:`6.25`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeDasharray:`1.7 2.2`,opacity:f.dashes}),(0,X.jsx)(`circle`,{ref:o,cx:`8`,cy:`8`,r:`6.25`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,opacity:f.track*.28}),(0,X.jsx)(`g`,{ref:c,className:`caps-status-mark-spin`,children:(0,X.jsx)(`circle`,{ref:s,cx:`8`,cy:`8`,r:`6.25`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,pathLength:1,strokeDasharray:`${String(f.sweep)} 1`,transform:`rotate(-90 8 8)`,opacity:f.arc})}),(0,X.jsx)(`circle`,{ref:l,cx:`8`,cy:`8`,r:f.disc*Q6,fill:`url(#${r}-surface)`,mask:`url(#${r}-knock)`})]})}var Poe=new Set([`ring`,`arc`,`check`,`cross`]);function Foe(e){return Poe.has(e)}var $6={neutral:`text-base-content`,primary:`text-primary`,secondary:`text-secondary`,accent:`text-accent`,success:`text-success`,info:`text-info`,warning:`text-warning`,error:`text-error`},e8=(0,K.forwardRef)(function({className:e,label:t,glyph:n=`dot`,motion:r=`none`,tone:i=`neutral`,size:a=`default`,appearance:o=`plain`,progress:s,...c},l){return(0,X.jsxs)(`span`,{...c,className:Z(`caps-status`,a===`compact`&&`caps-status-compact`,o===`chip`&&`caps-status-chip`,e),"data-tone":o===`chip`?i:void 0,"data-glyph":n,"data-motion":r,ref:l,children:[Foe(n)?(0,X.jsx)(Noe,{className:$6[i],glyph:n,progress:s}):(0,X.jsx)(joe,{className:$6[i],glyph:n,motion:r}),t===void 0?null:(0,X.jsx)(`span`,{children:t})]})}),Ioe={neutral:`progress-neutral`,primary:`progress-primary`,secondary:`progress-secondary`,accent:`progress-accent`,success:`progress-success`,info:`progress-info`,warning:`progress-warning`,error:`progress-error`},t8=(0,K.forwardRef)(function({className:e,tone:t=`primary`,...n},r){return(0,X.jsx)(`progress`,{...n,"data-complete":n.value!==void 0&&Number(n.value)>=Number(n.max??1)?`true`:void 0,className:Z(`progress caps-gooey-motion caps-gooey-progress w-full`,Ioe[t],e),ref:r})});(0,K.forwardRef)(function({label:e,value:t,max:n,tone:r=`info`,className:i,...a},o){return(0,X.jsxs)(`div`,{...a,ref:o,className:Z(`caps-game-meter`,i),children:[(0,X.jsxs)(`div`,{className:`caps-game-meter-readout`,children:[(0,X.jsx)(`span`,{children:e}),(0,X.jsxs)(`span`,{className:`caps-game-meter-value`,children:[t,` / `,n]})]}),(0,X.jsx)(t8,{"aria-label":e,value:t,max:n,tone:r})]})});function n8({className:e,items:t,onCancel:n,onRemove:r,onRetry:i,rowClassName:a}){return t.length?(0,X.jsx)(`div`,{"aria-live":`polite`,className:`caps-upload-queue flex w-full min-w-0 flex-col gap-sm ${e??``}`,"data-upload-rows":!0,children:t.map(e=>(0,X.jsx)(Roe,{item:e,onCancel:n,onRemove:r,onRetry:i,...a===void 0?{}:{rowClassName:a}},e.id))}):null}function r8({action:e,id:t,onAction:n,retry:r=!1}){return e?(0,X.jsx)(dz,{"aria-label":e.accessibleLabel,title:e.label,variant:`ghost`,size:`xs`,className:`motion-reduce:transition-none`,icon:r?(0,X.jsx)(lB,{}):(0,X.jsx)(mB,{}),onClick:()=>void n(t),type:`button`}):null}function Loe({item:e}){return(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`span`,{className:`block min-w-0 truncate`,title:e.name,children:e.name}),(0,X.jsx)(`div`,{className:`caps-upload-details`,children:(0,X.jsxs)(`span`,{"aria-live":e.alert?`assertive`:void 0,className:`caps-upload-status min-w-0 break-words`,"data-upload-status":!0,role:e.alert?`alert`:void 0,children:[e.alert??e.statusLabel,` `,e.progressLabel]})})]})}function Roe({item:e,onCancel:t,onRemove:n,onRetry:r,rowClassName:i}){return(0,X.jsxs)(`div`,{className:`caps-upload-row grid w-full min-w-0 max-w-full grid-cols-[2rem_minmax(0,1fr)_auto] items-center gap-sm p-sm text-xs ${i??``}`,children:[e.preview.kind===`image`?(0,X.jsx)(`img`,{alt:``,className:`caps-upload-preview mask mask-squircle size-8 shrink-0 object-cover`,src:e.preview.url}):(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`caps-upload-preview mask mask-squircle flex size-8 shrink-0 items-center justify-center bg-base-300`,children:(0,X.jsx)(rB,{className:`size-4`})}),(0,X.jsx)(Loe,{item:e}),(0,X.jsx)(zoe,{actions:e.actions,id:e.id,onCancel:t,onRemove:n,onRetry:r}),(0,X.jsx)(t8,{"aria-label":`${e.name} progress`,className:`caps-upload-progress`,tone:e.alert?`error`:e.progress===100?`success`:`accent`,max:100,value:e.progress??(e.alert?0:void 0)})]})}function zoe({actions:e,id:t,onCancel:n,onRemove:r,onRetry:i}){return(0,X.jsxs)(`div`,{className:`caps-upload-actions flex min-w-0 flex-wrap justify-end gap-xs`,children:[(0,X.jsx)(r8,{action:e.retry,id:t,onAction:i,retry:!0}),(0,X.jsx)(r8,{action:e.cancel,id:t,onAction:n}),(0,X.jsx)(r8,{action:e.remove,id:t,onAction:r})]})}var i8={unchecked:`M3.25 5.9 L5.1 7.9 L8.8 3.8`,checked:`M3.25 5.9 L5.1 7.9 L8.8 3.8`,mixed:`M3.4 6 L6 6 L8.6 6`},Boe={blurStdDeviation:.22,alphaSlope:18,alphaIntercept:-8};function Voe({state:e}){let t=`caps-checkbox-${(0,K.useId)().replaceAll(`:`,``)}`,n=(0,K.useRef)(null),r=(0,K.useRef)(e).current,i=(0,K.useRef)(e),a=hI();return(0,K.useLayoutEffect)(()=>{if(!n.current)return;let t=e!==`unchecked`,r=i.current!==`unchecked`,o=a||i.current===e;i.current=e;let s=lI(n.current),c=F6(s,{ease:`inCubic`,duration:160}),l=FR(n.current,{d:{to:i8[e],...o?N6:F6(s,{ease:`outCubic`,duration:200})},"stroke-dashoffset":{to:+!t,...o?N6:t?F6(s,{ease:`inOutSine`,duration:260}):c},"stroke-width":o?{to:t?2.4:0,duration:0}:t&&!r?[{to:2.2,...F6(s,{ease:`outCubic`,duration:65})},{to:2.4,delay:dI(s,120),...P6(s,{bounce:.35,duration:220})}]:{to:t?2.4:0,...c}});return()=>{l.cancel()}},[e,a]),(0,X.jsxs)(`svg`,{className:`caps-checkbox-visual`,width:`24`,height:`24`,viewBox:`0 0 12 12`,"aria-hidden":`true`,focusable:`false`,children:[(0,X.jsxs)(`defs`,{children:[(0,X.jsx)(VR,{id:`${t}-surface`,transform:`matrix(1 0 0 1 6 6)`}),(0,X.jsx)(HR,{id:`${t}-shadow`}),(0,X.jsx)(UR,{id:`${t}-inset`}),(0,X.jsx)(GR,{id:`${t}-goo`,values:Boe}),(0,X.jsxs)(`filter`,{id:`${t}-relief`,x:`-25%`,y:`-25%`,width:`150%`,height:`150%`,colorInterpolationFilters:`sRGB`,children:[(0,X.jsx)(`feGaussianBlur`,{in:`SourceAlpha`,stdDeviation:`0.28`,result:`relief`}),(0,X.jsx)(`feSpecularLighting`,{in:`relief`,surfaceScale:`1.2`,specularConstant:`0.55`,specularExponent:`18`,lightingColor:`color-mix(in srgb, var(--color-white) calc(var(--depth) * 100%), var(--color-black))`,result:`light`,children:(0,X.jsx)(`feDistantLight`,{azimuth:`225`,elevation:`55`})}),(0,X.jsx)(`feComposite`,{in:`light`,in2:`SourceAlpha`,operator:`in`,result:`clipped-light`}),(0,X.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`clipped-light`,mode:`screen`})]}),(0,X.jsx)(`mask`,{id:`${t}-contour`,maskUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:`12`,height:`12`,style:{maskType:`alpha`},children:(0,X.jsx)(`path`,{ref:n,d:i8[r],fill:`none`,stroke:`var(--color-white)`,strokeWidth:r===`unchecked`?0:2.4,pathLength:`1`,strokeDasharray:`1`,strokeDashoffset:+(r===`unchecked`),strokeLinecap:`round`,strokeLinejoin:`round`,filter:e===`mixed`?void 0:`url(#${t}-goo)`})}),(0,X.jsx)(`clipPath`,{id:`${t}-well`,children:(0,X.jsx)(`rect`,{x:`1`,y:`1`,width:`10`,height:`10`,rx:`2.5`})})]}),(0,X.jsx)(`rect`,{className:`caps-checkbox-track`,x:`0.5`,y:`0.5`,width:`11`,height:`11`,rx:`3`,filter:`url(#${t}-inset)`}),(0,X.jsx)(`g`,{clipPath:`url(#${t}-well)`,children:(0,X.jsx)(`g`,{filter:`url(#${t}-shadow)`,children:(0,X.jsx)(`g`,{filter:`url(#${t}-relief)`,children:(0,X.jsx)(`g`,{mask:`url(#${t}-contour)`,children:(0,X.jsx)(`rect`,{x:`0`,y:`0`,width:`12`,height:`12`,fill:`url(#${t}-surface)`})})})})})]})}var a8=(0,K.forwardRef)(function({className:e,appearance:t,indicator:n,invalid:r,indeterminate:i=!1,checked:a,defaultChecked:o=!1,onChange:s,...c},l){let u=(0,K.useRef)(null),[d,f]=(0,K.useState)(o),p=a??d,m=i?`mixed`:p?`checked`:`unchecked`;return(0,K.useImperativeHandle)(l,()=>{if(!u.current)throw Error(`Checkbox input is not mounted`);return u.current},[]),(0,K.useLayoutEffect)(()=>{u.current&&(u.current.indeterminate=i)},[i]),(0,K.useEffect)(()=>{let e=u.current?.form;if(!e||a!==void 0)return;let t=e=>{queueMicrotask(()=>{!e.defaultPrevented&&u.current&&f(o)})};return e.addEventListener(`reset`,t),()=>{e.removeEventListener(`reset`,t)}},[a,o,c.form]),(0,X.jsxs)(`span`,{className:`caps-checkbox`,"data-appearance":t===`compact`?t:void 0,"data-state":m,"data-custom-indicator":n!==void 0||void 0,children:[(0,X.jsx)(`input`,{...c,checked:p,"aria-checked":i?`mixed`:p,"aria-invalid":r?!0:c[`aria-invalid`]===!1?void 0:c[`aria-invalid`],className:Z(`caps-checkbox-input`,e),onChange:e=>{a===void 0&&f(e.target.checked),s?.(e),e.currentTarget.indeterminate=i},ref:u,type:`checkbox`}),n===void 0?(0,X.jsx)(Voe,{state:m}):n]})}),Hoe=gN({keyCode:vN(229)});function o8(e){return e.nativeEvent.isComposing||we(Hoe,e.nativeEvent).success}var s8=[],c8=void 0;function Uoe(){return c8}function Woe(e){s8.push(e)}function l8(e){let t=(t,n)=>{let r=q0(Goe).current,i;try{c8=r;for(let e of s8)e.before(r);i=e(t,n);for(let e of s8)e.after(r);r.didInitialize=!0}finally{c8=void 0}return i};return t.displayName=e.displayName||e.name,t}function u8(e){return K.forwardRef(l8(e))}function Goe(){return{didInitialize:!1}}function Koe(e,t){return t!=null&&!A3(t)?0:typeof e==`function`?e():e}function d8(e,t,n){let r=Koe(e,n);return typeof r==`number`?r:r?.[t]}function f8(e){return typeof e==`function`?e():e}function p8(e,t){return t||e===`click`||e===`mousedown`}function qoe(e){return e?.includes(`mouse`)&&e!==`mousedown`}function m8(e,t,n,r){let i=!1,a=!1,o=r??t2;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}}var Joe=`none`,h8=`trigger-press`,g8=`trigger-hover`,Yoe=`outside-press`,Xoe=`close-press`,_8=`focus-out`,Zoe=`escape-key`,v8=`imperative-action`;function y8(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function b8(e){let t=q0(Qoe,e).current;return t.next=e,y6(t.effect),t}function Qoe(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var x8=null;globalThis.requestAnimationFrame;var S8=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.callbacks[t]=null,--this.callbacksCount)}},C8=class e{static create(){return new e}static request(e){return S8.request(e)}static cancel(e){return S8.cancel(e)}currentId=x8;request(e){this.cancel(),this.currentId=S8.request(()=>{this.currentId=x8,e()})}cancel=()=>{this.currentId!==x8&&(S8.cancel(this.currentId),this.currentId=x8)};disposeEffect=()=>this.cancel};function w8(){let e=q0(C8.create).current;return n2(e.disposeEffect),e}var T8={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},$oe={...T8,position:`fixed`,margin:0,top:0,left:0};({...T8});var E8=K.forwardRef(function(e,t){let[n,r]=K.useState();y6(()=>{U4&&H4&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,X.jsx)(`span`,{...e,ref:t,style:$oe,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function D8(e){return`data-base-ui-${e}`}var O8=0;function k8(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(O8);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),$0;let o=requestAnimationFrame(a);return O8=o,()=>{O8===o&&(cancelAnimationFrame(o),O8=0)}}var A8=`data-base-ui-inert`,j8=new WeakMap,M8=new WeakSet,N8=new WeakMap,P8=0;function F8(e){return e?p4(e)?e.host:F8(e.parentNode):null}var I8=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=F8(t);return e.contains(n)?n:null}).filter(e=>e!=null),L8=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},R8=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{s4(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function ese(e,t,n,{mark:r=!0}){let i=I8(t,e),a=r?R8(t,L8(i),new Set(i)):[],o=[],s=[];if(n){let e=I8(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);R8(t,L8(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(j8.get(e)||0)+1;j8.set(e,r),o.push(e),r===1&&n&&M8.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(N8.get(e)||0)+1;N8.set(e,t),s.push(e),t===1&&e.setAttribute(A8,``)}),P8+=1,()=>{o.forEach(e=>{let t=(j8.get(e)||0)-1;j8.set(e,t),t||(M8.has(e)||e.removeAttribute(`aria-hidden`),M8.delete(e))}),r&&s.forEach(e=>{let t=(N8.get(e)||0)-1;N8.set(e,t),t||e.removeAttribute(A8)}),--P8,P8||(j8=new WeakMap,M8=new WeakSet,N8=new WeakMap)}}function z8(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Q3(e[0]).body;return ese(e,i,n,{mark:r})}var tse={style:{transition:`none`}},B8=`data-base-ui-click-trigger`,nse={fallbackAxisSide:`end`},rse={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},V8=l(WT(),1),H8=K.createContext(null),U8=()=>K.useContext(H8),ise=D8(`portal`);function ase(e={}){let{ref:t,container:n,componentProps:r=t2,elementProps:i}=e,a=X2(),o=U8()?.portalNode,[s,c]=K.useState(null),[l,u]=K.useState(null),d=X0(e=>{e!==null&&u(e)}),f=K.useRef(null);y6(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(u4(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=I2(`div`,r,{ref:[t,d],props:[{id:a,[ise]:``},i]}),m=s&&p?V8.createPortal(p,s):null;return{node:l,nodeId:K.isValidElement(p)?p.props.id:void 0,subtree:m}}var W8=K.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=ase({container:o,ref:t,componentProps:e,elementProps:c}),f=K.useRef(null),p=K.useRef(null),m=K.useRef(null),h=K.useRef(null),[g,_]=K.useState(null),v=K.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;K.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&m6(e)&&(e.type===`focusin`?v.current&&=(h6(l),!1):(Lae(l),v.current=!0))}return y8(j6(l,`focusin`,e,!0),j6(l,`focusout`,e,!0))},[l,y]),y6(()=>{!l||b!==!0||!v.current||(h6(l),v.current=!1)},[b,l]);let S=K.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,X.jsxs)(K.Fragment,{children:[d,(0,X.jsxs)(H8.Provider,{value:S,children:[x&&l&&(0,X.jsx)(E8,{"data-type":`outside`,ref:f,onFocus:e=>{m6(e,l)?m.current?.focus():p6(g?g.domReference:null)?.focus()}}),x&&l&&(0,X.jsx)(`span`,{role:s,"aria-owns":u,style:rse}),l&&V8.createPortal(a,l),x&&l&&(0,X.jsx)(E8,{"data-type":`outside`,ref:p,onFocus:e=>{m6(e,l)?h.current?.focus():(f6(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,m8(`focus-out`,e.nativeEvent)))}})]})]})});function G8(){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 ose=class{nodesRef={current:[]};events=G8();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},K8=K.createContext(null),q8=K.createContext(null),J8=()=>K.useContext(K8)?.id||null,Y8=e=>{let t=K.useContext(q8);return e??t};function sse(e){let t=X2(),n=Y8(e),r=J8();return y6(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function cse(e){let{children:t,id:n}=e,r=J8();return(0,X.jsx)(K8.Provider,{value:K.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function lse(e){let{children:t,externalTree:n}=e,r=q0(()=>n??new ose).current;return(0,X.jsx)(q8.Provider,{value:r,children:t})}function X8(e){return e==null?e:`current`in e?e.current:e}function use(e,t){let n=c4(J4(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(O3(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var dse=20,Z8=[];function Q8(){Z8=Z8.filter(e=>e.deref()?.isConnected)}function $8(e){Q8(),e&&s4(e)!==`body`&&(Z8.push(new WeakRef(e)),Z8.length>dse&&(Z8=Z8.slice(-20)))}function e5(){return Q8(),Z8[Z8.length-1]?.deref()}function fse(e){return e?c6(e)?e:u6(e)[0]||e:null}function t5(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=l6(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return c6(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function n5(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),v=t.useState(`floatingElement`),{events:y,dataRef:b}=t.context,x=X0(()=>b.current.floatingContext?.nodeId),S=i===!1,C=S3(_)&&S,w=b8(i),T=b8(a),E=b8(o),D=b8(u),O=b8(g),k=Y8(m),A=U8(),j=K.useRef(!1),M=K.useRef(!1),N=K.useRef(!1),P=K.useRef(null),F=K.useRef(``),I=K.useRef(``),L=K.useRef(null),R=K.useRef(null),z=u2(L,p,A?.beforeInsideRef),ee=u2(R,A?.afterInsideRef),te=a2(),B=a2(),ne=w8(),re=A!=null,V=C3(v),ie=X0((e=V)=>e?u6(e):[]),ae=X0(()=>h?.().filter(e=>e!=null)??[]);K.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&K4(V,G4(Q3(V)))&&ie().length===0&&!C&&E3(e)}return j6(Q3(V),`keydown`,e)},[r,V,c,C,ie]),K.useEffect(()=>{if(r||!g)return;let e=Q3(V);function t(){N.current=!1}function n(e){let t=J4(e),n=ae(),r=K4(v,t)||K4(_,t)||K4(A?.portalNode,t)||n.some(e=>e===t||K4(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,q4(t,`[data-base-ui-click-trigger]`)&&(M.current=!0,B.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return y8(j6(e,`pointerdown`,n,!0),j6(e,`pointerup`,t,!0),j6(e,`pointercancel`,t,!0),j6(e,`keydown`,i,!0),t)},[r,v,_,V,g,A,B,ae]),K.useEffect(()=>{if(r||!l)return;let e=Q3(V);function n(){M.current=!0,B.start(0,()=>{M.current=!1})}function i(e){let t=J4(e);c6(t)&&(P.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=J4(n);c&&r==null&&a!=null&&K4(v,a)&&$8(a),queueMicrotask(()=>{let o=x(),l=t.context.triggerElements,u=ae(),p=r?.hasAttribute(D8(`focus-guard`))&&[L.current,R.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,X8(f),X8(d)].includes(r),m=!(K4(_,r)||K4(v,r)||K4(r,v)||K4(A?.portalNode,r)||u.some(e=>e===r||K4(e,r))||l.hasMatchingElement(e=>K4(e,r))||p||k&&(w3(k.nodesRef.current,o).find(e=>K4(e.context?.elements.floating,r)||K4(e.context?.elements.domReference,r))||T3(k.nodesRef.current,o).find(e=>[e.context?.elements.floating,C3(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&V&&t5(V),s&&i!==_&&!Z3(a)&&G4(e)===e.body){if(f4(V)&&(V.focus(),s===`popup`)){ne.request(()=>{V.focus()});return}let e=ie(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||V;f4(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!c)&&r&&m&&!M.current&&(C||r!==e5())&&(j.current=!0,t.setOpen(!1,m8(_8,n)))})}function o(){N.current||(b.current.insideReactTree=!0,te.start(0,()=>{b.current.insideReactTree=!1}))}let u=f4(_)?_:null;if(!(!v&&!u))return y8(u&&j6(u,`focusout`,a),u&&j6(u,`pointerdown`,n),v&&j6(v,`focusin`,i),v&&j6(v,`focusout`,a),v&&A&&j6(v,`focusout`,o,!0))},[r,_,v,V,c,k,A,t,l,s,ie,C,x,b,te,B,ne,d,f,ae]),K.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${D8(`portal`)}]`)||[]),t=(k?T3(k.nodesRef.current,x()):[]).find(e=>S3(e.context?.elements.domReference||null))?.context?.elements.domReference,n=z8([v,...e,L.current,R.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...ae(),t,X8(f),X8(d),C?_:null].filter(e=>e!=null),{ariaHidden:c||C,mark:!1}),i=z8([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,c,A,C,k,x,d,f,ae]),y6(()=>{if(!g||r||!f4(V))return;F.current=``,I.current=``;let e=Q3(V),t=G4(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||K4(V,t))return;let i=null,a=()=>(i??=ie(V),i[0]||V),o;o=r===!0||r===null?a():X8(r),o||=a();let s=K4(V,G4(e)),c=b.current.openEvent,l=c?.type===`mousedown`&&O3(c);k8(o,{sync:l,preventScroll:o===V,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=G4(e);return!(t!==o&&K4(V,t))}})})},[r,g,V,ie,w,D,O,b]);let oe=K.useRef(null);y6(()=>{if(r||!V){oe.current=null;return}oe.current&&=(oe.current.cancelled=!0,null);let e=Q3(V),t=G4(e),n=D.current==null;$8(t);function i(e){if(e.open||(F.current=use(e.nativeEvent,I.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(D8(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(O3(e.nativeEvent)||k3(e.nativeEvent))j.current=!1;else{let e=!1;Q3(V).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&s4(t)!==`body`?t:null,s=n?o||a:a||o;return s||=e5()||null,typeof i==`boolean`?s:X8(i)||s||null}return()=>{y.off(`openchange`,i);let t=G4(e),n=ae(),r=K4(v,t)||n.some(e=>e===t||K4(e,t))||k&&w3(k.nodesRef.current,x(),!1).some(e=>K4(e.context?.elements.floating,t)),o=T.current,s=F.current,c=a(s),l={cancelled:!1};oe.current=l,queueMicrotask(()=>{oe.current===l&&(oe.current=null);let n=fse(c),i=E.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!j.current&&f4(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,V,T,E,D,y,k,_,x,ae]),y6(()=>{if(!H4||g||!v)return;let e=G4(Q3(v));!f4(e)||!b3(e)||K4(v,e)&&e.blur()},[g,v]),y6(()=>{if(!(r||!A))return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,c,g,t,l,_]),y6(()=>{if(!(r||!V))return t5(V),()=>{queueMicrotask(Q8)}},[r,V]);let H=!r&&(!c||!C)&&(re||c);return(0,X.jsxs)(K.Fragment,{children:[H&&(0,X.jsx)(E8,{"data-type":`inside`,ref:z,onFocus:e=>{if(c){let e=ie();k8(e[e.length-1])}else A?.portalNode&&(j.current=!1,m6(e,A.portalNode)?f6(_)?.focus():X8(f??A.beforeOutsideRef)?.focus())}}),n,H&&(0,X.jsx)(E8,{"data-type":`inside`,ref:ee,onFocus:e=>{c?k8(ie()[0]):A?.portalNode&&(l&&(j.current=!0),m6(e,A.portalNode)?p6(_)?.focus():X8(d??A.afterOutsideRef)?.focus())}})]})}function r5(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=h8}=t,l=e.context.dataRef,u=K.useRef(void 0),d=w8(),f=a2(),p=K.useMemo(()=>{function t(t,n,r,i){let a=m8(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=A3(e.pointerType,!0)&&k3(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||A3(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=J4(s),p=b3(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;if(r===`mousedown`&&o){u.current=void 0;return}A3(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return K.useMemo(()=>n?{reference:p}:t2,[n,p])}function pse(){return!1}function mse(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function i5(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=pse,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=Y8(c),m=X0(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=X0(()=>a),{escapeKey:v,outsidePress:y}=mse(s),b=K.useRef(!1),x=K.useRef(!1),S=K.useRef(!1),C=K.useRef(!1),w=K.useRef(!1),T=K.useRef(``),E=K.useRef(null),D=a2(),O=a2(),k=a2(),A=X0(()=>{O.clear(),d.current.insideReactTree=!1}),j=X0(e=>{let t=d.current.floatingContext?.nodeId;return(p?w3(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),M=X0(t=>v3(t,e.select(`floatingElement`))||v3(t,e.select(`domReferenceElement`))),N=X0(t=>{o()&&e.setOpen(!1,m8(h8,t.nativeEvent))}),P=X0(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=D3(t)?t.nativeEvent:t;if(w.current||i.isComposing||!v&&j(`__escapeKeyBubbles`))return;let a=m8(Zoe,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),F=X0(()=>{d.current.insideReactTree=!0,O.start(0,A)}),I=X0(t=>{if(!l||!n||t.button!==0)return;let r=J4(t.nativeEvent);K4(e.select(`floatingElement`),r)&&(b.current||(b.current=!0,x.current=!1))}),L=X0(e=>{!l||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});K.useEffect(()=>{function e(e){e.open||(C.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),K.useEffect(()=>A,[A]),K.useEffect(()=>{if(!l||!n)return l||(C.current=!1,w.current=!1,T.current=``,E.current=null),A;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=y;let t=new i2,i=Q3(u);function a(){k.clear(),w.current=!0}function o(){w.current=!0,k.start(H4?5:0,()=>{w.current=!1})}function s(){S.current=!0,t.start(0,()=>{S.current=!1})}function c(){b.current=!1,x.current=!1}function f(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function O(e){let t=d.current.floatingContext?.nodeId,n=p&&w3(p.nodesRef.current,t).some(t=>v3(e,t.context?.elements.floating));return M(e)||n}function N(n){if(m(n)){n.type!==`click`&&!M(n)&&(t.clear(),S.current=!1),A();return}if(d.current.insideReactTree){A();return}let r=J4(n),i=`[${D8(`inert`)}]`,a=d4(r)?r.getRootNode():null,o=Array.from((p4(a)?a:Q3(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>K4(e,r))))return;let c=d4(r)?r:null;for(;c&&!w4(c);){let e=D4(c);if(w4(e)||!d4(e))break;c=e}if(!(o.length&&d4(r)&&!y3(r)&&!K4(r,e.select(`floatingElement`))&&o.every(e=>!K4(c,e)))){if(f4(r)&&!(`touches`in n)){let e=w4(r),t=T4(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!O(n)){if(f()===`intentional`){if(n.detail!==0&&!O3(n)&&!C.current)return;if(S.current){t.clear(),S.current=!1;return}}typeof h==`function`&&!h(n)||j(`__outsidePressBubbles`)||(e.setOpen(!1,m8(Yoe,n)),A())}}}function F(t){f()!==`sloppy`||t.pointerType===`touch`||!e.select(`open`)||!n||M(t)||N(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||M(t))return;let r=t.touches[0];r&&(E.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=J4(e);if(!n)return;let r=j6(n,e.type,()=>{t(e),r()})}function R(e){T.current=`touch`,L(e,I)}function z(e){D.clear(),e.type===`pointerdown`&&(e.button===0&&(C.current=!0),T.current=e.pointerType),!(e.type===`mousedown`&&E.current&&!E.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?F(e):N(e)})}function ee(e){if(e.type===`pointercancel`&&(C.current=!1),!b.current)return;let n=x.current;if(c(),f()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!O(e)){if(n){s();return}typeof h==`function`&&!h(e)||(t.clear(),S.current=!0,A())}}}function te(e){if(f()!==`sloppy`||!E.current||M(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(N(e),D.clear(),E.current=null)}function B(e){L(e,te)}function ne(e){f()!==`sloppy`||!E.current||M(e)||(E.current.dismissOnTouchEnd&&N(e),D.clear(),E.current=null)}function re(e){L(e,ne)}let V=y8(r&&y8(j6(i,`keydown`,P),j6(i,`compositionstart`,a),j6(i,`compositionend`,o)),g&&y8(j6(i,`click`,z,!0),j6(i,`pointerdown`,z,!0),j6(i,`pointerup`,ee,!0),j6(i,`pointercancel`,ee,!0),j6(i,`mousedown`,z,!0),j6(i,`mouseup`,ee,!0),j6(i,`touchstart`,R,{capture:!0,passive:!0}),j6(i,`touchmove`,B,{capture:!0,passive:!0}),j6(i,`touchend`,re,{capture:!0,passive:!0})));return()=>{V(),t.clear(),c(),S.current=!1}},[d,u,r,g,h,l,n,v,y,P,A,_,j,M,p,e,D,k]);let R=K.useMemo(()=>({onKeyDown:P,onPointerDown:N,onClick:N}),[P,N]),z=K.useMemo(()=>({onKeyDown:P,onPointerDown:L,onMouseDown:L,onClickCapture:F,onMouseDownCapture(e){F(),I(e)},onPointerDownCapture(e){F(),I(e)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[P,F,I,L]);return K.useMemo(()=>n?{reference:R,floating:z,trigger:R}:{},[n,R,z])}function hse(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),y6(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};d4(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function gse(e,t=!1,n=!1,r=!1){let[i,a]=K.useState(e&&t?`idle`:void 0),[o,s]=K.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),y6(()=>{if(!e&&o&&i!==`ending`&&n){let e=C8.request(()=>{a(`ending`)});return()=>{C8.cancel(e)}}},[e,o,i,n]),y6(()=>{if(!e||t||i===void 0)return;let n=C8.request(()=>{a(void 0)});return()=>{C8.cancel(n)}},[t,e,i]),y6(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=C8.request(()=>{a(`idle`)});return()=>{C8.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var a5=null;function _se(e){if(!a5){let e=[];a5=e,queueMicrotask(()=>{a5=null,V8.flushSync(()=>{for(let t of e)t()})})}a5.push(e)}function o5(e,t=!1,n=!1){let r=w8();return X0((i,a=null)=>{r.cancel();let o=X8(e);if(o==null)return;let s=o,c=()=>{if(!n){V8.flushSync(i);return}_se(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(w6(s).map(e=>e.finished.then($0))).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(w6(s).some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=Z4;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function s5(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=X0(a),s=o5(r,n,i);K.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function vse(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=X0(i),{mounted:c,setMounted:l,transitionStatus:u}=gse(t,!1,!1,o),d=!t&&r;y6(()=>{t&&s(!1)},[t,s]);let f=K.useRef(c),p=K.useRef(!1),m=K2(),h=()=>{f.current=!1,l(!1),a()};y6(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=X0(()=>{if(f.current){if(t){p.current=!0,m();return}h()}});return s5({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var c5={tabIndex:-1,[Y4]:``};function l5(e){return t=>t!==`touch`||e.current}function u5(e,t=!1){let n=X2(),r=J8()!=null,i=q0(()=>e(n,r)).current;return hse({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function d5({handle:e,store:t}){return y6(()=>e.attachStore(t),[e,t]),null}function f5(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function yse(e,t){let n=K.useRef(null);return X0(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),f5(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),f5(t))})}function p5(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function bse(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function m5(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=yse(e,n),o=X0(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e);return}if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=X0(e=>{a(e),e&&o(e)});return y6(()=>(s(t.current),()=>s(null)),[s,t,n,e]),y6(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function h5(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=K.useRef(null),i=e.useState(`open`);y6(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=m8(Joe);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function g5(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=vse({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return q0(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function _5(e,t){e.useSyncedValues(t),y6(()=>()=>{e.update({activeTriggerProps:t2,inactiveTriggerProps:t2,popupProps:t2})},[e])}function v5(e,t){y6(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),y6(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var y5=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},b5=A0(),xse=g2(19)?Cse:wse;function x5(e,t,n,r,i){return xse(e,t,n,r,i)}function Sse(e,t,n,r,i){let a=K.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,b5.useSyncExternalStore)(e.subscribe,a,a)}Woe({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,b5.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Cse(e,t,n,r,i){let a=Uoe();if(!a)return Sse(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function wse(e,t,n,r,i){return(0,M0.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Tse=class{static create(e){return new this(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(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return x5(this,e,t,n,r)}},S5=class extends Tse{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){K.useDebugValue(e);let n=this;y6(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;y6(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;y6(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){K.useDebugValue(e);let n=this,r=t!==void 0;y6(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return K.useDebugValue(e),x5(this,this.selectors[e],t,n,r)}useContextCallback(e,t){K.useDebugValue(e);let n=X0(t??$0);this.context[e]=n}useStateSetter(e){let t=K.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)}})}},Ese={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Dse=class extends S5{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:G8(),nested:n,triggerElements:i},Ese),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&j3(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function C5(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Dse({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:t2,inactiveTriggerProps:t2,popupProps:t2}}var w5=e=>e.triggerIdProp??e.activeTriggerId,T5=e=>e.openProp??e.open,E5=e=>(e.popupElement?.id??e.floatingId)||void 0;function D5(e,t){return t!==void 0&&T5(e)&&w5(e)===t}function Ose(e,t){return D5(e,t)?!0:t!==void 0&&T5(e)&&w5(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var O5={open:T5,mounted:e=>e.mounted,transitionStatus:e=>T5(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:w5,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:E5,isTriggerActive:(e,t)=>t!==void 0&&w5(e)===t,isOpenedByTrigger:(e,t)=>D5(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&w5(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Ose(e,t)?E5(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function k5(e){let t=K.useCallback(t=>e===void 0?$0:e.subscribeStore(t),[e]),n=K.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,b5.useSyncExternalStore)(t,n,()=>e?.serverStore)}var kse=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new i2;restTimeout=new i2;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},A5=new WeakMap;function j5(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&A5.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),A5.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function M5(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=A5.get(n);a&&a!==e&&j5(a),j5(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,A5.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function N5(e){let t=e.context.dataRef.current,n=q0(()=>t.hoverInteractionState??kse.create()).current;return t.hoverInteractionState||=n,n2(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Ase(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=Y8(),u=J8(),d=N5(e),f=a2(),p=X0(()=>p8(c.current.openEvent?.type,d.interactedInside)),m=X0(()=>qoe(c.current.openEvent?.type)),h=X0(()=>{j5(d)});y6(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),K.useEffect(()=>h,[h]),y6(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&d4(s)&&o){let e=s,t=o,n=Q3(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??q4(e,`[data-rootownerid]`)??n.body;return M5(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),K.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&w3(l.nodesRef.current,u).length>0)}function a(t){let n=d8(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,m8(g8,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=J4(e);if(!x3(t)){d.interactedInside=!1;return}d.interactedInside=q4(t,`[aria-haspopup]`)!=null}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(_3(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(l&&r&&d4(o)&&w3(l.nodesRef.current,r,!1).some(e=>K4(e.context?.elements.floating,o)))){if(d.handler){d.handler(n);return}h(),m()&&!p()&&a(n)}}function v(n){!l||!u||t()||f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,m8(g8,n)),l.events.emit(`floating.closed`,n)})}let y=o;return y8(y&&j6(y,`mouseenter`,g),y&&j6(y,`mouseleave`,_),y&&j6(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var jse={current:null};function Mse(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=jse,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=Y8(l),v=N5(e),y=K.useRef(!1),b=b8(i),x=b8(r),S=b8(o),C=b8(n),w=b8(p),T=b8(f),E=X0(()=>p8(h.current.openEvent?.type,v.interactedInside)),D=X0(()=>w.current?.()!==!1),O=X0((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!K4(t,n);if(!d4(r))return!1;let a=r;return i.hasMatchingElement(e=>K4(e,a))&&(!t||!K4(t,a))}),k=X0(()=>{v.handler&&=(Q3(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),A=X0(()=>{j5(v)});return u&&(v.handleCloseOptions=i?.__options),K.useEffect(()=>k,[k]),K.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===g8,k(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,k]),K.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=d8(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,m8(g8,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,m8(g8,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!d4(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!A3(v.pointerType))return;let n=f8(S.current),r=d8(x.current,`open`,v.pointerType),i=J4(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(d4(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(K4(t,i)){c=t;break}}d4(o)&&d4(s)&&!e.context.triggerElements.hasElement(o)&&K4(o,s)&&(c=s);let l=c!=null&&O(s,c,i),u=e.select(`open`),d=T.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&d4(c)&&d4(s)&&K4(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;if(h){D()&&e.setOpen(!0,m8(g8,t,c));return}m||(r?v.openChangeTimeout.start(r,()=>{g&&D()&&e.setOpen(!0,m8(g8,t,c))}):g&&D()&&e.setOpen(!0,m8(g8,t,c)))}function o(n){if(E()){A();return}k();let r=Q3(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!_3(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){A(),k(),C.current&&!E()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n);return}(v.pointerType!==`touch`||!K4(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function l(e){K4(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?j6(r,`mouseout`,l):void 0;return s?y8(j6(r,`mousemove`,i,{once:!0}),j6(r,`mouseenter`,i),j6(r,`mouseleave`,o),f):y8(j6(r,`mouseenter`,i),j6(r,`mouseleave`,o),f)},[k,A,h,x,e,n,b,v,u,O,E,a,s,S,c,_,C,d,T,D,m]),K.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=O(i,r,t.target);if(a&&!A3(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;M5(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=f8(S.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,E())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&D()&&e.setOpen(!0,m8(g8,n,r))}v.pointerType===`touch`?V8.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,E,O,a,e,S,D])}var P5=.1,Nse=P5*P5,F5=.5;function I5(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function L5(e,t,n,r,i,a,o,s,c,l){let u=!1;return I5(e,t,n,r,i,a)&&(u=!u),I5(e,t,i,a,o,s)&&(u=!u),I5(e,t,o,s,c,l)&&(u=!u),I5(e,t,c,l,n,r)&&(u=!u),u}function Pse(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function R5(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Fse(e={}){let{blockPointerEvents:t=!1}=e,n=new i2,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Nse;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=J4(r),g=r.type===`mouseleave`,_=K4(u,h),v=K4(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&d4(r.relatedTarget)&&K4(u,r.relatedTarget))return;function y(){return!!(s&&w3(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=R5(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=R5(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=R5(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=R5(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!Pse(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?F5/2:F5*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+F5+1,o=C||T?S.bottom-F5:S.top,s=C?T?S.bottom-F5:S.top:S.bottom-F5;M=L5(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?F5/2:F5*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-F5,o=C||T?S.top+F5:S.bottom,s=C?T?S.top+F5:S.bottom:S.top+F5;M=L5(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?F5/2:F5*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+F5+1,o=w||E?S.right-F5:S.left,s=w?E?S.right-F5:S.left:S.right-F5;M=L5(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?F5/2:F5*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-F5,o=w||E?S.left+F5:S.right,s=w?E?S.left+F5:S.right:S.left+F5;M=L5(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function z5(e,t,n){let{reference:r,floating:i}=e,a=U3(t),o=W3(t),s=H3(o),c=z3(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=B3(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Ise(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}=R3(t,e),p=Y3(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=X3(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=X3(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 Lse=50,Rse=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ise},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=z5(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<Lse&&(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}=z5(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},zse=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}=R3(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=z3(r),_=U3(o),v=z3(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[J3(o)]:Tae(o)),x=p!==`none`;!d&&x&&b.push(...kae(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=wae(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`||_===U3(t)||T.every(e=>U3(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=U3(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},B5=new Set([`left`,`top`]);async function Bse(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=z3(n),s=B3(n),c=U3(n)===`y`,l=B5.has(o)?-1:1,u=a&&c?-1:1,d=R3(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 Vse=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 Bse(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}}}}},Hse=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}=R3(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=U3(i),p=V3(f),m=u[p],h=u[f],g=(e,t)=>L3(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Use=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}=R3(e,t),u={x:n,y:r},d=U3(i),f=V3(d),p=u[f],m=u[d],h=R3(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};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=B5.has(z3(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}}}},Wse=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=R3(e,t),c=await i.detectOverflow(t,s),l=z3(n),u=B3(n),d=U3(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=M3(p-c[m],g),y=M3(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*N3(c.left,c.right):S=p-2*N3(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function V5(e){let t=T4(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=f4(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=P3(n)!==a||P3(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function H5(e){return d4(e)?e:e.contextElement}function U5(e){let t=H5(e);if(!f4(t))return I3(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=V5(t),o=(a?P3(n.width):n.width)/r,s=(a?P3(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Gse=I3(0);function W5(e){let t=c4(e);return!C4()||!t.visualViewport?Gse:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Kse(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===c4(e)}function G5(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=H5(e),o=I3(1);t&&(r?d4(r)&&(o=U5(r)):o=U5(e));let s=Kse(a,n,r)?W5(a):I3(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=c4(a),t=d4(r)?c4(r):r,n=e,i=A4(n);for(;i&&t!==n;){let e=U5(i),t=i.getBoundingClientRect(),r=T4(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=c4(i),i=A4(n)}}return X3({width:u,height:d,x:c,y:l})}function K5(e,t){let n=E4(e).scrollLeft;return t?t.left+n:G5(l4(e)).left+n}function q5(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-K5(e,n),y:n.top+t.scrollTop}}function qse(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=l4(r),s=t?g4(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=I3(1),u=I3(0),d=f4(r);if((d||!a)&&((s4(r)!==`body`||m4(o))&&(c=E4(r)),d)){let e=G5(r);l=U5(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?q5(o,c):I3(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 Jse(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Yse(e){let t=E4(e),n=e.ownerDocument.body,r=N3(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=N3(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+K5(e),o=-t.scrollTop;return T4(n).direction===`rtl`&&(a+=N3(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Xse=25;function Zse(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=c4(e),a=l4(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!C4()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(K5(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Xse&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Qse(e,t){let n=G5(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=U5(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function J5(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Zse(e,n,t);else if(t===`document`)r=Yse(l4(e));else if(d4(t))r=Qse(t,n);else{let n=W5(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return X3(r)}function $se(e,t){let n=t.get(e);if(n)return n;let r=k4(e,[],!1).filter(e=>d4(e)&&s4(e)!==`body`),i=null,a=T4(e).position===`fixed`,o=a?D4(e):e;for(;d4(o)&&!w4(o);){let e=T4(o),t=x4(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=D4(o)}return t.set(e,r),r}function ece(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?g4(t)?[]:$se(t,this._c):[].concat(n),r],o=J5(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=J5(t,a[e],i);s=N3(n.top,s),c=M3(n.right,c),l=M3(n.bottom,l),u=N3(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function tce(e){let{width:t,height:n}=V5(e);return{width:t,height:n}}function nce(e,t,n){let r=f4(t),i=l4(t),a=n===`fixed`,o=G5(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=I3(0);if((r||!a)&&((s4(t)!==`body`||m4(i))&&(s=E4(t)),r)){let e=G5(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=K5(i));let l=i&&!r&&!a?q5(i,s):I3(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Y5(e){return T4(e).position===`static`}function X5(e,t){if(!f4(e)||T4(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return l4(e)===n&&(n=n.ownerDocument.body),n}function Z5(e,t){let n=c4(e);if(g4(e))return n;if(!f4(e)){let t=D4(e);for(;t&&!w4(t);){if(d4(t)&&!Y5(t))return t;t=D4(t)}return n}let r=X5(e,t);for(;r&&h4(r)&&Y5(r);)r=X5(r,t);return r&&w4(r)&&Y5(r)&&!x4(r)?n:r||S4(e)||n}var rce=async function(e){let t=this.getOffsetParent||Z5,n=this.getDimensions,r=await n(e.floating);return{reference:nce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ice(e){return T4(e).direction===`rtl`}var ace={convertOffsetParentRelativeRectToViewportRelativeRect:qse,getDocumentElement:l4,getClippingRect:ece,getOffsetParent:Z5,getElementRects:rce,getClientRects:Jse,getDimensions:tce,getScale:U5,isElement:d4,isRTL:ice};function Q5(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function oce(e,t,n){let r=null,i,a=l4(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=F3(d),h=F3(a.clientWidth-(u+f)),g=F3(a.clientHeight-(d+p)),_=F3(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:N3(0,M3(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Q5(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=c4(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function $5(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=H5(e),u=i||a?[...l?k4(l):[],...t?k4(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?oce(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?G5(e):null;c&&g();function g(){let t=G5(e);h&&!Q5(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 sce=Vse,cce=Hse,lce=zse,uce=Wse,dce=Use,fce=(e,t,n)=>{let r=new Map,i=n??{},a={...ace,...i.platform,_c:r};return Rse(e,t,{...i,platform:a})},e7=typeof document<`u`?K.useLayoutEffect:function(){};function t7(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(!t7(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)&&!t7(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function n7(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function r7(e,t){let n=n7(e);return Math.round(t*n)/n}function i7(e){let t=K.useRef(e);return e7(()=>{t.current=e}),t}function pce(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]=K.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=K.useState(r);t7(f,r)||p(r);let[m,h]=K.useState(null),[g,_]=K.useState(null),v=K.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=K.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=K.useRef(null),C=K.useRef(null),w=K.useRef(u),T=c!=null,E=i7(c),D=i7(i),O=i7(l),k=K.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),fce(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!t7(w.current,t)&&(w.current=t,V8.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);e7(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=K.useRef(!1);e7(()=>(A.current=!0,()=>{A.current=!1}),[]),e7(()=>{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=K.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=K.useMemo(()=>({reference:b,floating:x}),[b,x]),N=K.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=r7(M.floating,u.x),r=r7(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...n7(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return K.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var mce=(e,t)=>{let n=sce(e);return{name:n.name,fn:n.fn,options:[e,t]}},hce=(e,t)=>{let n=cce(e);return{name:n.name,fn:n.fn,options:[e,t]}},gce=(e,t)=>({fn:dce(e).fn,options:[e,t]}),_ce=(e,t)=>{let n=lce(e);return{name:n.name,fn:n.fn,options:[e,t]}},vce=(e,t)=>{let n=uce(e);return{name:n.name,fn:n.fn,options:[e,t]}},a7=K.createContext(void 0);function o7(e){let t=K.useContext(a7);if(t===void 0&&!e)throw Error(s2(47));return t}var yce={...O5,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!O5.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&O5.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>O5.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},bce=class extends S5{constructor(e,t,n){let r=new y5;super(xce(e,r,t,n),Sce(r),yce)}setOpen=(e,t)=>{let n=t.reason===g8,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=bse(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=p5(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),V8.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function xce(e,t,n,r=!1){let i={...C5(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function Sce(e){return{popupRef:K.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:K.createRef(),beforeTriggerFocusGuardRef:K.createRef(),beforeContentFocusGuardRef:K.createRef(),stickIfOpenTimeout:new i2,stickIfOpen:!0,triggerElements:e}}var s7=l8(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=wce(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),v5(u,d),h5(u);let{forceUnmount:m}=g5(d,u,()=>{u.context.stickIfOpen=!0,u.set(`openChangeReason`,null)});u.useSyncedValues({modal:o}),K.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),K.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,m8(v8))}),[m,u]);let h=d||f||s!=null;return(0,X.jsxs)(a7.Provider,{value:u,children:[s&&(0,X.jsx)(d5,{handle:s,store:u}),h&&(0,X.jsx)(Tce,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function Cce(e){return o7(!0)?(0,X.jsx)(s7,{props:e}):(0,X.jsx)(lse,{children:(0,X.jsx)(s7,{props:e})})}function wce(e,t){let n=u5((e,n)=>new bce(t,e,n));return K.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function Tce({store:e,modal:t}){let n=i5(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return _5(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var Ece=K.createContext(void 0);function Dce(e=!1){let t=K.useContext(Ece);if(t===void 0&&!e)throw Error(s2(16));return t}function Oce(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:K.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 c7(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(c4(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function l7(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=K.useRef(null),s=Dce(!0),c=a??s!==void 0,{props:l}=Oce({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=K.useCallback(()=>{let e=o.current;u7(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return y6(u,[u]),{getButtonProps:K.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return C2({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(N2(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=u7(r),s=!i&&kce(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),c7(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),c7(r,e)))},onKeyUp(e){if(!t){if(N2(e),a?.(e),e.target===e.currentTarget&&i&&c&&u7(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),c7(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:X0(e=>{o.current=e,u()})}}function u7(e){return f4(e)&&e.tagName===`BUTTON`}function kce(e){return f4(e)&&e.tagName===`A`&&!!e.href}function Ace(e,t){function n(n,r,i){let a=n.currentTarget;V8.flushSync(()=>{e.setOpen(!1,m8(_8,n.nativeEvent,a))}),Iae(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&m6(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function jce(e){let t=K.useRef(``),n=K.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:K.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 d7(e,t){let{onClick:n,onPointerDown:r}=jce(X0((n,r)=>{(typeof e==`function`?e():e)||t(r||(L4?`touch`:``))}));return K.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}var Mce=u8(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=o7(!0),h=k5(s)??m;if(!h)throw Error(s2(74));let g=Z2(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=K.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=m5(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`isPressOpenedByTrigger`,g),T=h.useState(`isTouchPressOpen`,l),E=h.useState(`hasTriggerFocusGuards`,g),D=Mse(v,{enabled:!a&&l&&!T,mouseOnly:!0,move:!1,handleClose:Fse(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),O=r5(v,{stickIfOpen:X0(()=>h.context.stickIfOpen)}),k=d7(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),A=h.useState(`triggerProps`,C),{getButtonProps:j,buttonRef:M}=l7({disabled:a,native:o}),N={open(e){return w?p3.open(e):f3.open(e)}},{handlePreFocusGuardFocus:P,handleFocusTargetFocus:F}=Ace(h,x),I=I2(`button`,e,{state:{disabled:a,open:y},ref:[M,t,S,x],props:[O.reference,D,A,k,{[B8]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,j],stateAttributesMapping:N}),L=(0,X.jsx)(K.Fragment,{children:I},g);return E?(0,X.jsxs)(K.Fragment,{children:[(0,X.jsx)(E8,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:P}),L,(0,X.jsx)(E8,{ref:h.context.triggerFocusTargetRef,onFocus:F})]}):L}),f7=K.createContext(void 0);function Nce(){let e=K.useContext(f7);if(e===void 0)throw Error(s2(45));return e}var Pce=K.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return o7().useState(`mounted`)||n?(0,X.jsx)(f7.Provider,{value:n,children:(0,X.jsx)(W8,{ref:t,...r})}):null});function p7(e){return g2(19)?e:e?`true`:void 0}var m7=K.createContext(void 0);function Fce(){let e=K.useContext(m7);if(!e)throw Error(s2(46));return e}function Ice(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=K.useState(null),d=K.useRef(null),f=Y8(n),p=K.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=pce({...e,elements:{...p,...l&&{reference:l}}}),h=K.useCallback(e=>{let t=d4(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=K.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=K.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=K.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return y6(()=>{o&&(d.current=o)},[o]),y6(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),K.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var Lce=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}=R3(e,t)||{};if(l==null)return{};let d=Y3(u),f={x:n,y:r},p=W3(i),m=H3(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=L3(D,k,O),j=!c.arrow&&B3(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Rce=(e,t)=>{let{name:n,fn:r}=Lce(e);return{name:n,fn:r,options:[e,t]}},zce={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,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Bce={sideX:`left`,sideY:`top`},Vce=`--available-width`,Hce=`--available-height`,Uce=`--anchor-width`,Wce=`--anchor-height`,Gce=`--transform-origin`,h7=Vce,g7=Hce;function _7(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 v7(e,t,n){let{rects:r,placement:i}=e;return{side:_7(t,z3(i),n),align:B3(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Kce(e){return qce(e,Ice)}function qce(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,C=_.side||`flip`,w=_.align||`flip`,T=_.fallbackAxisSide||`end`,E=v?.crossAxis??!1,D=v?.rootBoundary,O=typeof n==`function`?n:void 0,k=X0(O),A=O?k:n,j=b8(n),M=b8(g),N=S6()===`rtl`,[P,F]=K.useState(null);!g&&P!==null&&F(null);let I=x===`placement`,L=P?z3(P):null,R=P&&I?B3(P)||`center`:null,z=L||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":N?`left`:`right`,"inline-start":N?`right`:`left`}[i],ee=R||o,te=ee===`center`?z:`${z}-${ee}`,B=l;typeof B==`number`?B={top:B,right:B,bottom:B,left:B}:B&&={top:B.top||0,right:B.right||0,bottom:B.bottom||0,left:B.left||0};let ne=+(i===`bottom`),re=+(i===`top`),V=+(i===`right`),ie=+(i===`left`),ae={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:B},oe=K.useRef(null),H=b8(a),se=b8(s),ce=typeof a==`function`?0:a,le=typeof s==`function`?0:s,U=[];p&&U.push(p),U.push(mce(e=>{let t=v7(e,i,N),n=typeof H.current==`function`?H.current(t):H.current,r=typeof se.current==`function`?se.current(t):se.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ce,le,N,i]));let ue=w===`none`&&C!==`shift`,de=!ue&&(u||E||C===`shift`),fe=C===`none`?null:_ce({...ae,padding:{top:B.top+1+ne,right:B.right+1+ie,bottom:B.bottom+1+re,left:B.left+1+V},mainAxis:!E&&C===`flip`,crossAxis:w===`flip`&&`alignment`,fallbackAxisSideDirection:T}),pe=ue?null:hce({...ae,rootBoundary:D,mainAxis:w!==`none`,crossAxis:de,limiter:u||E?void 0:gce(e=>{if(!oe.current)return{};let{width:t,height:n}=oe.current.getBoundingClientRect(),r=U3(z3(e.placement)),i=r===`y`?t:n,a=r===`y`?B.left+B.right:B.top+B.bottom;return{offset:i/2+a/2}})},[ae,u,E,D,B,w]);C===`shift`||w===`shift`||ee===`center`?U.push(pe,fe):U.push(fe,pe),U.push(vce({...ae,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!M.current)return;let i=e.style;i.setProperty(h7,`${t}px`),i.setProperty(g7,`${n}px`);let a=c4(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(Uce,`${u}px`),i.setProperty(Wce,`${d}px`)}}),Rce(e=>({element:oe.current||Q3(e.elements.floating).createElement(`div`),padding:oe.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=z3(r),u=B3(r),d=U3(l)===`y`,f=oe.current,p=typeof a==`function`?a(v7(e,i,N)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return de&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Gce,d?`${m} ${h}`:`${h} ${m}`),{}}},zce,b),y6(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let me=K.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:he,elements:ge,x:_e,y:ve,middlewareData:ye,update:be,placement:xe,context:Se,isPositioned:Ce,floatingStyles:we}=t({rootContext:h,open:m?g:void 0,placement:te,middleware:U,strategy:r,whileElementsMounted:m?void 0:(...e)=>$5(...e,me),nodeId:y,externalTree:S}),{sideX:Te,sideY:Ee}=ye.adaptiveOrigin||Bce,De=Ce?r:`fixed`,Oe=K.useMemo(()=>{let e;return e=Ce?b?{position:De,[Te]:_e,[Ee]:ve}:{...we,position:De}:{position:De,top:0,left:0},e[h7]=`100vw`,e[g7]=`100vh`,Ce||(e.opacity=0),e},[b,De,Te,_e,Ee,ve,we,Ce]),ke=K.useRef(null);y6(()=>{if(!g)return;let e=j.current,t=typeof e==`function`?e():e,n=(y7(t)?t.current:t)||null;n!==ke.current&&(he.setPositionReference(n),ke.current=n)},[g,he,A,j]),K.useEffect(()=>{if(!g)return;let e=j.current;typeof e!=`function`&&y7(e)&&e.current!==ke.current&&(he.setPositionReference(e.current),ke.current=e.current)},[g,he,A,j]),K.useEffect(()=>{if(m&&g&&ge.reference&&ge.floating)return $5(ge.reference,ge.floating,be,me)},[m,g,ge,be,me]);let Ae=z3(xe),je=_7(i,Ae,N),Me=B3(xe)||`center`,Ne=!!ye.hide?.referenceHidden;y6(()=>{x&&g&&Ce&&(Ae!==z||I&&Me!==ee)&&F(xe)},[x,I,g,Ce,xe,Ae,Me,z,ee]);let Pe=K.useMemo(()=>({position:`absolute`,top:ye.arrow?.y,left:ye.arrow?.x}),[ye.arrow]),Fe=ye.arrow?.centerOffset!==0;return K.useMemo(()=>({positionerStyles:Oe,arrowStyles:Pe,arrowRef:oe,arrowUncentered:Fe,side:je,align:Me,physicalSide:Ae,anchorHidden:Ne,refs:he,context:Se,isPositioned:Ce,update:be}),[Oe,Pe,oe,Fe,je,Me,Ae,Ne,he,Se,Ce,be])}function y7(e){return e!=null&&`current`in e}var b7=K.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,X.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function Jce(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=K.useRef(null),o=K.useRef(null),s=o5(r);y6(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),y6(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}function x7(e){return e===`starting`?tse:t2}function Yce(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),I2(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},x7(r),i],stateAttributesMapping:m3})}var S7={},C7={},w7=``;function T7(e,t){return m4(e)?e:t}function E7(e,t,n){return/hidden|clip/.test(e.getComputedStyle(T7(t,n)).overflowY)}function Xce(e){if(typeof document>`u`)return!1;let t=Q3(e);return c4(t).innerWidth-t.documentElement.clientWidth>0}function Zce(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Q3(e),n=t.documentElement,r=t.body,i=T7(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Qce(e){let t=Q3(e),n=t.documentElement,r=t.body,i=T7(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function $ce(e){let t=Q3(e),n=t.documentElement,r=t.body,i=c4(n),a=0,o=0,s=!1,c=C8.create();if(H4&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,S7={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},w7=n.style.scrollBehavior,C7={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 u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=T7(n,r);if(s=Zce(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`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,S7),Object.assign(r.style,C7),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=w7)}function d(){u(),c.request(l)}l();let f=j6(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var ele=new class{lockCount=0;restore=null;timeoutLock=i2.create();timeoutUnlock=i2.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=Q3(e),n=t.documentElement,r=t.body,i=c4(n);if(E7(i,n,r)){let t=new i.MutationObserver(()=>{E7(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=L4||!Xce(e);this.restore=a?Qce(e):$ce(e)}};function D7(e=!0,t=null){y6(()=>{if(e)return ele.acquire(t)},[e,t])}var tle=20;function nle(e,t,n,r){let[i,a]=K.useState(!1);y6(()=>{if(!e||!t||n==null){a(!1);return}let r=Q3(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-tle)},[e,t,n]),D7(e&&(!t||i),r)}var rle=K.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=nse,..._}=e,v=o7(),y=Nce(),b=sse(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=Kce({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:v.useState(`adaptiveOrigin`)});Jce({store:v,domReference:x.useState(`domReferenceElement`),positionerElement:O,open:C});let M=E===!0&&w!==`trigger-hover`;nle(C&&M,D===`touch`,O,T);let N=v.useStateSetter(`positionerElement`),P=Yce(e,{open:C,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:k},{styles:j.positionerStyles,transitionStatus:A,props:_,refs:[t,N],hidden:!S,inert:!C});return(0,X.jsxs)(m7.Provider,{value:j,children:[S&&M&&(0,X.jsx)(b7,{inert:p7(!C),cutout:T}),(0,X.jsx)(cse,{id:b,children:P})]})}),O7=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),ile=K.createContext(void 0);function ale(e){let t=K.useContext(ile);if(t===void 0&&!e)throw Error(s2(69));return t}var ole=K.createContext(void 0);function sle(){let[e,t]=K.useState(0),n=X0(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:K.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var cle=K.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=o7(),l=Fce(),u=ale(!0)!=null,{context:d,hasClosePart:f}=sle(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);s5({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),Ase(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?l5(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=I2(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...c5,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&O7.has(e.key)&&e.stopPropagation()}},x7(g),s],stateAttributesMapping:h3});return(0,X.jsx)(n5,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:f4(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,X.jsx)(ole.Provider,{value:d,children:M})})}),k7=`data-glide-stand-in`;function A7(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return{x:r.left-n.left+e.scrollLeft-e.clientLeft,y:r.top-n.top+e.scrollTop-e.clientTop,width:r.width,height:r.height}}function j7(e){return{transform:`translate(${String(e.x)}px, ${String(e.y)}px)`,width:`${String(e.width)}px`,height:`${String(e.height)}px`}}function lle(e){let t=(0,K.useRef)(null);return(0,K.useCallback)(n=>{t.current?.(),t.current=n?ule(n,e):null},[e])}function ule(e,t){if(!pI(e))return()=>void 0;let n=e.ownerDocument,r=e.querySelector(t),i=r?A7(e,r):null,a=null,o=null,s=new Set,c=()=>{for(let e of s)e.removeAttribute(k7);s.clear(),a&&(a.hidden=!0),o=null},l=()=>{if(a)return a;let t=n.createElement(`span`);return t.className=`caps-glide`,t.setAttribute(`aria-hidden`,`true`),e.prepend(t),e.classList.add(`caps-glide-host`),getComputedStyle(e).position===`static`&&e.classList.add(`caps-glide-anchor`),a=t,t},u=(t,n)=>{let r=lI(e),u=A7(e,t),d=o&&a?A7(e,a):i;if(i=u,o?.cancel(),c(),r.reduced||d===null||Math.abs(d.y-u.y)<1&&Math.abs(d.x-u.x)<1)return;t.setAttribute(k7,`measure`);let f=getComputedStyle(t),p=f.backgroundColor,m=f.borderRadius;for(let e of[t,n])e&&(e.setAttribute(k7,``),s.add(e));let h=l();h.hidden=!1,h.style.backgroundColor=p,h.style.borderRadius=m;let g=h.animate([j7(d),j7(u)],{duration:r.normal,easing:fI(r,r.ease),fill:`forwards`});o=g,g.addEventListener(`finish`,()=>{o===g&&c()})},d=()=>{let n=e.querySelector(t);if(n===r)return;let i=r;r=n,n&&u(n,i)},f=new MutationObserver(d);return f.observe(e,{subtree:!0,attributes:!0,attributeFilter:[`data-highlighted`,`data-active`,`data-navigation`,`aria-selected`]}),e.addEventListener(`pointerover`,d),e.addEventListener(`pointerout`,d),()=>{f.disconnect(),e.removeEventListener(`pointerover`,d),e.removeEventListener(`pointerout`,d),o?.cancel(),c(),a?.remove()}}var dle=(0,K.createContext)(void 0),fle=(0,K.createContext)(null);function M7(e){let t=(0,K.useContext)(fle);return t===null?Object.hasOwn(globalThis,`document`)?document.body:null:t[e]}function ple(e){let t=(0,K.useContext)(dle),n=(0,K.useRef)(e);n.current=e,(0,K.useEffect)(()=>t?.(()=>{n.current()}),[t])}function mle({getKey:e,isDisabled:t=()=>!1,items:n}){let r=(0,K.useMemo)(()=>{let r=n.map(e);if(r.some(e=>!e))throw Error(`Selectable items require non-empty keys`);if(new Set(r).size!==r.length)throw Error(`Selectable items require unique keys`);return n.filter(e=>!t(e))},[e,t,n]),[i,a]=(0,K.useState)(null);(0,K.useEffect)(()=>{i!==null&&!r.some(t=>e(t)===i)&&a(null)},[i,r,e]);let o=r.find(t=>e(t)===i),s=o?r.findIndex(t=>e(t)===i):-1;return{activeIndex:s,activeItem:o,activeKey:i,enabledItems:r,move:(t,n)=>{if(r.length===0)return;let i=n?n===`start`?0:r.length-1:s<0?t>0?0:r.length-1:(s+t+r.length)%r.length,o=r[i];o&&a(e(o))},setActiveKey:a}}var hle=(0,K.forwardRef)(function({children:e,className:t,type:n=`button`,...r},i){return(0,X.jsxs)(`button`,{...r,ref:i,type:n,className:Z(`select caps-select caps-combobox-trigger w-full`,t),children:[(0,X.jsx)(`span`,{children:e}),(0,X.jsx)(Qz,{className:`caps-select-chevron`,"aria-hidden":`true`})]})});function gle({defaultOpen:e,defaultValue:t,getKey:n,getSearchText:r,groupBy:i,id:a,isDisabled:o,items:s,onOpenChange:c,onCommit:l,multiple:u,controlledOpen:d,controlledKeys:f,trigger:p}){let m=`${a}-listbox`,[h,g]=(0,K.useState)(``),[_,v]=(0,K.useState)(!1),[y,b]=(0,K.useState)(t),[x,S]=(0,K.useState)(e),C=f??(y===null?[]:[y]),w=p?d??x:!0,T=(0,K.useMemo)(()=>{let e=h.trim().toLowerCase();return e?s.filter(t=>r(t).toLowerCase().includes(e)):s},[r,s,h]),E=mle({getKey:n,isDisabled:o,items:T});(0,K.useEffect)(()=>{if(E.activeKey!==null)return;let e=E.enabledItems.find(e=>C.includes(n(e)))??E.enabledItems[0];e&&E.setActiveKey(n(e))},[E.activeKey,E.enabledItems,E.setActiveKey,n,C]);let D=e=>{v(!1),e||g(``),d===void 0&&S(e),c?.(e)},O=e=>`${m}-option-${encodeURIComponent(e)}`,k=e=>{let t=n(e);f===void 0&&b(t),l(e),p&&!u&&D(!1)},A=e=>{v(!0),g(e.target.value),E.setActiveKey(null)},j=e=>{if(o8(e))return;let t;switch(e.key){case`ArrowDown`:t=[1,void 0];break;case`ArrowUp`:t=[-1,void 0];break;case`End`:t=[1,`end`];break;case`Home`:t=[-1,`start`]}t?(v(!0),e.preventDefault(),E.move(t[0],t[1])):e.key===`Enter`&&E.activeItem&&(e.preventDefault(),k(E.activeItem))},M=(0,K.useMemo)(()=>{if(!i)return[{label:``,items:T}];let e=new Map;for(let t of T){let n=i(t),r=e.get(n);r?r.push(t):e.set(n,[t])}return[...e].map(([e,t])=>({label:e,items:t}))},[T,i]);return{keyboardNavigation:_,onPointerMove:()=>{v(!1)},activeKey:E.activeKey,activeItem:E.activeItem,groups:M,inputValue:h,listboxId:m,onInputChange:A,onInputKeyDown:j,optionId:O,open:w,commit:k,selectedKeys:C,setOpen:D}}function _le(e){let{"aria-describedby":t,"aria-invalid":n,"aria-label":r,"aria-labelledby":i,"aria-required":a,activeTone:o=`neutral`,container:s,contentClassName:c,defaultOpen:l=!1,defaultValue:u=null,emptyMessage:d=`No matches`,getKey:f,getLabel:p,getSearchText:m=p,groupBy:h,id:g,inputProps:_,inputRef:v,isDisabled:y=()=>!1,items:b,onOpenChange:x,onValueChange:S,multiple:C,open:w,placeholder:T=`Search…`,renderItem:E,rootRef:D,trigger:O,triggerRef:k,value:A,...j}=e,M=e=>{let t=f(e);if(C){let e=A.includes(t)?A.filter(e=>e!==t):[...A,t];S?.(e,b.filter(t=>e.includes(f(t))))}else S?.(t,e)},N;C?N=A:A!==void 0&&(N=A===null?[]:[A]);let P=(0,K.useId)(),F=O?.props??_,I=g??F?.id??P,L={id:I,"aria-describedby":[t,F?.[`aria-describedby`]].filter(Boolean).join(` `)||void 0,"aria-invalid":n??F?.[`aria-invalid`],"aria-label":F?.[`aria-label`]??r,"aria-labelledby":F?.[`aria-labelledby`]??i,"aria-required":a??F?.[`aria-required`]},{keyboardNavigation:R,onPointerMove:z,activeItem:ee,activeKey:te,commit:B,groups:ne,inputValue:re,listboxId:V,onInputChange:ie,onInputKeyDown:ae,open:oe,optionId:H,selectedKeys:se,setOpen:ce}=gle({defaultOpen:l,defaultValue:u,getKey:f,getSearchText:m,groupBy:h,id:I,isDisabled:y,items:b,onOpenChange:x,onCommit:M,multiple:C??!1,controlledOpen:w,controlledKeys:N,trigger:O});ple(()=>{O&&ce(!1)});let le=M7(`popover`),U=s===void 0?le:s,ue=lle(`.caps-combobox-option[data-active="true"]:not(:disabled), [data-navigation="pointer"] .caps-combobox-option:hover:not(:disabled)`),de=(0,X.jsx)(I6,{..._,...O?{}:L,"aria-activedescendant":ee?H(f(ee)):void 0,"aria-autocomplete":`list`,"aria-controls":V,"aria-expanded":!0,className:Z(`input-sm`,_?.className),id:O?_?.id??`${I}-input`:I,onChange:e=>{_?.onChange?.(e),ie(e)},onKeyDown:e=>{_?.onKeyDown?.(e),e.defaultPrevented||ae(e)},placeholder:_?.placeholder??T,ref:v,role:`combobox`,value:re}),fe=(0,X.jsx)(`div`,{id:V,ref:ue,className:`caps-combobox-list`,"data-navigation":R?`keyboard`:`pointer`,onPointerMove:z,role:`listbox`,"aria-multiselectable":C??void 0,children:ne.every(e=>e.items.length===0)?(0,X.jsx)(`div`,{className:`px-md py-md text-sm text-base-content`,children:d}):ne.map(e=>(0,X.jsxs)(`div`,{"aria-label":e.label||void 0,role:e.label?`group`:void 0,children:[e.label?(0,X.jsx)(`div`,{className:`px-md pb-xs pt-sm text-xs text-base-content uppercase tracking-wider`,children:e.label}):null,e.items.map(e=>{let t=f(e),n=y(e),r=te===t,i={active:r,disabled:n,selected:se.includes(t)};return(0,X.jsxs)(`button`,{"aria-disabled":n||void 0,"aria-selected":i.selected,className:`caps-combobox-option`,"data-active":r&&R,disabled:n,id:H(t),onClick:()=>{B(e)},onMouseDown:e=>{e.preventDefault()},role:`option`,tabIndex:-1,type:`button`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`caps-combobox-check`,children:i.selected?(0,X.jsx)(Zz,{}):null}),E?.(e,r,i)??p(e)]},t)})]},e.label))});return O?(0,X.jsx)(`div`,{...j,className:Z(j.className),ref:D,children:(0,X.jsxs)(Cce,{modal:!0,onOpenChange:ce,open:oe,children:[(0,X.jsx)(Mce,{...L,"aria-haspopup":`dialog`,className:`btn`,ref:k,render:O}),U===null?null:(0,X.jsx)(Pce,{container:U,children:(0,X.jsx)(rle,{align:`start`,side:`bottom`,sideOffset:4,children:(0,X.jsxs)(cle,{"data-active-tone":o,className:Z(`min-w-40 rounded-box border border-base-300 bg-base-100 p-xs shadow-lg outline-none caps-combobox-panel caps-combobox-popup`,c),children:[(0,X.jsx)(`div`,{className:`caps-combobox-search`,children:de}),fe]})})})]})}):(0,X.jsx)(`div`,{...j,className:Z(j.className),ref:D,children:(0,X.jsxs)(`div`,{className:Z(`caps-combobox-panel`,c),"data-active-tone":o,children:[(0,X.jsx)(`div`,{className:`caps-combobox-search`,children:de}),fe]})})}function N7({icon:e,caption:t}){return(0,X.jsxs)(`span`,{className:`caps-icon-choice-mark`,"aria-hidden":`true`,children:[(0,X.jsx)(`span`,{className:`caps-icon-choice-art`,children:e}),t?(0,X.jsx)(`span`,{className:`caps-icon-choice-caption`,children:t}):null,(0,X.jsx)(`span`,{className:`caps-icon-choice-lamp`})]})}var vle=(0,K.forwardRef)(function({label:e,icon:t,caption:n,appearance:r,className:i,...a},o){return(0,X.jsx)(`label`,{className:`caps-icon-choice`,"data-appearance":r===`compact`?r:void 0,children:(0,X.jsx)(a8,{...a,appearance:r??`default`,"aria-label":e,className:Z(`caps-icon-choice-input`,i),indicator:(0,X.jsx)(N7,{icon:t,caption:n}),ref:o})})});function yle({checked:e}){let t=`caps-radio-${(0,K.useId)().replaceAll(`:`,``)}`,n=(0,K.useRef)(null),r=(0,K.useRef)(e).current,i=(0,K.useRef)(e),a=(0,K.useRef)(null),o=uI(a),{reduced:s}=o;return(0,K.useLayoutEffect)(()=>{if(!n.current)return;let t=s||i.current===e;i.current=e;let r=e?4:0,a=F6(o,{ease:`outCubic`,duration:75}),c=e?P6(o,{bounce:.65,duration:300}):F6(o,{ease:`inCubic`,duration:100}),l=FR(n.current,t?{rx:r,ry:r,cy:6,duration:0}:{rx:[{to:e?3.5:4.15,...a},{to:r,...c}],ry:[{to:e?4.5:3.85,...a},{to:r,...c}],cy:[{to:e?5.85:6.1,...a},{to:6,...c}]});return()=>{l.cancel()}},[e,s,o]),(0,X.jsxs)(`svg`,{ref:a,className:`caps-radio-visual`,width:`24`,height:`24`,viewBox:`0 0 12 12`,"aria-hidden":`true`,focusable:`false`,children:[(0,X.jsxs)(`defs`,{children:[(0,X.jsx)(VR,{id:`${t}-surface`,transform:`matrix(1 0 0 1 6 6)`}),(0,X.jsx)(HR,{id:`${t}-shadow`}),(0,X.jsx)(UR,{id:`${t}-inset`}),(0,X.jsx)(`clipPath`,{id:`${t}-well`,children:(0,X.jsx)(`circle`,{cx:`6`,cy:`6`,r:`5`})})]}),(0,X.jsx)(`circle`,{className:`caps-radio-track`,cx:`6`,cy:`6`,r:`5.5`,filter:`url(#${t}-inset)`}),(0,X.jsx)(`g`,{clipPath:`url(#${t}-well)`,children:(0,X.jsx)(`ellipse`,{ref:n,cx:`6`,cy:`6`,rx:r?4:0,ry:r?4:0,fill:`url(#${t}-surface)`,filter:`url(#${t}-shadow)`})})]})}var P7=(0,K.createContext)(null),ble=(0,K.forwardRef)(function({children:e,className:t,defaultValue:n,disabled:r=!1,name:i,onValueChange:a,orientation:o=`vertical`,value:s,...c},l){let u=(0,K.useId)(),d=(0,K.useRef)(null);(0,K.useImperativeHandle)(l,()=>{if(!d.current)throw Error(`RadioGroup is not mounted`);return d.current},[]);let f=i??`radio-group-${u}`,[p,m]=(0,K.useState)(n),h=s??p;return(0,K.useEffect)(()=>{let e=d.current?.form;if(!e||s!==void 0)return;let t=e=>{queueMicrotask(()=>{e.defaultPrevented||m(n)})};return e.addEventListener(`reset`,t),()=>{e.removeEventListener(`reset`,t)}},[s,n,c.form]),(0,X.jsx)(P7.Provider,{value:{disabled:r,name:f,onValueChange:e=>{s===void 0&&m(e),a?.(e)},value:h},children:(0,X.jsx)(`fieldset`,{...c,className:Z(`flex gap-md`,o===`horizontal`?`flex-row flex-wrap`:`flex-col`,t),disabled:r,role:c.role??`radiogroup`,ref:d,children:e})})}),F7=(0,K.forwardRef)(function({className:e,indicator:t,onChange:n,onClick:r,value:i,...a},o){let s=(0,K.useContext)(P7);if(!s)throw Error(`RadioGroupItem must be used inside <RadioGroup>`);let c=s.value===i,l=e=>{n?.(e),e.target.checked&&s.onValueChange?.(i)};return(0,X.jsxs)(`span`,{className:`caps-radio`,"data-checked":c,"data-custom-indicator":t!==void 0||void 0,children:[(0,X.jsx)(`input`,{...a,"aria-checked":c,checked:c,className:Z(`caps-radio-input`,e),disabled:s.disabled||a.disabled,name:s.name,onChange:l,onClick:r,ref:o,type:`radio`,value:i}),t===void 0?(0,X.jsx)(yle,{checked:c}):t]})}),xle=(0,K.forwardRef)(function({description:e,id:t,meta:n,title:r,...i},a){let o=(0,K.useContext)(P7),s=(0,K.useId)(),c=t??s,l=o?.value===i.value,u=o?.disabled===!0||i.disabled===!0;return(0,X.jsxs)(`label`,{className:`caps-choice-card`,"data-checked":l,"data-disabled":u||void 0,htmlFor:c,children:[(0,X.jsx)(F7,{...i,"aria-describedby":e?`${c}-description`:void 0,"aria-labelledby":`${c}-title`,id:c,ref:a}),(0,X.jsxs)(`span`,{className:`caps-choice-card-copy`,children:[(0,X.jsx)(`span`,{className:`caps-choice-card-title`,id:`${c}-title`,children:r}),e?(0,X.jsx)(`span`,{className:`caps-choice-card-description`,id:`${c}-description`,children:e}):null]}),n?(0,X.jsx)(`span`,{className:`caps-choice-card-meta`,children:n}):null]})}),Sle=(0,K.forwardRef)(function({label:e,icon:t,caption:n,className:r,...i},a){return(0,X.jsx)(`label`,{className:`caps-icon-choice`,children:(0,X.jsx)(F7,{...i,"aria-label":e,className:Z(`caps-icon-choice-input`,r),indicator:(0,X.jsx)(N7,{icon:t,caption:n}),ref:a})})}),I7=(0,K.forwardRef)(function({className:e,invalid:t,...n},r){return(0,X.jsx)(`textarea`,{...n,"aria-invalid":t?!0:n[`aria-invalid`]===!1?void 0:n[`aria-invalid`],className:Z(`textarea textarea-bordered w-full`,t&&`textarea-error`,e),ref:r})}),Cle=BC(XC),wle=BC(QC),Tle=BC(iw(dw)),Ele=BC(ew(XC)),L7=ew(sw(File)),Dle=BC(L7),R7=nw([XC,dw,QC,JC,YC,ew(XC),L7]),Ole=BC(R7),z7=e=>Om(Cle(e.state.value),()=>``),B7=e=>Om(wle(e.state.value),()=>!1),kle=e=>Om(Tle(e.state.value),()=>null),Ale=e=>Om(Ele(e.state.value),()=>[]),jle=e=>Om(Dle(e.state.value),()=>[]),Mle=e=>Om(Ole(e.state.value),()=>null);function Nle({field:e,spec:t,locked:n,...r}){let[i,a]=(0,K.useState)(!1);return(0,X.jsxs)(L6,{children:[(0,X.jsx)(I6,{...r,name:t.name,disabled:n,type:i?`text`:`password`,autoComplete:`off`,spellCheck:!1,className:`caps-field-secret`,placeholder:t.placeholder,readOnly:t.readOnly,value:z7(e),onBlur:e.handleBlur,onChange:t=>{e.handleChange(t.currentTarget.value)}}),(0,X.jsx)(rz,{type:`button`,variant:`outline`,size:`icon`,"aria-label":i?`Hide`:`Show`,"aria-pressed":i,disabled:n,onClick:()=>{a(e=>!e)},children:i?(0,X.jsx)(tB,{"aria-hidden":`true`}):(0,X.jsx)(nB,{"aria-hidden":`true`})})]})}var Ple={text:`text`,email:`email`,url:`url`,tel:`tel`};function Fle({spec:e,field:t,locked:n,...r}){let i=jle(t),a=n||e.readOnly===!0,o=(0,K.useRef)(null);return(0,X.jsxs)(`div`,{className:`flex flex-col gap-sm`,children:[(0,X.jsx)(gI,{asChild:!0,children:(0,X.jsx)(`input`,{...r,ref:o,type:`file`,tabIndex:-1,required:r.required===!0&&i.length===0,name:e.name,accept:e.accept,multiple:e.multiple,disabled:a,onBlur:t.handleBlur,onChange:e=>{t.handleChange(Array.from(e.currentTarget.files??[])),e.currentTarget.value=``}})}),(0,X.jsx)(rz,{type:`button`,variant:`outline`,"aria-label":`Choose files for ${e.label}`,"aria-describedby":r[`aria-describedby`],"aria-invalid":r[`aria-invalid`],disabled:a,onBlur:t.handleBlur,onClick:()=>{o.current?.click()},children:`Choose files`}),(0,X.jsx)(n8,{items:i.map((e,t)=>({id:String(t),name:e.name,preview:{kind:`file`},progress:0,progressLabel:`${String(e.size)} bytes`,statusLabel:`Selected`,actions:a?{}:{remove:{label:`Remove`,accessibleLabel:`Remove ${e.name}`}}})),onRemove:e=>{t.handleChange(i.filter((t,n)=>String(n)!==e))},onCancel:()=>void 0,onRetry:()=>void 0})]})}function Ile({spec:e,field:t,locked:n,...r}){let i=e=>{t.handleChange(e)},a={...r,name:e.name,disabled:n,onBlur:t.handleBlur};switch(e.kind){case`text`:case`email`:case`url`:case`tel`:return(0,X.jsx)(I6,{...a,type:Ple[e.kind],inputMode:e.kind===`text`?void 0:e.kind,autoComplete:e.autoComplete,placeholder:e.placeholder,maxLength:e.maxLength,readOnly:e.readOnly,value:z7(t),onChange:e=>{i(e.currentTarget.value)}});case`textarea`:return(0,X.jsx)(I7,{...a,rows:e.rows??3,placeholder:e.placeholder,maxLength:e.maxLength,readOnly:e.readOnly,value:z7(t),onChange:e=>{i(e.currentTarget.value)}});case`secret`:return(0,X.jsx)(Nle,{...r,field:t,spec:e,locked:n});case`money`:return(0,X.jsxs)(L6,{children:[(0,X.jsx)(R6,{className:`caps-field-currency`,children:e.currency??`USD`}),(0,X.jsx)(I6,{...a,inputMode:`decimal`,autoComplete:`off`,className:`caps-field-amount`,placeholder:e.placeholder??`0.00`,readOnly:e.readOnly,value:z7(t),onChange:e=>{i(e.currentTarget.value)}})]});case`date`:return(0,X.jsx)(I6,{...a,type:`date`,readOnly:e.readOnly,value:z7(t),onChange:e=>{i(e.currentTarget.value)}});case`number`:return(0,X.jsx)(yoe,{...a,...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max},...e.step===void 0?{}:{step:e.step},...e.unit===void 0?{}:{unit:e.unit},...e.wrap===void 0?{}:{wrap:e.wrap},disabled:n||e.readOnly===!0,decrementLabel:`Decrease ${e.label}`,incrementLabel:`Increase ${e.label}`,value:kle(t),onValueChange:e=>{t.handleChange(e)}});case`select`:return(0,X.jsxs)(W6,{...a,value:z7(t),onChange:e=>{i(e.currentTarget.value)},children:[e.placeholder===void 0?null:(0,X.jsx)(`option`,{value:``,disabled:!0,children:e.placeholder}),e.options.map(e=>(0,X.jsx)(`option`,{value:e.value,disabled:e.disabled,children:e.label},e.value))]});case`combobox`:return(0,X.jsx)(_le,{id:r.id??e.name,"aria-describedby":r[`aria-describedby`],"aria-invalid":r[`aria-invalid`],"aria-required":r[`aria-required`],items:e.options,getKey:e=>e.value,getLabel:e=>e.label,isDisabled:t=>t.disabled||n||e.readOnly===!0,value:z7(t),...e.placeholder===void 0?{}:{placeholder:e.placeholder},trigger:(0,X.jsx)(hle,{name:e.name,disabled:n||e.readOnly===!0,onBlur:t.handleBlur,children:e.options.find(e=>e.value===z7(t))?.label??e.placeholder??`Choose…`}),inputProps:{"aria-label":`Search ${e.label}`,disabled:n||e.readOnly===!0},onValueChange:e=>{i(e??``),t.handleBlur()}});case`file`:return(0,X.jsx)(Fle,{...r,spec:e,field:t,locked:n});case`checkbox`:return(0,X.jsx)(a8,{...a,disabled:n||e.readOnly===!0,checked:B7(t),onChange:e=>{t.handleChange(e.currentTarget.checked)}});case`switch`:return(0,X.jsx)(G6,{...a,disabled:n||e.readOnly===!0,checked:B7(t),onCheckedChange:e=>{t.handleChange(e)}});case`radio`:case`icon-radio`:case`checkboxes`:case`icon-checkboxes`:return null}}var Lle=new Set([`radio`,`icon-radio`,`checkboxes`,`icon-checkboxes`]);function Rle({spec:e,field:t,locked:n,error:r}){let i=n||e.readOnly===!0,a=e.label;if(e.kind===`checkboxes`||e.kind===`icon-checkboxes`){let n=Ale(t),o=(e,r)=>{t.handleChange(r?[...n,e]:n.filter(t=>t!==e))};return(0,X.jsx)(V6,{legend:a,description:e.help,disabled:i,error:r??null,children:e.kind===`icon-checkboxes`?(0,X.jsx)(`div`,{className:`caps-field-icon-choices`,children:e.options.map(r=>(0,X.jsx)(vle,{name:e.name,value:r.value,label:r.label,...r.caption===void 0?{}:{caption:r.caption},icon:r.icon,disabled:r.disabled,checked:n.includes(r.value),onBlur:t.handleBlur,onChange:e=>{o(r.value,e.currentTarget.checked)}},r.value))}):e.options.map(r=>(0,X.jsx)(H6,{label:r.label,description:r.description,orientation:`inline`,children:(0,X.jsx)(a8,{name:e.name,value:r.value,disabled:r.disabled,checked:n.includes(r.value),onBlur:t.handleBlur,onChange:e=>{o(r.value,e.currentTarget.checked)}})},r.value))})}let o=e.options.some(e=>e.description!==void 0||e.meta!==void 0);return(0,X.jsx)(V6,{legend:a,description:e.help,disabled:i,error:r??null,children:(0,X.jsx)(ble,{name:e.name,"aria-label":a,value:z7(t),onValueChange:e=>{t.handleChange(e),t.handleBlur()},orientation:e.kind===`icon-radio`||o?`horizontal`:`vertical`,children:e.options.map(t=>e.kind===`icon-radio`?(0,X.jsx)(Sle,{value:t.value,label:t.label,...t.caption===void 0?{}:{caption:t.caption},icon:t.icon,disabled:t.disabled},t.value):o?(0,X.jsx)(xle,{value:t.value,title:t.label,description:t.description,meta:t.meta,disabled:t.disabled},t.value):(0,X.jsx)(H6,{label:t.label,orientation:`inline`,children:(0,X.jsx)(F7,{value:t.value,disabled:t.disabled})},t.value))})})}function zle({spec:e,field:t,locked:n,error:r,render:i,...a}){return i({name:e.name,label:e.label,help:e.help,value:Mle(t),onChange:e=>{t.handleChange(e)},onBlur:t.handleBlur,error:r,disabled:n,id:a.id??e.name,"aria-describedby":a[`aria-describedby`],"aria-invalid":r!==void 0})}function Ble({form:e,spec:t,locked:n}){let r=I0({form:e,name:t.name}),i=P0(e.store,e=>e.submissionAttempts>0),a=r.state.meta.isBlurred||i?Aoe(r.state.meta):void 0;if(t.render===void 0&&Lle.has(t.kind))return(0,X.jsx)(Rle,{spec:t,field:r,locked:n,error:a});let o=t.kind===`checkbox`?`inline`:(t.layout??(t.kind===`switch`?`row`:`stacked`))===`row`?`horizontal`:`vertical`;return(0,X.jsx)(H6,{label:t.label,description:t.help,icon:t.icon,orientation:o,error:a,...t.required===void 0?{}:{required:t.required},...t.optional===void 0?{}:{optional:t.optional},children:t.render===void 0?(0,X.jsx)(Ile,{spec:t,field:r,locked:n}):(0,X.jsx)(zle,{spec:t,field:r,locked:n,error:a,render:t.render})})}var Vle=BC(Nte(XC,R7));function V7({form:e,spec:t,locked:n}){let r=t.when;return P0(e.store,e=>r===void 0||r(Om(Vle(e.values),()=>({}))))?(0,X.jsx)(Ble,{form:e,spec:t,locked:n}):null}function Hle({form:e,section:t,locked:n}){let r=t.fields.map(t=>(0,X.jsx)(V7,{form:e,spec:t,locked:n},t.name));return t.title===void 0?r:(0,X.jsx)(moe,{title:t.title,description:t.description,children:r})}function Ule({model:e,names:t,disabled:n=!1}){let r=e.form;return t===void 0?e.description.sections.map(e=>(0,X.jsx)(Hle,{form:r,section:e,locked:n},e.id??``)):t.map(t=>{let i=e.description.fields.find(e=>e.name===t);return i===void 0?null:(0,X.jsx)(V7,{form:r,spec:i,locked:n},t)})}var H7=class{annotation;constructor(e){this.annotation=e}},Wle=class{sections;constructor(e){this.sections=e}},U7=`caps/form`,W7=0;function G7(e){W7+=1;let t={[`${U7}:${String(W7)}`]:new H7(e)};return e.label!==void 0&&(t.title=e.label),e.help!==void 0&&(t.description=e.help),t}XC.annotate(G7({kind:`secret`})).pipe(Pte(`Secret`));var K7=e=>{let t=e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[-_]+/g,` `).toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)};function Gle(e){return Object.values(e??{}).reduce((e,t)=>t instanceof H7?{...e,...t.annotation}:e,{})}function q7(e){return e.reduce((e,t)=>({...e,...Gle(t)}),{})}function J7(e){let t=e?.[U7];return t instanceof Wle?t.sections:{}}var Y7=BC(XC);function X7(e){if(My(e))return Cee(Y7(e.literal),{onNone:()=>null,onSome:e=>[e]});if(!Iy(e))return null;let t=[];for(let n of e.types){if(Dy(n))continue;let e=X7(n);if(e===null)return null;t.push(...e)}return t}function Z7(e){if(ky(e))return{type:`string`,literals:[]};if(Ay(e))return{type:`number`,nullable:!1};if(jy(e))return{type:`boolean`};let t=X7(e);if(t!==null)return{type:`string`,literals:t};if(Py(e)){let[t]=e.rest;if(t===void 0)return null;if(ky(t))return{type:`strings`,literals:[]};let n=X7(t);return n===null?null:{type:`strings`,literals:n}}if(Iy(e)){let t=e.types.filter(e=>!Dy(e)&&!Ey(e)),n=e.types.some(e=>Ey(e)),[r]=t;if(t.length!==1||r===void 0)return null;let i=Z7(r);return i?.type===`number`?{type:`number`,nullable:n}:n?null:i}return null}function Kle(e){let t=e.ast;if(!Fy(t))throw Error(`A schema form needs a Schema.Struct.`);return{fields:t.propertySignatures.map(e=>{let t=String(e.name),n=Cx(e.type),r=q7([e.type.annotations,...(e.type.checks??[]).map(e=>e.annotations)]),i=r.kind===`file`?{type:`files`}:Z7(n);if(i===null)throw Error(`Schema field "${t}" has no form control. Annotate it with field({ render }) or a kind.`);return{name:t,valueType:i,optional:e.type.context?.isOptional===!0,annotation:r,title:Vx(e.type),description:Hx(e.type)}}),sections:J7(Bx(t))}}function Q7(e){let t=e,n=!1,r=!1;for(;;)if(t instanceof yl)n=!0,t=t.unwrap();else if(t instanceof Cl)r=!0,t=t.unwrap();else if(t instanceof El)t=t.unwrap();else if(t instanceof Rl)t=t.in;else return{node:t,optional:n,nullable:r}}function $7(e){if(e instanceof Kc){let t=e.options.map(e=>$7(e));return t.some(e=>e===null)?null:t.flatMap(e=>e??[])}let t=e instanceof ul?e.options:e instanceof pl?[...e.values]:null;if(t===null)return null;let n=t.map(e=>Y7(e));return n.every(See)?n.map(e=>e.value):null}function qle(e){let{node:t,nullable:n}=Q7(e);if(t instanceof ds)return{type:`string`,literals:[]};if(t instanceof lc)return{type:`number`,nullable:n};if(t instanceof _c)return{type:`boolean`};let r=$7(t);if(r!==null)return{type:`string`,literals:r};if(t instanceof zc){let e=Q7(t.element).node;if(e instanceof ds)return{type:`strings`,literals:[]};let n=$7(e);return n===null?null:{type:`strings`,literals:n}}return null}function e9(e){let t=[e];for(;;){let e=t[t.length-1];if(e===void 0)break;let n=e instanceof yl||e instanceof Cl||e instanceof El?e.unwrap():e instanceof Rl?e.in:e;if(n===e)break;t.push(n)}return t.reverse().map(e=>fi.get(e))}function t9(e){return e9(e).reduce((e,t)=>({...e,...t}),{})}function Jle(e){return Object.entries(e.shape)}function Yle(e){let t=Q7(e).node;if(!(t instanceof Hc))throw Error(`A schema form needs a z.object.`);return{fields:Jle(t).map(([e,t])=>{let n=q7(e9(t)),r=n.kind===`file`?{type:`files`}:qle(t);if(r===null)throw Error(`Schema field "${e}" has no form control. Annotate it with field({ render }) or a kind.`);let i=t9(t);return{name:e,valueType:r,optional:Q7(t).optional,annotation:n,title:i.title,description:i.description}}),sections:J7(t9(e))}}function Xle(e,t){let n=t.options??{};return(e.length>0?e:Object.keys(n)).map(e=>{let t=n[e],r=t===void 0?{}:t instanceof Object?t:{label:t};return{value:e,label:r.label??K7(e),description:r.description,meta:r.meta,icon:r.icon,caption:r.caption,disabled:r.disabled===!0}})}function Zle(e,t){let n=t.some(e=>e.icon!==void 0);switch(e.type){case`boolean`:return`switch`;case`number`:return`number`;case`strings`:return n?`icon-checkboxes`:`checkboxes`;case`files`:return`file`;case`string`:return t.length===0?`text`:t.length>12?`combobox`:n?`icon-radio`:t.some(e=>e.description!==void 0||e.meta!==void 0)||t.length<=3?`radio`:`select`}}function Qle(e,t){switch(e.type){case`boolean`:return!1;case`number`:return e.nullable?null:0;case`strings`:case`files`:return[];case`string`:return t[0]?.value??``}}function $le(e){let t=e instanceof ls?Yle(e):Kle(e),n=t.fields.map((e,t)=>{let{kind:n,...r}=e.annotation,i=Xle(e.valueType.type===`string`||e.valueType.type===`strings`?e.valueType.literals:[],e.annotation),a=r.help??e.description;return{...r,name:e.name,label:r.label??e.title??K7(e.name),help:a,kind:n??Zle(e.valueType,i),options:i,optionalInSchema:e.optional,index:t}}),r={};t.fields.forEach((e,t)=>{let i=n[t];i&&(r[e.name]=Qle(e.valueType,i.options))});let i=e=>e.order??e.index,a=e=>e.section!==void 0&&Object.hasOwn(t.sections,e.section)?e.section:null,o=e=>n.filter(t=>a(t)===e).sort((e,t)=>i(e)-i(t)),s=Object.entries(t.sections).map(([e,t])=>({id:e,title:t.title,description:t.description,fields:o(e)}));return{fields:n,sections:[{id:null,title:void 0,description:void 0,fields:o(null)},...s].filter(e=>e.fields.length>0),defaults:r}}function n9(e){let t=e instanceof ls?e:LC(e);return{"~standard":{...t[`~standard`],validate:e=>{let n=t[`~standard`].validate(e);return n instanceof Promise?n.then(e=>r9(e)):r9(n)}}}}function r9(e){return e.issues===void 0?e:{issues:e.issues.map(e=>e.path===void 0?e:{...e,path:e.path.slice(0,1)})}}var i9=`onServer`;function eue(e){return e.state.meta.errorMap.onServer!==void 0}function tue(e){e.setMeta(e=>({...e,errorMap:{...e.errorMap,[i9]:void 0}}))}function nue(e,t,n){e.setFieldMeta(t,e=>({...e,isBlurred:!0,errorMap:{...e.errorMap,[i9]:n}}))}function a9(e){let[t,n]=(0,K.useState)(null),[r,i]=(0,K.useState)(null),[a,o]=(0,K.useState)(e.defaultValues),[s,c]=(0,K.useState)(null);X1(a,e.defaultValues)||(o(e.defaultValues),c(null));let{schema:l}=e,u=(0,K.useMemo)(()=>$le(l),[l]),d=(0,K.useMemo)(()=>n9(l),[l]),f=W0({defaultValues:s??a,validators:{onChange:d,onSubmit:d},listeners:{onChange:({fieldApi:e})=>{n(null),i(null),eue(e)&&tue(e)}},onSubmit:async({value:t,formApi:r})=>{n(null),i(null);let a=await n9(l)[`~standard`].validate(t);if(a.issues){n(a.issues[0]?.message??`Check the form and try again.`);return}let o=await e.onSubmit(a.value,t)??{kind:`saved`};if(o.kind===`refused`){n(o.error??null);let e=r;for(let[t,n]of Object.entries(o.fields??{}))n!==void 0&&n.length>0&&nue(e,t,n);return}let s=o.values??t;c(s),r.reset(s),i(o.message??`Saved`)}});return{description:u,form:f,error:t,saved:r,discard:()=>{n(null),i(null),f.reset()},submit:()=>f.handleSubmit()}}function o9(e){return{dirty:P0(e.form.store,e=>!e.isDefaultValue),submitting:P0(e.form.store,e=>e.isSubmitting),canSubmit:P0(e.form.store,e=>e.canSubmit)}}function s9({model:e,submitLabel:t=`Save changes`,discardLabel:n,allowClean:r,footer:i,children:a,disabled:o=!1,...s}){let{submitting:c}=o9(e);return(0,X.jsxs)(foe,{...s,busy:c,noValidate:!0,onSubmit:t=>{t.preventDefault(),e.form.state.isSubmitting||e.submit()},children:[a??(0,X.jsx)(Ule,{model:e,disabled:o}),i===void 0?(0,X.jsx)(aue,{model:e,label:t,...n===void 0?{}:{discardLabel:n},...r===void 0?{}:{allowClean:r}}):i]})}function rue({schema:e,defaultValues:t,onSubmit:n,...r}){let i=a9({schema:e,defaultValues:t,onSubmit:n});return(0,X.jsx)(s9,{...r,model:i})}function iue(e){return`model`in e?(0,X.jsx)(s9,{...e}):(0,X.jsx)(rue,{...e})}function aue({model:e,label:t,discardLabel:n,allowClean:r=!1,dirtyLabel:i=`Unsaved changes`,buttonProps:a,...o}){let{dirty:s,submitting:c,canSubmit:l}=o9(e),u=c?null:e.saved&&!s?(0,X.jsx)(e8,{tone:`success`,size:`compact`,label:e.saved}):s?(0,X.jsx)(e8,{tone:`neutral`,size:`compact`,label:i}):null;return(0,X.jsxs)(B6,{...o,error:e.error,status:u,children:[n&&s?(0,X.jsx)(rz,{type:`button`,variant:`ghost`,disabled:c,onClick:e.discard,children:n}):null,(0,X.jsx)(rz,{...a,type:`submit`,loading:c,disabled:c||!l||!s&&!r,children:t})]})}var c9=K.createContext(void 0);function l9(e){let t=K.useContext(c9);if(!e&&t===void 0)throw Error(s2(27));return t}var oue=K.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=l9(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return I2(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:h3,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),sue=K.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=l9(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=l7({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,m8(Xoe,e.nativeEvent))}return I2(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),cue=K.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=l9(),c=Z2(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),I2(`p`,e,{ref:t,props:[{id:c},o]})}),u9=K.createContext(void 0);function lue(){let e=K.useContext(u9);if(e===void 0)throw Error(s2(26));return e}var uue=`--nested-dialogs`,due=`data-nested-dialog-open`,fue={...m3,...t3,nestedDialogOpen(e){return e?{[due]:``}:null}},pue=K.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=l9(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);lue(),s5({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?l5(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=I2(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...c5,hidden:!m,onKeyDown(e){O7.has(e.key)&&e.stopPropagation()},style:{[uue]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:fue});return(0,X.jsx)(n5,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),mue=K.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=l9(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,X.jsx)(u9.Provider,{value:n,children:(0,X.jsxs)(W8,{ref:t,...r,children:[a&&o===!0&&(0,X.jsx)(b7,{ref:i.context.internalBackdropRef,inert:p7(!s)}),e.children]})}):null});function hue({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=K.useState(0),[d,f]=K.useState(0),p=l===0,m=i5(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=J4(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||K4(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return D7(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{!e.select(`open`)&&!e.select(`mounted`)||(u(t),f(n))}),y6(()=>{!r&&!i&&(u(0),f(0))},[r,i]),y6(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),_5(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var gue={...O5,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},_ue=class extends S5{constructor(e,t,n){let r=new y5,i=vue(e,r,t,n);super(i,yue(r),gue)}setOpen=(e,t)=>{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&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(p5(this.state,e,t.trigger)))}};function vue(e,t,n,r=!1){return{...C5(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function yue(e){return{popupRef:K.createRef(),backdropRef:K.createRef(),internalBackdropRef:K.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function bue(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=l9(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=u5((e,t)=>new _ue({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`);v5(b,x),h5(b);let{forceUnmount:w}=g5(x,b);K.useImperativeHandle(l,()=>({unmount:w,close:()=>b.setOpen(!1,m8(v8))}),[w,b]);let T=x||S||u!=null;return(0,X.jsxs)(c9.Provider,{value:b,children:[u&&(0,X.jsx)(d5,{handle:u,store:b}),T&&(0,X.jsx)(hue,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})}var xue=l8(function(e){return bue(`dialog`,e)}),Sue=K.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=l9(),c=Z2(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),I2(`h2`,e,{ref:t,props:[{id:c},o]})}),Cue=u8(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...u}=e,d=l9(!0),f=k5(l)??d;if(!f)throw Error(s2(79));let p=Z2(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`triggerPopupId`,p),_=K.useRef(null),{registerTrigger:v,isMountedByThisTrigger:y}=m5(p,_,f,{payload:c}),{getButtonProps:b,buttonRef:x}=l7({disabled:a,native:o}),S=r5(m),C=d7(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),w={disabled:a,open:h},T=f.useState(`triggerProps`,y);return I2(`button`,e,{state:w,ref:[x,t,v,_],props:[S.reference,T,C,{[B8]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":g},u,b],stateAttributesMapping:f3})}),d9=(0,K.createContext)(null);function f9({children:e,interactionOwner:t=`local`,modal:n=!0,onOpenChange:r,...i}){return(0,X.jsx)(d9.Provider,{value:{interactionOwner:t,modal:n},children:(0,X.jsx)(xue,{...i,modal:n,onOpenChange:(e,n)=>{if(t===`host`&&!e&&n.reason===`escape-key`){n.cancel(),n.allowPropagation();return}r?.(e,n)},children:e})})}function p9(){let e=(0,K.useContext)(d9);if(!e)throw Error(`Dialog parts must be used inside <Dialog>`);return e}(0,K.forwardRef)(function({className:e,type:t=`button`,...n},r){return(0,X.jsx)(Cue,{...n,className:t=>Z(`btn`,tI(e,t)),ref:r,type:t})});var wue=(0,K.forwardRef)(function({container:e,...t},n){let r=M7(`dialog`);return e==null&&r===null?null:(0,X.jsx)(mue,{...t,container:e??r,ref:n})}),Tue=(0,K.forwardRef)(function({className:e,...t},n){return(0,X.jsx)(oue,{...t,ref:n,className:t=>Z(`caps-dialog-backdrop fixed inset-0 bg-black/40`,tI(e,t))})}),Eue=(0,K.forwardRef)(function({className:e,finalFocus:t,...n},r){let i=p9();return(0,X.jsx)(pue,{...n,className:t=>Z(`caps-dialog-popup max-h-screen w-11/12 max-w-(--container-lg) overflow-y-auto overscroll-contain rounded-box bg-base-100 p-lg text-base-content shadow-xl`,tI(e,t)),finalFocus:i.interactionOwner===`host`?!1:t??!0,ref:r})}),m9=(0,K.forwardRef)(function({container:e,keepMounted:t=!0,className:n,...r},i){let{modal:a}=p9();return(0,X.jsxs)(wue,{container:e,keepMounted:t,children:[a===!0?(0,X.jsx)(Tue,{}):null,(0,X.jsx)(Eue,{...r,className:e=>Z(`fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2`,tI(n,e)),ref:i})]})});function h9({className:e,...t}){return(0,X.jsx)(`div`,{...t,className:Z(`flex justify-end gap-sm`,e)})}function g9({className:e,...t}){return(0,X.jsx)(`div`,{...t,className:Z(`flex flex-col gap-sm`,e)})}var _9=(0,K.forwardRef)(function({className:e,...t},n){return(0,X.jsx)(Sue,{...t,className:t=>Z(`text-lg font-semibold`,tI(e,t)),ref:n})});(0,K.forwardRef)(function({className:e,...t},n){return(0,X.jsx)(cue,{...t,className:t=>Z(`text-sm text-base-content`,tI(e,t)),ref:n})});var v9=(0,K.forwardRef)(function({className:e,type:t=`button`,...n},r){return(0,X.jsx)(sue,{...n,className:t=>Z(`btn btn-ghost`,tI(e,t)),ref:r,type:t})});function y9({items:e,openId:t,onOpenChange:n,leading:r,trailing:i,placement:a=`housing`,align:o=`end`,hostInset:s,className:c,...l}){let u=(0,K.useId)(),d=(0,K.useRef)(null),f=(0,K.useRef)(null),p=(0,K.useRef)(new Map),m=e.find(e=>e.id===t&&!e.disabled),h=m?.id,g=()=>{h&&p.current.get(h)?.focus(),n(null)};return(0,K.useEffect)(()=>{h&&f.current?.focus()},[h]),(0,K.useEffect)(()=>{s===void 0?d.current?.style.removeProperty(`--caps-status-tray-host-inset`):d.current?.style.setProperty(`--caps-status-tray-host-inset`,`${String(Math.max(0,s))}px`)},[s]),(0,K.useEffect)(()=>{if(!h)return;let e=e=>{e.key!==`Escape`||e.defaultPrevented||(e.preventDefault(),p.current.get(h)?.focus(),n(null))},t=e=>{e.target instanceof Node&&!d.current?.contains(e.target)&&n(null)};return document.addEventListener(`keydown`,e),document.addEventListener(`pointerdown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`pointerdown`,t)}},[h,n]),(0,X.jsxs)(J6,{...l,ref:d,className:Z(`caps-status-tray`,c),"data-placement":a,"data-align":o,children:[m?(0,X.jsxs)(Y6,{open:!0,ref:f,tabIndex:-1,side:`top`,id:`${u}-${m.id}`,role:`dialog`,"aria-labelledby":`${u}-title`,className:`caps-status-tray-panel`,"data-status-tray-panel":m.id,children:[(0,X.jsxs)(`div`,{className:`caps-status-tray-head`,children:[m.tone?(0,X.jsx)(e8,{size:`compact`,tone:m.tone,glyph:m.glyph??`dot`}):null,(0,X.jsx)(`span`,{id:`${u}-title`,className:`caps-status-tray-title`,children:m.title??m.label}),m.actions,(0,X.jsx)(dz,{"aria-label":`Close tray`,icon:(0,X.jsx)(mB,{"aria-hidden":`true`}),onClick:g})]}),(0,X.jsx)(`div`,{className:`caps-status-tray-body`,children:m.content})]}):null,a===`host`?null:(0,X.jsxs)(`div`,{className:`caps-status-tray-row`,children:[r,(0,X.jsx)(`div`,{className:`caps-status-tray-chips`,children:e.map(e=>(0,X.jsxs)(K.Fragment,{children:[(0,X.jsxs)(`button`,{ref:t=>{t?p.current.set(e.id,t):p.current.delete(e.id)},type:`button`,className:`caps-status-tray-chip`,"aria-expanded":h===e.id,"aria-controls":h===e.id?`${u}-${e.id}`:void 0,"aria-label":e.accessibleLabel,disabled:e.disabled,title:e.disabled?e.accessibleLabel:void 0,"aria-haspopup":`dialog`,"data-status-tray-chip":e.id,onClick:()=>{n(t===e.id?null:e.id)},children:[e.tone?(0,X.jsx)(e8,{size:`compact`,glyph:e.glyph??`dot`,motion:e.motion??`none`,tone:e.tone}):null,(0,X.jsx)(`span`,{className:`caps-status-tray-label`,children:e.label}),e.count!==void 0&&e.count>0?(0,X.jsx)(`span`,{className:`caps-status-tray-count`,children:e.count}):null]}),e.after]},e.id))}),i]})]})}function Due({children:e,className:t,...n}){return(0,X.jsx)(`div`,{...n,className:Z(`caps-status-tray-list`,t),children:e})}function b9({icon:e,primary:t,secondary:n,actions:r,className:i,...a}){return(0,X.jsxs)(`div`,{...a,className:Z(`caps-status-tray-item`,i),children:[e?(0,X.jsx)(`span`,{className:`caps-status-tray-icon`,children:e}):null,(0,X.jsxs)(`span`,{className:`caps-status-tray-text`,children:[(0,X.jsx)(`span`,{className:`caps-status-tray-primary`,children:t}),n?(0,X.jsx)(`span`,{className:`caps-status-tray-secondary`,children:n}):null]}),r?(0,X.jsx)(`span`,{className:`caps-status-tray-actions`,children:r}):null]})}function x9({children:e=`All caught up.`,title:t}){return(0,X.jsxs)(`div`,{className:`caps-status-tray-note`,children:[t?(0,X.jsx)(`strong`,{className:`caps-status-tray-note-title`,children:t}):null,(0,X.jsx)(`p`,{children:e})]})}var S9={error:0,warning:1,info:2};function Oue(e,t){let n=t.generating+t.uploading>0;if(n)return{busy:n,tone:void 0,label:[t.generating?`Creating ${String(t.generating)}`:``,t.uploading?`Uploading ${String(t.uploading)}`:``].filter(Boolean).join(` · `)};let r=[...e].sort((e,t)=>Number(t.blocking??!1)-Number(e.blocking??!1)||S9[e.tone]-S9[t.tone]).at(0);return r?{busy:n,tone:r.tone===`info`?`neutral`:r.tone,label:r.short+(e.length>1?` +${String(e.length-1)}`:``)}:null}function kue(e,t,n){let r=Oue(e,t);if(!r)return null;let i={kind:`button`,id:`activity`,text:`Activity`,count:e.length+t.generating+t.uploading,busy:r.busy,title:mD(`Activity: ${r.label}`,1024),opens:`dialog`,expanded:n};return r.tone===void 0?i:{...i,tone:r.tone}}var Aue={Setup:(0,X.jsx)(dB,{"aria-hidden":`true`,className:`size-[var(--stipe-icon-size-sm)]`}),Images:(0,X.jsx)(aB,{"aria-hidden":`true`,className:`size-[var(--stipe-icon-size-sm)]`}),Uploads:(0,X.jsx)(pB,{"aria-hidden":`true`,className:`size-[var(--stipe-icon-size-sm)]`})};function jue({controls:e,send:t,settings:n}){let r=[];return n&&r.push({id:`settings`,label:n.label,accessibleLabel:`Generation settings`,title:`Settings`,content:n.content}),(0,X.jsx)(y9,{className:`prints-footer`,items:r,align:n?.open?`start`:`end`,openId:n?.open?`settings`:null,onOpenChange:e=>{n?.onOpenChange(e===`settings`)},leading:e,trailing:t})}function Mue({notices:e,uploads:t,open:n,inset:r,onOpenChange:i,onDismiss:a,onDismissAll:o,onLoadMore:s}){return(0,X.jsx)(y9,{className:`prints-activity-tray`,placement:`host`,align:`start`,...r===void 0?{}:{hostInset:r},items:[{id:`activity`,label:`Activity`,title:`Activity`,content:(0,X.jsx)(Nue,{notices:e,uploads:t,onDismiss:a,onDismissAll:o,onLoadMore:s})}],openId:n?`activity`:null,onOpenChange:e=>{i(e===`activity`)}})}function Nue({notices:e,uploads:t,onDismiss:n,onDismissAll:r,onLoadMore:i}){let a=[`Setup`,`Images`,`Uploads`].map(t=>({group:t,items:e.filter(e=>e.group===t)})).filter(e=>e.items.length);return(0,X.jsxs)(`div`,{className:`prints-instrument`,children:[a.map(({group:e,items:t})=>(0,X.jsxs)(`section`,{"aria-label":e,className:`prints-notice-group`,children:[(0,X.jsx)(gz,{level:3,children:e}),(0,X.jsx)(Due,{children:t.map(e=>(0,X.jsx)(b9,{icon:Aue[e.group],primary:e.title,secondary:e.detail,actions:(0,X.jsxs)(`div`,{className:`prints-notice-actions`,"aria-label":`Actions for ${e.title}`,children:[e.actions?.map(e=>(0,X.jsx)(rz,{variant:`ghost`,size:`xs`,onClick:e.run,children:e.label},e.label)),e.blocking?null:(0,X.jsx)(dz,{"aria-label":`Dismiss ${e.title}`,icon:(0,X.jsx)(mB,{"aria-hidden":`true`}),onClick:()=>{n(e.key)}})]})},e.key))})]},e)),e.length?null:(0,X.jsx)(x9,{children:`All caught up.`}),t&&t.items.length>0?(0,X.jsxs)(`section`,{"aria-label":`Upload queue`,className:`prints-upload-bank`,children:[(0,X.jsx)(gz,{level:3,children:`Uploading`}),(0,X.jsx)(n8,{...t})]}):null,(0,X.jsxs)(`div`,{className:`prints-panel-footer`,children:[(0,X.jsx)(`span`,{className:`prints-footer-note`,children:`Clear keeps setup notices`}),(0,X.jsx)(rz,{variant:`ghost`,size:`xs`,disabled:!e.some(e=>!e.blocking),onClick:r,children:`Clear`}),i?(0,X.jsx)(rz,{variant:`ghost`,size:`xs`,onClick:i,children:`Load more activity`}):null]})]})}function Pue({folder:e}){return(0,X.jsx)(f9,{open:e.editing,onOpenChange:e.setEditing,children:(0,X.jsxs)(m9,{children:[(0,X.jsx)(g9,{children:(0,X.jsx)(_9,{children:`Save prints to`})}),(0,X.jsx)(Iue,{folder:e},e.computerId),(0,X.jsx)(h9,{children:(0,X.jsx)(v9,{render:(0,X.jsx)(rz,{variant:`outline`,size:`sm`}),children:`Close`})})]})})}var Fue=q({path:Gte.check(cw(RC(ZN),{message:`Enter an absolute Computer folder, such as /media.`})).annotate(G7({label:`Folder`,placeholder:`/media`}))});function Iue({folder:e}){let t=(0,K.useRef)(!1),n=a9({schema:Fue,defaultValues:{path:e.path??`/media`},onSubmit:async({path:n})=>{let r=await e.choose(n,t.current);return r?{kind:`refused`,fields:{path:r}}:{kind:`saved`}}}),r=e=>{t.current=e,n.form.setFieldMeta(`path`,e=>({...e,errorMap:{...e.errorMap,onServer:void 0}}))},i=e.busy||!e.writable;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(iue,{model:n,disabled:i,footer:(0,X.jsxs)(B6,{divider:!1,children:[(0,X.jsx)(nI,{className:`[--caps-keycap-width:auto]`,label:`Use`,type:`submit`,disabled:i,onClick:()=>{r(!1)}}),(0,X.jsx)(nI,{className:`[--caps-keycap-width:auto]`,label:`Create`,type:`submit`,disabled:i,onClick:()=>{r(!0)}})]})}),e.error?(0,X.jsx)(b9,{role:`alert`,icon:(0,X.jsx)(iB,{"aria-hidden":`true`,className:`size-[var(--stipe-icon-size-sm)]`}),primary:e.error}):(0,X.jsx)(x9,{children:e.writable?`Prints saves new images and uploads here and shows this folder as your gallery.`:`This Computer is read-only for Prints, so the folder can’t change.`})]})}function Lue({connected:e,mediaCapability:t,modelsError:n,retryModels:r,modelsLoading:i,models:a,canGenerate:o,canWrite:s,generationError:c,recoveryError:l,pendingGenerations:u,activeGenerations:d,gallerySlots:f,computerId:p,failed:m,uploadError:h,uploads:g,permissions:_,resume:v,discard:y,retryUpload:b}){let x=[];if(e)p===null?x.push({key:`no-computer`,group:`Setup`,tone:`info`,blocking:!0,short:`Choose a Computer`,title:`No Computer selected`,detail:`Choose a Computer for this window, or create one in Grove.`}):t?n===null?!i&&!o&&x.push({key:`approval`,group:`Setup`,tone:`warning`,blocking:!0,short:`Generation not enabled`,title:`Media generation isn’t enabled`,detail:`Turn it on in this App’s Team permissions. Images already generated can still be saved.`,actions:[{label:`Permissions`,run:()=>{_()}}]}):x.push({key:`models:${n}`,group:`Setup`,tone:`warning`,blocking:!0,short:`Models unavailable`,title:`Couldn’t load image models`,detail:n,actions:[{label:`Retry`,run:r}]}):x.push({key:`no-media`,group:`Setup`,tone:`info`,blocking:!0,short:`Image creation off`,title:`Image creation is off for this Computer`,detail:`You can still browse and upload images.`});else{let e=Ow(new Y(`Prints disconnected`,{code:`DISCONNECTED`,retryable:!0}));x.push({key:`disconnected`,group:`Setup`,tone:`warning`,blocking:!0,short:e.title,title:e.title,detail:e.message})}e&&p!==null&&!s&&x.push({key:`read-only`,group:`Setup`,tone:`info`,blocking:!0,short:`Read-only`,title:`Read-only Computer`,detail:`Uploads and new prints are off.`}),c!==null&&x.push({key:c.key,group:`Images`,tone:`error`,short:`Image failed`,title:`Couldn’t create image`,detail:c.message,actions:c.billing?[{label:`Open Billing`,run:c.billing}]:c.retry?[{label:`Retry`,run:c.retry}]:[]}),l!==null&&x.push({key:`recovery:${l}`,group:`Images`,tone:`error`,short:`Retry blocked`,title:l});for(let e of u){if(d.has(e.reference.requestId)||f.some(t=>t.computerId===e.reference.computerId&&t.path===e.input.destination.path))continue;let t=`Unfinished ${FB(a,e.input.settings.model)?.kind??`media`}`;x.push({key:`unfinished:${e.reference.requestId}`,group:`Images`,tone:`info`,short:t,title:t,detail:e.reference.computerId===p?e.input.settings.prompt:`${e.input.settings.prompt} · on Computer ${e.reference.computerId}`,actions:[...e.reference.computerId===p?[{label:`Resume`,run:()=>{v(e)}}]:[],{label:`Discard`,run:()=>{y(e)}}]})}m.length>0&&x.push({key:`files:${m.join(`|`)}`,group:`Images`,tone:`error`,short:`Couldn’t open images`,title:`Couldn’t open some images`,detail:m.join(`, `)}),h!==null&&x.push({key:`uploads:${h}`,group:`Uploads`,tone:`error`,short:`Upload failed`,title:`Couldn’t add images`,detail:h});for(let e of g)(e.status===`error`||e.status===`cancelled`)&&x.push({key:`upload:${e.id}:${e.status}`,group:`Uploads`,tone:e.status===`error`?`error`:`info`,short:`Upload failed`,title:`${e.file.name} wasn’t saved`,detail:e.message,actions:[{label:`Retry`,run:()=>{b(e.id)}}]});return x}function Rue(e,t){let n=BT(Are(e)),r=HT(TN({queryKey:xF.dismissals(e),mutationFn:({owner:e,id:t,keys:n})=>FP(e.capabilities,{operation:`dismiss-notices`,computerId:t,keys:n}),apply:(e,t)=>({keys:[...new Set([...e.keys,...t.keys])].slice(-200)})})),i=n=>{e&&t&&n.length>0&&r.mutate({owner:e,id:t,keys:n})};return{error:r.variables?.owner===e&&r.variables.id===t&&r.isError?`Could not dismiss activity. Please try again.`:n.isError?`Could not load dismissed activity. Notices may reappear.`:null,visible:e=>e.filter(e=>(e.blocking??!1)||!n.data?.keys.includes(e.key)),dismiss:e=>{i([e])},dismissAll:e=>{i(e.filter(e=>!e.blocking).map(e=>e.key).slice(-200))}}}var C9=0,w9=1,zue=2,Bue=0,T9=1;function Vue(e,t,n){let r=e.list,i;for(;r;){if(r.index===n)return!1;if(t>r.high)break;i=r,r=r.next}return i||(e.list={index:n,high:t,next:r}),i&&(i.next={index:n,high:t,next:i.next}),!0}function Hue(e,t){let n=e.list;if(n.index===t)return n.next===null?Bue:(e.list=n.next,T9);let r=n;for(n=n.next;n!==null;){if(n.index===t)return r.next=n.next,T9;r=n,n=n.next}}var E9={low:0,max:0,high:0,C:zue,P:void 0,R:void 0,L:void 0,list:void 0};E9.P=E9,E9.L=E9,E9.R=E9;function D9(e){let t=e.high;e.max=e.L===E9&&e.R===E9?t:e.L===E9?Math.max(e.R.max,t):e.R===E9?Math.max(e.L.max,t):Math.max(Math.max(e.L.max,e.R.max),t)}function O9(e){let t=e;for(;t.P!==E9;)D9(t.P),t=t.P}function k9(e,t){if(t.R===E9)return;let n=t.R;t.R=n.L,n.L!==E9&&(n.L.P=t),n.P=t.P,t.P===E9?e.root=n:t===t.P.L?t.P.L=n:t.P.R=n,n.L=t,t.P=n,D9(t),D9(n)}function A9(e,t){if(t.L===E9)return;let n=t.L;t.L=n.R,n.R!==E9&&(n.R.P=t),n.P=t.P,t.P===E9?e.root=n:t===t.P.R?t.P.R=n:t.P.L=n,n.R=t,t.P=n,D9(t),D9(n)}function j9(e,t,n){t.P===E9?e.root=n:t===t.P.L?t.P.L=n:t.P.R=n,n.P=t.P}function Uue(e,t){let n;for(;t!==E9&&t.C===w9;)t===t.P.L?(n=t.P.R,n.C===C9&&(n.C=w9,t.P.C=C9,k9(e,t.P),n=t.P.R),n.L.C===w9&&n.R.C===w9?(n.C=C9,t=t.P):(n.R.C===w9&&(n.L.C=w9,n.C=C9,A9(e,n),n=t.P.R),n.C=t.P.C,t.P.C=w9,n.R.C=w9,k9(e,t.P),t=e.root)):(n=t.P.L,n.C===C9&&(n.C=w9,t.P.C=C9,A9(e,t.P),n=t.P.L),n.R.C===w9&&n.L.C===w9?(n.C=C9,t=t.P):(n.L.C===w9&&(n.R.C=w9,n.C=C9,k9(e,n),n=t.P.L),n.C=t.P.C,t.P.C=w9,n.L.C=w9,A9(e,t.P),t=e.root));t.C=w9}function Wue(e){for(;e.L!==E9;)e=e.L;return e}function Gue(e,t){let n;for(;t.P.C===C9;)t.P===t.P.P.L?(n=t.P.P.R,n.C===C9?(t.P.C=w9,n.C=w9,t.P.P.C=C9,t=t.P.P):(t===t.P.R&&(t=t.P,k9(e,t)),t.P.C=w9,t.P.P.C=C9,A9(e,t.P.P))):(n=t.P.P.L,n.C===C9?(t.P.C=w9,n.C=w9,t.P.P.C=C9,t=t.P.P):(t===t.P.L&&(t=t.P,A9(e,t)),t.P.C=w9,t.P.P.C=C9,k9(e,t.P.P)));e.root.C=w9}function Kue(){let e={root:E9,size:0},t={};return{insert(n,r,i){let a=e.root,o=E9;for(;a!==E9&&(o=a,n!==o.low);)a=n<a.low?a.L:a.R;if(n===o.low&&o!==E9){if(!Vue(o,r,i))return;o.high=Math.max(o.high,r),D9(o),O9(o),t[i]=o,e.size++;return}let s={low:n,high:r,max:r,C:C9,P:o,L:E9,R:E9,list:{index:i,high:r,next:null}};o===E9?e.root=s:(s.low<o.low?o.L=s:o.R=s,O9(s)),Gue(e,s),t[i]=s,e.size++},remove(n){let r=t[n];if(r===void 0)return;delete t[n];let i=Hue(r,n);if(i===void 0)return;if(i===T9){r.high=r.list.high,D9(r),O9(r),e.size--;return}let a=r,o=a.C,s;r.L===E9?(s=r.R,j9(e,r,r.R)):r.R===E9?(s=r.L,j9(e,r,r.L)):(a=Wue(r.R),o=a.C,s=a.R,a.P===r?s.P=a:(j9(e,a,a.R),a.R=r.R,a.R.P=a),j9(e,r,a),a.L=r.L,a.L.P=a,a.C=r.C),D9(s),O9(s),o===w9&&Uue(e,s),e.size--},search(t,n,r){let i=[e.root];for(;i.length!==0;){let e=i.pop();if(!(e===E9||t>e.max)&&(e.L!==E9&&i.push(e.L),e.R!==E9&&i.push(e.R),e.low<=n&&e.high>=t)){let n=e.list;for(;n!==null;)n.high>=t&&r(n.index,e.low),n=n.next}}},get size(){return e.size}}}var que=e=>{let t=K.useRef(e);return K.useEffect(()=>{t.current=e}),t},M9=(e,t)=>{let n=t||Jue,r,i;return function(){return r&&n(arguments,r)?i:i=e.apply(null,r=arguments)}},Jue=(e,t)=>e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3],N9=class{constructor(){this.set=void 0,this.get=void 0;let e,t;this.get=n=>n===e?t:void 0,this.set=(n,r)=>{e=n,t=r}}},P9=e=>{try{return new e}catch{let e={};return{set(t,n){e[t]=n},get(t){return e[t]}}}},Yue=e=>{let t=e.length,n=P9(e[0]),r,i,a,o,s=t===1;return t<3?{g:e=>(r=n.get(e[0]))===void 0||s?r:r.get(e[1]),s:(t,a)=>(s?n.set(t[0],a):(r=n.get(t[0]))===void 0?(i=P9(e[1]),i.set(t[1],a),n.set(t[0],i)):r.set(t[1],a),a)}:{g:e=>{for(o=n,a=0;a<t;a++)if((o=o.get(e[a]))===void 0)return;return o},s:(r,s)=>{for(o=n,a=0;a<t-1;a++)(i=o.get(r[a]))===void 0?(i=P9(e[a+1]),o.set(r[a],i),o=i):o=i;return o.set(r[t-1],s),s}}},Xue=(e,t)=>{let n,{g:r,s:i}=Yue(e);return function(){return(n=r(arguments))===void 0?i(arguments,t.apply(null,arguments)):n}},Zue=new WeakMap;function Que(){let e=K.useState($ue)[1];return K.useRef(()=>e({})).current}var $ue={},F9=K.createElement;function ede(e){let{positioner:t,resizeObserver:n,items:r,as:i=`div`,id:a,className:o,style:s,role:c=`grid`,tabIndex:l=0,containerRef:u,itemAs:d=`div`,itemStyle:f,itemHeightEstimate:p=300,itemKey:m=rde,overscanBy:h=2,scrollTop:g,isScrolling:_,height:v,render:y,onRender:b}=e,x=0,S,C=Que(),w=ade(t,n),T=r.length,{columnWidth:E,columnCount:D,range:O,estimateHeight:k,size:A,shortestColumn:j}=t,M=A(),N=j(),P=[],F=c===`list`?`listitem`:c===`grid`?`gridcell`:void 0,I=que(b);h=v*h;let L=g+h,R=N<L&&M<T;if(O(Math.max(0,g-h/2),L,(e,t,n)=>{let i=r[e],a=m(i,e),o={top:n,left:t,width:E,writingMode:`horizontal-tb`,position:`absolute`};P.push(F9(d,{key:a,ref:w(e),role:F,style:typeof f==`object`&&f?Object.assign({},o,f):o},L9(y,e,i,E))),S===void 0?(x=e,S=e):(x=Math.min(x,e),S=Math.max(S,e))}),R){let e=Math.min(T-M,Math.ceil((g+h-N)/p*D)),t=M,n=ide(E);for(;t<M+e;t++){let e=r[t],i=m(e,t);P.push(F9(d,{key:i,ref:w(t),role:F,style:typeof f==`object`?Object.assign({},n,f):n},L9(y,t,e,E)))}}K.useEffect(()=>{typeof I.current==`function`&&S!==void 0&&I.current(x,S,r),I9=`1`},[x,S,r,I]),K.useEffect(()=>{R&&C()},[R,t]);let z=tde(_,k(T,p));return F9(i,{ref:u,key:I9,id:a,role:c,className:o,tabIndex:l,style:typeof s==`object`?nde(z,s):z,children:P})}var I9=`0`,L9=Xue([N9,{},WeakMap,N9],(e,t,n,r)=>F9(e,{index:t,data:n,width:r})),tde=M9((e,t)=>({position:`relative`,width:`100%`,maxWidth:`100%`,height:Math.ceil(t),maxHeight:Math.ceil(t),willChange:e?`contents`:void 0,pointerEvents:e?`none`:void 0})),R9=(e,t)=>e[0]===t[0]&&e[1]===t[1],nde=M9((e,t)=>Object.assign({},e,t),R9);function rde(e,t){return t}var ide=M9(e=>({width:e,zIndex:-1e3,visibility:`hidden`,position:`absolute`,writingMode:`horizontal-tb`}),(e,t)=>e[0]===t[0]),ade=M9((e,t)=>n=>r=>{r!==null&&(t&&(t.observe(r),Zue.set(r,n)),e.get(n)===void 0&&e.set(n,r.offsetHeight))},R9),ode=function(e,t,n,r){n===void 0&&(n=0),r===void 0&&(r=n);let i=Kue(),a=Array(e),o=[],s=Array(e);for(let t=0;t<e;t++)a[t]=0,s[t]=[];return{columnCount:e,columnWidth:t,set:function(e,c){c===void 0&&(c=0);let l=0;for(let e=1;e<a.length;e++)a[e]<a[l]&&(l=e);let u=a[l]||0;a[l]=u+c+r,s[l].push(e),o[e]={left:l*(t+n),top:u,height:c,column:l},i.insert(u,u+c,e)},get:e=>o[e],update:t=>{let n=Array(e),c=0,l=0;for(;c<t.length-1;c++){let e=t[c],r=o[e];r.height=t[++c],i.remove(e),i.insert(r.top,r.top+r.height,e),n[r.column]=n[r.column]===void 0?e:Math.min(e,n[r.column])}for(c=0;c<n.length;c++){if(n[c]===void 0)continue;let e=s[c],t=sde(e,n[c]),u=s[c][t],d=o[u];for(a[c]=d.top+d.height+r,l=t+1;l<e.length;l++){let t=e[l],n=o[t];n.top=a[c],a[c]=n.top+n.height+r,i.remove(t),i.insert(n.top,n.top+n.height,t)}}},range:(e,t,n)=>i.search(e,t,(e,t)=>n(e,o[e].left,t)),estimateHeight:(t,n)=>{let r=Math.max(0,Math.max.apply(null,a));return t===i.size?r:r+Math.ceil((t-i.size)/e)*n},shortestColumn:()=>a.length>1?Math.min.apply(null,a):a[0]||0,size(){return i.size},all(){return o}}},sde=(e,t)=>{let n=0,r=e.length-1;for(;n<=r;){let i=n+r>>>1,a=e[i];if(a===t)return i;a<=t?n=i+1:r=i-1}return-1},cde={queued:`Waiting to start`,generating:`Generating`,refining:`Refining`,done:void 0,failed:void 0},lde=(0,K.forwardRef)(function({status:e,children:t,aspectRatio:n,label:r,indicator:i,failure:a,className:o,style:s,...c},l){let u=(0,K.useRef)(null);(0,K.useImperativeHandle)(l,()=>u.current);let d=(0,K.useRef)(e),[f,p]=(0,K.useState)(!1),[m,h]=(0,K.useState)(e);m!==e&&(h(e),p(e===`done`)),(0,K.useLayoutEffect)(()=>{let t=u.current,n=d.current;if(d.current=e,!t||n===e)return;if(!pI(t)){p(!1);return}let r=lI(t),i=fI(r,r.ease),a=[],o=t.querySelector(`:scope > [data-layer="media"]`),s=t.querySelector(`:scope > [data-layer="placeholder"]`),c=t.querySelector(`:scope > [data-layer="failure"]`);if(e===`done`&&o){let e=o.animate(r.reduced?[{opacity:0},{opacity:1}]:[{opacity:0,filter:`blur(10px)`,transform:`scale(1.03)`},{opacity:1,filter:`blur(0px)`,transform:`none`}],{duration:r.reduced?r.fast:r.slow*2,easing:i,fill:`backwards`});e.addEventListener(`finish`,()=>{p(!1)}),a.push(e),s&&a.push(s.animate([{opacity:1},{opacity:0}],{duration:r.reduced?r.fast:r.slow,easing:i,fill:`forwards`}))}return e===`failed`&&c&&a.push(c.animate([{opacity:0,transform:`translateY(${String(r.distance)}px)`},{opacity:1,transform:`none`}],{duration:r.normal,easing:i})),n===`failed`&&s&&a.push(s.animate([{opacity:.4},{opacity:1}],{duration:r.normal,easing:i})),()=>{for(let e of a)e.cancel()}},[e]);let g=e===`queued`||e===`generating`||e===`refining`,_=r??cde[e],v=e===`done`||e===`refining`;return(0,X.jsxs)(`div`,{...c,ref:u,className:Z(`caps-generation-frame`,o),"data-status":e,"data-aspect":n===void 0?void 0:``,"aria-busy":g,style:n===void 0?s:{aspectRatio:n,...s},children:[e===`done`&&!f?null:(0,X.jsxs)(`div`,{className:Z(`caps-generation-placeholder`,e===`queued`&&`skeleton`),"data-layer":`placeholder`,role:e===`done`?void 0:`status`,"aria-hidden":e===`done`||void 0,children:[e===`generating`||e===`refining`||e===`done`?i??(0,X.jsx)(ez,{decorative:!0,size:`lg`,variant:`bloom`}):null,_===void 0?null:(0,X.jsx)(gI,{children:_})]}),v?(0,X.jsx)(`div`,{className:`caps-generation-media`,"data-layer":`media`,children:t}):null,e===`failed`&&a!==void 0?(0,X.jsx)(`div`,{className:`caps-generation-failure`,"data-layer":`failure`,role:`alert`,children:a}):null]})}),ude=`modulepreload`,dde=function(e,t){return new URL(e,t).href},z9={},fde=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=dde(t,n),t=s(t),t in z9)return;z9[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:ude,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},B9=0,pde=320,mde=656;function hde(e,t){return e<=0||!Number.isFinite(t)||t<=0?0:e===1?1:e<=4?2:t>=1280?4:t>=mde?3:2}function V9({item:e}){return E$(e.path)?(0,X.jsx)(`video`,{"aria-label":e.path,className:`block h-full w-full object-cover`,"data-media-thumb":!0,loop:!0,muted:!0,playsInline:!0,src:e.url}):(0,X.jsx)(`img`,{alt:e.path,className:`block h-full w-full object-cover`,"data-media-thumb":!0,src:e.url})}var gde=(0,K.memo)(function({item:e}){let t=(0,K.useRef)(null);(0,K.useEffect)(()=>{e.onVisible?.()},[e.onVisible]);let[n,r]=(0,K.useState)(e.pending===!0&&!e.onVisible);return e.pending&&!e.onVisible&&!n&&r(!0),(0,K.useLayoutEffect)(()=>{let r=t.current;if(!r||e.pending||n)return;let i=window.matchMedia(`(prefers-reduced-motion: reduce)`);if(i.matches)return;let a=!0,o,s,c=()=>o?.();return fde(async()=>{let{animate:e,spring:t}=await Promise.resolve().then(()=>BR);return{animate:e,spring:t}},void 0,import.meta.url).then(({animate:e,spring:t})=>{if(!a)return;let n=e(r,{opacity:{from:0,to:1,duration:160,ease:`outQuad`},translateY:{from:6,to:0,ease:t({bounce:.16,duration:320})},scale:{from:.985,to:1,ease:t({bounce:.16,duration:320})}});o=()=>{n.complete()},s=()=>{n.revert()}}),i.addEventListener(`change`,c),()=>{a=!1,i.removeEventListener(`change`,c),s?.()}},[e.key,e.pending,n]),(0,X.jsxs)(`div`,{ref:t,className:`prints-gallery-tile`,"data-referenced":e.referenced?!0:void 0,children:[(0,X.jsx)(`button`,{className:`block h-full w-full overflow-hidden bg-base-200 p-0 text-left`,"data-media-thumb-wrap":!0,type:`button`,disabled:e.pending,onClick:()=>{e.onOpen(e.path)},onKeyDown:t=>{t.key.toLowerCase()===`i`&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&e.onInfo&&(t.preventDefault(),e.onInfo())},title:e.path,children:(0,X.jsx)(`div`,{className:`caps-item block! h-full w-full overflow-hidden rounded-none! border-0! bg-transparent! shadow-none! z-auto! -outline-offset-2!`,"data-selected":e.selected??!1,children:e.pending||n||e.error?(0,X.jsx)(lde,{"data-media-pending":e.pending?`true`:void 0,failure:e.error?(0,X.jsx)(`span`,{title:e.error,className:`prints-tile-failed`,children:(0,X.jsx)(e8,{size:`compact`,appearance:`chip`,glyph:`bang`,tone:`error`,label:`Not saved`})}):void 0,indicator:(0,X.jsx)(ez,{decorative:!0,size:`fill`,tone:`accent`,variant:`bloom`}),label:e.pendingLabel??`Preparing image…`,status:e.pending?e.error?`failed`:`generating`:`done`,children:e.pending?null:(0,X.jsx)(V9,{item:e})}):(0,X.jsx)(V9,{item:e})})}),e.error?(0,X.jsxs)(`div`,{className:`prints-gallery-pending-actions`,children:[e.onRetry?(0,X.jsx)(dz,{"aria-label":`Retry ${e.path}`,icon:(0,X.jsx)(lB,{}),onClick:e.onRetry}):null,e.onDismiss?(0,X.jsx)(dz,{"aria-label":`Dismiss ${e.path}`,icon:(0,X.jsx)(mB,{}),onClick:e.onDismiss}):null]}):null,(0,X.jsxs)(`div`,{className:`prints-gallery-tools`,children:[!e.pending&&e.onInfo?(0,X.jsx)(dz,{"aria-label":`Image info: ${e.path}`,title:`Image info (I)`,"aria-keyshortcuts":`I`,onClick:e.onInfo,icon:(0,X.jsx)(oB,{})}):null,!e.pending&&e.onToggleReference?(0,X.jsx)(dz,{className:`prints-gallery-reference`,"aria-label":`${e.referenced?`Remove reference`:`Add reference`}: ${e.path}`,title:e.referenced?`Remove reference`:`Add reference`,"aria-pressed":e.referenced??!1,disabled:e.referenceDisabled,onClick:e.onToggleReference,icon:e.referenced?(0,X.jsx)(Zz,{}):(0,X.jsx)(aB,{})}):null]})]})}),_de=(0,K.memo)(function({children:e,style:t,...n}){return(0,X.jsx)(`div`,{"data-media-grid":!0,...n,style:t,children:e})});function vde(e,t){let[n,r]=(0,K.useState)({height:0,width:0});return(0,K.useEffect)(()=>{let t=e.current;if(!t)return;let n=()=>{r(e=>{let n={height:t.clientHeight,width:t.clientWidth};return n.width===e.width&&n.height===e.height?e:n})};n();let i=new ResizeObserver(n);return i.observe(t),window.addEventListener(`resize`,n),()=>{i.disconnect(),window.removeEventListener(`resize`,n)}},[e,t]),n}function yde(e){let[t,n]=(0,K.useState)(0),[r,i]=(0,K.useState)(!1);return(0,K.useEffect)(()=>{let t=e.current;if(!t)return;let r=null,a=()=>{n(t.scrollTop),i(!0),r!==null&&clearTimeout(r),r=setTimeout(()=>{i(!1)},150)};return t.addEventListener(`scroll`,a,{passive:!0}),()=>{t.removeEventListener(`scroll`,a),r!==null&&clearTimeout(r)}},[e]),{isScrolling:r,scrollTop:t}}function bde(e,t){let n=Math.max(1,hde(e.length,t));return(0,K.useMemo)(()=>{let r=Math.floor((t-(n-1)*B9)/n),i=ode(n,r,B9);return r>0&&e.forEach((e,t)=>{let n=e.height>0?e.width/e.height:1;i.set(t,r/n)}),i},[e,t,n])}var xde=(0,K.memo)(function({data:e,width:t}){let n=e.height>0?e.width/e.height:1;return(0,X.jsx)(`div`,{"data-media-tile":e.key,style:{height:t/n,width:t},children:(0,X.jsx)(gde,{item:e})})});function H9(e,t){let n=Array.from(e.querySelectorAll(`[data-media-tile]`)).find(e=>e.dataset.mediaTile===t)?.querySelector(`[data-media-thumb-wrap]`);return!n||n.disabled?!1:(n.focus({preventScroll:!0}),!0)}function Sde(e,t,n){let r=e.ownerDocument;(r.activeElement!==r.body||H9(e,t))&&n()}function Cde(e,t,n){let r=n.top+t.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop;return(r<e.scrollTop||r+n.height>e.scrollTop+e.clientHeight)&&e.scrollTo({top:r,behavior:`instant`}),r}var wde=(0,K.memo)(function({items:e,scrollRef:t,focus:n}){let r=vde(t,e.length),i=r.width||pde,a=bde(e,i),{isScrolling:o,scrollTop:s}=yde(t),c=(0,K.useRef)(new Set),l=(0,K.useRef)(null),u=(0,K.useRef)(null);(0,K.useEffect)(()=>{if(!n)return;let o=l.current===n.requestId;if(o&&u.current===i)return;let s=t.current,c=e.findIndex(e=>e.key===n.key),d=a.get(c);if(!s||!d||r.height===0)return;let f=s.querySelector(`[data-media-grid]`);if(!f)return;let p=Cde(s,f,d);if(o){Sde(s,n.key,()=>{u.current=i});return}H9(s,n.key)?(l.current=n.requestId,u.current=i,n.onFocus()):s.scrollTo({top:p,behavior:`instant`})},[n,e,r.height,t,s,a,i]),(0,K.useEffect)(()=>{let n=t.current;if(!n||r.width===0||r.height===0)return;let i=e.reduce((e,t,n)=>t.pending&&!t.onVisible&&!c.current.has(t.key)?n:e,-1);if(c.current=new Set(e.map(e=>e.key)),i<0)return;let o=a.get(i),s=n.querySelector(`[data-media-grid]`);if(!o||!s)return;let l=s.getBoundingClientRect().top-n.getBoundingClientRect().top+n.scrollTop+o.top,u=l+o.height;l>=n.scrollTop&&u<=n.scrollTop+n.clientHeight||n.scrollTo({top:Math.max(0,l-Math.max(0,(n.clientHeight-o.height)/2)),behavior:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`instant`:`smooth`})},[e,r.width,r.height,t,a]);let d=(0,K.useCallback)(({data:e,width:t})=>(0,X.jsx)(xde,{data:e,width:t}),[]);return ede({as:_de,height:r.height,isScrolling:o,itemKey:e=>e.key,items:e,overscanBy:2,positioner:a,render:d,scrollTop:s})});function Tde({items:e,scrollRef:t,focus:n}){return(0,X.jsx)(`section`,{"data-media-mosaic":!0,children:(0,X.jsx)(wde,{items:e,scrollRef:t,focus:n})})}function Ede(e,t,n){let r=new Map(e.map(e=>[e.key,e])),i=new Set(t.map(e=>e.key));return[...t.filter(e=>!e.resolved||r.has(e.key)).map(e=>{let t=r.get(e.key);return t&&e.resolved?t:n(e)}),...e.filter(e=>!i.has(e.key))]}function Dde(e,t){return e.animate(t.reduced?[{opacity:1},{opacity:0}]:[{opacity:1,transform:`none`},{opacity:0,transform:`translateY(-120%)`}],{duration:t.reduced?t.fast:t.normal,easing:fI(t,t.easeExit),fill:`backwards`})}function Ode(e,t){let n=-12*Math.min(1.5,t.bounce/.3);return e.animate(t.reduced?[{opacity:0},{opacity:1}]:[{opacity:0,transform:`translateY(70%)`},{opacity:1,transform:`translateY(${String(n)}%)`,offset:.6},{opacity:1,transform:`none`}],{duration:t.reduced?t.fast:t.springDuration,easing:fI(t,t.ease),fill:`backwards`})}function U9(e,t,n){return e.animate([{opacity:1-n},{opacity:n}],{duration:t.reduced?t.fast:t.normal,delay:n===1&&!t.reduced?t.fast/2:0,easing:fI(t,t.ease),fill:`backwards`})}function kde(e,t){let n=1+.05*Math.min(1.5,.4+t.bounce/.3);return e.animate([{transform:`scale(1)`},{transform:`scale(${String(n)})`,offset:.4},{transform:`scale(1)`}],{duration:t.springDuration,easing:fI(t,`ease-out`)})}var Ade=(0,K.forwardRef)(function({state:e,onStop:t,stopLabel:n=`Stop`,iconSize:r=20,onClick:i,disabled:a,className:o,tone:s=`primary`,"aria-label":c,...l},u){let d=(0,K.useRef)(null);(0,K.useImperativeHandle)(u,()=>d.current);let f=(0,K.useRef)(e);(0,K.useLayoutEffect)(()=>{let t=d.current,n=f.current;if(f.current=e,!t||n===e||!pI(t))return;let r=t.querySelector(`[data-glyph="arrow"]`),i=t.querySelector(`[data-glyph="busy"]`);if(!r||!i)return;let a=lI(t),o=[];return e===`busy`?o.push(Dde(r,a),U9(i,a,1)):n===`busy`&&o.push(U9(i,a,0),Ode(r,a)),n===`empty`&&e===`ready`&&!a.reduced&&o.push(kde(t,a)),()=>{for(let e of o)e.cancel()}},[e]);let p=e===`busy`,m=p&&t!==void 0;return(0,X.jsx)(nI,{...l,ref:d,className:Z(`caps-send-action`,o),tone:s,"aria-busy":p?!0:void 0,"aria-label":m?n:c,"data-send-state":e,disabled:a===!0||e===`empty`||p&&!m,onClick:m?t:i,label:null,icon:(0,X.jsxs)(`span`,{className:`caps-send-glyph`,"data-state":e,children:[(0,X.jsx)(`span`,{"data-glyph":`arrow`,children:(0,X.jsx)(Xz,{"aria-hidden":`true`,size:r})}),(0,X.jsx)(`span`,{"data-glyph":`busy`,children:t===void 0?(0,X.jsx)(ez,{decorative:!0,size:`sm`}):(0,X.jsx)(fB,{"aria-hidden":`true`,fill:`currentColor`,size:Math.round(r*.7)})})]})})});function W9(e,t){return`${e}-${String(t)}`}function jde(e){switch(e.key){case`ArrowDown`:return`next`;case`ArrowUp`:return`previous`;case`Enter`:return e.shiftKey?null:`accept`;case`Tab`:return`accept`;case`Escape`:return`dismiss`;default:return null}}function Mde(e){return{role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":e.open,"aria-controls":e.open?e.listId:void 0,"aria-activedescendant":e.open?W9(e.listId,e.selected):void 0}}function G9({open:e,rows:t,selected:n,listId:r,label:i,kind:a,hint:o,empty:s,onHighlight:c,onChoose:l}){return(0,X.jsx)(Y6,{open:e,side:`top`,"data-parakeet-slash":``,children:(0,X.jsxs)(`div`,{className:`parakeet-slash-menu`,"data-kind":a,children:[o===void 0?null:(0,X.jsx)(`p`,{className:`parakeet-slash-hint`,children:o}),t.length===0?s===void 0?null:(0,X.jsx)(`p`,{className:`parakeet-slash-hint`,children:s}):(0,X.jsx)(`div`,{id:r,role:`listbox`,"aria-label":i,children:t.map((e,t)=>(0,X.jsxs)(Eoe,{id:W9(r,t),active:t===n,"aria-disabled":e.disabled===!0||void 0,"data-disabled":e.disabled===!0,onMouseEnter:()=>{c(t)},onClick:()=>{l(t)},children:[e.media===void 0?null:(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`parakeet-slash-media`,children:e.media}),(0,X.jsx)(`span`,{className:`parakeet-slash-label`,children:e.label}),(0,X.jsx)(`span`,{className:`parakeet-slash-detail`,children:e.detail}),e.keys===void 0||e.keys.length===0?null:(0,X.jsx)(`kbd`,{className:`parakeet-slash-keys`,children:e.keys})]},e.key))})]})})}function Nde(e,t=/Mac|iPhone|iPad/u.test(globalThis.navigator.userAgent)){return e.startsWith(`<leader>`)?`Ctrl K ${e.slice(8)}`:e.split(` `).map(e=>e.split(`+`).map(e=>e===`mod`?t?`⌘`:`Ctrl`:e===`escape`?`Esc`:e.length===1?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1)).join(e===`ctrl+k`||e===`mod+k`?` `:`+`)).join(` `)}function Pde(e){let t=new Map;for(let n of e.bindings)t.set(n.commandId,[...t.get(n.commandId)??[],Nde(n.binding)]);return e.slash.map(e=>({alias:e.alias,commandId:e.commandId,command:e.command,title:e.title,description:e.description,category:e.category,order:e.order,grammar:e.arguments,consumesDraft:e.consumesDraft,keys:t.get(e.commandId)??[],availability:e.availability}))}function Fde(e,t){let n=e.toLocaleLowerCase(),r=t.toLocaleLowerCase();if(r.length===0)return{tier:0,spread:0,indices:[]};let i=e=>Array.from({length:r.length},(t,n)=>e+n);if(n.startsWith(r))return{tier:0,spread:n.length-r.length,indices:i(0)};let a=n.search(RegExp(`[-_\\s]${r.replaceAll(/[.*+?^${}()|[\]\\]/gu,`\\$&`)}`,`u`));if(a>=0)return{tier:1,spread:a,indices:i(a+1)};let o=n.indexOf(r);if(o>=0)return{tier:2,spread:o,indices:i(o)};let s=[],c=0;for(let e of r){let t=n.indexOf(e,c);if(t<0)return;s.push(t),c=t+1}let l=s[0]??0;return{tier:3,spread:(s.at(-1)??0)-l-r.length+1,indices:s}}function Ide(e,t,n,r){return e.map(e=>({entry:e,match:Fde(t(e),n)})).filter(e=>e.match!==void 0).sort((e,n)=>e.match.tier-n.match.tier||e.match.spread-n.match.spread||r(e.entry)-r(n.entry)||t(e.entry).localeCompare(t(n.entry))).map(({entry:e,match:t})=>({entry:e,indices:t.indices}))}var K9=[`help`,`login`,`model`];function Lde(e,t,n={}){if(!t.startsWith(`/`)||t.includes(`
|
|
91
|
-
`))return{kind:`none`};let r=t.search(/\s/u);if(r<0){let r=t.slice(1);return{kind:`commands`,query:r,items:Ide(e.filter(e=>e.availability.status===`available`&&(r.length===0?e.category===(n.idleCategory??`Conversation`)||K9.includes(e.alias):e.category!==`Advanced`||e.alias.toLocaleLowerCase().startsWith(r.toLocaleLowerCase()))),e=>e.alias,r,e=>{let t=K9.indexOf(e.alias);return r.length===0&&t>=0?t-K9.length:e.order}).map(({entry:e,indices:t})=>({command:e,label:`/${e.alias}`,matches:t.map(e=>e+1),insert:e.grammar===void 0?`/${e.alias}`:`/${e.alias} `}))}}let i=t.slice(1,r),a=e.find(e=>e.alias===i);if(a?.grammar===void 0||a.availability.status!==`available`)return{kind:`none`};let o=t.slice(r).trimStart(),s=(o.includes(` `)?[]:a.grammar.words??[]).filter(e=>e.word.toLocaleLowerCase().startsWith(o.toLocaleLowerCase())).map(e=>({word:e,label:e.word,matches:Array.from({length:o.length},(e,t)=>t),insert:`/${i} ${e.word}`}));return{kind:`arguments`,command:a,query:o,hint:`/${i} ${a.grammar.hint}`,items:s}}var q9=`prints-prompt-counter`;function Rde({busy:e,disabled:t,label:n,onGenerate:r,promptOver:i}){return(0,X.jsx)(Ade,{"aria-describedby":i?q9:void 0,"aria-label":n,className:`prints-generate`,"data-generation-submit":!0,disabled:t||i,onClick:r,state:e?`busy`:`ready`,title:n})}function zde({caretRequest:e,disabled:t,maxLength:n,addedLength:r=0,menu:i,mentionCount:a,onCaret:o,onChange:s,onMentionDismiss:c,onMentionMove:l,onMentionPick:u,onSend:d,onSlashMove:f,onSlashPick:p,placeholder:m,slashCount:h,value:g}){let _=(0,K.useRef)(null),v=(0,K.useRef)(g),[y,b]=(0,K.useState)([]),[x,S]=(0,K.useState)(-1),[C,w]=(0,K.useState)(!1),T=(0,K.useRef)(!1),E=(0,K.useRef)(!1);v.current=g,(0,K.useLayoutEffect)(()=>{if(C||t||!E.current)return;E.current=!1;let e=_.current;e&&e.ownerDocument.activeElement===e.ownerDocument.body&&e.focus({preventScroll:!0})},[t,C]),(0,K.useLayoutEffect)(()=>{let t=_.current;!t||e?.value!==g||(t.setSelectionRange(e.caret,e.caret),t.focus({preventScroll:!0}))},[e,g]),(0,K.useLayoutEffect)(()=>{let e=_.current;e&&(e.style.height=`auto`,e.style.height=`${String(Math.min(e.scrollHeight,160))}px`)},[g]);let D=(0,K.useCallback)(async()=>{let e=v.current.trim();if(!(!e||t||T.current)&&!(n!==void 0&&e.length+r>n)){E.current=_.current===_.current?.ownerDocument.activeElement,T.current=!0,w(!0);try{if(!await d())return;b(t=>t.at(-1)===e?t:[...t,e].slice(-20)),S(-1),s(``)}finally{T.current=!1,w(!1)}}},[t,n,s,d,r]),O=g.trim().length,k=O>0?O+r:0,A=n!==void 0&&k>n;return(0,X.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,X.jsx)(I7,{"aria-invalid":A?!0:void 0,"aria-label":`Image prompt`,className:`min-h-12 max-h-40 w-full resize-none !border-0 !bg-transparent !shadow-none focus:!outline-none`,"data-generation-prompt":!0,...Mde(i),disabled:t===!0||C,onChange:e=>{s(e.currentTarget.value),o(e.currentTarget.selectionStart),S(-1)},onSelect:e=>{o(e.currentTarget.selectionStart)},onKeyDown:e=>{if(o8(e))return;let t=jde(e);if(a>0&&t!==null){e.preventDefault(),t===`next`?l(1):t===`previous`?l(-1):t===`accept`?u():c();return}if(g.startsWith(`/`)&&t!==null&&(h>0||t===`dismiss`||e.key===`Enter`)){if(e.preventDefault(),t===`dismiss`)s(g.slice(1));else if(h)t===`next`?f(1):t===`previous`?f(-1):p();else return;return}if(e.key===`Enter`&&!e.shiftKey){e.preventDefault(),D();return}if(e.key===`ArrowUp`&&_.current?.selectionStart===0&&y.length&&(x===-1||x>0)){e.preventDefault();let t=x===-1?y.length-1:x-1;S(t),s(y[t]);return}if(e.key===`ArrowDown`&&x!==-1){e.preventDefault();let t=x+1;t>=y.length?(S(-1),s(``)):(S(t),s(y[t]))}},placeholder:m,ref:_,rows:1,value:g}),n!==void 0&&k>0?(0,X.jsx)(`p`,{className:`px-3 pb-1 text-xs tabular-nums ${A?`text-error`:`text-dim`}`,"data-prompt-counter":!0,id:q9,role:A?`alert`:`status`,children:A?`${String(k)} / ${String(n)} characters. This model accepts up to ${String(n)}; shorten the prompt${r>0?` or its style and characters`:``} by ${String(k-n)} or pick another model.`:`${String(k)} / ${String(n)}`}):null]})}function Bde({index:e,listId:t,matches:n,onHighlight:r,onPick:i}){return(0,X.jsx)(G9,{open:!0,rows:n.map(e=>({key:e.id,label:`/${e.slash}`,detail:e.description??e.title})),selected:e,listId:t,label:`Commands`,kind:`commands`,empty:`No matching commands`,onHighlight:r,onChoose:i})}function Vde(e,t){let[n,r]=(0,K.useState)(0),i=t.startsWith(`/`),a=(0,K.useMemo)(()=>{if(!i)return[];let n=Lde(e.map((e,t)=>({alias:e.slash,commandId:e.id,command:e.command,title:e.title,description:e.description,category:`Prompt`,order:t,keys:[],availability:{status:`available`}})),t,{idleCategory:`Prompt`});return n.kind===`commands`?n.items.flatMap(({command:t})=>e.find(e=>e.id===t.commandId)??[]):[]},[t,e,i]);return(0,K.useEffect)(()=>{r(0)},[t]),{moveSlash:e=>{r(t=>a.length?(t+e+a.length)%a.length:0)},highlightSlash:r,resetSlash:()=>{r(0)},slashIndex:n,slashMatches:a,slashOpen:i}}function Hde({images:e,index:t,listId:n,matches:r,onHighlight:i,onPick:a}){return(0,X.jsx)(G9,{open:!0,rows:r.map(t=>{let n=t.references.at(0)?.path,r=e.find(e=>e.path===n);return{key:String(t.id),label:`@${t.name}`,detail:t.description||void 0,media:(0,X.jsx)(`span`,{className:`prints-character-thumb mask mask-squircle`,children:r?(0,X.jsx)(`img`,{src:r.url,alt:``}):null})}}),selected:t,listId:n,label:`Characters`,kind:`characters`,onHighlight:i,onChoose:a})}function Ude(e,t){let[n,r]=(0,K.useState)(0),[i,a]=(0,K.useState)(0),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(null),u=o===t?null:Cre(t,n),d=u?wre(e,u.query):[];return(0,K.useEffect)(()=>{a(0)},[t]),{caretRequest:c,matches:d,index:i,setCaret:r,highlight:a,dismiss:()=>{s(t)},move:e=>{a(t=>d.length?(t+e+d.length)%d.length:0)},complete:e=>{let i=d.at(e);if(!u||!i)return null;let a=`${t.slice(0,u.start)}@${i.name} ${t.slice(n)}`,o=u.start+i.name.length+2;return l({value:a,caret:o}),r(o),a}}}function Wde(e){let t=Nw(),n=BT(Nre(e)),r=n=>({mutationFn:t=>{let r=e?.context.get().computerId;if(!e||!r)throw Error(`No Computer selected`);return n(e,r,t)},onSuccess:n=>{t.setQueryData(xF.characters(e),n)}}),i=HT(r((e,t,n)=>Ere(e.capabilities,t,n))),a=HT(r((e,t,n)=>Dre(e.capabilities,t,n))),o=i.error??a.error??n.error;return{characters:n.data?.characters??[],error:o?Ow(o).message:null,busy:i.isPending||a.isPending,save:(e,t)=>{i.mutate(e,{onSuccess:t})},remove:(e,t)=>{a.mutate(e,{onSuccess:t})}}}var J9=RC(iF),Y9=e=>e.split(`/`).at(-1)??e;function Gde({paths:e,images:t}){return(0,X.jsx)(`span`,{className:`flex gap-xs`,children:e.map(e=>{let n=t.find(t=>t.path===e);return(0,X.jsx)(`span`,{className:`prints-character-thumb mask mask-squircle`,title:e,children:n?(0,X.jsx)(`img`,{src:n.url,alt:Y9(e)}):null},e)})})}function Kde({characters:e,images:t,open:n,onOpenChange:r,busy:i,error:a,canUpload:o,onUpload:s,onSave:c,onDelete:l}){let[u,d]=(0,K.useState)(null),f=u?.name.trim()??``,p=f!==``&&!J9(f)?`Use letters, numbers, - and _ only, so you can type @name.`:null;return(0,X.jsx)(f9,{open:n,onOpenChange:e=>{e||d(null),r(e)},children:(0,X.jsxs)(m9,{children:[(0,X.jsx)(g9,{children:(0,X.jsx)(_9,{children:`Characters`})}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-sm`,children:[e.length===0&&u===null?(0,X.jsx)(`p`,{className:`text-sm`,children:`No characters yet. Save one, then type @name in a prompt to keep it the same in every image.`}):(0,X.jsx)(`ul`,{className:`flex flex-col gap-sm`,"aria-label":`Saved characters`,children:e.map(e=>(0,X.jsxs)(`li`,{className:`flex items-center justify-between gap-sm`,children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-sm`,children:[(0,X.jsx)(Gde,{paths:e.references.map(e=>e.path),images:t}),(0,X.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`@`,e.name]})]}),(0,X.jsxs)(`span`,{className:`flex gap-xs`,children:[(0,X.jsx)(rz,{size:`xs`,variant:`ghost`,type:`button`,onClick:()=>{d(e)},children:`Edit`}),(0,X.jsx)(rz,{size:`xs`,variant:`ghost`,type:`button`,disabled:i,onClick:()=>{l(e,()=>{u?.id===e.id&&d(null)})},children:`Delete`})]})]},e.id))}),u===null?(0,X.jsx)(rz,{size:`xs`,type:`button`,onClick:()=>{d({name:``,description:``,references:[]})},children:`New character`}):(0,X.jsxs)(`div`,{className:`flex flex-col gap-sm`,children:[(0,X.jsx)(I6,{"aria-label":`Character name`,maxLength:32,placeholder:`Name, typed as @name`,value:u.name,onChange:e=>{d({...u,name:e.currentTarget.value})}}),p?(0,X.jsx)(`p`,{role:`alert`,className:`text-xs`,children:p}):null,(0,X.jsx)(I7,{"aria-label":`Character description`,maxLength:500,rows:4,placeholder:`Short description added to the prompt, e.g. a tall girl with silver hair and a red scarf`,value:u.description,onChange:e=>{d({...u,description:e.currentTarget.value})}}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-sm`,children:[(0,X.jsxs)(`span`,{className:`text-xs`,children:[`Reference images (`,u.references.length,` /`,` `,8,`)`]}),(0,X.jsxs)(rz,{size:`xs`,variant:`ghost`,type:`button`,disabled:!o,onClick:s,children:[(0,X.jsx)(pB,{"aria-hidden":`true`,size:14}),`Upload`]})]}),t.length===0?(0,X.jsx)(`p`,{className:`text-xs`,children:`No images in the Prints folder yet. Upload one to use it as a reference.`}):(0,X.jsx)(`ul`,{className:`prints-character-picker`,"aria-label":`Reference images`,children:t.map(e=>{let t=u.references.some(t=>t.path===e.path);return(0,X.jsx)(`li`,{title:e.path,children:(0,X.jsxs)(`label`,{className:`prints-character-pick`,children:[(0,X.jsx)(`img`,{src:e.url,alt:``}),(0,X.jsx)(`span`,{className:`prints-character-check`,children:(0,X.jsx)(a8,{"aria-label":`Use ${Y9(e.path)}`,checked:t,disabled:!t&&u.references.length>=8,onChange:()=>{d({...u,references:t?u.references.filter(t=>t.path!==e.path):[...u.references,{path:e.path}]})}})})]})},e.path)})}),(0,X.jsxs)(`div`,{className:`flex gap-xs`,children:[(0,X.jsx)(rz,{size:`xs`,variant:`primary`,type:`button`,disabled:i||!J9(f),onClick:()=>{c({id:u.id,name:f,description:u.description.trim(),references:u.references},()=>{d(null)})},children:`Save character`}),(0,X.jsx)(rz,{size:`xs`,variant:`ghost`,type:`button`,onClick:()=>{d(null)},children:`Cancel`})]})]}),a?(0,X.jsx)(`p`,{role:`alert`,className:`text-xs`,children:a}):null]}),(0,X.jsx)(h9,{children:(0,X.jsx)(v9,{render:(0,X.jsx)(rz,{variant:`outline`,size:`sm`}),children:`Close`})})]})})}var X9=q({destination:WC(iw(XC)),height:WC(vw),model:WC(XC),prompt:WC(XC),references:WC(ew(q({path:XC,role:WC(rw([`first-frame`,`last-frame`,`reference`]))}))),generateAudio:WC(iw(QC)),steps:WC(iw(vw)),style:WC(iw(XC)),width:WC(vw)}),qde=rl(fs(),lu()).parse(structuredClone(ww(X9,{onExcessProperty:`error`}).schema)),Z9=(e,t,n,r)=>({id:e,title:t,category:`Image generation`,description:n,projections:{agent:{}},action:r===void 0?{presentation:{type:`action`}}:{inputSchema:r,presentation:{type:`action`}}}),Jde=Z9(`inspect-generation-draft`,`Inspect image draft`,`Read the current Prints image form and available models`),Yde=Z9(`set-generation-draft`,`Edit image draft`,`Set selected Prints image form fields; this does not generate an image`,qde),Xde=Z9(`submit-generation-draft`,`Generate image`,`Submit the current Prints image form using the same action as the Send button`);function Zde(e,t){let n=!1,r=new Set,i=(t,i)=>{e.commands.register(t,i).then(e=>{n?e():r.add(e)},()=>void 0)};return i(Jde,()=>{if(n)return;let e=t.readDraft();return{draft:{destination:e.destination??null,height:e.height,model:e.model,prompt:e.prompt,generateAudio:e.generateAudio??null,references:e.references.map(e=>({path:e.path,role:e.role??null})),steps:e.steps??null,style:e.style??null,width:e.width},models:t.readModels().map(e=>({id:e.id,label:e.label,defaultHeight:e.input.defaultHeight,defaultWidth:e.input.defaultWidth,maxReferences:e.input.maxReferences}))}}),i(Yde,({arguments:e})=>{if(n)return;let r=HC(X9,{onExcessProperty:`error`})(e);t.setDraft(r)}),i(Xde,async()=>{if(!n)return{accepted:await t.submit()}}),()=>{if(!n){n=!0;for(let e of r)e();r.clear()}}}function Qde(e){return[{id:`clear-prompt`,title:`Clear prompt`,category:`Prompt`,description:`Remove the current prompt`,projections:{slash:{aliases:[`clear`],order:0},palette:{}},handler:()=>{e().clear()}},..._B.map((t,n)=>({id:`size-${t}`,title:`Use ${t} size`,category:`Prompt`,description:`Use ${String(gB[t].width)} × ${String(gB[t].height)}`,projections:{slash:{aliases:[t],order:n+1},palette:{}},handler:()=>{e().useSize(t)}})),{id:`choose-style`,title:`Choose style`,category:`Prompt`,description:`Pick, create or edit a saved style`,projections:{slash:{aliases:[`style`],order:4},palette:{}},handler:()=>{e().openStyles()}},{id:`no-style`,title:`Use no style`,category:`Prompt`,description:`Send the prompt without a style`,projections:{slash:{aliases:[`nostyle`],order:5},palette:{}},handler:()=>{e().clearStyle()}}]}function $de(e,t){let n=(0,K.useRef)(e);n.current=e;let r=QM(t,{sourceId:`media-prompt`,namespace:`media`},(0,K.useCallback)(()=>Qde(()=>n.current),[])),i=(0,K.useSyncExternalStore)(r.subscribe,r.snapshot,r.snapshot);return{items:(0,K.useMemo)(()=>Pde(i).map(e=>({id:e.commandId,command:e.command,slash:e.alias,title:e.title,description:e.description})),[i]),run:e=>{r.execute(e,{origin:`slash`})}}}function efe(e){let t=Nw(),n=BT(jre(e)),r=n=>({mutationFn:t=>{let r=e?.context.get().computerId;if(!e||!r)throw Error(`No Computer selected`);return n(e,r,t)},onSuccess:n=>{t.setQueryData(xF.styles(e),n)}}),i=HT(r((e,t,n)=>eF(e.capabilities,t,n))),a=HT(r((e,t,n)=>tF(e.capabilities,t,n))),o=i.error??a.error??n.error;return{styles:n.data?.styles??[],error:o?Ow(o).message:null,busy:i.isPending||a.isPending,save:(e,t)=>{i.mutate(e,{onSuccess:n=>{t(n.styles.find(t=>t.name===e.name))}})},remove:(e,t)=>{a.mutate(e,{onSuccess:t})}}}function Q9(e){let t=e.filter(e=>e.kind===`video`&&e.video!==null&&e.input.maxReferences>=1&&e.video.referenceRoles.includes(`first-frame`));return t.find(e=>e.video?.provider===`seedance`)??t.at(0)}function tfe(e,t,n){let r=e.video;if(r===null)return;let i=Math.log(t/n),a=e=>Math.abs(Math.log(e.width/e.height)-i);return r.formats.filter(e=>e.resolution===r.defaultResolution).reduce((e,t)=>e===void 0||a(t)<a(e)?t:e,void 0)}function nfe(e,t){let{lineage:n,printPath:r,models:i,current:a}=t,o=e===`animate`?Q9(i):void 0;if(e===`animate`&&o===void 0)return{kind:`refused`,message:`No video model on this Computer takes a first frame.`};let s=FB(i,n.model),c=o??s??FB(i,a.model);if(c===void 0)return{kind:`refused`,message:`Choose a model from the granted registry.`};let l=o===void 0&&s===void 0?`This print was made with ${n.model}, which is no longer available. Loaded it with ${PB(c)} instead.`:null,u=n.references.slice(0,n.typed.references),d=e===`animate`?{path:r,role:`first-frame`}:{path:r},f=[d,...u.filter(e=>e.path!==r)];if(e!==`reuse`&&c.input.maxReferences===0)return{kind:`refused`,message:`${c.label} does not take reference images.`};let p=e===`reuse`?u:e===`remix`?f:[d],m=IB(a,c),h={width:n.width??m.width,height:n.height??m.height},g=o===void 0?NB(h,c,void 0):tfe(c,h.width,h.height)??m,_=o===void 0&&c.input.steps!==`fixed`&&n.steps!==null&&c.id===n.model?n.steps:m.steps,v=n.style!==null&&t.styles.includes(n.style)?n.style:void 0;return{kind:`draft`,notice:l,draft:{...m,destination:void 0,prompt:n.typed.prompt,references:p,steps:_,style:v,width:g.width,height:g.height}}}function rfe({id:e,styles:t,selected:n,disabled:r,onSelect:i}){let a=n===void 0||t.some(e=>e.name===n);return(0,X.jsxs)(W6,{id:e,"aria-label":`Prompt style`,"data-generation-style":!0,className:`select-sm`,disabled:r,onChange:e=>{i(e.currentTarget.value||void 0)},value:n??``,children:[(0,X.jsx)(`option`,{value:``,children:`No style`}),a?null:(0,X.jsx)(`option`,{value:n,children:n}),t.map(e=>(0,X.jsx)(`option`,{value:e.name,children:e.name},e.id))]})}function ife({styles:e,selected:t,open:n,onOpenChange:r,busy:i,error:a,onSelect:o,onSave:s,onDelete:c}){let[l,u]=(0,K.useState)(null);return(0,X.jsx)(f9,{open:n,onOpenChange:r,children:(0,X.jsxs)(m9,{children:[(0,X.jsx)(g9,{children:(0,X.jsx)(_9,{children:`Styles`})}),(0,X.jsx)(`ul`,{className:`space-y-1`,"aria-label":`Saved styles`,children:e.map(e=>(0,X.jsxs)(`li`,{className:`flex items-center justify-between gap-sm`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,X.jsxs)(`span`,{className:`flex gap-xs`,children:[(0,X.jsx)(rz,{size:`xs`,variant:t===e.name?`primary`:`ghost`,type:`button`,"aria-pressed":t===e.name,onClick:()=>{o(e.name),r(!1)},children:`Use`}),e.builtIn?null:(0,X.jsx)(rz,{size:`xs`,variant:`ghost`,type:`button`,onClick:()=>{u(e)},children:`Edit`}),(0,X.jsx)(rz,{size:`xs`,variant:`ghost`,type:`button`,onClick:()=>{u({name:`${e.name} copy`.slice(0,64),text:e.text})},children:`Duplicate`}),e.builtIn?null:(0,X.jsx)(rz,{size:`xs`,variant:`ghost`,type:`button`,disabled:i,onClick:()=>{c(e,()=>{t===e.name&&o(void 0),l?.id===e.id&&u(null)})},children:`Delete`})]})]},e.id))}),l===null?(0,X.jsx)(rz,{size:`xs`,type:`button`,onClick:()=>{u({name:``,text:``})},children:`New style`}):(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(I6,{"aria-label":`Style name`,maxLength:64,value:l.name,onChange:e=>{u({...l,name:e.currentTarget.value})}}),(0,X.jsx)(I7,{"aria-label":`Style text`,maxLength:8e3,rows:6,value:l.text,onChange:e=>{u({...l,text:e.currentTarget.value})}}),(0,X.jsxs)(`div`,{className:`flex gap-xs`,children:[(0,X.jsx)(rz,{size:`xs`,variant:`primary`,type:`button`,disabled:i||l.name.trim()===``||l.text.trim()===``,onClick:()=>{let n=e.find(e=>e.id===l.id);s({id:l.id,name:l.name.trim(),text:l.text},e=>{n&&t===n.name&&e&&o(e.name),u(null)})},children:`Save style`}),(0,X.jsx)(rz,{size:`xs`,variant:`ghost`,type:`button`,onClick:()=>{u(null)},children:`Cancel`})]})]}),a?(0,X.jsx)(`p`,{role:`alert`,className:`text-xs`,children:a}):null,(0,X.jsx)(h9,{children:(0,X.jsx)(v9,{render:(0,X.jsx)(rz,{variant:`outline`,size:`sm`}),children:`Close`})})]})})}var afe=[`a mushroom knight`,`moss on a keyboard`,`your Agent's selfie`];function ofe(e){let t=(0,K.useRef)(!1),n=W0({defaultValues:xB(),onSubmit:async({value:n})=>{t.current=await e.current(n)}}),r=(0,K.useCallback)(async()=>(t.current=!1,await n.handleSubmit(),t.current),[n]);return Object.assign(n,{submitCurrent:r})}function sfe({form:e,selected:t,stylePicker:n,sizeChoices:r,sizeMode:i,onCustomSize:a,onEditStyles:o,onEditCharacters:s}){let c=t?.input.dimensions===`none`,l=t!==void 0&&t.sizes!==null,u=t?.video??null;return(0,X.jsxs)(`div`,{className:`prints-settings`,children:[(0,X.jsx)(H6,{label:`Style`,orientation:`horizontal`,children:n}),(0,X.jsx)(H6,{label:`Size`,orientation:`horizontal`,children:(0,X.jsx)(W6,{"aria-label":`Generation size`,"data-generation-size":!0,className:`select-sm`,disabled:c,title:c?`This model chooses the output size.`:void 0,onChange:t=>{let n=t.currentTarget.value;a(n===`custom`);let i=r.find(e=>e.value===n);i&&(e.setFieldValue(`width`,i.width),e.setFieldValue(`height`,i.height))},value:c?`provider`:i,children:c?(0,X.jsx)(`option`,{value:`provider`,children:`Model default`}):(0,X.jsxs)(X.Fragment,{children:[l&&!r.some(e=>e.value===i)?(0,X.jsx)(`option`,{value:i,disabled:!0,children:`Choose a supported resolution`}):null,r.map(e=>(0,X.jsx)(`option`,{value:e.value,children:e.label},e.value)),l?null:(0,X.jsx)(`option`,{value:`custom`,children:`Custom size`})]})})}),!c&&!l&&i===`custom`?(0,X.jsxs)(`div`,{className:`prints-custom-size`,children:[(0,X.jsx)(e.Field,{name:`width`,children:e=>(0,X.jsx)(H6,{label:`Width`,children:(0,X.jsx)(I6,{"aria-label":`Generation width`,"data-generation-width":!0,max:4096,min:1,onChange:t=>{e.handleChange(Number(t.currentTarget.value)||1)},type:`number`,value:e.state.value})})}),(0,X.jsx)(e.Field,{name:`height`,children:e=>(0,X.jsx)(H6,{label:`Height`,children:(0,X.jsx)(I6,{"aria-label":`Generation height`,"data-generation-height":!0,max:4096,min:1,onChange:t=>{e.handleChange(Number(t.currentTarget.value)||1)},type:`number`,value:e.state.value})})})]}):null,u?(0,X.jsx)(e.Field,{name:`durationSeconds`,children:e=>(0,X.jsx)(H6,{label:`Length`,orientation:`horizontal`,children:(0,X.jsx)(W6,{"aria-label":`Video length in seconds`,className:`select-sm`,"data-generation-duration":!0,onChange:t=>{let n=t.currentTarget.value;e.handleChange(u.durations.find(e=>String(e)===n))},value:e.state.value===void 0?``:String(e.state.value),children:u.durations.map(e=>(0,X.jsxs)(`option`,{value:String(e),children:[e,` seconds`]},e))})})}):null,u?.supportsAudio?(0,X.jsx)(e.Field,{name:`generateAudio`,children:e=>u.defaultGenerateAudio===null?(0,X.jsx)(H6,{label:`Audio`,orientation:`horizontal`,children:(0,X.jsxs)(W6,{"aria-label":`Video audio`,className:`select-sm`,"data-generation-audio":!0,onChange:t=>{let n=t.currentTarget.value;e.handleChange(n===``?void 0:n===`on`)},value:e.state.value===void 0?``:e.state.value?`on`:`off`,children:[(0,X.jsx)(`option`,{value:``,children:`Model default`}),(0,X.jsx)(`option`,{value:`on`,children:`On`}),(0,X.jsx)(`option`,{value:`off`,children:`Off`})]})}):(0,X.jsx)(H6,{label:`Audio`,orientation:`horizontal`,children:(0,X.jsx)(G6,{"aria-label":`Video audio`,checked:e.state.value??!0,"data-generation-audio":!0,onCheckedChange:e.handleChange})})}):null,t&&t.input.steps!==`fixed`?(0,X.jsx)(e.Field,{name:`steps`,children:e=>(0,X.jsx)(H6,{label:`Steps`,optional:!0,orientation:`horizontal`,children:(0,X.jsx)(I6,{"aria-label":`Generation steps`,className:`input-sm`,"data-generation-steps":!0,max:t.input.maxSteps??void 0,min:1,onChange:t=>{e.handleChange(t.currentTarget.value===``?void 0:Number(t.currentTarget.value))},type:`number`,value:e.state.value??``})})}):null,(0,X.jsxs)(`div`,{className:`prints-settings-library`,children:[(0,X.jsx)(rz,{size:`xs`,variant:`ghost`,type:`button`,onClick:()=>{o()},children:`Edit styles…`}),(0,X.jsx)(rz,{size:`xs`,variant:`ghost`,type:`button`,onClick:()=>{s()},children:`Characters…`})]})]})}function cfe({actions:e,guidance:t,commandApp:n,form:r,models:i,modelsLoading:a,mediaCapability:o,submitting:s,values:c,computerId:l,mediaDirectory:u,referenceImages:d,characters:f,characterDialog:p,onSubmit:m,footer:h,styleControls:g,addedLength:_}){let v=FB(i,c.model),y=c.prompt.trim().length,b=v!==void 0&&y>0&&y+_>v.maxPromptLength,x=zB(v),S=v?.video??null,C=BB(c.references,v),w=v===void 0?void 0:VB(C,v,S?.formats.find(e=>e.width===c.width&&e.height===c.height)?.resolution),T=v?.input.maxReferences??0,E=c.references.length>T,[D,O]=(0,K.useState)(!1),[k,A]=(0,K.useState)(!1),j=v!==void 0&&v.sizes!==null,M=MB(v),N=j?`${String(c.width)}x${String(c.height)}`:D?`custom`:M.find(e=>e.width===c.width&&e.height===c.height)?.value??`custom`,[P,F]=(0,K.useState)(!1),I=$de({clear:()=>{r.setFieldValue(`prompt`,``)},useSize:e=>{O(!1),r.setFieldValue(`width`,gB[e].width),r.setFieldValue(`height`,gB[e].height),r.setFieldValue(`prompt`,``)},openStyles:()=>{r.setFieldValue(`prompt`,``),F(!0)},clearStyle:()=>{r.setFieldValue(`style`,void 0),r.setFieldValue(`prompt`,``)}},n),[L,R]=(0,K.useState)(!1),z=Ude(f,c.prompt),ee=Vde(I.items,c.prompt),te=(0,K.useId)(),B=`${te}-commands`,ne=`${te}-characters`,re=_F({prompt:c.prompt,saved:f,references:c.references,model:v===void 0?void 0:{label:v.label,maxReferences:v.input.maxReferences}}),V=pF(c.prompt,f).characters,ie=e=>{let t=ee.slashMatches.at(e);t&&(ee.resetSlash(),I.run(t.command))},ae=g({open:P,onOpenChange:F}),oe=[c.style,jB(v,c.width,c.height),S&&c.durationSeconds!==void 0?`${String(c.durationSeconds)}s`:void 0,S?.supportsAudio&&c.generateAudio===!1?`silent`:void 0].filter(e=>e!=null),H=(0,X.jsx)(sfe,{form:r,selected:v,stylePicker:ae.picker,sizeChoices:M,sizeMode:N,onCustomSize:O,onEditStyles:()=>{A(!1),F(!0)},onEditCharacters:()=>{A(!1),R(!0)}});return(0,X.jsx)(J6,{className:`prints-composer-anchor`,children:(0,X.jsxs)(q6,{"aria-label":`Image generation`,className:`prints-composer`,"data-generation-form":!0,children:[(0,X.jsx)(Toe,{attachments:c.references.length>0?(0,X.jsx)(`div`,{className:`prints-reference-tray`,"aria-label":`Image references`,children:c.references.map((e,t)=>{let n=d.find(t=>t.path===e.path),i=C[t]?.role,a=RB(x,C,t);return(0,X.jsxs)(`div`,{className:`prints-reference-tile`,title:e.path,children:[(0,X.jsx)(`div`,{className:`prints-reference-face mask mask-squircle`,children:n?(0,X.jsx)(`img`,{src:n.url,alt:e.path.split(`/`).at(-1)}):(0,X.jsxs)(`span`,{children:[`Ref `,t+1]})}),i===void 0?null:a===void 0?(0,X.jsx)(`span`,{className:`prints-reference-role`,"data-reference-role":i,children:LB[i]}):(0,X.jsx)(rz,{size:`xs`,variant:`ghost`,type:`button`,className:`prints-reference-role`,"data-reference-role":i,"aria-label":`Reference ${String(t+1)}: ${LB[i]}. Use as ${LB[a]}`,title:`Use as ${LB[a]}`,onClick:()=>{r.setFieldValue(`references`,C.map((e,n)=>n===t?{...e,role:a}:e))},children:LB[i]}),(0,X.jsx)(dz,{icon:(0,X.jsx)(mB,{}),className:`prints-reference-remove`,"aria-label":`Remove reference ${String(t+1)}`,onClick:()=>{r.setFieldValue(`references`,c.references.filter(t=>t.path!==e.path))}})]},e.path)})}):void 0,input:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`form`,{"aria-busy":s,onSubmit:e=>{e.preventDefault(),m()},children:(0,X.jsx)(r.Field,{name:`prompt`,children:e=>(0,X.jsxs)(`div`,{className:`prints-prompt`,children:[ee.slashOpen?(0,X.jsx)(Bde,{index:ee.slashIndex,listId:B,matches:ee.slashMatches,onHighlight:ee.highlightSlash,onPick:ie}):null,!ee.slashOpen&&z.matches.length>0?(0,X.jsx)(Hde,{images:d,index:z.index,listId:ne,matches:z.matches,onHighlight:z.highlight,onPick:t=>{let n=z.complete(t);n!==null&&e.handleChange(n)}}):null,(0,X.jsx)(zde,{caretRequest:z.caretRequest,menu:ee.slashOpen?{open:ee.slashMatches.length>0,listId:B,selected:ee.slashIndex}:{open:z.matches.length>0,listId:ne,selected:z.index},mentionCount:ee.slashOpen?0:z.matches.length,onCaret:z.setCaret,onMentionDismiss:z.dismiss,onMentionMove:z.move,onMentionPick:()=>{let t=z.complete(z.index);t!==null&&e.handleChange(t)},disabled:!o||a||i.length===0||s,maxLength:v?.maxPromptLength,addedLength:_,onChange:t=>{e.handleChange(t)},onSend:m,onSlashMove:ee.moveSlash,onSlashPick:()=>{ie(ee.slashIndex)},placeholder:`What are we making?`,slashCount:ee.slashMatches.length,value:e.state.value}),c.references.length>0||w!==void 0||V.length>0?(0,X.jsxs)(`div`,{className:`prints-composer-notes`,children:[c.references.length>0?(0,X.jsxs)(`span`,{className:`prints-reference-count`,"data-generation-references":!0,"data-over-limit":E?``:void 0,role:E?`alert`:void 0,children:[c.references.length,` / `,T,` `,`references`,E?T===0?` — this model takes none; remove them or pick another model`:` — over this model's limit; remove some to generate`:null]}):null,w===void 0?null:(0,X.jsx)(`span`,{className:`prints-reference-count`,"data-generation-reference-roles":!0,"data-over-limit":``,role:`alert`,children:w}),V.length>0?(0,X.jsx)(`span`,{className:`prints-reference-count`,"data-generation-characters":!0,"data-over-limit":re.kind===`refused`?``:void 0,role:re.kind===`refused`?`alert`:void 0,children:re.kind===`refused`?re.message:`Characters: ${V.map(e=>e.name).join(`, `)}`}):null]}):null]})})}),t?(0,X.jsxs)(`div`,{className:`prints-composer-guidance`,role:`status`,"data-composer-guidance":!0,children:[(0,X.jsx)(`span`,{children:t.group===`Images`&&t.detail?t.detail:(0,X.jsxs)(X.Fragment,{children:[t.title,`. `,t.detail]})}),t.actions?.map(e=>(0,X.jsx)(rz,{variant:`ghost`,size:`xs`,onClick:e.run,children:e.label},e.label))]}):null]}),toolbar:h((0,X.jsxs)(X.Fragment,{children:[e,(0,X.jsx)(r.Field,{name:`model`,children:e=>(0,X.jsxs)(`label`,{className:`prints-model`,children:[(0,X.jsx)(`span`,{className:`sr-only`,children:`Model`}),(0,X.jsxs)(W6,{"aria-label":`Generation model`,"data-generation-model":!0,className:`select-sm`,disabled:a||!o,onChange:t=>{let n=FB(i,t.currentTarget.value);if(e.handleChange(t.currentTarget.value),!n)return;let a=r.store.state.fieldMeta,o=IB(c,n),s=NB(c,n,v);(n.input.dimensions===`none`||n.sizes!==null)&&O(!1),r.setFieldValue(`width`,s.width),r.setFieldValue(`height`,s.height),r.setFieldValue(`durationSeconds`,o.durationSeconds),r.setFieldValue(`generateAudio`,o.generateAudio),(n.input.steps===`fixed`||!a.steps?.isTouched)&&r.setFieldValue(`steps`,o.steps)},value:e.state.value,children:[i.length===0?(0,X.jsx)(`option`,{value:``,children:l===null?`Choose a Computer`:a?`Loading models…`:`Models unavailable`}):null,i.map(e=>(0,X.jsx)(`option`,{value:e.id,children:PB(e)},e.id))]})]})}),l&&u?(0,X.jsxs)(`span`,{className:`sr-only`,"data-generation-computer":!0,title:`Saved to ${l}:${u}`,children:[`Saves to `,u]}):null]}),(0,X.jsx)(Rde,{busy:s,disabled:!o||a||i.length===0||s,label:wB(v),onGenerate:()=>{m()},promptOver:b}),{label:(0,X.jsxs)(`span`,{className:`prints-settings-chip`,children:[(0,X.jsx)(dB,{"aria-hidden":`true`,className:`size-[var(--stipe-icon-size-sm)]`}),oe.length>0?oe.join(` · `):`Settings`]}),content:H,open:k,onOpenChange:A})}),ae.dialog,p({open:L,onOpenChange:R})]})})}function lfe({connection:e}){let t=(0,K.useRef)(e);t.current=e;let n=Doe(e?.app??null),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(),s=Rue(e?.app??null,n.computerId),[c,l]=(0,K.useState)(null);(0,K.useEffect)(()=>{l(null)},[e,n.computerId]);let u=n.path,{gallery:d,images:f,failed:p,loading:m,gallerySlots:h,canBrowse:g,canRead:_,canWrite:v,reserveSlot:y,failSlot:b,clearSlotError:x,removeSlot:S,openComputerFile:C,uploads:w,uploadFiles:T}=Z$(e,n),E=XN(e,(e,t,n,r)=>(d.refresh(),C(e,t,n,r))),D=d.entries.some(e=>e.path===E.target?.path);(0,K.useEffect)(()=>{E.target&&!D&&d.nextPageReady&&d.loadMore()},[E.target,D,d.nextPageReady,d.loadMore]);let O=f.find(e=>e.source.kind===`computer`&&e.source.computerId===E.target?.computerId&&e.source.path===E.target.path),k=efe(e?.app??null),A=Wde(e?.app??null),j=u1({connection:e,folder:n,styles:k.styles,characters:A.characters,effects:{reserve:y,failed:b,saved:({result:e},t)=>{_?C(e.destination.path,`add`,t,e.destination.computerId):b(`${e.destination.computerId}:${e.destination.path}`,`Image saved, but this App cannot read its preview.`)}}}),{state:M,models:N,modelsLoading:P,modelsError:F,canGenerate:I,mediaCapability:L,pendingGenerations:R,activeGenerations:z,recoveryError:ee}=j,te=(0,K.useRef)(N),B=(0,K.useRef)(j);B.current=j;let ne=(0,K.useRef)(null),re=(0,K.useRef)(null),V=(0,K.useRef)(0),[ie,ae]=(0,K.useState)(null),oe=(0,K.useRef)(j.submit);oe.current=async e=>{let t=await j.submit(e);return t&&ae(null),t};let H=ofe(oe),se=e=>{H.setFieldValue(`model`,e.model),H.setFieldValue(`width`,e.width),H.setFieldValue(`height`,e.height),H.setFieldValue(`steps`,e.steps),H.setFieldValue(`durationSeconds`,e.durationSeconds),H.setFieldValue(`generateAudio`,e.generateAudio),H.setFieldValue(`prompt`,e.prompt),H.setFieldValue(`references`,e.references),H.setFieldValue(`style`,e.style),H.setFieldValue(`destination`,void 0)},ce=(0,K.useRef)(H);ce.current=H;let le=P0(H.store,e=>e.values),U=P0(H.store,e=>e.isSubmitting),ue=e?.app;(0,K.useEffect)(()=>{if(ue)return Zde(ue,{readDraft:()=>ce.current.store.state.values,readModels:()=>te.current,setDraft:e=>{let t=ce.current;if(e.model!==void 0){let n=FB(te.current,e.model);if(!n)throw Error(`Choose a model from the granted registry.`);let r=IB(t.store.state.values,n),i=FB(te.current,t.store.state.values.model),a=NB(t.store.state.values,n,i);t.setFieldValue(`model`,r.model),t.setFieldValue(`width`,a.width),t.setFieldValue(`height`,a.height),t.setFieldValue(`steps`,r.steps),t.setFieldValue(`durationSeconds`,r.durationSeconds),t.setFieldValue(`generateAudio`,r.generateAudio)}e.generateAudio!==void 0&&t.setFieldValue(`generateAudio`,e.generateAudio??void 0),e.destination!==void 0&&t.setFieldValue(`destination`,e.destination??void 0),e.height!==void 0&&t.setFieldValue(`height`,e.height),e.prompt!==void 0&&t.setFieldValue(`prompt`,e.prompt),e.references!==void 0&&t.setFieldValue(`references`,e.references),e.steps!==void 0&&t.setFieldValue(`steps`,e.steps??void 0),e.style!==void 0&&t.setFieldValue(`style`,e.style??void 0),e.width!==void 0&&t.setFieldValue(`width`,e.width)},submit:()=>ce.current.store.state.isSubmitting||B.current.isRunning()?Promise.resolve(!1):ce.current.submitCurrent()})},[ue]),(0,K.useEffect)(()=>{te.current=N},[N]),(0,K.useEffect)(()=>{if(N.length===0||F)return;let e=N.find(e=>e.id===`@cf/black-forest-labs/flux-2-klein-4b`)??N[0];if(!H.store.state.fieldMeta.model?.isTouched){let t=IB(H.store.state.values,e);H.setFieldValue(`model`,t.model),H.store.state.fieldMeta.width?.isTouched||H.setFieldValue(`width`,t.width),H.store.state.fieldMeta.height?.isTouched||H.setFieldValue(`height`,t.height),H.store.state.fieldMeta.steps?.isTouched||H.setFieldValue(`steps`,t.steps)}},[H,F,N]);let de=FB(N,le.model),fe=le.references,pe=de?.input.maxReferences??0,me=(0,K.useRef)({openComputerFile:C,retryPath:j.retryPath,uploads:w});me.current={openComputerFile:C,retryPath:j.retryPath,uploads:w};let he=O?O.source.kind===`computer`?`${O.source.computerId}:${O.source.path}`:O.file.name:null,ge=(0,K.useMemo)(()=>f.map(e=>({key:e.source.kind===`computer`?`${e.source.computerId}:${e.source.path}`:e.file.name,selected:(e.source.kind===`computer`?`${e.source.computerId}:${e.source.path}`:e.file.name)===he,path:e.source.kind===`computer`?e.source.path:e.file.name,referenced:fe.some(t=>e.source.kind===`computer`&&t.path===e.source.path),referenceDisabled:fe.length>=pe&&!fe.some(t=>e.source.kind===`computer`&&t.path===e.source.path),onToggleReference:e.source.kind===`computer`&&pe>0?()=>{if(e.source.kind!==`computer`)return;let t=e.source.path,n=fe.some(e=>e.path===t);H.setFieldValue(`references`,n?fe.filter(e=>e.path!==t):[...fe,{path:t}])}:void 0,onInfo:()=>{l(e)},url:e.url,width:e.width,height:e.height,onOpen:()=>{e.source.kind===`computer`?me.current.openComputerFile(e.source.path,`open`,e.source.connection,e.source.computerId):window.open(e.url,`_blank`,`noopener,noreferrer`)}})),[f,fe,pe,H,he]),_e=(0,K.useMemo)(()=>{let e=n.computerId;if(!e)return ge;let t=new Map(ge.map(e=>[e.key,e])),r=[...d.entries].sort((e,t)=>t.modifiedAt-e.modifiedAt||e.name.localeCompare(t.name)).map(n=>{let r=`${e}:${n.path}`;return t.get(r)??{key:r,path:n.path,width:1,height:1,url:``,pending:!0,pendingLabel:`Loading print…`,onOpen:()=>void 0,onVisible:()=>{d.loadFile(n.path)},error:d.failures.includes(n.name)?`Could not load this print.`:void 0}}),i=new Set(r.map(e=>e.key));return[...r,...ge.filter(e=>!i.has(e.key)&&e.key!==he)]},[ge,d.entries,d.loadFile,d.failures,n.computerId,he]),ve=M.kind===`pending`,ye=(0,K.useMemo)(()=>Ede(_e,h,e=>{let n=w.items.find(t=>t.id===e.uploadId),r=e.error??(n?.status===`error`||n?.status===`cancelled`?n.message:void 0);return{key:e.key,path:e.path,width:e.width,height:e.height,url:``,pending:!0,error:r,pendingLabel:n?.status===`complete`||M.kind===`completed`?`Loading preview…`:e.uploadId?`Uploading image…`:e.pendingLabel,onOpen:()=>void 0,onRetry:r&&(_||n&&n.status!==`complete`)?()=>{if(x(e.key),n&&n.status!==`complete`){me.current.uploads.retry(n.id);return}!e.uploadId&&me.current.retryPath(e.path)||t.current&&me.current.openComputerFile(e.path,`add`,t.current,e.computerId)}:void 0,onDismiss:r?()=>{S(e.key),e.uploadId&&me.current.uploads.remove(e.uploadId)}:void 0}}),[_e,h,w.items,M.kind,_]),be=U||ve,xe=h.some(e=>e.error!==void 0),Se=w.items.filter(e=>e.computerId===n.computerId),Ce=M.kind===`error`&&F===null?{key:j.errorKey,message:M.message,billing:M.action===`billing`&&e?()=>{e.app.ui.openTeamBilling().catch(n=>{M$(`open-team-billing`,n),t.current===e&&j.reportRecoveryError(n)})}:void 0,retry:xe&&M.retryable!==!1?j.retry:void 0}:null,we=Lue({connected:e!==null,mediaCapability:L,modelsError:F,retryModels:j.retryModels,modelsLoading:P,models:N,canGenerate:I,canWrite:v,generationError:Ce,recoveryError:ee,pendingGenerations:R,activeGenerations:z,gallerySlots:h,computerId:n.computerId,failed:p,uploadError:w.error,uploads:Se,permissions:()=>{e?.app.ui.requestAppPermissions({}).catch(e=>{j.reportRecoveryError(e)})},resume:e=>{j.resume(e)},discard:e=>{j.discard(e)},retryUpload:e=>{w.retry(e)}});s.error&&we.push({key:`dismissal-storage`,group:`Setup`,tone:`warning`,blocking:!0,short:`Activity not saved`,title:`Activity not saved`,detail:s.error});let Te=s.visible(we),Ee={generating:z.size,uploading:Se.filter(e=>e.status===`sending`||e.status===`queued`).length},De={items:Se.filter(e=>e.status===`sending`||e.status===`queued`).map(e=>({id:e.id,name:e.file.name,preview:{kind:`image`,url:e.previewUrl},progress:null,progressLabel:``,statusLabel:e.message,actions:{cancel:{label:`Cancel`,accessibleLabel:`Cancel ${e.file.name}`}}})),onCancel:e=>{w.cancel(e)},onRetry:e=>{w.retry(e)},onRemove:e=>{w.remove(e)}},Oe=new Set([...d.entries.map(e=>`${n.computerId??``}:${e.path}`),...f.map(e=>e.source.kind===`computer`?`${e.source.computerId}:${e.source.path}`:e.file.name)]).size,ke=kue(Te,Ee,r);ZM(e?.app,[...n.available?[Coe(n.path,{checking:n.busy&&n.path===null,editing:n.editing})]:[],...ke===null?[]:[ke],...g?[{kind:`text`,id:`prints`,text:`${String(Oe)} ${Oe===1?`print`:`prints`}`}]:[]],e=>e.itemId===`activity`?(o(e.anchor?.start),i(e=>!e),!0):e.itemId!==`folder`||!n.available?!1:(n.setEditing(!0),!0),t=>{M$(`prints.status.report`,t),e?.app.ui.showToast({message:`Prints couldn't update its status bar.`,tone:`error`}).catch(e=>{M$(`prints.status.toast`,e)})});let Ae=f.flatMap(e=>e.source.kind===`computer`?[{path:e.source.path,url:e.url}]:[]);return(0,X.jsxs)(`main`,{className:`h-full w-full flex flex-col overflow-hidden`,"data-app-pane":`media`,"data-generation-state":M.kind,"data-computer-capability":g?`connected`:`absent`,onPaste:e=>{let t=Array.from(e.clipboardData.files);t.length&&v&&(e.preventDefault(),T(t.map(e=>(V.current+=1,new File([e],`paste-${String(V.current)}-${Y$(e.name)}`,{type:e.type,lastModified:e.lastModified})))))},children:[(0,X.jsxs)(`div`,{className:`prints-gallery-region`,children:[(0,X.jsx)(coe,{screen:!0,surface:!0,surfaceSize:`lg`,surfaceDepth:`deep`,ref:ne,className:`flex-1 min-h-0`,"data-media-scroll":!0,"aria-busy":m||d.loading,onDragOver:e=>{e.preventDefault()},onDrop:e=>{e.preventDefault();let t=Array.from(e.dataTransfer.files);t.length&&v&&T(t)},children:(0,X.jsxs)(`div`,{className:`prints-gallery-content`,children:[ye.length>0?(0,X.jsx)(Tde,{items:ye,scrollRef:ne,focus:O&&E.target?{key:`${E.target.computerId}:${E.target.path}`,requestId:E.target.requestId,onFocus:()=>{l(O)}}:void 0}):m||d.loading?(0,X.jsx)(K6,{variant:`hint`,role:`status`,"aria-live":`polite`,title:`Loading prints…`,description:`Your library is on its way.`}):(0,X.jsx)(K6,{"aria-live":`polite`,"data-absence":!0,"data-media-empty":!0,role:`status`,variant:`panel`,visual:(0,X.jsx)(aB,{}),title:`Nothing printed yet.`,description:n.computerId===null?`Your images will appear here.`:n.available&&u===null?`Pick a folder in the composer below, then describe something or drop in images.`:`Describe something and it lands here, or drop in images from your Computer.`,...L?{suggestions:afe.map(e=>({label:e,onSelect:()=>{H.setFieldValue(`prompt`,e)}}))}:{}}),d.hasNextPage&&(0,X.jsx)(rz,{variant:`ghost`,disabled:d.loading,onClick:d.loadMore,children:d.loading?`Loading images…`:`Load more images`})]})}),E.error?(0,X.jsx)(`p`,{role:`alert`,children:`Could not open this print. It may no longer be available on this Computer.`}):null,c&&(c.source.kind===`local`||c.source.connection===e&&c.source.computerId===n.computerId)?(0,X.jsx)(U$,{image:c,app:e?.app??null,referenceImages:Ae,models:N,canAnimate:Q9(N)!==void 0,onIterate:(e,t)=>{if(c.source.kind!==`computer`)return null;let n=nfe(e,{lineage:t,printPath:c.source.path,models:N,styles:k.styles.map(e=>e.name),current:H.store.state.values});return n.kind===`refused`?n.message:(se(n.draft),ae(n.notice===null?null:{model:n.draft.model,message:n.notice}),l(null),null)},onClose:()=>{l(null)}},c.url):null]}),(0,X.jsxs)(`div`,{className:`prints-composer-dock`,children:[(0,X.jsx)(`section`,{"aria-label":`Computer uploads`,className:`prints-uploads`,children:(0,X.jsx)(`input`,{ref:re,type:`file`,disabled:!v||u===null,accept:`image/*`,multiple:!0,hidden:!0,"aria-label":`Choose images to upload`,onChange:e=>{T(Array.from(e.currentTarget.files??[])),e.currentTarget.value=``}})}),(0,X.jsx)(cfe,{addedLength:mF(le.prompt,k.styles.find(e=>e.name===le.style)?.text,A.characters),styleControls:e=>({picker:(0,X.jsx)(rfe,{styles:k.styles,selected:le.style,disabled:!L||P||be,onSelect:e=>{H.setFieldValue(`style`,e)}}),dialog:(0,X.jsx)(ife,{open:e.open,onOpenChange:e.onOpenChange,styles:k.styles,selected:le.style,busy:k.busy,error:k.error,onSelect:e=>{H.setFieldValue(`style`,e)},onSave:k.save,onDelete:(e,t)=>{k.remove(e.id,t)}})}),characters:A.characters,characterDialog:e=>(0,X.jsx)(Kde,{open:e.open,onOpenChange:e.onOpenChange,characters:A.characters,images:Ae,busy:A.busy,error:A.error,canUpload:v&&u!==null,onUpload:()=>re.current?.click(),onSave:A.save,onDelete:(e,t)=>{A.remove(e.id,t)}}),guidance:Te.find(e=>e.blocking&&e.group===`Setup`)??(M.kind===`error`?Te.find(e=>e.key===Ce?.key):void 0)??(ie!==null&&ie.model===le.model?{key:`iteration-model`,group:`Images`,tone:`warning`,short:`Model changed`,title:`Model changed`,detail:ie.message,actions:[{label:`Dismiss`,run:()=>{ae(null)}}]}:void 0),commandApp:ue,footer:(e,t,n)=>(0,X.jsx)(jue,{settings:n,controls:e,send:t}),actions:(0,X.jsx)(nI,{"aria-label":`Upload images`,title:v?`Upload images to Computer`:`Connect a writable Computer to upload`,icon:(0,X.jsx)(pB,{}),label:null,className:`prints-upload-key`,disabled:!v||u===null,onClick:()=>re.current?.click()}),form:H,mediaCapability:L&&I&&v&&u!==null,models:N,modelsLoading:P,onSubmit:H.submitCurrent,submitting:be,values:le,computerId:n.computerId,mediaDirectory:u,referenceImages:Ae})]}),ke===null?null:(0,X.jsx)(Mue,{notices:Te,uploads:De,open:r,inset:a,onOpenChange:i,onDismiss:s.dismiss,onDismissAll:()=>{s.dismissAll(we)},onLoadMore:j.hasMore?j.loadMore:void 0}),(0,X.jsx)(Pue,{folder:n})]})}var $9=document.getElementById(`media-root`);if(!$9)throw Error(`Media root is missing`);KM($9,{name:`Prints`,queryClient:CN()},({app:e})=>(0,K.createElement)(lfe,{connection:e?{app:e}:null}));
|