@devframes/plugin-messages--assets 0.9.19 → 0.10.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.
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(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 n={bus:{agentManifestChanged:`agent:manifest:changed`,agentToolRegistered:`agent:tool:registered`,agentToolUnregistered:`agent:tool:unregistered`,agentResourceRegistered:`agent:resource:registered`,agentResourceUnregistered:`agent:resource:unregistered`},client:{isTrustedUpdated:`rpc:is-trusted:updated`,error:`rpc:error`,connectionStatus:`connection:status`,connectionError:`connection:error`},broadcast:{authRevoked:`devframe:auth:revoked`,clientStateUpdated:`devframe:rpc:client-state:updated`,clientStatePatch:`devframe:rpc:client-state:patch`,streamingChunk:`devframe:streaming:chunk`,streamingEnd:`devframe:streaming:end`,streamingUploadCancel:`devframe:streaming:upload-cancel`},inPageChannel:{panelStateUpdated:`devframe:in-page:panel-state:updated`,panelStatePatch:`devframe:in-page:panel-state:patch`},postMessage:{remoteAssetsError:`devframe:remote-assets-error`,inPageChannel:`devframe:in-page-channel`}},r=`__connection.json`,i=`__DEVFRAME_CONNECTION__`,a=`x-birpc-session`,o=`__rpc-dump/index.json`,s=`devframe:services`,c=`devframe_otp`,l=`devframe_auth_token`;n.postMessage.remoteAssetsError;function u(e){return typeof e==`string`?`'${e}'`:new m().serialize(e)}var d=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,f=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[d.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function p(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&f[n]?f[n]:n+128,s=a<128&&f[a]?f[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var m=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?p(e,t):n===`number`&&r===`number`?e-t:p(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(p),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`,`)}]`};for(let t of[`BigInt64Array`,`BigUint64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`n,`)}${e.length>0?`n`:``}]`};return e})(),h=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],g=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],_=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`,v=[],y=class{_data=new b;_hash=new b([...h]);_nDataBytes=0;_minBufferSize=0;finalize(e){e&&this._append(e);let t=this._nDataBytes*8,n=this._data.sigBytes*8;return this._data.words[n>>>5]|=128<<24-n%32,this._data.words[(n+64>>>9<<4)+14]=Math.floor(t/4294967296),this._data.words[(n+64>>>9<<4)+15]=t,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7];for(let n=0;n<64;n++){if(n<16)v[n]=e[t+n]|0;else{let e=v[n-15],t=(e<<25|e>>>7)^(e<<14|e>>>18)^e>>>3,r=v[n-2],i=(r<<15|r>>>17)^(r<<13|r>>>19)^r>>>10;v[n]=t+v[n-7]+i+v[n-16]}let d=s&c^~s&l,f=r&i^r&a^i&a,p=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),m=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),h=u+m+d+g[n]+v[n],_=p+f;u=l,l=c,c=s,s=o+h|0,o=a,a=i,i=r,r=h+_|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+u|0}_append(e){typeof e==`string`&&(e=b.fromUtf8(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(e){let t,n=this._data.sigBytes/64;n=e?Math.ceil(n):Math.max((n|0)-this._minBufferSize,0);let r=n*16,i=Math.min(r*4,this._data.sigBytes);if(r){for(let e=0;e<r;e+=16)this._doProcessBlock(this._data.words,e);t=this._data.words.splice(0,r),this._data.sigBytes-=i}return new b(t,i)}},b=class e{words;sigBytes;constructor(e,t){e=this.words=e||[],this.sigBytes=t===void 0?e.length*4:t}static fromUtf8(t){let n=unescape(encodeURIComponent(t)),r=n.length,i=[];for(let e=0;e<r;e++)i[e>>>2]|=(n.charCodeAt(e)&255)<<24-e%4*8;return new e(i,r)}toBase64(){let e=[];for(let t=0;t<this.sigBytes;t+=3){let n=this.words[t>>>2]>>>24-t%4*8&255,r=this.words[t+1>>>2]>>>24-(t+1)%4*8&255,i=this.words[t+2>>>2]>>>24-(t+2)%4*8&255,a=n<<16|r<<8|i;for(let n=0;n<4&&t*8+n*6<this.sigBytes*8;n++)e.push(_.charAt(a>>>6*(3-n)&63))}return e.join(``)}concat(e){if(this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4),this.sigBytes%4)for(let t=0;t<e.sigBytes;t++){let n=e.words[t>>>2]>>>24-t%4*8&255;this.words[this.sigBytes+t>>>2]|=n<<24-(this.sigBytes+t)%4*8}else for(let t=0;t<e.sigBytes;t+=4)this.words[this.sigBytes+t>>>2]=e.words[t>>>2];this.sigBytes+=e.sigBytes}};function x(e){return new y().finalize(e).toBase64()}function S(e){return x(u(e))}function C(e){return S(e)}var w=class{cacheMap=new Map;options;keySerializer;constructor(e){this.options=e,this.keySerializer=e.keySerializer||(e=>C(e))}updateOptions(e){this.options={...this.options,...e}}cached(e,t){let n=this.cacheMap.get(e);if(n)return n.get(this.keySerializer(t))}has(e,t){return this.cacheMap.get(e)?.has(this.keySerializer(t))??!1}apply(e,t){let n=this.cacheMap.get(e.m)||new Map;n.set(this.keySerializer(e.a),t),this.cacheMap.set(e.m,n)}validate(e){return this.options.functions.includes(e)}clear(e){e?this.cacheMap.delete(e):this.cacheMap.clear()}};function T(e,t){let n=`\x1B[${e}m`,r=`\x1B[${t}m`;return((e,...t)=>{if(Array.isArray(e)&&`raw`in e){let i=e,a=``;for(let e=0;e<i.length;e++)a+=i[e],e<t.length&&(a+=String(t[e]));return`${n}${a}${r}`}return`${n}${String(e)}${r}`})}var ee={blue:T(34,39),cyan:T(36,39),gray:T(90,39),green:T(32,39),red:T(31,39),yellow:T(33,39),bold:T(1,22),dim:T(2,22),reset:T(0,0),underline:T(4,24)};function te(e,...t){return typeof e==`function`?e(...t):e}var ne=Error.captureStackTrace,re=class e extends Error{name;code;docs;fix;sources;get why(){return this.message}constructor(t,n=e){super(t.why,{cause:t.cause}),this.code=this.name=t.code,this.fix=t.fix,this.docs=t.docs,this.sources=t.sources,ne?.(this,n)}toJSON(){return{name:this.name,why:this.why,fix:this.fix,docs:this.docs,sources:this.sources,cause:this.cause,stack:this.stack}}};function ie(e,t){return typeof e==`string`?`${e}/${t.toLowerCase()}`:e?.(t)}function E(e){let t=e.reporters??[],n={},{docsBase:r}=e;for(let i of Object.keys(e.codes)){let a=e.codes[i],o=a.docs===!1?void 0:a.docs||ie(r,i),s=(e={},n={})=>{let r=new re({code:i,why:te(a.why,e),fix:te(a.fix,e),docs:o,cause:e.cause,sources:e.sources},s);for(let e of t)e(r,n);return r};n[i]=s}return n}function ae(e){return t=>{let n=`${e.bold(e.red(`[${t.name}]`))} ${t.message}`,r=[];return t.fix&&r.push(`${e.dim(`fix:`)} ${t.fix}`),t.sources?.length&&r.push(`${e.dim(`sources:`)} ${t.sources.join(`, `)}`),t.docs&&r.push(`${e.dim(`see:`)} ${e.cyan(t.docs)}`),r.length===0?n:[n,...r.map((t,n)=>`${e.dim(n<r.length-1?`├▶`:`╰▶`)} ${t}`)].join(`
|
|
2
|
+
`)}}var oe=ae(ee);function se(e,{method:t=`warn`}={}){console[t](oe(e))}function ce(e){return E({...e,reporters:[se,...e.reporters??[]]})}var le=ce({docsBase:`https://devfra.me/errors`,codes:{DF0019:{why:e=>`RPC function "${e.name}" has \`agent\` set but \`jsonSerializable\` is \`false\`; MCP requires JSON-serializable data.`,fix:"Remove `jsonSerializable: false`, or remove `agent` to keep it RPC-only."},DF0020:{why:e=>`RPC function "${e.name}" declares \`jsonSerializable: true\` but the value at "${e.path}" is a ${e.type}.`,fix:"Either drop `jsonSerializable: true` (falls back to structured-clone) or change the value to a JSON-safe shape."},DF0021:{why:e=>`RPC function "${e.name}" is already registered`,fix:"Use the `force` parameter to overwrite an existing registration."},DF0022:{why:e=>`RPC function "${e.name}" is not registered. Use register() to add new functions.`},DF0023:{why:e=>`RPC function "${e.name}" is not registered`},DF0024:{why:e=>`Either handler or setup function must be provided for RPC function "${e.name}"`},DF0025:{why:e=>`Function "${e.name}" not found in dump store`},DF0026:{why:e=>`No dump match for "${e.name}" with args: ${e.args}`},DF0027:{why:e=>`Function "${e.name}" with type "${e.type}" cannot have dump configuration. Only "static" and "query" types support dumps.`},DF0028:{why:e=>`Function "${e.name}" with type "${e.type}" cannot use \`snapshot: true\`. Only "query" functions support this sugar; "static" functions have equivalent default behavior already.`,fix:"Remove `snapshot: true`, or change the function type to `query`."},DF0043:{why:e=>`RPC function "${e.name}" received an invalid argument at position ${e.index}: ${e.issues}`,fix:"Pass a value that satisfies the `args` schema declared for this function."},DF0044:{why:e=>`RPC function "${e.name}" returned a value that failed its \`returns\` schema: ${e.issues}`,fix:"Make the handler return a value that satisfies the `returns` schema, or relax the schema."}}});function ue(e){if(e.agent&&e.jsonSerializable===!1)throw le.DF0019({name:e.name});e.agent&&!e.jsonSerializable&&(e.jsonSerializable=!0)}async function de(e,t){let n=e[`~standard`].validate(t);return n instanceof Promise?await n:n}function fe(e){return e.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `)}async function pe(e,t,n){let r=n.slice();if(!t||t.length===0)return r;for(let r=0;r<t.length;r++){let i=t[r];if(!i)continue;let a=await de(i,n[r]);if(a.issues)throw le.DF0043({name:e,index:r,issues:fe(a.issues)})}return r}async function me(e,t,n){if(!t)return n;let r=await de(t,n);if(r.issues)throw le.DF0044({name:e,issues:fe(r.issues)});return n}async function he(e,t){if(!e.setup)return{};if(typeof t==`object`&&t){e.__cache??=new WeakMap;let n=e.__cache,r=n.get(t);return r||(r=Promise.resolve(e.setup(t)),r.catch(()=>{n.get(t)===r&&n.delete(t)}),n.set(t,r)),await r}if(!e.__promise){let n=Promise.resolve(e.setup(t));n.catch(()=>{e.__promise===n&&(e.__promise=void 0)}),e.__promise=n}return await e.__promise}async function ge(e,t){let n=e.handler;if(!n){let r=await he(e,t);if(!r.handler)throw le.DF0024({name:e.name});n=r.handler}let r=e.args,i=e.returns;if(!r&&!i)return n;let a=n;return async(...t)=>{let n=await pe(e.name,r,t),o=await a(...n);return await me(e.name,i,o)}}var _e=class{context;definitions=new Map;functions;_onChanged=[];constructor(e){this.context=e;let t=this.definitions,n=this;this.functions=new Proxy({},{get(e,r){let i=t.get(r);if(i)return ge(i,n.context)},has(e,n){return t.has(n)},getOwnPropertyDescriptor(e,n){return{value:t.get(n)?.handler,configurable:!0,enumerable:!0}},ownKeys(){return Array.from(t.keys())}})}register(e,t=!1){if(this.definitions.has(e.name)&&!t)throw le.DF0021({name:e.name});ue(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}update(e,t=!1){if(!this.definitions.has(e.name)&&!t)throw le.DF0022({name:e.name});ue(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}onChanged(e){return this._onChanged.push(e),()=>{let t=this._onChanged.indexOf(e);t!==-1&&this._onChanged.splice(t,1)}}async getHandler(e){return await ge(this.definitions.get(e),this.context)}getSchema(e){let t=this.definitions.get(e);if(!t)throw le.DF0023({name:String(e)});return{args:t.args,returns:t.returns}}has(e){return this.definitions.has(e)}get(e){return this.definitions.get(e)}list(){return Array.from(this.definitions.keys())}};function ve(e,t=``){return JSON.stringify(e,function(e,n){let r=this,i=r==null?n:r[e];if(i===void 0){if(Array.isArray(r))throw be(t,`undefined`,r,e);return n}return i!==null&&ye(i,r,e,t),n})}function ye(e,t,n,r){if(typeof e==`bigint`)throw be(r,`BigInt`,t,n);if(typeof e!=`object`)return;if(e instanceof Map)throw be(r,`Map`,t,n);if(e instanceof Set)throw be(r,`Set`,t,n);if(e instanceof Date)throw be(r,`Date`,t,n);if(Array.isArray(e))return;let i=Object.getPrototypeOf(e);if(i!==null&&i!==Object.prototype)throw be(r,e.constructor?.name??`class instance`,t,n)}function be(e,t,n,r){let i=xe(n,r);return le.DF0020({name:e||`<anonymous>`,type:t,path:i})}function xe(e,t){return Array.isArray(e)?`[${t}]`:t===``?`<root>`:t}function Se(){let e={};function t(t,...n){let r=e[t]||[];for(let e=0,t=r.length;e<t;e++){let t=r[e];t&&t(...n)}}function n(n,...r){t(n,...r),delete e[n]}function r(t,n){return(e[t]||=[]).push(n),()=>{e[t]=e[t]?.filter(e=>n!==e)}}function i(e,t){let n=r(e,((...e)=>(n(),t(...e))));return n}return{_listeners:e,emit:t,emitOnce:n,on:r,once:i}}var Ce=/^[\w+.-]{2,}:\/\//;function we(e){return e.endsWith(`/`)?e:`${e}/`}function Te(e){return(e.endsWith(`/`)?e.slice(0,-1):e)||`/`}function Ee(e,...t){let n=e;for(let e of t)e&&e!==`/`&&(n=n?we(n)+e.replace(/^\.?\//,``):e);return n}function De(e,t){if(!t||t===`/`||Ce.test(e))return e;let n=Te(t);return e.startsWith(n)?e:Ee(n,e)}function Oe(e,t){let n=e.match(Ce);return t+(n?e.slice(n[0].length):e)}var ke=`__DEVFRAME_CONNECTION_META__`,Ae=`__DEVFRAME_CONNECTION_AUTH_TOKEN__`;function je(e){let t=[()=>window?.[e],()=>globalThis?.[e],()=>parent.window?.[e]];for(let e of t)try{let t=e();if(t)return t}catch{}}function Me(){return je(i)}function Ne(){return je(ke)}function Pe(e){if(e)return e;try{let e=localStorage.getItem(Ae);if(e)return e}catch{}return je(Ae)}function Fe(e){globalThis[i]=e,globalThis[ke]={...e.connectionMeta,baseUrl:e.metaBaseUrl},e.authToken&&Ie(e.authToken)}function Ie(e){try{localStorage.setItem(Ae,e)}catch{}globalThis[Ae]=e;let t=Me();t&&(globalThis[i]={...t,authToken:e})}function Le(e){let t=De(r,e);try{return new URL(t,globalThis.location?.href).href}catch{return t}}function Re(e,t){return t&&t!==e.authToken?{...e,authToken:t}:e}function ze(){let e=Me();if(e)return Re(e,Pe()??e.authToken??e.connectionMeta.authToken);let t=Ne();if(t)return{connectionMeta:t,metaBaseUrl:t.baseUrl??Le(`./`),authToken:Pe(t.authToken)}}async function Be(e={}){if(e.connection){let t=Re(e.connection,Pe(e.authToken??e.connection.authToken??e.connection.connectionMeta.authToken));return Fe(t),t}let t=Array.isArray(e.baseURL)?e.baseURL:[e.baseURL??`./`];if(e.connectionMeta){let n={connectionMeta:e.connectionMeta,metaBaseUrl:Le(t[0]??`./`),authToken:Pe(e.authToken??e.connectionMeta.authToken)};return Fe(n),n}let n=ze();if(n){let t=Re(n,Pe(e.authToken??n.authToken??n.connectionMeta.authToken));return Fe(t),t}let i=[];for(let n of t){let t=De(r,n),a=Le(n);try{let n=await fetch(t);if(!n.ok)throw Error(`Failed to fetch connection meta from ${a}: ${n.status}`);let r=await n.json(),i=n.url||a,o={connectionMeta:r,metaBaseUrl:r.baseUrl?new URL(r.baseUrl,i).href:i,authToken:Pe(e.authToken??r.authToken)};return Fe(o),o}catch(e){i.push(e)}}throw Error(`Failed to get connection meta from ${t.join(`, `)}`,{cause:i})}var Ve=class extends Error{name=`DevframeConnectionError`;kind;constructor(e,t,n){super(t,n),this.kind=e}};function He(e=c){try{let t=globalThis.location?.hash?.replace(/^#/,``)??``;return new URLSearchParams(t).get(e)||void 0}catch{return}}function Ue(e){try{let t=new URL(globalThis.location.href),n=new URLSearchParams(t.hash.replace(/^#/,``));if(!n.has(e))return;n.delete(e),t.hash=n.toString(),globalThis.history?.replaceState(globalThis.history.state,``,t.href)}catch{}}function We(e=c){let t=He(e);return t&&Ue(e),t}async function Ge(e,t={}){let n=We(t.param??`devframe_otp`);return n?e.isTrusted?!0:e.requestTrustWithCode(n):!1}function Ke(e){let t={},n=new WeakMap,r,i=()=>(r??=e.sharedState.get(s,{initialValue:{}}).then(e=>(t=e.value(),e.on(`updated`,e=>{t=e}),e)),r);return i(),{state:i,has:e=>e in t,keys:()=>Object.keys(t),get:r=>{let i=t[r];if(!i)return;let a=n.get(i);return a||(a={...i,rpc:e.scope(i.scope).rpc},n.set(i,a)),a}}}var qe=Symbol.for(`immer-nothing`),Je=Symbol.for(`immer-draftable`),Ye=Symbol.for(`immer-state`);function Xe(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ze=Object,Qe=Ze.getPrototypeOf,$e=`constructor`,et=`prototype`,tt=`configurable`,nt=`enumerable`,rt=`writable`,it=`value`,at=e=>!!e&&!!e[Ye];function ot(e){return e?lt(e)||gt(e)||!!e[Je]||!!e[$e]?.[Je]||_t(e)||vt(e):!1}var st=Ze[et][$e].toString(),ct=new WeakMap;function lt(e){if(!e||!yt(e))return!1;let t=Qe(e);if(t===null||t===Ze[et])return!0;let n=Ze.hasOwnProperty.call(t,$e)&&t[$e];if(n===Object)return!0;if(!bt(n))return!1;let r=ct.get(n);return r===void 0&&(r=Function.toString.call(n),ct.set(n,r)),r===st}function ut(e,t,n=!0){dt(e)===0?(n?Reflect.ownKeys(e):Ze.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function dt(e){let t=e[Ye];return t?t.type_:gt(e)?1:_t(e)?2:vt(e)?3:0}var ft=(e,t,n=dt(e))=>n===2?e.has(t):Ze[et].hasOwnProperty.call(e,t),pt=(e,t,n=dt(e))=>n===2?e.get(t):e[t],mt=(e,t,n,r=dt(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function ht(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var gt=Array.isArray,_t=e=>e instanceof Map,vt=e=>e instanceof Set,yt=e=>typeof e==`object`,bt=e=>typeof e==`function`,xt=e=>typeof e==`boolean`;function St(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var Ct=e=>yt(e)?e?.[Ye]:null,wt=e=>e.copy_||e.base_,Tt=e=>e.modified_?e.copy_:e.base_;function Et(e,t){if(_t(e))return new Map(e);if(vt(e))return new Set(e);if(gt(e))return Array[et].slice.call(e);let n=lt(e);if(t===!0||t===`class_only`&&!n){let t=Ze.getOwnPropertyDescriptors(e);delete t[Ye];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[rt]===!1&&(a[rt]=!0,a[tt]=!0),(a.get||a.set)&&(t[i]={[tt]:!0,[rt]:!0,[nt]:a[nt],[it]:e[i]})}return Ze.create(Qe(e),t)}{let t=Qe(e);if(t!==null&&n)return{...e};let r=Ze.create(t);return Ze.assign(r,e)}}function Dt(e,t=!1){return At(e)||at(e)||!ot(e)?e:(dt(e)>1&&Ze.defineProperties(e,{set:kt,add:kt,clear:kt,delete:kt}),Ze.freeze(e),t&&ut(e,(e,t)=>{Dt(t,!0)},!1),e)}function Ot(){Xe(2)}var kt={[it]:Ot};function At(e){return e===null||!yt(e)||Ze.isFrozen(e)}var jt=`MapSet`,Mt=`Patches`,Nt=`ArrayMethods`,Pt={};function Ft(e){let t=Pt[e];return t||Xe(0,e),t}var It=e=>!!Pt[e];function Lt(e,t){Pt[e]||(Pt[e]=t)}var Rt,zt=()=>Rt,Bt=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:It(jt)?Ft(jt):void 0,arrayMethodsPlugin_:It(Nt)?Ft(Nt):void 0});function Vt(e,t){t&&(e.patchPlugin_=Ft(Mt),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ht(e){Ut(e),e.drafts_.forEach(Gt),e.drafts_=null}function Ut(e){e===Rt&&(Rt=e.parent_)}var Wt=e=>Rt=Bt(Rt,e);function Gt(e){let t=e[Ye];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Kt(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[Ye].modified_&&(Ht(t),Xe(4)),ot(e)&&(e=qt(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[Ye].base_,e,t)}else e=qt(t,n);return Jt(t,e,!0),Ht(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===qe?void 0:e}function qt(e,t){if(At(t))return t;let n=t[Ye];if(!n)return nn(t,e.handledSet_,e);if(!Xt(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);en(n,e)}return n.copy_}function Jt(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Dt(t,n)}function Yt(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Xt=(e,t)=>e.scope_===t,Zt=[];function Qt(e,t,n,r){let i=wt(e),a=e.type_;if(r!==void 0&&pt(i,r,a)===t){mt(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;ut(i,(e,n)=>{if(at(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??Zt;for(let e of o)mt(i,e,n,a)}function $t(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!Xt(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=Tt(i);Qt(e,i.draft_??i,a,n),en(i,r)})}function en(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}Yt(e)}}function tn(e,t,n){let{scope_:r}=e;if(at(n)){let i=n[Ye];Xt(i,r)&&i.callbacks_.push(function(){fn(e),Qt(e,n,Tt(i),t)})}else ot(n)&&e.callbacks_.push(function(){let i=wt(e);e.type_===3?i.has(n)&&nn(n,r.handledSet_,r):pt(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&nn(pt(e.copy_,t,e.type_),r.handledSet_,r)})}function nn(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||at(e)||t.has(e)||!ot(e)||At(e)?e:(t.add(e),ut(e,(r,i)=>{if(at(i)){let t=i[Ye];Xt(t,n)&&(mt(e,r,Tt(t),e.type_),Yt(t))}else ot(i)&&nn(i,t,n)}),e)}function rn(e,t){let n=gt(e),r={type_:+!!n,scope_:t?t.scope_:zt(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=an;n&&(i=[r],a=on);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var an={get(e,t){if(t===Ye)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=wt(e);if(!ft(i,t,e.type_))return ln(e,i,t);let a=i[t];if(e.finalized_||!ot(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&St(t))return a;if(a===sn(e.base_,t)||cn(e,t,a)){fn(e);let n=e.type_===1?+t:t,r=mn(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in wt(e)},ownKeys(e){return Reflect.ownKeys(wt(e))},set(e,t,n){let r=un(wt(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=sn(wt(e),t),i=r?.[Ye];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(ht(n,r)&&(n!==void 0||ft(e.base_,t,e.type_)))return!0;fn(e),dn(e)}return e.copy_[t]===n&&(n!==void 0||ft(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),tn(e,t,n),!0)},deleteProperty(e,t){return fn(e),sn(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),dn(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=wt(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[rt]:!0,[tt]:e.type_!==1||t!==`length`,[nt]:r[nt],[it]:n[t]}},defineProperty(){Xe(11)},getPrototypeOf(e){return Qe(e.base_)},setPrototypeOf(){Xe(12)}},on={};for(let e in an){let t=an[e];on[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}on.deleteProperty=function(e,t){return on.set.call(this,e,t,void 0)},on.set=function(e,t,n){return an.set.call(this,e[0],t,n,e[0])};function sn(e,t){let n=e[Ye];return(n?wt(n):e)[t]}function cn(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!ot(n)||n[Ye]?!1:e.baseRefs_.has(n)}function ln(e,t,n){let r=un(t,n);return r?it in r?r[it]:r.get?.call(e.draft_):void 0}function un(e,t){if(!(t in e))return;let n=Qe(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Qe(n)}}function dn(e){e.modified_||(e.modified_=!0,e.parent_&&dn(e.parent_))}function fn(e){e.copy_||=(e.assigned_=new Map,Et(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var pn=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(bt(e)&&!bt(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}bt(t)||Xe(6),n!==void 0&&!bt(n)&&Xe(7);let r;if(ot(e)){let i=Wt(this),a=mn(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?Ht(i):Ut(i)}return Vt(i,n),Kt(r,i)}if(!e||!yt(e)){if(r=t(e),r===void 0&&(r=e),r===qe&&(r=void 0),this.autoFreeze_&&Dt(r,!0),n){let t=[],i=[];Ft(Mt).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}Xe(1,e)},this.produceWithPatches=(e,t)=>{if(bt(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},xt(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),xt(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),xt(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ot(e)||Xe(8),at(e)&&(e=hn(e));let t=Wt(this),n=mn(t,e,void 0);return n[Ye].isManual_=!0,Ut(t),n}finishDraft(e,t){let n=e&&e[Ye];(!n||!n.isManual_)&&Xe(9);let{scope_:r}=n;return Vt(r,t),Kt(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=Ft(Mt).applyPatches_;return at(e)?r(e,t):this.produce(e,e=>r(e,t))}};function mn(e,t,n,r){let[i,a]=_t(t)?Ft(jt).proxyMap_(t,n):vt(t)?Ft(jt).proxySet_(t,n):rn(t,n);return(n?.scope_??zt()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?$t(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function hn(e){return at(e)||Xe(10,e),gn(e)}function gn(e){if(!ot(e)||At(e))return e;let t=e[Ye],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Et(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Et(e,!0);return ut(n,(e,t)=>{mt(n,e,gn(t))},r),t&&(t.finalized_=!1),n}function _n(){function e(n,r=[]){if(n.key_!==void 0){let e=n.parent_.copy_??n.parent_.base_,t=Ct(pt(e,n.key_)),i=pt(e,n.key_);if(i===void 0||i!==n.draft_&&i!==n.base_&&i!==n.copy_||t!=null&&t.base_!==n.base_)return null;let a=n.parent_.type_===3,o;if(a){let e=n.parent_;o=Array.from(e.drafts_.keys()).indexOf(n.key_)}else o=n.key_;if(!(a&&e.size>o||ft(e,o)))return null;r.push(o)}if(n.parent_)return e(n.parent_,r);r.reverse();try{t(n.copy_,r)}catch{return null}return r}function t(e,t){let n=e;for(let e=0;e<t.length-1;e++){let r=t[e];if(n=pt(n,r),!yt(n)||n===null)throw Error(`Cannot resolve path at '${t.join(`/`)}'`)}return n}let n=`replace`,r=`remove`;function i(e,t,n){if(e.scope_.processedForPatches_.has(e))return;e.scope_.processedForPatches_.add(e);let{patches_:r,inversePatches_:i}=n;switch(e.type_){case 0:case 2:return o(e,t,r,i);case 1:return a(e,t,r,i);case 3:return s(e,t,r,i)}}function a(e,t,i,a){let{base_:o,assigned_:s}=e,c=e.copy_;c.length<o.length&&([o,c]=[c,o],[i,a]=[a,i]);let l=e.allIndicesReassigned_===!0;for(let e=0;e<o.length;e++){let r=c[e],u=o[e];if((l||s?.get(e.toString()))&&r!==u){let o=r?.[Ye];if(o&&o.modified_)continue;let s=t.concat([e]);i.push({op:n,path:s,value:d(r)}),a.push({op:n,path:s,value:d(u)})}}for(let e=o.length;e<c.length;e++){let n=t.concat([e]);i.push({op:`add`,path:n,value:d(c[e])})}for(let e=c.length-1;o.length<=e;--e){let n=t.concat([e]);a.push({op:r,path:n})}}function o(e,t,i,a){let{base_:o,copy_:s,type_:c}=e;ut(e.assigned_,(e,l)=>{let u=pt(o,e,c),f=pt(s,e,c),p=l?ft(o,e)?n:`add`:r;if(u===f&&p===n)return;let m=t.concat(e);i.push(p===r?{op:p,path:m}:{op:p,path:m,value:d(f)}),a.push(p===`add`?{op:r,path:m}:p===r?{op:`add`,path:m,value:d(u)}:{op:n,path:m,value:d(u)})})}function s(e,t,n,i){let{base_:a,copy_:o}=e,s=0;a.forEach(e=>{if(!o.has(e)){let a=t.concat([s]);n.push({op:r,path:a,value:e}),i.unshift({op:`add`,path:a,value:e})}s++}),s=0,o.forEach(e=>{if(!a.has(e)){let a=t.concat([s]);n.push({op:`add`,path:a,value:e}),i.unshift({op:r,path:a,value:e})}s++})}function c(e,t,r){let{patches_:i,inversePatches_:a}=r;i.push({op:n,path:[],value:t===qe?void 0:t}),a.push({op:n,path:[],value:e})}function l(e,t){return t.forEach(t=>{let{path:i,op:a}=t,o=e;for(let e=0;e<i.length-1;e++){let t=dt(o),n=i[e];typeof n!=`string`&&typeof n!=`number`&&(n=``+n),(t===0||t===1)&&(n===`__proto__`||n===$e)&&Xe(19),bt(o)&&n===et&&Xe(19),o=pt(o,n),(o===null||!yt(o))&&Xe(18,i.join(`/`))}let s=dt(o),c=u(t.value),l=i[i.length-1];switch(a){case n:switch(s){case 2:return o.set(l,c);case 3:Xe(16);default:return o[l]=c}case`add`:switch(s){case 1:return l===`-`?o.push(c):o.splice(l,0,c);case 2:return o.set(l,c);case 3:return o.add(c);default:return o[l]=c}case r:switch(s){case 1:return o.splice(l,1);case 2:return o.delete(l);case 3:return o.delete(t.value);default:return delete o[l]}default:Xe(17,a)}}),e}function u(e){if(!ot(e))return e;if(gt(e))return e.map(u);if(_t(e))return new Map(Array.from(e.entries()).map(([e,t])=>[e,u(t)]));if(vt(e))return new Set(Array.from(e).map(u));let t=Object.create(Qe(e));for(let n in e)t[n]=u(e[n]);return ft(e,Je)&&(t[Je]=e[Je]),t}function d(e){return at(e)?u(e):e}Lt(Mt,{applyPatches_:l,generatePatches_:i,generateReplacementPatches_:c,getPath:e})}globalThis.Iterator?.from;var vn=new pn,yn=vn.produce,bn=vn.produceWithPatches.bind(vn),xn=vn.applyPatches.bind(vn),Sn=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function Cn(e=21){let t=``,n=e;for(;n--;)t+=Sn[Math.random()*64|0];return t}var wn=1e3;function Tn(e,t){if(e.add(t),e.size>wn){let t=e.values().next().value;t!==void 0&&e.delete(t)}}function En(e){let{enablePatches:t=!1}=e;t&&_n();let n=Se(),r=e.initialValue,i=new Set;return{on:n.on,value:()=>r,patch:(e,t=Cn())=>{i.has(t)||(_n(),r=xn(r,e),Tn(i,t),n.emit(`updated`,r,void 0,t))},mutate:(e,a=Cn())=>{if(!i.has(a)){if(Tn(i,a),t){let[t,i]=bn(r,e);if(t===r)return;r=t,n.emit(`updated`,r,i,a)}else{let t=yn(r,e);if(t===r)return;r=t,n.emit(`updated`,r,void 0,a)}}},syncIds:i}}function Dn(e){let t=new Map,r=new Map,i=new Map,a=new Set,o=e.connectionMeta.backend===`static`;function s(e,t){let n=i.get(e);return n&&typeof n==`object`&&!Array.isArray(n)&&typeof t==`object`&&!Array.isArray(t)?{...n,...t}:t}e.client.register({name:n.broadcast.clientStateUpdated,type:`event`,handler:(e,n,r)=>{let i=t.get(e);i&&!i.syncIds.has(r)&&i.mutate(()=>s(e,n),r)}}),e.client.register({name:n.broadcast.clientStatePatch,type:`event`,handler:(e,n,r)=>{let i=t.get(e);i&&!i.syncIds.has(r)&&i.patch(n,r)}});function c(t,n){let r=[];return r.push(n.on(`updated`,(n,r,i)=>{o||(r?e.callEvent(`devframe:rpc:server-state:patch`,t,r,i):e.callEvent(`devframe:rpc:server-state:set`,t,n,i))})),()=>{for(let e of r)e()}}return{keys:()=>Array.from(t.keys()),onKeyAdded(e){return a.add(e),()=>{a.delete(e)}},delete(e){let n=r.get(e);r.delete(e);let a=t.delete(e);return i.delete(e),n?.(),a},get:async(l,u)=>{if(u?.initialValue!==void 0&&i.set(l,u.initialValue),t.has(l))return t.get(l);let d=En({initialValue:u?.initialValue,enablePatches:!1});async function f(){if(o||e.callEvent(`devframe:rpc:server-state:subscribe`,l),u?.initialValue!==void 0){t.set(l,d);for(let e of a)e(l);return e.call(`devframe:rpc:server-state:get`,l).then(e=>{e!==void 0&&d.mutate(()=>s(l,e))}).catch(e=>{console.error(`Error getting server state`,e)}),r.set(l,c(l,d)),d}{let n=await e.call(`devframe:rpc:server-state:get`,l);d.mutate(()=>s(l,n)),t.set(l,d);for(let e of a)e(l);return r.set(l,c(l,d)),d}}return new Promise(t=>{if(e.isTrusted)f().then(t);else{t(d);let r=!1;e.events.on(n.client.isTrustedUpdated,e=>{e&&!r&&(r=!0,f())})}})}}}var On=typeof self==`object`?self:globalThis,kn=new Set([`Error`,`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`,`AggregateError`]),An=new Set([`Boolean`,`Number`,`String`,`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float16Array`,`Float32Array`,`Float64Array`,`BigInt64Array`,`BigUint64Array`]);function jn(e,t){let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o,r=kn.has(e)?On[e]:void 0;return n(new(r??On.Error)(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}if(typeof a==`string`&&An.has(a))return n(new On[a](o),i);throw TypeError(`unable to deserialize unsafe or unknown type: ${String(a)}`)};return r}function Mn(e){return jn(new Map,e)(0)}var Nn=``,{toString:Pn}={},{keys:Fn}=Object;function In(e){let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Pn.call(e).slice(8,-1);switch(n){case`Array`:return[1,Nn];case`Object`:return[2,Nn];case`Date`:return[3,Nn];case`RegExp`:return[4,Nn];case`Map`:return[5,Nn];case`Set`:return[6,Nn];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]}function Ln([e,t]){return e===0&&(t===`function`||t===`symbol`)}function Rn(e,t,n,r){let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=In(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize ${s}`);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Fn(r))(e||!Ln(In(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(Ln(In(n))||Ln(In(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!Ln(In(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a}function zn(e,t={}){let n=[];return Rn(!(t.json||t.lossy),!!t.json,new Map,n)(e),n}var{parse:Bn,stringify:Vn}=JSON,Hn={json:!0,lossy:!0};function Un(e){return Mn(Bn(e))}function Wn(e){return Vn(zn(e,Hn))}function Gn(e){return Mn(e)}function Kn(e){return Wn(e)}function qn(e){return Un(e)}var Jn=new Map;function Yn(e=Jn){let t=new Map;return{serialize:n=>{let r;return n.t===`q`?r=n.m:(r=t.get(n.i),t.delete(n.i)),!(n.t===`s`&&`e`in n)&&r&&e.get(r)?.jsonSerializable===!0?ve(n,r??``):`s:${Kn(n)}`},deserialize:e=>{let n=e.startsWith(`s:`)?qn(e.slice(2)):JSON.parse(e);return n.t===`q`&&n.i&&n.m&&t.set(n.i,n.m),n}}}function Xn(){}function Zn(e){let t=e.search(/\n\n|\r\n\r\n/);if(!(t<0))return{frame:e.slice(0,t),rest:e.slice(t+(e[t]===`\r`?4:2))}}function Qn(e){let t=`message`,n=[];for(let r of e.split(/\r?\n/))r.startsWith(`:`)||(r.startsWith(`event:`)?t=r.slice(6).trimStart():r.startsWith(`data:`)&&n.push(r.slice(5).replace(/^ /,``)));return{event:t,data:n}}function $n(e){let{onConnected:t=Xn,onError:n=Xn,onDisconnected:r=Xn,definitions:i,fetch:o=globalThis.fetch.bind(globalThis)}=e,s=e.url;e.authToken&&(s=`${s}${s.includes(`?`)?`&`:`?`}${l}=${encodeURIComponent(e.authToken)}`);let c=Yn(i),u=new AbortController,d=!1,f,p,m,h,g=new Promise((e,t)=>{m=e,h=t});g.catch(()=>{});function _(e){d||(d=!0,h(e),n(e),r())}function v(){d||(d=!0,h(Error(`Devframe SSE stream closed`)),r())}function y(e,n){if(e===`session`){m(n),t();return}f?.(n)}async function b(e){let t=e.getReader();p=t;let n=new TextDecoder,r=``;for(;;){let{done:e,value:i}=await t.read();if(e)break;for(r+=n.decode(i,{stream:!0});;){let e=Zn(r);if(!e)break;r=e.rest;let{event:t,data:n}=Qn(e.frame);n.length>0&&y(t,n.join(`
|
|
3
|
+
`))}}v()}return(async()=>{try{let e=await o(s,{headers:{accept:`text/event-stream`},signal:u.signal});if(!e.ok||!e.body)throw Error(`Devframe SSE stream request failed: ${e.status}`);await b(e.body)}catch(e){if(u.signal.aborted){v();return}_(e instanceof Error?e:Error(String(e)))}})(),{close:()=>{d=!0,u.abort(),p?.cancel().catch(()=>{})},on:e=>{f=e},post:async e=>{let t;try{t=await g}catch{return}if(d){n(Error(`Devframe SSE channel is closed; message dropped`));return}try{let n=await o(s,{method:`POST`,headers:{"content-type":`text/plain; charset=utf-8`,[a]:t},body:e});if(n.status===200){let e=await n.text();e&&f?.(e);return}if(!n.ok)throw Error(`Devframe SSE POST failed: ${n.status}`)}catch(e){n(e instanceof Error?e:Error(String(e)))}},serialize:c.serialize,deserialize:c.deserialize}}function er(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var tr=Math.random.bind(Math),nr=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function rr(e=21){let t=``,n=e;for(;n--;)t+=nr[tr()*64|0];return t}var ir=6e4,ar=e=>e,or=ar,{clearTimeout:sr,setTimeout:cr}=globalThis;function lr(e,t){let{post:n,on:r,off:i=()=>{},eventNames:a=[],serialize:o=ar,deserialize:s=or,resolver:c,bind:l=`rpc`,timeout:u=ir,proxify:d=!0}=t,f=!1,p=new Map,m,h;async function g(e,r,i,a){if(f)throw Error(`[birpc] rpc is closed, cannot call "${e}"`);let s={m:e,a:r,t:`q`};a&&(s.o=!0);let c=async e=>n(o(e));if(i){await c(s);return}if(m)try{await m}finally{m=void 0}let{promise:l,resolve:d,reject:g}=er(),_=rr();s.i=_;let v;async function y(n=s){return u>=0&&(v=cr(()=>{try{if(t.onTimeoutError?.call(h,e,r)!==!0)throw Error(`[birpc] timeout on calling "${e}"`)}catch(e){g(e)}p.delete(_)},u),typeof v==`object`&&(v=v.unref?.())),p.set(_,{resolve:d,reject:g,timeoutId:v,method:e}),await c(n),l}try{t.onRequest?await t.onRequest.call(h,s,y,d):await y()}catch(e){if(t.onGeneralError?.call(h,e)!==!0)throw e;return}finally{sr(v),p.delete(_)}return l}let _={$call:(e,...t)=>g(e,t,!1),$callOptional:(e,...t)=>g(e,t,!1,!0),$callEvent:(e,...t)=>g(e,t,!0),$callRaw:e=>g(e.method,e.args,e.event,e.optional),$rejectPendingCalls:y,get $closed(){return f},get $meta(){return t.meta},$close:v,$functions:e};h=d?new Proxy({},{get(t,n){if(Object.hasOwn(_,n))return _[n];if(n===`then`&&!a.includes(`then`)&&!(`then`in e))return;let r=(...e)=>g(n,e,!0);if(a.includes(n))return r.asEvent=r,r;let i=(...e)=>g(n,e,!1);return i.asEvent=r,i}}):_;function v(e){f=!0,p.forEach(({reject:t,method:n})=>{let r=Error(`[birpc] rpc is closed, cannot call "${n}"`);if(e)return e.cause??=r,t(e);t(r)}),p.clear(),i(b)}function y(e){let t=Array.from(p.values()).map(({method:t,reject:n})=>e?e({method:t,reject:n}):n(Error(`[birpc]: rejected pending call "${t}".`)));return p.clear(),t}async function b(r,...i){let a;try{a=s(r)}catch(e){if(t.onGeneralError?.call(h,e)!==!0)throw e;return}if(a.t===`q`){let{m:r,a:s,o:u}=a,d,f,p=await(c?c.call(h,r,e[r]):e[r]);if(u&&(p||=()=>void 0),!p)f=Error(`[birpc] function "${r}" not found`);else try{d=await p.apply(l===`rpc`?h:e,s)}catch(e){f=e}if(a.i){if(f&&t.onFunctionError&&t.onFunctionError.call(h,f,r,s)===!0)return;if(!f)try{await n(o({t:`s`,i:a.i,r:d}),...i);return}catch(e){if(f=e,t.onGeneralError?.call(h,e,r,s)!==!0)throw e}try{await n(o({t:`s`,i:a.i,e:f}),...i)}catch(e){if(t.onGeneralError?.call(h,e,r,s)!==!0)throw e}}}else{let{i:e,r:t,e:n}=a,r=p.get(e);r&&(sr(r.timeoutId),n?r.reject(n):r.resolve(t)),p.delete(e)}}return m=r(b),h}function ur(e,t){let{channel:n,rpcOptions:r={}}=t;return lr(e,{...n,timeout:-1,...r,proxify:!1})}function dr(e){let{transport:t,authToken:r,connectionMeta:i,events:a,clientRpc:o,rpcOptions:s={},callTimeout:c=0}=e,l=!1,u=`connecting`,d=null,f=Promise.withResolvers();function p(e,t=null){if(t?d=t:e===`connected`&&(d=null),e===u)return;let r=u;u=e,a.emit(n.client.connectionStatus,e,r)}let m=new Set;function h(e){for(let t of[...m])t.reject(e)}function g(){return u===`disconnected`||u===`error`?new Ve(`connection`,`[devframe] Not connected to the devframe server`,{cause:d??void 0}):u===`unauthorized`?new Ve(`auth`,`[devframe] Not authorized by the devframe server`,{cause:d??void 0}):null}function _(e,t){return new Promise((r,i)=>{let o=!1,s,l={reject(e){o||(u(),a.emit(n.client.error,e,t),i(e))}};function u(){o=!0,m.delete(l),s&&clearTimeout(s)}m.add(l),c>0&&(s=setTimeout(()=>{l.reject(new Ve(`timeout`,`[devframe] RPC call "${t}" timed out after ${c}ms`))},c)),e.then(e=>{o||(u(),r(e))},e=>{if(o)return;u();let r=e instanceof Error?e:Error(String(e));a.emit(n.client.error,r,t),i(r)})})}let v=new Map;for(let e of i.jsonSerializableMethods??[])v.set(e,{jsonSerializable:!0});let y=e.createChannel({definitions:v,onError(e){p(`error`,e),a.emit(n.client.connectionError,e),h(new Ve(`connection`,`[devframe] Connection to the devframe server failed`,{cause:e}))},onDisconnected(){u!==`error`&&p(`disconnected`),h(new Ve(`connection`,`[devframe] Disconnected from the devframe server`,{cause:d??void 0}))}}),b=ur(o.functions,{channel:y,rpcOptions:s});o.register({name:n.broadcast.authRevoked,type:`event`,handler:()=>{l=!1;let e=new Ve(`auth`,`[devframe] The devframe server revoked this client's trust`);p(`unauthorized`,e),a.emit(n.client.connectionError,e),h(e),a.emit(n.client.isTrustedUpdated,!1)}});let x=r;async function S(e){x=e;let t=await b.$call(`anonymous:devframe:auth`,{authToken:e,ua:navigator.userAgent,origin:location.origin});if(l=t.isTrusted,l)f.resolve(!0),p(`connected`);else{let e=new Ve(`auth`,`[devframe] The devframe server refused this client's credentials`);p(`unauthorized`,e),a.emit(n.client.connectionError,e)}return a.emit(n.client.isTrustedUpdated,l),t.isTrusted}async function C(e){let t=(await b.$call(`anonymous:devframe:auth:exchange`,{code:e,ua:navigator.userAgent,origin:location.origin}))?.authToken??null;return t&&(x=t,l=!0,f.resolve(!0),p(`connected`),a.emit(n.client.isTrustedUpdated,!0)),t}async function w(e={}){await b.$call(`anonymous:devframe:auth:request-code`,{ua:navigator.userAgent,origin:location.origin,...e.reissue?{reissue:!0}:{}})}async function T(){return l?!0:S(x??``)}async function ee(e=6e4){if(l&&f.resolve(!0),e<=0)return f.promise;let t;try{return await Promise.race([f.promise,new Promise((n,r)=>{t=setTimeout(()=>{r(Error(`[devframe] Timeout waiting for rpc to be trusted`))},e)})]),l}finally{clearTimeout(t)}}return{transport:t,get isTrusted(){return l},get status(){return u},get connectionError(){return d},requestTrust:T,requestTrustWithToken:S,requestTrustWithCode:C,requestAuthCode:w,ensureTrusted:ee,call:(...e)=>{let t=String(e[0]),r=g();return r?(a.emit(n.client.error,r,t),Promise.reject(r)):_(b.$call(...e),t)},callEvent:(...e)=>{let t=g();if(t){a.emit(n.client.error,t,String(e[0]));return}return b.$callEvent(...e)},callOptional:(...e)=>{let t=String(e[0]),r=g();return r?(a.emit(n.client.error,r,t),Promise.reject(r)):_(b.$callOptional(...e),t)},close:()=>{y.close()}}}function fr(e,t,n){let r=(()=>{try{return new URL(t,n.href)}catch{return new URL(n.href)}})();if(e&&typeof e==`object`){if(e.host!=null||e.port!=null){let t=e.host??`${r.hostname}:${e.port}`;return new URL(e.path??`/`,`${r.protocol}//${t}`).href}return new URL(e.path??``,r).href}let i=e??``;return/^https?:\/\//i.test(i)?i:new URL(i,r).href}function pr(e){let{authToken:t,connectionMeta:n,metaBaseUrl:r,events:i,clientRpc:a,rpcOptions:o={},sseOptions:s={},callTimeout:c=0}=e,l=fr(n.sse,r??`./`,location);return dr({transport:`sse`,authToken:t,connectionMeta:n,events:i,clientRpc:a,rpcOptions:o,callTimeout:c,createChannel:e=>$n({url:l,authToken:t,definitions:e.definitions,...s,onConnected(){s.onConnected?.()},onError(t){e.onError(t),s.onError?.(t)},onDisconnected(){e.onDisconnected(),s.onDisconnected?.()}})})}function mr(e){let{name:t,message:n,cause:r,...i}=e,a=r instanceof Error?r:hr(r)?mr(r):r,o=a===void 0?Error(n):Error(n,{cause:a});return o.name=t,Object.assign(o,i),o}function hr(e){return typeof e==`object`&&!!e&&typeof e.message==`string`&&typeof e.name==`string`}function gr(e){return typeof e==`object`&&!!e&&e.type===`static`&&typeof e.path==`string`}function _r(e){return typeof e==`object`&&!!e&&e.type===`query`&&typeof e.records==`object`&&e.records!==null}function vr(e){return typeof e==`object`&&!!e&&(`output`in e||`error`in e)}function yr(e){if(e.error)throw mr(e.error);return e.output}function br(e){return e.some(e=>e!=null)}function xr(e){return typeof e==`object`&&e&&`serialization`in e&&`data`in e?e.data:e}function Sr(e,t){let n=new Map,r=new Map;function i(e,t){return t===`structured-clone`&&Array.isArray(e)?Gn(e):e}function a(e,t){return i(xr(e),t)}async function o(e){n.has(e.path)||n.set(e.path,t(e.path).then(t=>a(t,e.serialization)));let r=await n.get(e.path);return vr(r)?yr(r):r}async function s(e,n){return r.has(e)||r.set(e,t(e).then(e=>a(e,n))),await r.get(e)}async function c(t,n){if(!(t in e))throw Error(`[devframe-rpc] Function "${t}" not found in dump store`);let r=e[t];if(gr(r)){if(br(n))throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`);return await o(r)}if(_r(r)){let e=C(n),i=r.records[e];if(i)return yr(await s(i,r.serialization));if(r.fallback)return yr(await s(r.fallback,r.serialization));throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}if(!br(n))return r;throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}return{call:async(e,t)=>await c(e,t),callOptional:async(t,n)=>{if(t in e)return await c(t,n)},callEvent:async(e,t)=>{}}}async function Cr(e){let t=Sr(await e.fetchJsonFromBases(o),e.fetchJsonFromBases);return{transport:`static`,isTrusted:!0,status:`connected`,connectionError:null,requestTrust:async()=>!0,requestTrustWithToken:async()=>!0,requestTrustWithCode:async()=>null,requestAuthCode:async()=>{},ensureTrusted:async()=>!0,call:(...e)=>t.call(e[0],e.slice(1)),callEvent:(...e)=>t.callEvent(e[0],e.slice(1)),callOptional:(...e)=>t.callOptional(e[0],e.slice(1)),close:()=>{}}}var wr=256,Tr=class extends Error{name=`StreamClosedError`};function Er(e={}){let t=e.id??Cn(),n=Math.max(0,e.replayWindow??0),r=Se(),i=new AbortController,a=[],o=!1,s=0;function c(e){if(o)throw new Tr(`Cannot write to a closed stream "${t}"`);s+=1,n>0&&(a.push({seq:s,chunk:e}),a.length>n&&(a.length-n===1?a.shift():a.splice(0,a.length-n))),r.emit(`chunk`,s,e)}function l(e){if(o)return;o=!0;let t=Or(e);i.abort(e),r.emit(`end`,t)}function u(){o||(o=!0,i.signal.aborted||i.abort(`stream closed`),r.emit(`end`,void 0))}function d(e){o||i.signal.aborted||i.abort(e??`aborted`)}let f=new WritableStream({write(e){c(e)},close(){u()},abort(e){l(e)}});return{id:t,signal:i.signal,get closed(){return o},get lastSeq(){return s},write:c,error:l,close:u,abort:d,writable:f,events:r,buffer:a}}function Dr(e={}){let t=e.id??Cn(),n=Math.max(1,e.highWaterMark??wr),r=[],i=0,a=!1,o=!1,s,c,l,u;function d(){if(c){if(r.length>0){let e=r.shift(),t=c;c=void 0,t.resolve({value:e,done:!1});return}if(a){let e=c;if(c=void 0,s){let t=Error(s.message);t.name=s.name,e.reject(t)}else e.resolve({value:void 0,done:!0})}}}function f(){if(l){for(;r.length>0;){let e=r.shift();try{l.enqueue(e)}catch{break}}if(a&&l){try{if(s){let e=Error(s.message);e.name=s.name,l.error(e)}else l.close()}catch{}l=void 0}}}function p(t,s){if(!(a||o)&&!(t<=i)){if(i=t,r.push(s),r.length>n){let t=r.length-n;r.splice(0,t),e.onOverflow?.(t)}d(),u&&f()}}function m(e){a||(a=!0,s=e,d(),u&&f())}function h(){o||a||(o=!0,e.onCancel?.(),m(void 0))}function g(){return u||(u=new ReadableStream({start(e){l=e,f()},cancel(){h()}}),u)}return{id:t,get cancelled(){return o},get done(){return a},get lastSeenSeq(){return i},get readable(){return g()},cancel:h,_push:p,_end:m,[Symbol.asyncIterator](){return{next(){if(r.length>0)return Promise.resolve({value:r.shift(),done:!1});if(a){if(s){let e=Error(s.message);return e.name=s.name,Promise.reject(e)}return Promise.resolve({value:void 0,done:!0})}return new Promise((e,t)=>{c={resolve:e,reject:t}})},return(){return h(),Promise.resolve({value:void 0,done:!0})}}}}}function Or(e){if(e instanceof Error)return{name:e.name||`Error`,message:e.message};if(typeof e==`string`)return{name:`Error`,message:e};try{return{name:`Error`,message:JSON.stringify(e)}}catch{return{name:`Error`,message:String(e)}}}var kr=``;function Ar(e,t){return`${e}${kr}${t}`}function jr(e){let t=new Map,r=new Map;e.client.register({name:n.broadcast.streamingChunk,type:`event`,handler(e,n,r,i){t.get(Ar(e,n))?._push(r,i)}}),e.client.register({name:n.broadcast.streamingEnd,type:`event`,handler(e,n,r){let i=Ar(e,n),a=t.get(i);a&&(a._end(r),t.delete(i))}}),e.client.register({name:n.broadcast.streamingUploadCancel,type:`event`,handler(e,t){let n=Ar(e,t),i=r.get(n);i&&(i.abort(`server cancelled upload`),r.delete(n))}}),e.events.on(n.client.isTrustedUpdated,n=>{if(n)for(let[n,r]of t){if(r.cancelled||r.done)continue;let t=n.indexOf(kr);if(t<0)continue;let i=n.slice(0,t),a=n.slice(t+1);e.callEvent(`devframe:streaming:subscribe`,i,a,{afterSeq:r.lastSeenSeq})}});function i(r,i,a={}){let o=Ar(r,i),s=t.get(o);if(s)return s;let c=Dr({id:i,highWaterMark:a.highWaterMark,onOverflow(e){console.warn(`[devframe] DF0029: Stream "${r}#${i}" dropped ${e} chunk(s) after exceeding the client high-water mark.`)},onCancel(){e.callEvent(`devframe:streaming:cancel`,r,i),t.delete(o)}});if(t.set(o,c),e.isTrusted)e.callEvent(`devframe:streaming:subscribe`,r,i,{afterSeq:0});else{let a=e.events.on(n.client.isTrustedUpdated,n=>{n&&(a(),t.has(o)&&!c.cancelled&&!c.done&&e.callEvent(`devframe:streaming:subscribe`,r,i,{afterSeq:c.lastSeenSeq}))})}return c}function a(t,n){let i=Ar(t,n),a=r.get(i);if(a)return a;let o=Er({id:n});return o.events.on(`chunk`,(r,i)=>{e.callEvent(`devframe:streaming:upload-chunk`,t,n,r,i)}),o.events.on(`end`,a=>{e.callEvent(`devframe:streaming:upload-end`,t,n,a),r.delete(i)}),r.set(i,o),o}return{subscribe:i,upload:a}}function Mr(){}var Nr=new Map;function Pr(e){let t=e.url;e.authToken&&(t=`${t}?${l}=${encodeURIComponent(e.authToken)}`);let n=new WebSocket(t),{onConnected:r=Mr,onError:i=Mr,onDisconnected:a=Mr,definitions:o=Nr}=e;n.addEventListener(`open`,e=>{r(e)}),n.addEventListener(`error`,e=>{let t=e instanceof Error?e:Error(e.type);i(t)}),n.addEventListener(`close`,e=>{a(e)});let s=Yn(o);return{close:()=>{n.close()},on:e=>{n.addEventListener(`message`,t=>{e(t.data)})},post:e=>{if(n.readyState===WebSocket.OPEN){n.send(e);return}if(n.readyState===WebSocket.CONNECTING){let t=()=>{i(),n.readyState===WebSocket.OPEN&&n.send(e)},r=()=>i();function i(){n.removeEventListener(`open`,t),n.removeEventListener(`close`,r)}n.addEventListener(`open`,t),n.addEventListener(`close`,r);return}i(Error(`Devframe WebSocket is not open; message dropped`))},serialize:s.serialize,deserialize:s.deserialize}}function Fr(e,t,n){let r=(()=>{try{return new URL(t,n.href)}catch{return new URL(n.href)}})(),i=r.protocol===`https:`?`wss:`:`ws:`;if(e&&typeof e==`object`){if(e.host!=null||e.port!=null){let t=e.host??`${r.hostname}:${e.port}`,n=new URL(e.path??`/`,`${i}//${t}`);return n.protocol=i,n.href}let t=new URL(e.path??``,r);return t.protocol=i,t.href}if(typeof e==`number`)return`${i}//${r.hostname}:${e}`;let a=e??``;if(/^wss?:\/\//i.test(a))return a;if(/^https?:\/\//i.test(a))return Oe(a,/^https/i.test(a)?`wss://`:`ws://`);let o=new URL(a,r);return o.protocol=i,o.href}function Ir(e){let{authToken:t,connectionMeta:n,metaBaseUrl:r,events:i,clientRpc:a,rpcOptions:o={},wsOptions:s={},callTimeout:c=0}=e,l=Fr(n.websocket,r??`./`,location);return dr({transport:`websocket`,authToken:t,connectionMeta:n,events:i,clientRpc:a,rpcOptions:o,callTimeout:c,createChannel:e=>Pr({url:l,authToken:t,definitions:e.definitions,...s,onConnected(e){s.onConnected?.(e)},onError(t){e.onError(t),s.onError?.(t)},onDisconnected(t){e.onDisconnected(),s.onDisconnected?.(t)}})})}function Lr(e){return e.includes(`:`)}function Rr(e,t){return Lr(t)?t:`${e}:${t}`}function zr(e){return{async get(t){return(await e()).value()[t]},async set(t,n){(await e()).mutate(e=>{e[t]=n})},async delete(t){(await e()).mutate(e=>{delete e[t]})},async all(){return(await e()).value()},async onChange(t){return(await e()).on(`updated`,e=>t(e))}}}function Br(e,t,n){let r=`devframe:settings:${n}:${t}`,i;function a(){return i||=e.sharedState.get(r,{initialValue:{}}),i}return zr(a)}function Vr(e,t){return{global:Br(e,t,`global`),project:Br(e,t,`project`)}}function Hr(e,t){return{namespace:t,base:e,rpc:{namespace:t,register(n){if(Lr(n.name))throw Error(`[devframe] Scoped client RPC registration for namespace "${t}" received an already-namespaced function name "${n.name}". Pass a bare name without a ":" separator.`);e.client.register({...n,name:`${t}:${n.name}`})},call:((n,...r)=>e.call(Rr(t,n),...r)),callEvent:((n,...r)=>e.callEvent(Rr(t,n),...r)),callOptional:((n,...r)=>e.callOptional(Rr(t,n),...r)),sharedState:((n,r)=>e.sharedState.get(Rr(t,n),r)),streaming:{subscribe:(n,r,i)=>e.streaming.subscribe(Rr(t,n),r,i),upload:(n,r)=>e.streaming.upload(Rr(t,n),r)}},settings:Vr(e,t),scope:e.scope}}var Ur=128;function Wr(e){return e.replace(/[^\w-]+/g,`_`).slice(0,Ur)}var Gr=Object.freeze({type:`object`,additionalProperties:!0});function Kr(e){let t=e[`~standard`];if(t.jsonSchema)try{return t.jsonSchema.input({target:`draft-2020-12`})}catch{return Gr}return Gr}function qr(e){if(!e||e.length===0)return{type:`object`,properties:{}};let t={},n=[];for(let r=0;r<e.length;r++){let i=`arg${r}`;t[i]=Kr(e[r]),n.push(i)}return{type:`object`,properties:t,required:n,additionalProperties:!1}}function Jr(e,t){if(Array.isArray(e))return e;if(e==null)return[];if(typeof e!=`object`)return;let n=e;if(t!=null)return Array.from({length:t},(e,t)=>n[`arg${t}`]);if(`arg0`in n){let e=[];for(;`arg${e.length}`in n;)e.push(n[`arg${e.length}`]);return e}return Object.keys(n).length===0?[]:void 0}function Yr(e,t){return Jr(e,t)??[e]}function Xr(){if(typeof document<`u`){let e=document.modelContext;if(e)return e}if(typeof navigator<`u`){let e=navigator.modelContext;if(e)return e}}function Zr(e,t={}){let n=t.modelContext??Xr();if(!n)return()=>{};let r=n,i=new Map,a=new Map;function o(t,n){let o=Wr(t.name),s=a.get(o);if(s&&s!==t.name){console.warn(`[devframe] WebMCP tool name "${o}" (from "${t.name}") collides with "${s}"; keeping the first registration.`);return}let c=new AbortController,l=r.registerTool({name:o,description:n.description,inputSchema:qr(t.args),annotations:{title:n.title??t.name,readOnlyHint:Qr(t,n)===`read`,destructiveHint:Qr(t,n)===`destructive`},execute:n=>$r(t,e.context,n)},{signal:c.signal});l&&`then`in l&&l.then(()=>{},()=>{}),a.set(o,t.name),i.set(t.name,()=>{c.abort(),l&&`unregister`in l&&typeof l.unregister==`function`&&l.unregister(),a.delete(o)})}function s(t){let n=t?[t]:[...e.definitions.keys()];for(let t of n){i.get(t)?.(),i.delete(t);let n=e.definitions.get(t),r=n?.agent;n&&r&&o(n,r)}}s();let c=e.onChanged(e=>s(e));return()=>{c();for(let e of i.values())e();i.clear()}}function Qr(e,t){if(t.safety)return t.safety;let n=e.type??`query`;return n===`static`||n===`query`?`read`:`action`}async function $r(e,t,n){try{let r=Yr(n,e.args?.length);return{content:[{type:`text`,text:ei(await(await ge(e,t))(...r))}]}}catch(e){return{isError:!0,content:[{type:`text`,text:ti(e)}]}}}function ei(e){return e===void 0?`undefined`:typeof e==`string`?e:JSON.stringify(e,null,2)}function ti(e){if(!(e instanceof Error))return String(e);let t=e.cause instanceof Error?` (cause: ${e.cause.message})`:``;return`${e.name}: ${e.message}${t}`}function ni(e,t){if(t.backend===`static`)return`static`;let n=t.websocket!==void 0,r=t.sse!==void 0;if(e===`websocket`){if(!n)throw Error(`[devframe] transport: 'websocket' was requested, but this server does not advertise a WebSocket endpoint`);return`websocket`}if(e===`sse`){if(!r)throw Error(`[devframe] transport: 'sse' was requested, but this server does not advertise an SSE endpoint`);return`sse`}if(t.backend===`sse`&&r)return`sse`;if(n)return`websocket`;if(r)return`sse`;throw Error(`[devframe] This server advertises no RPC transport (backend "none"), so there is nothing to connect to. Enable the WebSocket or SSE endpoint on the server, or use its static/MCP surfaces instead.`)}async function ri(e={}){let{baseURL:t=`./`,rpcOptions:n={},cacheOptions:r=!1}=e,i=Se(),a=Array.isArray(t)?t:[t],o=await Be(e),{connectionMeta:s,metaBaseUrl:c,authToken:l}=o,u=a[0]??`./`;try{u=new URL(`.`,c).href}catch{}let d=new w({functions:[],...typeof e.cacheOptions==`object`?e.cacheOptions:{}}),f={rpc:void 0},p=new _e(f),m=e.webmcp===!1?void 0:Zr(p);async function h(e){let t=[u,...a.filter(e=>e!==u)].filter(e=>e!=null),n=[];for(let r of t)try{return await fetch(De(e,r)).then(t=>{if(!t.ok)throw Error(`Failed to fetch ${e} from ${r}: ${t.status}`);return t.json()})}catch(e){n.push(e)}throw Error(`Failed to load ${e} from ${t.join(`, `)}`,{cause:n})}let g={authToken:l,connectionMeta:s,metaBaseUrl:c,events:i,clientRpc:p,callTimeout:e.callTimeout,rpcOptions:{...n,async onRequest(e,t,i){if(await n.onRequest?.call(this,e,t,i),r&&d?.validate(e.m)){if(d.has(e.m,e.a))return i(d.cached(e.m,e.a));let n=await t(e);d.apply(e,n)}else await t(e)}}},_=ni(e.transport??`auto`,s),v=_===`static`?await Cr({fetchJsonFromBases:h}):_===`sse`?pr({...g,sseOptions:e.sseOptions}):Ir({...g,wsOptions:e.wsOptions}),y;try{y=new BroadcastChannel(`devframe-auth`)}catch{}let b,x=!1;function S(e){return((...t)=>x||!b?e(...t):b.then(()=>e(...t)))}function C(){try{m?.()}finally{try{y?.close()}finally{v.close?.()}}}let T={events:i,get isTrusted(){return v.isTrusted},get status(){return v.status},get connectionError(){return v.connectionError},get transport(){return v.transport??_},get connection(){return o},connectionMeta:s,ensureTrusted:v.ensureTrusted,requestTrust:v.requestTrust,requestTrustWithToken:async e=>(Ie(e),o={...o,authToken:e},v.requestTrustWithToken(e)),requestTrustWithCode:async e=>{let t=await v.requestTrustWithCode(e);if(!t)return!1;Ie(t),o={...o,authToken:t};try{y?.postMessage({type:`auth-update`,authToken:t})}catch{}return!0},requestAuthCode:e=>v.requestAuthCode(e),call:S(v.call),callEvent:S(v.callEvent),callOptional:S(v.callOptional),client:p,sharedState:void 0,services:void 0,streaming:void 0,cacheManager:d,scope:void 0,close:C};T.sharedState=Dn(T),T.streaming=jr(T),T.services=Ke(T);let ee=new Map;T.scope=(e=>{if(!e)return T;let t=ee.get(e);return t||(t=Hr(T,e),ee.set(e,t)),t}),f.rpc=T;function te(){try{return typeof window<`u`&&window.self===window.top}catch{return!1}}async function ne(){if(e.simpleAuth!==!1&&te()&&typeof globalThis.prompt==`function`)for(await T.requestAuthCode().catch(()=>{});!T.isTrusted;){let e=globalThis.prompt(`devframe: enter the authentication code shown in your terminal`);if(e==null)return;let t=e.trim();if(t&&await T.requestTrustWithCode(t))return}}async function re(){let t=await v.requestTrust(),n=e.otpParam??`devframe_otp`,r=n?await Ge(T,{param:n}):!1;t||r||T.isTrusted||await ne()}return b=re().then(()=>{x=!0},()=>{x=!0}),y&&(y.onmessage=e=>{e.data?.type===`auth-update`&&e.data.authToken&&T.requestTrustWithToken(e.data.authToken)}),T}var ii=ri;function ai(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var D={},oi=[],si=()=>{},ci=()=>!1,li=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ui=e=>e.startsWith(`onUpdate:`),di=Object.assign,fi=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},pi=Object.prototype.hasOwnProperty,O=(e,t)=>pi.call(e,t),k=Array.isArray,mi=e=>xi(e)===`[object Map]`,hi=e=>xi(e)===`[object Set]`,gi=e=>xi(e)===`[object Date]`,A=e=>typeof e==`function`,_i=e=>typeof e==`string`,vi=e=>typeof e==`symbol`,j=e=>typeof e==`object`&&!!e,yi=e=>(j(e)||A(e))&&A(e.then)&&A(e.catch),bi=Object.prototype.toString,xi=e=>bi.call(e),Si=e=>xi(e).slice(8,-1),Ci=e=>xi(e)===`[object Object]`,wi=e=>_i(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,Ti=ai(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),Ei=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Di=/-\w/g,Oi=Ei(e=>e.replace(Di,e=>e.slice(1).toUpperCase())),ki=/\B([A-Z])/g,Ai=Ei(e=>e.replace(ki,`-$1`).toLowerCase()),ji=Ei(e=>e.charAt(0).toUpperCase()+e.slice(1)),Mi=Ei(e=>e?`on${ji(e)}`:``),Ni=(e,t)=>!Object.is(e,t),Pi=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Fi=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Ii=e=>{let t=parseFloat(e);return isNaN(t)?e:t},Li,Ri=()=>Li||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function zi(e){if(k(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=_i(r)?Ui(r):zi(r);if(i)for(let e in i)t[e]=i[e]}return t}if(_i(e)||j(e))return e}var Bi=/;(?![^(]*\))/g,Vi=/:([^]+)/,Hi=/\/\*[^]*?\*\//g;function Ui(e){let t={};return e.replace(Hi,``).split(Bi).forEach(e=>{if(e){let n=e.split(Vi);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function M(e){let t=``;if(_i(e))t=e;else if(k(e))for(let n=0;n<e.length;n++){let r=M(e[n]);r&&(t+=r+` `)}else if(j(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function Wi(e){if(!e)return null;let{class:t,style:n}=e;return t&&!_i(t)&&(e.class=M(t)),n&&(e.style=zi(n)),e}var Gi=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,Ki=ai(Gi);Gi+``;function qi(e){return!!e||e===``}function Ji(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Xi(e[r],t[r]);return n}function Yi(e,t){if(e.size!==t.size)return!1;let n=Array.from(t),r=new Uint8Array(n.length);for(let t of e){let e=-1;for(let i=0;i<n.length;i++)if(!r[i]&&Xi(t,n[i])){e=i;break}if(e<0)return!1;r[e]=1}return!0}function Xi(e,t){if(e===t)return!0;let n=gi(e),r=gi(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=vi(e),r=vi(t),n||r)return e===t;if(n=k(e),r=k(t),n||r)return n&&r?Ji(e,t):!1;if(n=j(e),r=j(t),n||r){if(!n||!r)return!1;if(n=mi(e),r=mi(t),n||r||(n=hi(e),r=hi(t),n||r))return n&&r?Yi(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){let r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!Xi(e[n],t[n]))return!1}}return String(e)===String(t)}function Zi(e,t){return e.findIndex(e=>Xi(e,t))}var Qi=e=>!!(e&&e.__v_isRef===!0),N=e=>_i(e)?e:e==null?``:k(e)||j(e)&&(e.toString===bi||!A(e.toString))?Qi(e)?N(e.value):JSON.stringify(e,$i,2):String(e),$i=(e,t)=>Qi(t)?$i(e,t.value):mi(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[ea(t,r)+` =>`]=n,e),{})}:hi(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>ea(e))}:vi(t)?ea(t):j(t)&&!k(t)&&!Ci(t)?String(t):t,ea=(e,t=``)=>vi(e)?`Symbol(${e.description??t})`:e,ta,na=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&ta&&(ta.active?(this.parent=ta,this.index=(ta.scopes||(ta.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=ta;try{return ta=this,e()}finally{ta=t}}}on(){++this._on===1&&(this.prevScope=ta,ta=this)}off(){if(this._on>0&&--this._on===0){if(ta===this)ta=this.prevScope;else{let e=ta;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let e=this.scopes.slice();for(t=0,n=e.length;t<n;t++)e[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}};function ra(){return ta}function ia(e,t=!1){ta&&ta.cleanups.push(e)}var aa,oa=new WeakSet,sa=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,ta&&(ta.active?ta.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,oa.has(this)&&(oa.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||da(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,wa(this),ma(this);let e=aa,t=ba;aa=this,ba=!0;try{return this.fn()}finally{ha(this),aa=e,ba=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)va(e);this.deps=this.depsTail=void 0,wa(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?oa.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ga(this)&&this.run()}get dirty(){return ga(this)}},ca=0,la,ua;function da(e,t=!1){if(e.flags|=8,t){e.next=ua,ua=e;return}e.next=la,la=e}function fa(){ca++}function pa(){if(--ca>0)return;if(ua){let e=ua;for(ua=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;la;){let t=la;for(la=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function ma(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ha(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),va(r),ya(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function ga(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(_a(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function _a(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ta)||(e.globalVersion=Ta,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ga(e))))return;e.flags|=2;let t=e.dep,n=aa,r=ba;aa=e,ba=!0;try{ma(e);let n=e.fn(e._value);(t.version===0||Ni(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{aa=n,ba=r,ha(e),e.flags&=-3}}function va(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)va(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function ya(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var ba=!0,xa=[];function Sa(){xa.push(ba),ba=!1}function Ca(){let e=xa.pop();ba=e===void 0||e}function wa(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=aa;aa=void 0;try{t()}finally{aa=e}}}var Ta=0,Ea=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Da=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!aa||!ba||aa===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==aa)t=this.activeLink=new Ea(aa,this),aa.deps?(t.prevDep=aa.depsTail,aa.depsTail.nextDep=t,aa.depsTail=t):aa.deps=aa.depsTail=t,Oa(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=aa.depsTail,t.nextDep=void 0,aa.depsTail.nextDep=t,aa.depsTail=t,aa.deps===t&&(aa.deps=e)}return t}trigger(e){this.version++,Ta++,this.notify(e)}notify(e){fa();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{pa()}}};function Oa(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)Oa(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var ka=new WeakMap,Aa=Symbol(``),ja=Symbol(``),Ma=Symbol(``);function Na(e,t,n){if(ba&&aa){let t=ka.get(e);t||ka.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new Da),r.map=t,r.key=n),r.track()}}function Pa(e,t,n,r,i,a){let o=ka.get(e);if(!o){Ta++;return}let s=e=>{e&&e.trigger()};if(fa(),t===`clear`)o.forEach(s);else{let i=k(e),a=i&&wi(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===Ma||!vi(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(Ma)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(Aa)),mi(e)&&s(o.get(ja)));break;case`delete`:i||(s(o.get(Aa)),mi(e)&&s(o.get(ja)));break;case`set`:mi(e)&&s(o.get(Aa))}}pa()}function Fa(e){let t=P(e);return t===e?t:(Na(t,`iterate`,Ma),wo(e)?t:t.map(Do))}function Ia(e){return Na(e=P(e),`iterate`,Ma),e}function La(e,t){return Co(e)?Oo(So(e)?Do(t):t):Do(t)}var Ra={__proto__:null,[Symbol.iterator](){return za(this,Symbol.iterator,e=>La(this,e))},concat(...e){return Fa(this).concat(...e.map(e=>k(e)?Fa(e):e))},entries(){return za(this,`entries`,e=>(e[1]=La(this,e[1]),e))},every(e,t){return Va(this,`every`,e,t,void 0,arguments)},filter(e,t){return Va(this,`filter`,e,t,e=>e.map(e=>La(this,e)),arguments)},find(e,t){return Va(this,`find`,e,t,e=>La(this,e),arguments)},findIndex(e,t){return Va(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return Va(this,`findLast`,e,t,e=>La(this,e),arguments)},findLastIndex(e,t){return Va(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return Va(this,`forEach`,e,t,void 0,arguments)},includes(...e){return Ua(this,`includes`,e)},indexOf(...e){return Ua(this,`indexOf`,e)},join(e){return Fa(this).join(e)},lastIndexOf(...e){return Ua(this,`lastIndexOf`,e)},map(e,t){return Va(this,`map`,e,t,void 0,arguments)},pop(){return Wa(this,`pop`)},push(...e){return Wa(this,`push`,e)},reduce(e,...t){return Ha(this,`reduce`,e,t)},reduceRight(e,...t){return Ha(this,`reduceRight`,e,t)},shift(){return Wa(this,`shift`)},some(e,t){return Va(this,`some`,e,t,void 0,arguments)},splice(...e){return Wa(this,`splice`,e)},toReversed(){return Fa(this).toReversed()},toSorted(e){return Fa(this).toSorted(e)},toSpliced(...e){return Fa(this).toSpliced(...e)},unshift(...e){return Wa(this,`unshift`,e)},values(){return za(this,`values`,e=>La(this,e))}};function za(e,t,n){let r=Ia(e),i=r[t]();return r!==e&&!wo(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var Ba=Array.prototype;function Va(e,t,n,r,i,a){let o=Ia(e),s=o!==e&&!wo(e),c=o[t];if(c!==Ba[t]){let t=c.apply(e,a);return s?Do(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,La(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function Ha(e,t,n,r){let i=Ia(e),a=i!==e&&!wo(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=La(e,t)),n.call(this,t,La(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?La(e,c):c}function Ua(e,t,n){let r=P(e);Na(r,`iterate`,Ma);let i=r[t](...n);return(i===-1||i===!1)&&To(n[0])?(n[0]=P(n[0]),r[t](...n)):i}function Wa(e,t,n=[]){Sa(),fa();let r=P(e)[t].apply(e,n);return pa(),Ca(),r}var Ga=ai(`__proto__,__v_isRef,__isVue`),Ka=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(vi));function qa(e){vi(e)||(e=String(e));let t=P(this);return Na(t,`has`,e),t.hasOwnProperty(e)}var Ja=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?ho:mo:i?po:fo).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=k(e);if(!r){let e;if(a&&(e=Ra[t]))return e;if(t===`hasOwnProperty`)return qa}let o=Reflect.get(e,t,ko(e)?e:n);if((vi(t)?Ka.has(t):Ga(t))||(r||Na(e,`get`,t),i))return o;if(ko(o)){let e=a&&wi(t)?o:o.value;return r&&j(e)?yo(e):e}return j(o)?r?yo(o):_o(o):o}},Ya=class extends Ja{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=k(e)&&wi(t);if(!this._isShallow){let e=Co(i);if(!wo(n)&&!Co(n)&&(i=P(i),n=P(n)),!a&&ko(i)&&!ko(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:O(e,t),s=Reflect.set(e,t,n,ko(e)?e:r);return e===P(r)&&s&&(o?Ni(n,i)&&Pa(e,`set`,t,n,i):Pa(e,`add`,t,n)),s}deleteProperty(e,t){let n=O(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&Pa(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!vi(t)||!Ka.has(t))&&Na(e,`has`,t),n}ownKeys(e){return Na(e,`iterate`,k(e)?`length`:Aa),Reflect.ownKeys(e)}},Xa=class extends Ja{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},Za=new Ya,Qa=new Xa,$a=new Ya(!0),eo=new Xa(!0),to=e=>e,no=e=>Reflect.getPrototypeOf(e);function ro(e,t,n){return function(...r){let i=this.__v_raw,a=P(i),o=mi(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?to:t?Oo:Do;return!t&&Na(a,`iterate`,c?ja:Aa),di(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function io(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function ao(e,t){let n={get(n){let r=this.__v_raw,i=P(r),a=P(n);e||(Ni(n,a)&&Na(i,`get`,n),Na(i,`get`,a));let{has:o}=no(i),s=t?to:e?Oo:Do;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&Na(P(t),`iterate`,Aa),t.size},has(t){let n=this.__v_raw,r=P(n),i=P(t);return e||(Ni(t,i)&&Na(r,`has`,t),Na(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=P(a),s=t?to:e?Oo:Do;return!e&&Na(o,`iterate`,Aa),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return di(n,e?{add:io(`add`),set:io(`set`),delete:io(`delete`),clear:io(`clear`)}:{add(e){let n=P(this),r=no(n),i=P(e),a=!t&&!wo(e)&&!Co(e)?i:e;return r.has.call(n,a)||Ni(e,a)&&r.has.call(n,e)||Ni(i,a)&&r.has.call(n,i)||(n.add(a),Pa(n,`add`,a,a)),this},set(e,n){!t&&!wo(n)&&!Co(n)&&(n=P(n));let r=P(this),{has:i,get:a}=no(r),o=i.call(r,e);o||=(e=P(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?Ni(n,s)&&Pa(r,`set`,e,n,s):Pa(r,`add`,e,n),this},delete(e){let t=P(this),{has:n,get:r}=no(t),i=n.call(t,e);i||=(e=P(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&Pa(t,`delete`,e,void 0,a),o},clear(){let e=P(this),t=e.size!==0,n=e.clear();return t&&Pa(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=ro(r,e,t)}),n}function oo(e,t){let n=ao(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(O(n,r)&&r in t?n:t,r,i)}var so={get:oo(!1,!1)},co={get:oo(!1,!0)},lo={get:oo(!0,!1)},uo={get:oo(!0,!0)},fo=new WeakMap,po=new WeakMap,mo=new WeakMap,ho=new WeakMap;function go(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function _o(e){return Co(e)?e:xo(e,!1,Za,so,fo)}function vo(e){return xo(e,!1,$a,co,po)}function yo(e){return xo(e,!0,Qa,lo,mo)}function bo(e){return xo(e,!0,eo,uo,ho)}function xo(e,t,n,r,i){if(!j(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=go(Si(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function So(e){return Co(e)?So(e.__v_raw):!!(e&&e.__v_isReactive)}function Co(e){return!!(e&&e.__v_isReadonly)}function wo(e){return!!(e&&e.__v_isShallow)}function To(e){return e?!!e.__v_raw:!1}function P(e){let t=e&&e.__v_raw;return t?P(t):e}function Eo(e){return!O(e,`__v_skip`)&&Object.isExtensible(e)&&Fi(e,`__v_skip`,!0),e}var Do=e=>j(e)?_o(e):e,Oo=e=>j(e)?yo(e):e;function ko(e){return e?e.__v_isRef===!0:!1}function Ao(e){return Mo(e,!1)}function jo(e){return Mo(e,!0)}function Mo(e,t){return ko(e)?e:new No(e,t)}var No=class{constructor(e,t){this.dep=new Da,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:P(e),this._value=t?e:Do(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||wo(e)||Co(e);e=n?e:P(e),Ni(e,t)&&(this._rawValue=e,this._value=n?e:Do(e),this.dep.trigger())}};function F(e){return ko(e)?e.value:e}function Po(e){return A(e)?e():F(e)}var Fo={get:(e,t,n)=>t===`__v_raw`?e:F(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return ko(i)&&!ko(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function Io(e){return So(e)?e:new Proxy(e,Fo)}var Lo=class{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new Da,{get:n,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}};function Ro(e){return new Lo(e)}var zo=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Da(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ta-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&aa!==this)return da(this,!0),!0}get value(){let e=this.dep.track();return _a(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function Bo(e,t,n=!1){let r,i;return A(e)?r=e:(r=e.get,i=e.set),new zo(r,i,n)}var Vo={},Ho=new WeakMap,Uo=void 0;function Wo(e,t=!1,n=Uo){if(n){let t=Ho.get(n);t||Ho.set(n,t=[]),t.push(e)}}function Go(e,t,n=D){let{immediate:r,deep:i,once:a,scheduler:o,augmentJob:s,call:c}=n,l=e=>i?e:wo(e)||i===!1||i===0?Ko(e,1):Ko(e),u,d,f,p,m=!1,h=!1;if(ko(e)?(d=()=>e.value,m=wo(e)):So(e)?(d=()=>l(e),m=!0):k(e)?(h=!0,m=e.some(e=>So(e)||wo(e)),d=()=>e.map(e=>{if(ko(e))return e.value;if(So(e))return l(e);if(A(e))return c?c(e,2):e()})):d=A(e)?t?c?()=>c(e,2):e:()=>{if(f){Sa();try{f()}finally{Ca()}}let t=Uo;Uo=u;try{return c?c(e,3,[p]):e(p)}finally{Uo=t}}:si,t&&i){let e=d,t=i===!0?1/0:i;d=()=>Ko(e(),t)}let g=ra(),_=()=>{u.stop(),g&&g.active&&fi(g.effects,u)};if(a&&t){let e=t;t=(...t)=>{let n=e(...t);return _(),n}}let v=h?Array(e.length).fill(Vo):Vo,y=e=>{if(u.flags&1&&(u.dirty||e)){if(t){let n=u.run();if(e||i||m||(h?n.some((e,t)=>Ni(e,v[t])):Ni(n,v))){f&&f();let e=Uo;Uo=u;try{let e=[n,v===Vo?void 0:h&&v[0]===Vo?[]:v,p];v=n,c?c(t,3,e):t(...e)}finally{Uo=e}}}else u.run()}};return s&&s(y),u=new sa(d),u.scheduler=o?()=>o(y,!1):y,p=e=>Wo(e,!1,u),f=u.onStop=()=>{let e=Ho.get(u);if(e){if(c)c(e,4);else for(let t of e)t();Ho.delete(u)}},t?r?y(!0):v=u.run():o?o(y.bind(null,!0),!0):u.run(),_.pause=u.pause.bind(u),_.resume=u.resume.bind(u),_.stop=_,_}function Ko(e,t=1/0,n){if(t<=0||!j(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ko(e))Ko(e.value,t,n);else if(k(e))for(let r=0;r<e.length;r++)Ko(e[r],t,n);else if(hi(e)||mi(e))e.forEach(e=>{Ko(e,t,n)});else if(Ci(e)){for(let r in e)Ko(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Ko(e[r],t,n)}return e}function qo(e,t,n,r){try{return r?e(...r):e()}catch(e){Yo(e,t,n)}}function Jo(e,t,n,r){if(A(e)){let i=qo(e,t,n,r);return i&&yi(i)&&i.catch(e=>{Yo(e,t,n)}),i}if(k(e)){let i=[];for(let a=0;a<e.length;a++)i.push(Jo(e[a],t,n,r));return i}}function Yo(e,t,n,r=!0){let i=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||D;if(t){let r=t.parent,i=t.proxy,o=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){let t=r.ec;if(t){for(let n=0;n<t.length;n++)if(t[n](e,i,o)===!1)return}r=r.parent}if(a){Sa(),qo(a,null,10,[e,i,o]),Ca();return}}Xo(e,n,i,r,o)}function Xo(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}var Zo=[],Qo=-1,$o=[],es=null,ts=0,ns=Promise.resolve(),rs=null;function is(e){let t=rs||ns;return e?t.then(this?e.bind(this):e):t}function as(e){let t=Qo+1,n=Zo.length;for(;t<n;){let r=t+n>>>1,i=Zo[r],a=ds(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function os(e){if(!(e.flags&1)){let t=ds(e),n=Zo[Zo.length-1];!n||!(e.flags&2)&&t>=ds(n)?Zo.push(e):Zo.splice(as(t),0,e),e.flags|=1,ss()}}function ss(){rs||=ns.then(fs)}function cs(e){if(!k(e))es&&e.id===-1?es.splice(ts+1,0,e):e.flags&1||($o.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)$o.push(e[t]);ss()}function ls(e,t,n=Qo+1){for(;n<Zo.length;n++){let t=Zo[n];if(t&&t.flags&2){if(e&&t.id!==e.uid)continue;Zo.splice(n,1),n--,t.flags&4&&(t.flags&=-2),t(),t.flags&4||(t.flags&=-2)}}}function us(e){if($o.length){let e=[...new Set($o)].sort((e,t)=>ds(e)-ds(t));if($o.length=0,es){for(let t=0;t<e.length;t++)es.push(e[t]);return}for(es=e,ts=0;ts<es.length;ts++){let e=es[ts];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}es=null,ts=0}}var ds=e=>e.id==null?e.flags&2?-1:1/0:e.id;function fs(e){try{for(Qo=0;Qo<Zo.length;Qo++){let e=Zo[Qo];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),qo(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Qo<Zo.length;Qo++){let e=Zo[Qo];e&&(e.flags&=-2)}Qo=-1,Zo.length=0,us(e),rs=null,(Zo.length||$o.length)&&fs(e)}}var ps=null,ms=null;function hs(e){let t=ps;return ps=e,ms=e&&e.type.__scopeId||null,t}function gs(e,t=ps,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&Nl(-1);let i=hs(t),a=kl.length,o;try{o=e(...n)}finally{for(let e=kl.length;e>a;e--)jl();hs(i),r._d&&Nl(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function _s(e,t){if(ps===null)return e;let n=du(ps),r=e.dirs||=[];for(let e=0;e<t.length;e++){let[i,a,o,s=D]=t[e];i&&(A(i)&&(i={mounted:i,updated:i}),i.deep&&Ko(a),r.push({dir:i,instance:n,value:a,oldValue:void 0,arg:o,modifiers:s}))}return e}function vs(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&(Sa(),Jo(c,n,8,[e.el,s,e,t]),Ca())}}function ys(e,t){if(Zl){let n=Zl.provides,r=Zl.parent&&Zl.parent.provides;r===n&&(n=Zl.provides=Object.create(r)),n[e]=t}}function bs(e,t,n=!1){let r=Ql();if(r||Fc){let i=Fc?Fc._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&A(t)?t.call(r&&r.proxy):t}}var xs=Symbol.for(`v-scx`),Ss=()=>bs(xs);function Cs(e,t){return Ts(e,null,{flush:`sync`})}function ws(e,t,n){return Ts(e,t,n)}function Ts(e,t,n=D){let{immediate:r,deep:i,flush:a,once:o}=n,s=di({},n),c=t&&r||!t&&a!==`post`,l;if(iu){if(a===`sync`){let e=Ss();l=e.__watcherHandles||=[]}else if(!c){let e=()=>{};return e.stop=si,e.resume=si,e.pause=si,e}}let u=Zl;s.call=(e,t,n)=>Jo(e,u,t,n);let d=!1;a===`post`?s.scheduler=e=>{pl(e,u&&u.suspense)}:a!==`sync`&&(d=!0,s.scheduler=(e,t)=>{t?e():os(e)}),s.augmentJob=e=>{t&&(e.flags|=4),d&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))};let f=Go(e,t,s);return iu&&(l?l.push(f):c&&f()),f}function Es(e,t,n){let r=this.proxy,i=_i(e)?e.includes(`.`)?Ds(r,e):()=>r[e]:e.bind(r,r),a;A(t)?a=t:(a=t.handler,n=t);let o=tu(this),s=Ts(i,a.bind(r),n);return o(),s}function Ds(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var Os=Symbol(`_vte`),ks=e=>e.__isTeleport,As=Symbol(`_leaveCb`);function js(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==Dl){t=n;break}}return t}function Ms(e){if(!Bs(e))return ks(e.type)&&e.children?js(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&A(n.default))return n.default()}}function Ns(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;Ns(ks(n.type)&&Ms(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function I(e,t){return A(e)?di({name:e.name},t,{setup:e}):e}function Ps(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function Fs(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var Is=new WeakMap;function Ls(e,t,n,r,i=!1){if(k(e)){e.forEach((e,a)=>Ls(e,t&&(k(t)?t[a]:t),n,r,i));return}if(zs(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Ls(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?du(r.component):r.el,o=i?null:a,{i:s,r:c}=e,l=t&&t.r,u=s.refs===D?s.refs={}:s.refs,d=s.setupState,f=P(d),p=d===D?ci:e=>!Fs(u,e)&&O(f,e),m=(e,t)=>!(t&&Fs(u,t));if(l!=null&&l!==c){if(Rs(t),_i(l))u[l]=null,p(l)&&(d[l]=null);else if(ko(l)){let e=t;m(l,e.k)&&(l.value=null),e.k&&(u[e.k]=null)}}if(A(c))qo(c,s,12,[o,u]);else{let t=_i(c),r=ko(c);if(t||r){let s=()=>{if(e.f){let n=t?p(c)?d[c]:u[c]:m(c)||!e.k?c.value:u[e.k];if(i)k(n)&&fi(n,a);else if(k(n))n.includes(a)||n.push(a);else if(t)u[c]=[a],p(c)&&(d[c]=u[c]);else{let t=[a];m(c,e.k)&&(c.value=t),e.k&&(u[e.k]=t)}}else t?(u[c]=o,p(c)&&(d[c]=o)):r&&(m(c,e.k)&&(c.value=o),e.k&&(u[e.k]=o))};if(o){let t=()=>{s(),Is.delete(e)};t.id=-1,Is.set(e,t),pl(t,n)}else Rs(e),s()}}}function Rs(e){let t=Is.get(e);t&&(t.flags|=8,Is.delete(e))}Ri().requestIdleCallback,Ri().cancelIdleCallback;var zs=e=>!!e.type.__asyncLoader,Bs=e=>e.type.__isKeepAlive;function Vs(e,t){Us(e,`a`,t)}function Hs(e,t){Us(e,`da`,t)}function Us(e,t,n=Zl){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Gs(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Bs(e.parent.vnode)&&Ws(r,t,n,e),e=e.parent}}function Ws(e,t,n,r){let i=Gs(t,e,r,!0);Qs(()=>{fi(r[t],i)},n)}function Gs(e,t,n=Zl,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{Sa();let i=tu(n),a=Jo(t,n,e,r);return i(),Ca(),a};return r?i.unshift(a):i.push(a),a}}var Ks=e=>(t,n=Zl)=>{(!iu||e===`sp`)&&Gs(e,(...e)=>t(...e),n)},qs=Ks(`bm`),Js=Ks(`m`),Ys=Ks(`bu`),Xs=Ks(`u`),Zs=Ks(`bum`),Qs=Ks(`um`),$s=Ks(`sp`),ec=Ks(`rtg`),tc=Ks(`rtc`);function nc(e,t=Zl){Gs(`ec`,e,t)}var rc=`components`,ic=Symbol.for(`v-ndc`);function ac(e){return _i(e)?oc(rc,e,!1)||e:e||ic}function oc(e,t,n=!0,r=!1){let i=ps||Zl;if(i){let n=i.type;if(e===rc){let e=fu(n,!1);if(e&&(e===t||e===Oi(t)||e===ji(Oi(t))))return n}let a=sc(i[e]||n[e],t)||sc(i.appContext[e],t);return!a&&r?n:a}}function sc(e,t){return e&&(e[t]||e[Oi(t)]||e[ji(Oi(t))])}function cc(e,t,n,r){let i,a=n&&n[r],o=k(e);if(o||_i(e)){let n=o&&So(e),r=!1,s=!1;n&&(r=!wo(e),s=Co(e),e=Ia(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?Oo(Do(e[n])):Do(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}else if(j(e)){if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}}else i=[];return n&&(n[r]=i),i}function lc(e,t,n,r,i,a){if(n??={},ps.ce||ps.parent&&zs(ps.parent)&&ps.parent.ce){let e=a!=null&&n.key==null?di({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),R(),B(L,null,[H(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let s=kl.length;R();let c;try{let i=o&&uc(o(n)),s=n.key||a||i&&i.key;c=B(L,{key:(s&&!vi(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=kl.length;e>s;e--)jl();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),c}function uc(e){return e.some(e=>!Fl(e)||!(e.type===Dl||e.type===L&&!uc(e.children)))?e:null}var dc=e=>e?ru(e)?du(e):dc(e.parent):null,fc=di(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>dc(e.parent),$root:e=>dc(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Sc(e),$forceUpdate:e=>e.f||=()=>{os(e.update)},$nextTick:e=>e.n||=is.bind(e.proxy),$watch:e=>Es.bind(e)}),pc=(e,t)=>e!==D&&!e.__isScriptSetup&&O(e,t),mc={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:o,type:s,appContext:c}=e;if(t[0]!==`$`){let e=o[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(pc(r,t))return o[t]=1,r[t];else if(i!==D&&O(i,t))return o[t]=2,i[t];else if(O(a,t))return o[t]=3,a[t];else if(n!==D&&O(n,t))return o[t]=4,n[t];else _c&&(o[t]=0)}let l=fc[t],u,d;if(l)return t===`$attrs`&&Na(e.attrs,`get`,``),l(e);if((u=s.__cssModules)&&(u=u[t]))return u;if(n!==D&&O(n,t))return o[t]=4,n[t];if(d=c.config.globalProperties,O(d,t))return d[t]},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return pc(i,t)?(i[t]=n,!0):r!==D&&O(r,t)?(r[t]=n,!0):O(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:o}},s){let c;return!!(n[s]||e!==D&&s[0]!==`$`&&O(e,s)||pc(t,s)||O(a,s)||O(r,s)||O(fc,s)||O(i.config.globalProperties,s)||(c=o.__cssModules)&&c[s])},defineProperty(e,t,n){return n.get==null?O(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function hc(e){return k(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function gc(e,t){return!e||!t?e||t:k(e)&&k(t)?e.concat(t):di({},hc(e),hc(t))}var _c=!0;function vc(e){let t=Sc(e),n=e.proxy,r=e.ctx;_c=!1,t.beforeCreate&&bc(t.beforeCreate,e,`bc`);let{data:i,computed:a,methods:o,watch:s,provide:c,inject:l,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:m,activated:h,deactivated:g,beforeDestroy:_,beforeUnmount:v,destroyed:y,unmounted:b,render:x,renderTracked:S,renderTriggered:C,errorCaptured:w,serverPrefetch:T,expose:ee,inheritAttrs:te,components:ne,directives:re,filters:ie}=t;if(l&&yc(l,r,null),o)for(let e in o){let t=o[e];A(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);j(t)&&(e.data=_o(t))}if(_c=!0,a)for(let e in a){let t=a[e],i=W({get:A(t)?t.bind(n,n):A(t.get)?t.get.bind(n,n):si,set:!A(t)&&A(t.set)?t.set.bind(n):si});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e})}if(s)for(let e in s)xc(s[e],r,n,e);if(c){let e=A(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{ys(t,e[t])})}u&&bc(u,e,`c`);function E(e,t){k(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(E(qs,d),E(Js,f),E(Ys,p),E(Xs,m),E(Vs,h),E(Hs,g),E(nc,w),E(tc,S),E(ec,C),E(Zs,v),E(Qs,b),E($s,T),k(ee)){if(ee.length){let t=e.exposed||={};ee.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={}}x&&e.render===si&&(e.render=x),te!=null&&(e.inheritAttrs=te),ne&&(e.components=ne),re&&(e.directives=re),T&&Ps(e)}function yc(e,t,n=si){k(e)&&(e=Dc(e));for(let n in e){let r=e[n],i;i=j(r)?`default`in r?bs(r.from||n,r.default,!0):bs(r.from||n):bs(r),ko(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function bc(e,t,n){Jo(k(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function xc(e,t,n,r){let i=r.includes(`.`)?Ds(n,r):()=>n[r];if(_i(e)){let n=t[e];A(n)&&ws(i,n)}else if(A(e))ws(i,e.bind(n));else if(j(e)){if(k(e))e.forEach(e=>xc(e,t,n,r));else{let r=A(e.handler)?e.handler.bind(n):t[e.handler];A(r)&&ws(i,r,e)}}}function Sc(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>Cc(c,e,o,!0)),Cc(c,t,o)),j(t)&&a.set(t,c),c}function Cc(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&Cc(e,a,n,!0),i&&i.forEach(t=>Cc(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=wc[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var wc={data:Tc,props:Ac,emits:Ac,methods:kc,computed:kc,beforeCreate:Oc,created:Oc,beforeMount:Oc,mounted:Oc,beforeUpdate:Oc,updated:Oc,beforeDestroy:Oc,beforeUnmount:Oc,destroyed:Oc,unmounted:Oc,activated:Oc,deactivated:Oc,errorCaptured:Oc,serverPrefetch:Oc,components:kc,directives:kc,watch:jc,provide:Tc,inject:Ec};function Tc(e,t){return t?e?function(){return di(A(e)?e.call(this,this):e,A(t)?t.call(this,this):t)}:t:e}function Ec(e,t){return kc(Dc(e),Dc(t))}function Dc(e){if(k(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Oc(e,t){return e?[...new Set([].concat(e,t))]:t}function kc(e,t){return e?di(Object.create(null),e,t):t}function Ac(e,t){return e?k(e)&&k(t)?[...new Set([...e,...t])]:di(Object.create(null),hc(e),hc(t??{})):t}function jc(e,t){if(!e)return t;if(!t)return e;let n=di(Object.create(null),e);for(let r in t)n[r]=Oc(e[r],t[r]);return n}function Mc(){return{app:null,config:{isNativeTag:ci,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var Nc=0;function Pc(e,t){return function(n,r=null){A(n)||(n=di({},n)),r!=null&&!j(r)&&(r=null);let i=Mc(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:Nc++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:hu,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&A(e.install)?(a.add(e),e.install(c,...t)):A(e)&&(a.add(e),e(c,...t))),c},mixin(e){return i.mixins.includes(e)||i.mixins.push(e),c},component(e,t){return t?(i.components[e]=t,c):i.components[e]},directive(e,t){return t?(i.directives[e]=t,c):i.directives[e]},mount(a,o,l){if(!s){let u=c._ceVNode||H(n,r);return u.appContext=i,l===!0?l=`svg`:l===!1&&(l=void 0),o&&t?t(u,a):e(u,a,l),s=!0,c._container=a,a.__vue_app__=c,du(u.component)}},onUnmount(e){o.push(e)},unmount(){s&&(Jo(o,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(e,t){return i.provides[e]=t,c},runWithContext(e){let t=Fc;Fc=c;try{return e()}finally{Fc=t}}};return c}}var Fc=null;function Ic(e,t,n=D){let r=Ql(),i=Oi(t),a=Ai(t),o=Lc(e,i),s=Ro((o,s)=>{let c,l=D,u;return Cs(()=>{let t=e[i];Ni(c,t)&&(c=t,s())}),{get(){return o(),n.get?n.get(c):c},set(e){let o=n.set?n.set(e):e;if(!Ni(o,c)&&!(l!==D&&Ni(e,l)))return;let d=r.vnode.props,f=!!(d&&(t in d||i in d||a in d)&&(`onUpdate:${t}`in d||`onUpdate:${i}`in d||`onUpdate:${a}`in d));f||(c=e,s()),r.emit(`update:${t}`,o),Ni(e,l)&&(Ni(e,o)&&!Ni(o,u)||f&&l!==D&&!Ni(o,c))&&s(),l=e,u=o}}});return s[Symbol.iterator]=()=>{let e=0;return{next(){return e<2?{value:e++?o||D:s,done:!1}:{done:!0}}}},s}var Lc=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${Oi(t)}Modifiers`]||e[`${Ai(t)}Modifiers`];function Rc(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||D,i=n,a=t.startsWith(`update:`),o=a&&Lc(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>_i(e)?e.trim():e)),o.number&&(i=i.map(Ii)));let s,c=r[s=Mi(t)]||r[s=Mi(Oi(t))];!c&&a&&(c=r[s=Mi(Ai(t))]),c&&Jo(c,e,6,i);let l=r[s+`Once`];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,Jo(l,e,6,i)}}var zc=new WeakMap;function Bc(e,t,n=!1){let r=n?zc:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!A(e)){let r=e=>{let n=Bc(e,t,!0);n&&(s=!0,di(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(j(e)&&r.set(e,null),null):(k(a)?a.forEach(e=>o[e]=null):di(o,a),j(e)&&r.set(e,o),o)}function Vc(e,t){return!e||!li(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),O(e,t[0].toLowerCase()+t.slice(1))||O(e,Ai(t))||O(e,t))}function Hc(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:d,data:f,setupState:p,ctx:m,inheritAttrs:h}=e,g=hs(e),_,v;try{if(n.shapeFlag&4){let e=i||r,t=e;_=Ul(l.call(t,e,u,d,p,f,m)),v=s}else{let e=t;_=Ul(e.length>1?e(d,{attrs:s,slots:o,emit:c}):e(d,null)),v=t.props?s:Uc(s)}}catch(t){kl.length=0,Yo(t,e,1),_=H(Dl)}let y=_;if(v&&h!==!1){let e=Object.keys(v),{shapeFlag:t}=y;e.length&&t&7&&(a&&e.some(ui)&&(v=Wc(v,a)),y=Vl(y,v,!1,!0))}return n.dirs&&(y=Vl(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&Ns(ks(y.type)&&Ms(y)||y,n.transition),_=y,hs(g),_}var Uc=e=>{let t;for(let n in e)(n===`class`||n===`style`||li(n))&&((t||={})[n]=e[n]);return t},Wc=(e,t)=>{let n={};for(let r in e)(!ui(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Gc(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Kc(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(qc(o,r,n)&&!Vc(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||Kc(r,o,l):!!o;return!1}function Kc(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(qc(t,e,a)&&!Vc(n,a))return!0}return!1}function qc(e,t,n){let r=e[n],i=t[n];return n===`style`&&j(r)&&j(i)?!Xi(r,i):r!==i}function Jc({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var Yc={},Xc=()=>Object.create(Yc),Zc=e=>Object.getPrototypeOf(e)===Yc;function Qc(e,t,n,r=!1){let i={},a=Xc();e.propsDefaults=Object.create(null),el(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:vo(i):e.type.props?i:a,e.attrs=a}function $c(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=P(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(Vc(e.emitsOptions,o))continue;let u=t[o];if(c){if(O(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=Oi(o);i[t]=tl(c,s,t,u,e,!1)}}else u!==a[o]&&(a[o]=u,l=!0)}}}else{el(e,t,i,a)&&(l=!0);let r;for(let a in s)(!t||!O(t,a)&&((r=Ai(a))===a||!O(t,r)))&&(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=tl(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)(!t||!O(t,e))&&(delete a[e],l=!0)}l&&Pa(e.attrs,`set`,``)}function el(e,t,n,r){let[i,a]=e.propsOptions,o=!1,s;if(t)for(let c in t){if(Ti(c))continue;let l=t[c],u;i&&O(i,u=Oi(c))?!a||!a.includes(u)?n[u]=l:(s||={})[u]=l:Vc(e.emitsOptions,c)||(!(c in r)||l!==r[c])&&(r[c]=l,o=!0)}if(a){let t=P(n),r=s||D;for(let o=0;o<a.length;o++){let s=a[o];n[s]=tl(i,t,s,r[s],e,!O(r,s))}}return o}function tl(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=O(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&A(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=tu(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===Ai(n))&&(r=!0))}return r}var nl=new WeakMap;function rl(e,t,n=!1){let r=n?nl:t.propsCache,i=r.get(e);if(i)return i;let a=e.props,o={},s=[],c=!1;if(!A(e)){let r=e=>{c=!0;let[n,r]=rl(e,t,!0);di(o,n),r&&s.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!a&&!c)return j(e)&&r.set(e,oi),oi;if(k(a))for(let e=0;e<a.length;e++){let t=Oi(a[e]);il(t)&&(o[t]=D)}else if(a)for(let e in a){let t=Oi(e);if(il(t)){let n=a[e],r=o[t]=k(n)||A(n)?{type:n}:di({},n),i=r.type,c=!1,l=!0;if(k(i))for(let e=0;e<i.length;++e){let t=i[e],n=A(t)&&t.name;if(n===`Boolean`){c=!0;break}n===`String`&&(l=!1)}else c=A(i)&&i.name===`Boolean`;r[0]=c,r[1]=l,(c||O(r,`default`))&&s.push(t)}}let l=[o,s];return j(e)&&r.set(e,l),l}function il(e){return e[0]!==`$`&&!Ti(e)}var al=e=>e===`_`||e===`_ctx`||e===`$stable`,ol=e=>k(e)?e.map(Ul):[Ul(e)],sl=(e,t,n)=>{if(t._n)return t;let r=gs((...e)=>ol(t(...e)),n);return r._c=!1,r},cl=(e,t,n)=>{let r=e._ctx;for(let n in e){if(al(n))continue;let i=e[n];if(A(i))t[n]=sl(n,i,r);else if(i!=null){let e=ol(i);t[n]=()=>e}}},ll=(e,t)=>{let n=ol(t);e.slots.default=()=>n},ul=(e,t,n)=>{for(let r in t)(n||!al(r))&&(e[r]=t[r])},dl=(e,t,n)=>{let r=e.slots=Xc();if(e.vnode.shapeFlag&32){let e=t._;e?(ul(r,t,n),n&&Fi(r,`_`,e,!0)):cl(t,r)}else t&&ll(e,t)},fl=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,o=D;if(r.shapeFlag&32){let e=t._;e?n&&e===1?a=!1:ul(i,t,n):(a=!t.$stable,cl(t,i)),o=t}else t&&(ll(e,t),o={default:1});if(a)for(let e in i)!al(e)&&o[e]==null&&delete i[e]},pl=Tl;function ml(e){return hl(e)}function hl(e,t){let n=Ri();n.__VUE__=!0;let{insert:r,remove:i,patchProp:a,createElement:o,createText:s,createComment:c,setText:l,setElementText:u,parentNode:d,nextSibling:f,setScopeId:p=si,insertStaticContent:m}=e,h=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!Il(e,t)&&(r=ge(e),de(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case El:g(e,t,n,r);break;case Dl:_(e,t,n,r);break;case Ol:e??v(t,n,r,o);break;case L:ne(e,t,n,r,i,a,o,s,c);break;default:d&1?x(e,t,n,r,i,a,o,s,c):d&6?re(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,ye)}u!=null&&i?Ls(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&Ls(e.ref,null,a,e,!0)},g=(e,t,n,i)=>{if(e==null)r(t.el=s(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},_=(e,t,n,i)=>{e==null?r(t.el=c(t.children||``),n,i):t.el=e.el},v=(e,t,n,r)=>{[e.el,e.anchor]=m(e.children,t,n,r,e.el,e.anchor)},y=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=f(e),r(e,n,i),e=a;r(t,n,i)},b=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=f(e),i(e),e=n;i(t)},x=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)S(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),T(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},S=(e,t,n,i,s,c,l,d)=>{let f,p,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(f=e.el=o(e.type,c,m&&m.is,m),h&8?u(f,e.children):h&16&&w(e.children,f,null,i,s,gl(e,c),l,d),_&&vs(e,null,i,`created`),C(f,e,e.scopeId,l,i),m){for(let e in m)e!==`value`&&!Ti(e)&&a(f,e,null,m[e],c,i);`value`in m&&a(f,`value`,null,m.value,c),(p=m.onVnodeBeforeMount)&&ql(p,i,e)}_&&vs(e,null,i,`beforeMount`);let v=vl(s,g);v&&g.beforeEnter(f),r(f,t,n),((p=m&&m.onVnodeMounted)||v||_)&&pl(()=>{try{p&&ql(p,i,e),v&&g.enter(f),_&&vs(e,null,i,`mounted`)}finally{}},s)},C=(e,t,n,r,i)=>{if(n&&p(e,n),r)for(let t=0;t<r.length;t++)p(e,r[t]);if(i){let n=i.subTree;if(t===n||wl(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;C(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},w=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?Wl(e[l]):Ul(e[l]);h(null,c,t,n,r,i,a,o,s)}},T=(e,t,n,r,i,o,s)=>{let c=t.el=e.el,{patchFlag:l,dynamicChildren:d,dirs:f}=t;l|=e.patchFlag&16;let p=e.props||D,m=t.props||D,h;if(n&&_l(n,!1),(h=m.onVnodeBeforeUpdate)&&ql(h,n,t,e),f&&vs(t,e,n,`beforeUpdate`),n&&_l(n,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(l=0,s=!1,d=null),(p.innerHTML&&m.innerHTML==null||p.textContent&&m.textContent==null)&&u(c,``),d?ee(e.dynamicChildren,d,c,n,r,gl(t,i),o):s||se(e,t,c,null,n,r,gl(t,i),o,!1),l>0){if(l&16)te(c,p,m,n,i);else if(l&2&&p.class!==m.class&&a(c,`class`,null,m.class,i),l&4&&a(c,`style`,p.style,m.style,i),l&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=p[r],s=m[r];(s!==o||r===`value`)&&a(c,r,o,s,i,n)}}l&1&&e.children!==t.children&&u(c,t.children)}else!s&&d==null&&te(c,p,m,n,i);((h=m.onVnodeUpdated)||f)&&pl(()=>{h&&ql(h,n,t,e),f&&vs(t,e,n,`updated`)},r)},ee=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s],u=c.el&&(c.type===L||!Il(c,l)||c.shapeFlag&198)?d(c.el):n;h(c,l,u,null,r,i,a,o,!0)}},te=(e,t,n,r,i)=>{if(t!==n){if(t!==D)for(let o in t)!Ti(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(Ti(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},ne=(e,t,n,i,a,o,c,l,u)=>{let d=t.el=e?e.el:s(``),f=t.anchor=e?e.anchor:s(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(l=l?l.concat(h):h),e==null?(r(d,n,i),r(f,n,i),w(t.children||[],n,f,a,o,c,l,u)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(ee(e.dynamicChildren,m,n,a,o,c,l),(t.key!=null||a&&t===a.subTree)&&yl(e,t,!0)):se(e,t,n,f,a,o,c,l,u)},re=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):ie(t,n,r,i,a,o,c):E(e,t,c)},ie=(e,t,n,r,i,a,o)=>{let s=e.component=Xl(e,r,i);if(Bs(e)&&(s.ctx.renderer=ye),au(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,ae,o),!e.el){let r=s.subTree=H(Dl);_(null,r,t,n),e.placeholder=r.el}}else ae(s,e,t,n,i,a,o)},E=(e,t,n)=>{let r=t.component=e.component;if(Gc(e,t,n)){if(r.asyncDep&&!r.asyncResolved){oe(r,t,n);return}r.next=t,r.update()}else t.el=e.el,r.vnode=t},ae=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=xl(e);if(n){t&&(t.el=c.el,oe(e,t,o)),n.asyncDep.then(()=>{pl(()=>{e.isUnmounted||l()},i)});return}}let u=t,f;_l(e,!1),t?(t.el=c.el,oe(e,t,o)):t=c,n&&Pi(n),(f=t.props&&t.props.onVnodeBeforeUpdate)&&ql(f,s,t,c),_l(e,!0);let p=Hc(e),m=e.subTree;e.subTree=p,h(m,p,d(m.el),ge(m),e,i,a),t.el=p.el,u===null&&Jc(e,p.el),r&&pl(r,i),(f=t.props&&t.props.onVnodeUpdated)&&pl(()=>ql(f,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=zs(t);if(_l(e,!1),l&&Pi(l),!m&&(o=c&&c.onVnodeBeforeMount)&&ql(o,d,t),_l(e,!0),s&&xe){let t=()=>{e.subTree=Hc(e),xe(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=Hc(e);h(null,o,n,r,e,i,a),t.el=o.el}if(u&&pl(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;pl(()=>ql(o,d,e),i)}(t.shapeFlag&256||d&&zs(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&pl(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new sa(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>os(u),_l(e,!0),l()},oe=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,$c(e,t.props,r,n),fl(e,t.children,n),Sa(),ls(e),Ca()},se=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,d=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(p&128){le(l,f,n,r,i,a,o,s,c);return}if(p&256){ce(l,f,n,r,i,a,o,s,c);return}}m&8?(d&16&&he(l,i,a),f!==l&&u(n,f)):d&16?m&16?le(l,f,n,r,i,a,o,s,c):he(l,i,a,!0):(d&8&&u(n,``),m&16&&w(f,n,r,i,a,o,s,c))},ce=(e,t,n,r,i,a,o,s,c)=>{e||=oi,t||=oi;let l=e.length,u=t.length,d=Math.min(l,u),f=0;for(;f<d;f++){let r=t[f]=c?Wl(t[f]):Ul(t[f]);h(e[f],r,n,null,i,a,o,s,c)}l>u?he(e,i,a,!0,!1,d):w(t,n,r,i,a,o,s,c,d)},le=(e,t,n,r,i,a,o,s,c)=>{let l=0,u=t.length,d=e.length-1,f=u-1;for(;l<=d&&l<=f;){let r=e[l],u=t[l]=c?Wl(t[l]):Ul(t[l]);if(Il(r,u))h(r,u,n,null,i,a,o,s,c);else break;l++}for(;l<=d&&l<=f;){let r=e[d],l=t[f]=c?Wl(t[f]):Ul(t[f]);if(Il(r,l))h(r,l,n,null,i,a,o,s,c);else break;d--,f--}if(l>d){if(l<=f){let e=f+1,d=e<u?t[e].el:r;for(;l<=f;)h(null,t[l]=c?Wl(t[l]):Ul(t[l]),n,d,i,a,o,s,c),l++}}else if(l>f)for(;l<=d;)de(e[l],i,a,!0),l++;else{let p=l,m=l,g=new Map;for(l=m;l<=f;l++){let e=t[l]=c?Wl(t[l]):Ul(t[l]);e.key!=null&&g.set(e.key,l)}let _,v=0,y=f-m+1,b=!1,x=0,S=Array(y);for(l=0;l<y;l++)S[l]=0;for(l=p;l<=d;l++){let r=e[l];if(v>=y){de(r,i,a,!0);continue}let u;if(r.key!=null)u=g.get(r.key);else for(_=m;_<=f;_++)if(S[_-m]===0&&Il(r,t[_])){u=_;break}u===void 0?de(r,i,a,!0):(S[u-m]=l+1,u>=x?x=u:b=!0,h(r,t[u],n,null,i,a,o,s,c),v++)}let C=b?bl(S):oi;for(_=C.length-1,l=y-1;l>=0;l--){let e=m+l,d=t[e],f=t[e+1],p=e+1<u?f.el||Cl(f):r;S[l]===0?h(null,d,n,p,i,a,o,s,c):b&&(_<0||l!==C[_]?ue(d,n,p,2):_--)}}},ue=(e,t,n,a,o=null)=>{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){ue(e.component.subTree,t,n,a);return}if(d&128){e.suspense.move(t,n,a);return}if(d&64){c.move(e,t,n,ye);return}if(c===L){r(s,t,n);for(let e=0;e<u.length;e++)ue(u[e],t,n,a);r(e.anchor,t,n);return}if(c===Ol){y(e,t,n);return}if(a!==2&&d&1&&l){if(a===0)l.persisted&&!s[As]?r(s,t,n):(l.beforeEnter(s),r(s,t,n),pl(()=>l.enter(s),o));else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{let e=s._isLeaving||!!s[As];s._isLeaving&&s[As](!0),l.persisted&&!e?u():a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}}else r(s,t,n)},de=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(Sa(),Ls(s,null,n,e,!0),Ca()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!zs(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&ql(_,t,e),u&6)me(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&vs(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,ye,r):l&&!l.hasOnce&&(a!==L||d>0&&d&64)?he(l,t,n,!1,!0):(a===L&&d&384||!i&&u&16)&&he(c,t,n),r&&fe(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&pl(()=>{_&&ql(_,t,e),h&&vs(e,null,t,`unmounted`),v&&(e.el=null)},n)},fe=e=>{let{type:t,el:n,anchor:r,transition:a}=e;if(t===L){pe(n,r);return}if(t===Ol){b(e);return}let o=()=>{i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(e.shapeFlag&1&&a&&!a.persisted){let{leave:t,delayLeave:r}=a,i=()=>t(n,o);r?r(e.el,o,i):i()}else o()},pe=(e,t)=>{let n;for(;e!==t;)n=f(e),i(e),e=n;i(t)},me=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;Sl(c),Sl(l),r&&Pi(r),i.stop(),a&&(a.flags|=8,de(o,e,t,n)),s&&pl(s,t),pl(()=>{e.isUnmounted=!0},t)},he=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)de(e[o],t,n,r,i)},ge=e=>{if(e.shapeFlag&6)return ge(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=f(e.anchor||e.el),n=t&&t[Os];return n?f(n):t},_e=!1,ve=(e,t,n)=>{let r;e==null?t._vnode&&(de(t._vnode,null,null,!0),r=t._vnode.component):h(t._vnode||null,e,t,null,null,null,n),t._vnode=e,_e||=(_e=!0,ls(r),us(),!1)},ye={p:h,um:de,m:ue,r:fe,mt:ie,mc:w,pc:se,pbc:ee,n:ge,o:e},be,xe;return t&&([be,xe]=t(ye)),{render:ve,hydrate:be,createApp:Pc(ve,be)}}function gl({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function _l({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function vl(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function yl(e,t,n=!1){let r=e.children,i=t.children;if(k(r)&&k(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=Wl(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&yl(t,a)),a.type===El&&(a.patchFlag===-1&&(a=i[e]=Wl(a)),a.el=t.el),a.type===Dl&&!a.el&&(a.el=t.el)}}function bl(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function xl(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:xl(t)}function Sl(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Cl(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?Cl(t.subTree):null}var wl=e=>e.__isSuspense;function Tl(e,t){t&&t.pendingBranch?k(e)?t.effects.push(...e):t.effects.push(e):cs(e)}var L=Symbol.for(`v-fgt`),El=Symbol.for(`v-txt`),Dl=Symbol.for(`v-cmt`),Ol=Symbol.for(`v-stc`),kl=[],Al=null;function R(e=!1){kl.push(Al=e?null:[])}function jl(){kl.pop(),Al=kl[kl.length-1]||null}var Ml=1;function Nl(e,t=!1){Ml+=e,e<0&&Al&&t&&(Al.hasOnce=!0)}function Pl(e){return e.dynamicChildren=Ml>0?Al||oi:null,jl(),Ml>0&&Al&&Al.push(e),e}function z(e,t,n,r,i,a){return Pl(V(e,t,n,r,i,a,!0))}function B(e,t,n,r,i){return Pl(H(e,t,n,r,i,!0))}function Fl(e){return e?e.__v_isVNode===!0:!1}function Il(e,t){return e.type===t.type&&e.key===t.key}var Ll=({key:e})=>e??null,Rl=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:_i(e)||ko(e)||A(e)?{i:ps,r:e,k:t,f:!!n}:e);function V(e,t=null,n=null,r=0,i=null,a=e===L?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ll(t),ref:t&&Rl(t),scopeId:ms,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:ps};return s?(Gl(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=_i(n)?8:16),Ml>0&&!o&&Al&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&Al.push(c),c}var H=zl;function zl(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===ic)&&(e=Dl),Fl(e)){let r=Vl(e,t,!0);return n&&Gl(r,n),Ml>0&&!a&&Al&&(r.shapeFlag&6?Al[Al.indexOf(e)]=r:Al.push(r)),r.patchFlag=-2,r}if(pu(e)&&(e=e.__vccOpts),t){t=Bl(t);let{class:e,style:n}=t;e&&!_i(e)&&(t.class=M(e)),j(n)&&(To(n)&&!k(n)&&(n=di({},n)),t.style=zi(n))}let o=_i(e)?1:wl(e)?128:ks(e)?64:j(e)?4:A(e)?2:0;return V(e,t,n,r,i,o,a,!0)}function Bl(e){return e?To(e)||Zc(e)?di({},e):e:null}function Vl(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?Kl(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Ll(l),ref:t&&t.ref?n&&a?k(a)?a.concat(Rl(t)):[a,Rl(t)]:Rl(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==L?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Vl(e.ssContent),ssFallback:e.ssFallback&&Vl(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&Ns(u,c.clone(u)),u}function Hl(e=` `,t=0){return H(El,null,e,t)}function U(e=``,t=!1){return t?(R(),B(Dl,null,e)):H(Dl,null,e)}function Ul(e){return e==null||typeof e==`boolean`?H(Dl):k(e)?H(L,null,e.slice()):Fl(e)?Wl(e):H(El,null,String(e))}function Wl(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Vl(e)}function Gl(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(k(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Gl(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!Zc(t)?t._ctx=ps:r===3&&ps&&(ps.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(A(t)){if(r&65){Gl(e,{default:t});return}t={default:t,_ctx:ps},n=32}else t=String(t),r&64?(n=16,t=[Hl(t)]):n=8;e.children=t,e.shapeFlag|=n}function Kl(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=M([t.class,r.class]));else if(e===`style`)t.style=zi([t.style,r.style]);else if(li(e)){let n=t[e],i=r[e];i&&n!==i&&!(k(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!ui(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function ql(e,t,n,r=null){Jo(e,t,7,[n,r])}var Jl=Mc(),Yl=0;function Xl(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||Jl,a={uid:Yl++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new na(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:rl(r,i),emitsOptions:Bc(r,i),emit:null,emitted:null,propsDefaults:D,inheritAttrs:r.inheritAttrs,ctx:D,data:D,props:D,attrs:D,slots:D,refs:D,setupState:D,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=Rc.bind(null,a),e.ce&&e.ce(a),a}var Zl=null,Ql=()=>Zl||ps,$l,eu;{let e=Ri(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};$l=t(`__VUE_INSTANCE_SETTERS__`,e=>Zl=e),eu=t(`__VUE_SSR_SETTERS__`,e=>iu=e)}var tu=e=>{let t=Zl;return $l(e),e.scope.on(),()=>{e.scope.off(),$l(t)}},nu=()=>{Zl&&Zl.scope.off(),$l(null)};function ru(e){return e.vnode.shapeFlag&4}var iu=!1;function au(e,t=!1,n=!1){t&&eu(t);let{props:r,children:i}=e.vnode,a=ru(e);Qc(e,r,a,t),dl(e,i,n||t);let o=a?ou(e,t):void 0;return t&&eu(!1),o}function ou(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,mc);let{setup:r}=n;if(r){Sa();let n=e.setupContext=r.length>1?uu(e):null,i=tu(e),a=qo(r,e,0,[e.props,n]),o=yi(a);if(Ca(),i(),(o||e.sp)&&!zs(e)&&Ps(e),o){if(a.then(nu,nu),t)return a.then(n=>{eu(!0);try{su(e,n,t)}finally{eu(!1)}}).catch(t=>{Yo(t,e,0)});e.asyncDep=a}else su(e,a,t)}else cu(e,t)}function su(e,t,n){A(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:j(t)&&(e.setupState=Io(t)),cu(e,n)}function cu(e,t,n){let r=e.type;e.render||=r.render||si;{let t=tu(e);Sa();try{vc(e)}finally{Ca(),t()}}}var lu={get(e,t){return Na(e,`get`,``),e[t]}};function uu(e){return{attrs:new Proxy(e.attrs,lu),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function du(e){return e.exposed?e.exposeProxy||=new Proxy(Io(Eo(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in fc)return fc[n](e)},has(e,t){return t in e||t in fc}}):e.proxy}function fu(e,t=!0){return A(e)?e.displayName||e.name:e.name||t&&e.__name}function pu(e){return A(e)&&`__vccOpts`in e}var W=(e,t)=>Bo(e,t,iu);function mu(e,t,n){try{Nl(-1);let r=arguments.length;return r===2?j(t)&&!k(t)?Fl(t)?H(e,null,[t]):H(e,t):H(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Fl(n)&&(n=[n]),H(e,t,n))}finally{Nl(1)}}var hu=`3.5.42`,gu=void 0,_u=typeof window<`u`&&window.trustedTypes;if(_u)try{gu=_u.createPolicy(`vue`,{createHTML:e=>e})}catch{}var vu=gu?e=>gu.createHTML(e):e=>e,yu=`http://www.w3.org/2000/svg`,bu=`http://www.w3.org/1998/Math/MathML`,xu=typeof document<`u`?document:null,Su=xu&&xu.createElement(`template`),Cu={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?xu.createElementNS(yu,e):t===`mathml`?xu.createElementNS(bu,e):n?xu.createElement(e,{is:n}):xu.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>xu.createTextNode(e),createComment:e=>xu.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>xu.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{Su.innerHTML=vu(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Su.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},wu=Symbol(`_vtc`);function Tu(e,t,n){let r=e[wu];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Eu=Symbol(`_vod`),Du=Symbol(`_vsh`),Ou=Symbol(``),ku=/(?:^|;)\s*display\s*:/;function Au(e,t,n){let r=e.style,i=_i(n),a=!1;if(n&&!i){if(t){if(_i(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Mu(r,t,``)}else for(let e in t)n[e]??Mu(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Mu(r,i,``):Iu(e,i,!_i(t)&&t?t[i]:void 0,o)||Mu(r,i,o)}}else if(i){if(t!==n){let e=r[Ou];e&&(n+=`;`+e),r.cssText=n,a=ku.test(n)}}else t&&e.removeAttribute(`style`);Eu in e&&(e[Eu]=a?r.display:``,e[Du]&&(r.display=`none`))}var ju=/\s*!important$/;function Mu(e,t,n){if(k(n))n.forEach(n=>Mu(e,t,n));else if(n??=``,t.startsWith(`--`))ju.test(n)?e.setProperty(t,n.replace(ju,``),`important`):e.setProperty(t,n);else{let r=Fu(e,t);ju.test(n)?e.setProperty(Ai(r),n.replace(ju,``),`important`):e[r]=n}}var Nu=[`Webkit`,`Moz`,`ms`],Pu={};function Fu(e,t){let n=Pu[t];if(n)return n;let r=Oi(t);if(r!==`filter`&&r in e)return Pu[t]=r;r=ji(r);for(let n=0;n<Nu.length;n++){let i=Nu[n]+r;if(i in e)return Pu[t]=i}return t}function Iu(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&_i(r)&&n===r}var Lu=`http://www.w3.org/1999/xlink`;function Ru(e,t,n,r,i,a=Ki(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(Lu,t.slice(6,t.length)):e.setAttributeNS(Lu,t,n):n==null||a&&!qi(n)?e.removeAttribute(t):e.setAttribute(t,a?``:vi(n)?String(n):n)}function zu(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?vu(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=qi(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function Bu(e,t,n,r){e.addEventListener(t,n,r)}function Vu(e,t,n,r){e.removeEventListener(t,n,r)}var Hu=Symbol(`_vei`);function Uu(e,t,n,r,i=null){let a=e[Hu]||(e[Hu]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=Ku(t);r?Bu(e,n,a[t]=Xu(r,i),s):o&&(Vu(e,n,o,s),a[t]=void 0)}}var Wu=/(Once|Passive|Capture)$/,Gu=/^on:?(?:Once|Passive|Capture)$/;function Ku(e){let t,n;for(;(n=e.match(Wu))&&!Gu.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):Ai(e.slice(2)),t]}var qu=0,Ju=Promise.resolve(),Yu=()=>qu||=(Ju.then(()=>qu=0),Date.now());function Xu(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(k(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&Jo(e,t,5,a)}}else Jo(r,t,5,[e])};return n.value=e,n.attached=Yu(),n}var Zu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Qu=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?Tu(e,r,o):t===`style`?Au(e,n,r):li(t)?ui(t)||Uu(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),1):t[0]===`^`?(t=t.slice(1),0):$u(e,t,r,o))?(zu(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&Ru(e,t,r,o,a,t!==`value`)):e._isVueCE&&(ed(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!_i(r)))?zu(e,Oi(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Ru(e,t,r,o))};function $u(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&Zu(t)&&A(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return Zu(t)&&_i(n)?!1:t in e}function ed(e,t){let n=e._def.props;if(!n)return!1;let r=Oi(t);return Array.isArray(n)?n.some(e=>Oi(e)===r):Object.keys(n).some(e=>Oi(e)===r)}var td=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return k(t)?e=>Pi(t,e):t};function nd(e){e.target.composing=!0}function rd(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var id=Symbol(`_assign`),ad=Symbol(`_initialValue`);function od(e,t,n){return t&&(e=e.trim()),n&&(e=Ii(e)),e}var sd={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e.parentNode&&(e.type===`text`?e[ad]=e.defaultValue.replace(/[\r\n]/g,``):e.type===`textarea`&&(e[ad]=e.defaultValue.replace(/\r\n?/g,`
|
|
4
|
+
`))),e[id]=td(i);let a=r||i.props&&i.props.type===`number`;Bu(e,t?`change`:`input`,t=>{t.target.composing||e[id](od(e.value,n,a))}),(n||a)&&Bu(e,`change`,()=>{e.value=od(e.value,n,a)}),t||(Bu(e,`compositionstart`,nd),Bu(e,`compositionend`,rd),Bu(e,`change`,rd))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[ad];delete e[ad],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[id](od(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[id]=td(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?Ii(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},cd={deep:!0,created(e,t,n){e[id]=td(n),Bu(e,`change`,()=>{let t=e._modelValue,n=md(e),r=e.checked,i=e[id];if(k(t)){let e=Zi(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(hi(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(hd(e,r))})},mounted:ld,beforeUpdate(e,t,n){e[id]=td(n),ld(e,t,n)}};function ld(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(k(t))i=Zi(t,r.props.value)>-1;else if(hi(t))i=t.has(r.props.value);else{if(t===n)return;i=Xi(t,hd(e,!0))}e.checked!==i&&(e.checked=i)}var ud={created(e,{value:t},n){e.checked=Xi(t,n.props.value),e[id]=td(n),Bu(e,`change`,()=>{e[id](md(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[id]=td(r),t!==n&&(e.checked=Xi(t,r.props.value))}},dd={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,Bu(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?Ii(md(e)):md(e)),r=e.multiple,i=r?hi(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?k(i)?t.slice():t:i];try{e[id](i)}finally{is(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[id]=td(r)},mounted(e,{value:t}){pd(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[id]=td(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!fd(t,n[1],n[0]))&&pd(e,t)}};function fd(e,t,n){if(!n||k(e))return Xi(e,t);if(hi(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function pd(e,t){let n=e.multiple,r=k(t);if(!n||r||hi(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=md(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Zi(t,o)>-1}else a.selected=t.has(o)}else if(Xi(md(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function md(e){return`_value`in e?e._value:e.value}function hd(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var gd={created(e,t,n){vd(e,t,n,null,`created`)},mounted(e,t,n){vd(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){vd(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){vd(e,t,n,r,`updated`)}};function _d(e,t){switch(e){case`SELECT`:return dd;case`TEXTAREA`:return sd;default:switch(t){case`checkbox`:return cd;case`radio`:return ud;default:return sd}}}function vd(e,t,n,r,i){let a=_d(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}var yd=[`ctrl`,`shift`,`alt`,`meta`],bd={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>yd.some(n=>e[`${n}Key`]&&!t.includes(n))},xd=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=bd[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},Sd=di({patchProp:Qu},Cu),Cd;function wd(){return Cd||=ml(Sd)}var Td=((...e)=>{let t=wd().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Dd(e);if(!r)return;let i=t._component;!A(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Ed(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function Ed(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function Dd(e){return _i(e)?document.querySelector(e):e}var Od=Symbol(`antfu-design-color-scheme`);function kd(e){let t=bs(Od,void 0);return W(()=>e?.()??t?.value??`light`)}function Ad(e,t){let n=e.length,r,i,a=!1,o=!1;Array.isArray(e[0])?r=e:(r=[e],n=r.length,a=!0),Array.isArray(t[0])?i=t:(i=t.length>0?t.map(e=>[e]):[[]],o=!0);let s=i[0].length,c=i[0].map((e,t)=>i.map(e=>e[t])),l=r.map(e=>c.map(t=>{let n=0;if(!Array.isArray(e)){for(let r of t)n+=e*r;return n}for(let r=0;r<e.length;r++)n+=e[r]*(t[r]||0);return n}));return n===1&&a&&(l=l[0]),s===1&&o?n===1&&a?l[0]:l.map(e=>e[0]):l}function jd(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function G(e,t,n=[0,0,0]){let r=jd(e,t[0]),i=jd(e,t[1]),a=jd(e,t[2]);return n[0]=r,n[1]=i,n[2]=a,n}var Md=t({bisectLeft:()=>Wd,clamp:()=>Vd,copySign:()=>Hd,diag:()=>Kd,interpolate:()=>Rd,interpolateInv:()=>zd,inv:()=>Qd,isInstance:()=>Gd,isNone:()=>K,isString:()=>Nd,lu:()=>qd,mapRange:()=>Bd,multiplyMatrices:()=>Ad,multiply_v3_m3x3:()=>G,serializeNumber:()=>Fd,skipNone:()=>Id,solve:()=>$d,spow:()=>q,toPrecision:()=>Ld,type:()=>Pd,zdiv:()=>Ud});function Nd(e){return Pd(e)===`string`}function Pd(e){return(Object.prototype.toString.call(e).match(/^\[object\s+(.*?)\]$/)[1]||``).toLowerCase()}function Fd(e,{precision:t=16,unit:n}){return K(e)?`none`:(e=+Ld(e,t),e+(n??``))}function K(e){return e===null}function Id(e){return K(e)?0:e}function Ld(e,t){if(e===0)return 0;let n=~~e,r=0;n&&t&&(r=~~Math.log10(Math.abs(n))+1);let i=10**(t-r);return Math.floor(e*i+.5)/i}function Rd(e,t,n){return K(e)||isNaN(e)?t:K(t)||isNaN(t)?e:e+(t-e)*n}function zd(e,t,n){return(n-e)/(t-e)}function Bd(e,t,n){return!e||!t||e===t||e[0]===t[0]&&e[1]===t[1]||isNaN(n)||n===null?n:Rd(t[0],t[1],zd(e[0],e[1],n))}function Vd(e,t,n){return Math.max(Math.min(n,t),e)}function Hd(e,t){return Math.sign(e)===Math.sign(t)?e:-e}function q(e,t){return Hd(Math.abs(e)**t,e)}function Ud(e,t){return t===0?0:e/t}function Wd(e,t,n=0,r=e.length){for(;n<r;){let i=n+r>>1;e[i]<t?n=i+1:r=i}return n}function Gd(e,t){if(e instanceof t)return!0;let n=t.name;for(;e;){let t=Object.getPrototypeOf(e),r=t?.constructor?.name;if(r===n)return!0;if(!r||r===`Object`)return!1;e=t}return!1}function Kd(e){let t=e.length,n=[];for(let r=0;r<t;r++){n[r]=[];for(let i=0;i<t;i++)n[r][i]=r===i?e[r]:0}return n}function qd(e,{pIndices:t=!1}={}){let n,r,i,a,o=e.length;t?(n=Array.from({length:o},(e,t)=>t),i=Kd(Array(o).fill(1))):(r=Kd(Array(o).fill(1)),i=structuredClone(r)),a=structuredClone(e);for(let e=0;e<o-1;e++){let s=e,c=Math.abs(a[e][e]);for(let t=e+1;t<o;t++){let n=Math.abs(a[t][e]);n>c&&(s=t,c=n)}if(s!=e){if([a[e],a[s]]=[a[s],a[e]],t?[n[e],n[s]]=[n[s],n[e]]:[r[e],r[s]]=[r[s],r[e]],e)for(let t=0;t<e;t++)[i[e][t],i[s][t]]=[i[s][t],i[e][t]]}else if(!c)continue;for(let t=e+1;t<o;t++){let n=a[t][e]/a[e][e];for(let r=e;r<o;r++)a[t][r]+=-a[e][r]*n,i[t][r]+=i[e][r]*n}}return t?[n,i,a]:[r,i,a]}function Jd(e,t,n){for(let r=0;r<n;r++){let i=t[r];for(let a=0;a<r;a++)for(let o=0;o<n;o++)i[o]-=e[r][a]*t[a][o];for(let t=0;t<n;t++)i[t]/=e[r][r]}return t}function Yd(e,t,n){for(let i=n-1;i>-1;i--){let a=t[i];for(let o=i+1;o<n;o++)for(var r=0;r<n;r++)a[r]-=e[i][o]*t[o][r];for(let r=0;r<n;r++)t[i][r]/=e[i][i]}return t}function Xd(e,t,n){for(let r=0;r<n;r++){let n=t[r];for(let i=0;i<r;i++)n-=e[r][i]*t[i];t[r]=n/e[r][r]}return t}function Zd(e,t,n){for(let r=n-1;r>-1;r--){let i=t[r];for(let a=r+1;a<n;a++)i-=e[r][a]*t[a];t[r]=i/e[r][r]}return t}function Qd(e){let[t,n,r]=qd(e),i=n.length;if(n.map((e,t)=>e[t]*r[t][t]).reduce((e,t)=>e*t,1)===0)throw Error(`Matrix is singular`);return Yd(r,Jd(n,t,i),i)}function $d(e,t){let[n,r,i]=qd(e,{pIndices:!0}),a=r.length;if(r.map((e,t)=>e[t]*i[t][t]).reduce((e,t)=>e*t,1)===0)throw Error(`Matrix is singular`);return Zd(i,Xd(r,n.map(e=>t[e]),a),a)}var ef=new class{add(e,t,n){if(typeof arguments[0]!=`string`){for(var e in arguments[0])this.add(e,arguments[0][e],arguments[1]);return}(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][n?`unshift`:`push`](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}},tf={gamut_mapping:`css`,precision:5,deltaE:`76`,verbose:!0,warn:function(e){this.verbose&&globalThis?.console?.warn?.(e)}},nf=class{type;coordMeta;coordRange;range;constructor(e,t){if(typeof e==`object`&&(this.coordMeta=e),t&&(this.coordMeta=t,this.coordRange=t.range??t.refRange),typeof e==`string`){let t=e.trim().match(/^(?<type><[a-z]+>)(\[(?<min>-?[.\d]+),\s*(?<max>-?[.\d]+)\])?$/);if(!t)throw TypeError(`Cannot parse ${e} as a type definition.`);this.type=t.groups.type;let{min:n,max:r}=t.groups;(n||r)&&(this.range=[+n,+r])}}get computedRange(){return this.range?this.range:this.type===`<percentage>`?this.percentageRange():this.type===`<angle>`?[0,360]:null}get unit(){return this.type===`<percentage>`?`%`:this.type===`<angle>`?`deg`:``}resolve(e){if(this.type===`<angle>`)return e;let t=this.computedRange,n=this.coordRange;return this.type===`<percentage>`&&(n??=this.percentageRange()),Bd(t,n,e)}serialize(e,t){let n=this.type===`<percentage>`?this.percentageRange(100):this.computedRange,r=this.unit;return e=Bd(this.coordRange,n,e),Fd(e,{unit:r,precision:t})}toString(){let e=this.type;if(this.range){let[t=``,n=``]=this.range;e+=`[${t},${n}]`}return e}percentageRange(e=1){let t;return t=this.coordMeta&&this.coordMeta.range||this.coordRange&&this.coordRange[0]>=0?[0,1]:[-1,1],[t[0]*e,t[1]*e]}static get(e,t){return Gd(e,this)?e:new this(e,t)}},rf=Symbol(`instance`),af=class e{type;name;spaceCoords;coords;id;alpha;constructor(e,t=e.space){e[rf]=this,this.type=`function`,this.name=`color`,Object.assign(this,e),this.space=t,this.type!==`custom`&&(this.spaceCoords=Object.values(t.coords),this.coords||=this.spaceCoords.map(e=>{let t=[`<number>`,`<percentage>`];return e.type===`angle`&&t.push(`<angle>`),t}),this.coords=this.coords.map((e,t)=>{let n=this.spaceCoords[t];return typeof e==`string`&&(e=e.trim().split(/\s*\|\s*/)),e.map(e=>nf.get(e,n))}))}serializeCoords(e,t,n){return n=e.map((e,t)=>nf.get(n?.[t]??this.coords[t][0],this.spaceCoords[t])),e.map((e,r)=>n[r].serialize(e,t))}coerceCoords(e,t){return Object.entries(this.space.coords).map(([n,r],i)=>{let a=e[i];if(K(a)||isNaN(a))return a;let o=t[i],s=this.coords[i].find(e=>e.type==o);if(!s){let e=r.name||n;throw TypeError(`${o??a?.raw??a} not allowed for ${e} in ${this.name}()`)}return a=s.resolve(a),s.range&&(t[i]=s.toString()),a})}canSerialize(){return this.type===`function`||this.serialize}parse(e){return null}static get(t,...n){return!t||Gd(t,this)?t:t[rf]?t[rf]:new e(t,...n)}},of={D50:[.3457/.3585,1,.2958/.3585],D65:[.3127/.329,1,.3583/.329]};function sf(e){return Array.isArray(e)?e:of[e]}function cf(e,t,n,r={}){if(e=sf(e),t=sf(t),!e||!t)throw TypeError(`Missing white point to convert ${e?``:`from`}${!e&&!t?`/`:``}${t?``:`to`}`);if(e===t)return n;let i={W1:e,W2:t,XYZ:n,options:r};if(ef.run(`chromatic-adaptation-start`,i),i.M||(i.W1===of.D65&&i.W2===of.D50?i.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:i.W1===of.D50&&i.W2===of.D65&&(i.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),ef.run(`chromatic-adaptation-end`,i),i.M)return G(i.XYZ,i.M);throw TypeError(`Only Bradford CAT with white points D50 and D65 supported for now.`)}function lf(e,t){let n={str:String(e)?.trim(),options:t};if(ef.run(`parse-start`,n),n.color)return n.color;n.parsed=pf(n.str);let r,i=n.options?n.options.parseMeta??n.options.meta:null;if(n.parsed){let t=n.parsed.name,a,o,s=n.parsed.args,c=s.map((e,t)=>n.parsed.argMeta[t]?.type);if(t===`color`){let r=s.shift();c.shift();let i=r.startsWith(`--`)?r.substring(2):`--${r}`,l=[r,i];if(a=Y.findFormat({name:t,id:l,type:`function`}),!a){let t,a=r in Y.registry?r:i;if(a in Y.registry){let n=Y.registry[a].formats?.color?.id;n&&(t=`Did you mean ${e.replace(`color(`+r,`color(`+n)}?`)}throw TypeError(`Cannot parse ${n.str}. `+(t??`Missing a plugin?`))}o=a.space,a.id.startsWith(`--`)&&!r.startsWith(`--`)&&tf.warn(`${o.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${a.id}) instead of color(${r}).`),r.startsWith(`--`)&&!a.id.startsWith(`--`)&&tf.warn(`${o.name} is a standard space and supported in the CSS spec. Use color(${a.id}) instead of prefixed color(${r}).`)}else a=Y.findFormat({name:t,type:`function`}),o=a.space;i&&Object.assign(i,{format:a,formatId:a.name,types:c,commas:n.parsed.commas});let l=1;n.parsed.lastAlpha&&(l=n.parsed.args.pop(),i&&(i.alphaType=c.pop()));let u=a.coords.length;if(s.length!==u)throw TypeError(`Expected ${u} coordinates for ${o.id} in ${n.str}), got ${s.length}`);s=a.coerceCoords(s,c),r={spaceId:o.id,coords:s,alpha:l}}else spaceloop:for(let e of Y.all)for(let t in e.formats){let a=e.formats[t];if(a.type!==`custom`||a.test&&!a.test(n.str))continue;let o=e.getFormat(a),s=o.parse(n.str);if(s){i&&Object.assign(i,{format:o,formatId:t}),r=s;break spaceloop}}if(!r)throw TypeError(`Could not parse ${e} as a color. Missing a plugin?`);return r.alpha=K(r.alpha)?r.alpha:r.alpha===void 0?1:Vd(0,r.alpha,1),r}var uf={"%":.01,deg:1,grad:.9,rad:180/Math.PI,turn:360},df={function:/^([a-z]+)\(((?:calc\(NaN\)|.)+?)\)$/i,number:/^([-+]?(?:[0-9]*\.)?[0-9]+(e[-+]?[0-9]+)?)$/i,unitValue:RegExp(`(${Object.keys(uf).join(`|`)})$`),singleArgument:/\/?\s*(none|NaN|calc\(NaN\)|[-+\w.]+(?:%|deg|g?rad|turn)?)/g};function ff(e){let t={},n=e.match(df.unitValue)?.[0],r=t.raw=e;return n?(t.type=n===`%`?`<percentage>`:`<angle>`,t.unit=n,t.unitless=Number(r.slice(0,-n.length)),r=t.unitless*uf[n]):df.number.test(r)?(r=Number(r),t.type=`<number>`):r===`none`?r=null:r===`NaN`||r===`calc(NaN)`?(r=NaN,t.type=`<number>`):t.type=`<ident>`,{value:r,meta:t}}function pf(e){if(!e)return;e=e.trim();let t=e.match(df.function);if(t){let e=[],n=[],r=!1,i=t[1].toLowerCase(),a=t[2].replace(df.singleArgument,(t,a)=>{let{value:o,meta:s}=ff(a);return(t.startsWith(`/`)||i!==`color`&&e.length===3)&&(r=!0),e.push(o),n.push(s),``});return{name:i,args:e,argMeta:n,lastAlpha:r,commas:a.includes(`,`),rawName:t[1],rawArgs:t[2]}}}function J(e,t){if(Array.isArray(e))return e.map(e=>J(e,t));if(!e)throw TypeError(`Empty color reference`);Nd(e)&&(e=lf(e,t));let n=e.space||e.spaceId;return typeof n==`string`&&(e.space=Y.get(n)),e.alpha===void 0&&(e.alpha=1),e}var mf=75e-6,Y=class e{constructor(t){this.id=t.id,this.name=t.name,this.base=t.base?e.get(t.base):null,this.aliases=t.aliases,this.displaySpaces=t.displaySpaces?.map(t=>e.get(t)),this.bases=[];for(let e=this.base;e;e=e.base)this.bases.push(e);t.rgbGamut&&(this.rgbGamut=t.rgbGamut),t.linearGamut&&(this.linearGamut=t.linearGamut),this.base&&(t.fromBase&&(this.fromBase=t.fromBase),t.toBase&&(this.toBase=t.toBase));let n=t.coords??this.base.coords;for(let e in n)`name`in n[e]||(n[e].name=e);this.coords=n;let r=t.white??this.base.white??`D65`;this.white=sf(r),this.formats=t.formats??{};for(let e in this.formats){let t=this.formats[e];t.type||=`function`,t.name||=e}this.formats.color?.id||(this.formats.color={...this.formats.color??{},id:t.cssId||this.id}),this.gamutSpace=t.gamutSpace?t.gamutSpace===`self`?this:e.get(t.gamutSpace):this.isPolar?this.base:this,this.gamutSpace.isUnbounded&&(this.inGamut=(e,t)=>!0),this.M=t.M??{},this.referred=t.referred,Object.defineProperty(this,"path",{value:hf(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),ef.run(`colorspace-init-end`,this)}inGamut(e,{epsilon:t=mf}={}){if(!this.equals(this.gamutSpace))return e=this.to(this.gamutSpace,e),this.gamutSpace.inGamut(e,{epsilon:t});let n=Object.values(this.coords);return e.every((e,r)=>{let i=n[r];if(i.type!==`angle`&&i.range){if(K(e))return!0;let[n,r]=i.range;return(n===void 0||e>=n-t)&&(r===void 0||e<=r+t)}return!0})}get isUnbounded(){return Object.values(this.coords).every(e=>!(`range`in e))}get cssId(){return this.formats?.color?.id||this.id}get hueId(){for(let e in this.coords)if(this.coords[e].type===`angle`)return e;return null}get hueIndex(){return Object.keys(this.coords).findIndex(e=>this.coords[e].type===`angle`)}get isPolar(){return this.hueId!==null}getFormat(e){if(!e)return null;e==="default"?e=Object.values(this.formats)[0]:typeof e==`string`&&(e=this.formats[e]);let t=af.get(e,this);return t!==e&&e.name in this.formats&&(this.formats[e.name]=t),t}equals(e){return e?this===e||this.id===e||this.id===e.id:!1}to(t,n){if(arguments.length===1){let e=J(t);[t,n]=[e.space,e.coords]}if(t=e.get(t),this.equals(t))return n;n=n.map(e=>K(e)?0:e);let r=this.path,i=t.path,a,o;for(let e=0;e<r.length&&r[e].equals(i[e]);e++)a=r[e],o=e;if(!a)throw Error(`Cannot convert between color spaces ${this} and ${t}: no connection space was found`);for(let e=r.length-1;e>o;e--)n=r[e].toBase(n);for(let e=o+1;e<i.length;e++)n=i[e].fromBase(n);return n}from(t,n){if(arguments.length===1){let e=J(t);[t,n]=[e.space,e.coords]}return t=e.get(t),t.to(this,n)}toString(){return`${this.name} (${this.id})`}getMinCoords(){let e=[];for(let t in this.coords){let n=this.coords[t],r=n.range||n.refRange;e.push(r?.min??0)}return e}static registry={};static get all(){return[...new Set(Object.values(e.registry))]}static register(e,t){if(arguments.length===1&&(t=arguments[0],e=t.id),t=this.get(t),this.registry[e]&&this.registry[e]!==t)throw Error(`Duplicate color space registration: '${e}'`);if(this.registry[e]=t,arguments.length===1&&t.aliases)for(let e of t.aliases)this.register(e,t);return t}static get(t,...n){if(!t||Gd(t,this))return t;if(Pd(t)===`string`){let n=e.registry[t.toLowerCase()];if(!n)throw TypeError(`No color space found with id = "${t}"`);return n}if(n.length)return e.get(...n);throw TypeError(`${t} is not a valid color space`)}static findFormat(t,n=e.all){if(!t)return null;typeof t==`string`&&(t={name:t});for(let e of n)for(let[n,r]of Object.entries(e.formats)){r.name??=n,r.type??=`function`;let i=(!t.name||r.name===t.name)&&(!t.type||r.type===t.type);if(t.id){let e=r.ids||[r.id],n=Array.isArray(t.id)?t.id:[t.id];i&&=n.some(t=>e.includes(t))}if(i){let t=af.get(r,e);return t!==r&&(e.formats[r.name]=t),t}}return null}static resolveCoord(t,n){let r=Pd(t),i,a;if(r===`string`?t.includes(`.`)?[i,a]=t.split(`.`):[i,a]=[,t]:Array.isArray(t)?[i,a]=t:(i=t.space,a=t.coordId),i=e.get(i),i||=n,!i)throw TypeError(`Cannot resolve coordinate reference ${t}: No color space specified and relative references are not allowed here`);if(r=Pd(a),r===`number`||r===`string`&&a>=0){let e=Object.entries(i.coords)[a];if(e)return{space:i,id:e[0],index:a,...e[1]}}i=e.get(i);let o=a.toLowerCase(),s=0;for(let e in i.coords){let t=i.coords[e];if(e.toLowerCase()===o||t.name?.toLowerCase()===o)return{space:i,id:e,index:s,...t};s++}throw TypeError(`No "${a}" coordinate found in ${i.name}. Its coordinates are: ${Object.keys(i.coords).join(`, `)}`)}static DEFAULT_FORMAT={type:`functions`,name:`color`}};function hf(e){let t=[e];for(let n=e;n=n.base;)t.push(n);return t}var gf=new Y({id:`xyz-d65`,name:`XYZ D65`,coords:{x:{refRange:[0,1],name:`X`},y:{refRange:[0,1],name:`Y`},z:{refRange:[0,1],name:`Z`}},white:`D65`,formats:{color:{ids:[`xyz-d65`,`xyz`]}},aliases:[`xyz`]}),_f=class extends Y{constructor(e){e.coords||={r:{range:[0,1],name:`Red`},g:{range:[0,1],name:`Green`},b:{range:[0,1],name:`Blue`}},e.base||=gf;let t=e.toXYZ_M??e.M?.toXYZ,n=e.fromXYZ_M??e.M?.fromXYZ;e.referred??=`display`,super(e),t&&n&&(this.M.toXYZ=t,this.M.fromXYZ=n)}toBase(e){let t=G(e,this.M.toXYZ);return this.white!==this.base.white&&(t=cf(this.white,this.base.white,t)),t}fromBase(e){return e=cf(this.base.white,this.white,e),G(e,this.M.fromXYZ)}},vf=new Y({id:`xyz-d50`,name:`XYZ D50`,white:`D50`,base:gf,fromBase:e=>cf(gf.white,`D50`,e),toBase:e=>cf(`D50`,gf.white,e)}),yf=216/24389,bf=24/116,xf=24389/27,Sf=of.D50,Cf=new Y({id:`lab`,name:`Lab`,coords:{l:{refRange:[0,100],name:`Lightness`},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:Sf,base:vf,fromBase(e){let t=e.map((e,t)=>e/Sf[t]).map(e=>e>yf?Math.cbrt(e):(xf*e+16)/116);return[116*t[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])]},toBase(e){let[t,n,r]=e,i=[];return i[1]=(t+16)/116,i[0]=n/500+i[1],i[2]=i[1]-r/200,[i[0]>bf?i[0]**3:(116*i[0]-16)/xf,e[0]>8?((e[0]+16)/116)**3:e[0]/xf,i[2]>bf?i[2]**3:(116*i[2]-16)/xf].map((e,t)=>e*Sf[t])},formats:{lab:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <percentage>`]}}});function wf(e){return typeof e==`number`?(e%360+360)%360:e}function Tf(e,t){let[n,r]=t,i=K(n),a=K(r);if(i&&a)return[n,r];if(i?n=r:a&&(r=n),e===`raw`)return t;n=wf(n),r=wf(r);let o=r-n;return e===`increasing`?o<0&&(r+=360):e===`decreasing`?o>0&&(n+=360):e===`longer`?-180<o&&o<180&&(o>0?n+=360:r+=360):e===`shorter`&&(o>180?n+=360:o<-180&&(r+=360)),[n,r]}var Ef=new Y({id:`lch`,name:`LCH`,coords:{l:{refRange:[0,100],name:`Lightness`},c:{refRange:[0,150],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:Cf,fromBase(e){if(this.ε===void 0){let e=Object.values(this.base.coords)[1].refRange,t=e[1]-e[0];this.ε=t/1e5}let[t,n,r]=e,i=Math.abs(n)<this.ε&&Math.abs(r)<this.ε,a=i?null:wf(Math.atan2(r,n)*180/Math.PI);return[t,i?0:Math.sqrt(n**2+r**2),a]},toBase(e){let[t,n,r]=e,i=null,a=null;return K(r)||(n=n<0?0:n,i=n*Math.cos(r*Math.PI/180),a=n*Math.sin(r*Math.PI/180)),[t,i,a]},formats:{lch:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <angle>`]}}}),Df=25**7,Of=Math.PI,kf=180/Of,Af=Of/180;function jf(e){let t=e*e;return t*t*t*e}function Mf(e,t,{kL:n=1,kC:r=1,kH:i=1}={}){[e,t]=J([e,t]);let[a,o,s]=Cf.from(e),c=Ef.from(Cf,[a,o,s])[1],[l,u,d]=Cf.from(t),f=Ef.from(Cf,[l,u,d])[1];c<0&&(c=0),f<0&&(f=0);let p=jf((c+f)/2),m=.5*(1-Math.sqrt(p/(p+Df))),h=(1+m)*o,g=(1+m)*u,_=Math.sqrt(h**2+s**2),v=Math.sqrt(g**2+d**2),y=h===0&&s===0?0:Math.atan2(s,h),b=g===0&&d===0?0:Math.atan2(d,g);y<0&&(y+=2*Of),b<0&&(b+=2*Of),y*=kf,b*=kf;let x=l-a,S=v-_,C=b-y,w=y+b,T=Math.abs(C),ee;_*v===0?ee=0:T<=180?ee=C:C>180?ee=C-360:C<-180?ee=C+360:tf.warn(`the unthinkable has happened`);let te=2*Math.sqrt(v*_)*Math.sin(ee*Af/2),ne=(a+l)/2,re=(_+v)/2,ie=jf(re),E;E=_*v===0?w:T<=180?w/2:w<360?(w+360)/2:(w-360)/2;let ae=(ne-50)**2,oe=1+.015*ae/Math.sqrt(20+ae),se=1+.045*re,ce=1;ce-=.17*Math.cos((E-30)*Af),ce+=.24*Math.cos(2*E*Af),ce+=.32*Math.cos((3*E+6)*Af),ce-=.2*Math.cos((4*E-63)*Af);let le=1+.015*re*ce,ue=30*Math.exp(-1*((E-275)/25)**2),de=2*Math.sqrt(ie/(ie+Df)),fe=-1*Math.sin(2*ue*Af)*de,pe=(x/(n*oe))**2;return pe+=(S/(r*se))**2,pe+=(te/(i*le))**2,pe+=fe*(S/(r*se))*(te/(i*le)),Math.sqrt(pe)}var Nf={XYZtoLMS:[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],LMStoXYZ:[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],LMStoLab:[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],LabtoLMS:[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]]},Pf=new Y({id:`oklab`,name:`Oklab`,coords:{l:{refRange:[0,1],name:`Lightness`},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:`D65`,base:gf,M:Nf,fromBase(e){let t=G(e,Nf.XYZtoLMS);return t[0]=Math.cbrt(t[0]),t[1]=Math.cbrt(t[1]),t[2]=Math.cbrt(t[2]),G(t,Nf.LMStoLab,t)},toBase(e){let t=G(e,Nf.LabtoLMS);return t[0]**=3,t[1]**=3,t[2]**=3,G(t,Nf.LMStoXYZ,t)},formats:{oklab:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <percentage>`]}}});function Ff(e,t){[e,t]=J([e,t]);let[n,r,i]=Pf.from(e),[a,o,s]=Pf.from(t),c=n-a,l=r-o,u=i-s;return Math.sqrt(c**2+l**2+u**2)}var If=75e-6;function Lf(e,t,{epsilon:n=If}={}){e=J(e),t||=e.space,t=Y.get(t);let r=e.coords;return t!==e.space&&(r=t.from(e)),t.inGamut(r,{epsilon:n})}function X(e,t,{inGamut:n}={}){e=J(e),t=Y.get(t);let r=t.from(e),i={space:t,coords:r,alpha:e.alpha};return n&&(i=jh(i,n===!0?void 0:n)),i}X.returns=`color`;function Rf(e,t){e=J(e);let n=Y.get(t,t?.space),r=t?.precision,i;return i=!n||e.space.equals(n)?e.coords.slice():n.from(e),r===void 0?i:i.map(e=>Ld(e,r))}function zf(e,t){if(e=J(e),t===`alpha`)return e.alpha??1;let{space:n,index:r}=Y.resolveCoord(t,e.space);return Rf(e,n)[r]}var Bf=new Y({id:`oklch`,name:`OkLCh`,coords:{l:{refRange:[0,1],name:`Lightness`},c:{refRange:[0,.4],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},white:`D65`,base:Pf,fromBase:Ef.fromBase,toBase:Ef.toBase,formats:{oklch:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <angle>`]}}});function Vf(e,t,n,r){return e=J(e),Array.isArray(t)&&([t,n,r]=[e.space,t,n]),t=Y.get(t),e.coords=t===e.space?n.slice():t.to(e.space,n),r!==void 0&&(e.alpha=r),e}Vf.returns=`color`;function Hf(e,t,n){if(e=J(e),arguments.length===2&&Pd(arguments[1])===`object`){let t=arguments[1];for(let n in t)Hf(e,n,t[n])}else if(typeof n==`function`&&(n=n(zf(e,t))),t===`alpha`)e.alpha=n;else{let{space:r,index:i}=Y.resolveCoord(t,e.space),a=Rf(e,r);a[i]=n,Vf(e,r,a)}return e}Hf.returns=`color`;function Uf(e){return{space:e.space,coords:e.coords.slice(),alpha:e.alpha}}function Wf(e,t,n=`lab`){n=Y.get(n);let r=n.from(e),i=n.from(t);return Math.sqrt(r.reduce((e,t,n)=>{let r=i[n];return K(t)||K(r)?e:e+(r-t)**2},0))}function Gf(e,t){return Wf(e,t,`lab`)}var Kf=Math.PI/180;function qf(e,t,{l:n=2,c:r=1}={}){[e,t]=J([e,t]);let[i,a,o]=Cf.from(e),[,s,c]=Ef.from(Cf,[i,a,o]),[l,u,d]=Cf.from(t),f=Ef.from(Cf,[l,u,d])[1];s<0&&(s=0),f<0&&(f=0);let p=i-l,m=s-f,h=a-u,g=o-d,_=h**2+g**2-m**2,v=.511;i>=16&&(v=.040975*i/(1+.01765*i));let y=.0638*s/(1+.0131*s)+.638,b;K(c)&&(c=0),b=c>=164&&c<=345?.56+Math.abs(.2*Math.cos((c+168)*Kf)):.36+Math.abs(.4*Math.cos((c+35)*Kf));let x=s**4,S=Math.sqrt(x/(x+1900)),C=y*(S*b+1-S),w=(p/(n*v))**2;return w+=(m/(r*y))**2,w+=_/C**2,Math.sqrt(w)}var Jf=203,Yf=new Y({id:`xyz-abs-d65`,cssId:`--xyz-abs-d65`,name:`Absolute XYZ D65`,coords:{x:{refRange:[0,9504.7],name:`Xa`},y:{refRange:[0,1e4],name:`Ya`},z:{refRange:[0,10888.3],name:`Za`}},base:gf,fromBase(e){return e.map(e=>e*Jf)},toBase(e){return e.map(e=>e/Jf)}}),Xf=1.15,Zf=.66,Qf=2610/2**14,$f=2**14/2610,ep=3424/4096,tp=2413/128,np=2392/128,rp=1.7*2523/32,ip=32/(1.7*2523),ap=-.56,op=16295499532821565e-27,sp={XYZtoCone:[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],ConetoXYZ:[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],ConetoIab:[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],IabtoCone:[[1,.13860504327153927,.05804731615611883],[1,-.1386050432715393,-.058047316156118904],[1,-.09601924202631895,-.811891896056039]]},cp=new Y({id:`jzazbz`,name:`Jzazbz`,coords:{jz:{refRange:[0,1],name:`Jz`},az:{refRange:[-.21,.21]},bz:{refRange:[-.21,.21]}},base:Yf,M:sp,fromBase(e){let[t,n,r]=e,[i,a,o]=G(G([Xf*t-.1499999999999999*r,Zf*n- -.33999999999999997*t,r],sp.XYZtoCone).map(function(e){return q((ep+tp*q(e/1e4,Qf))/(1+np*q(e/1e4,Qf)),rp)}),sp.ConetoIab);return[.43999999999999995*i/(1+ap*i)-op,a,o]},toBase(e){let[t,n,r]=e,[i,a,o]=G(G([(t+op)/(.43999999999999995-ap*(t+op)),n,r],sp.IabtoCone).map(function(e){return 1e4*q((ep-q(e,ip))/(np*q(e,ip)-tp),$f)}),sp.ConetoXYZ),s=(i+.1499999999999999*o)/Xf;return[s,(a+-.33999999999999997*s)/Zf,o]},formats:{jzazbz:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <percentage>`]}}}),lp=new Y({id:`jzczhz`,name:`JzCzHz`,coords:{jz:{refRange:[0,1],name:`Jz`},cz:{refRange:[0,.26],name:`Chroma`},hz:{refRange:[0,360],type:`angle`,name:`Hue`}},base:cp,fromBase:Ef.fromBase,toBase:Ef.toBase,formats:{jzczhz:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <angle>`]}}});function up(e,t){[e,t]=J([e,t]);let[n,r,i]=lp.from(e),[a,o,s]=lp.from(t),c=n-a,l=r-o;K(i)&&K(s)?(i=0,s=0):K(i)?i=s:K(s)&&(s=i);let u=i-s,d=2*Math.sqrt(r*o)*Math.sin(u/2*(Math.PI/180));return Math.sqrt(c**2+l**2+d**2)}var dp=3424/4096,fp=2413/128,pp=2392/128,mp=2610/16384,hp=2523/32,gp=16384/2610,_p=32/2523,vp={XYZtoLMS:[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],LMStoIPT:[[2048/4096,2048/4096,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],IPTtoLMS:[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],LMStoXYZ:[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]]},yp=new Y({id:`ictcp`,name:`ICTCP`,coords:{i:{refRange:[0,1],name:`I`},ct:{refRange:[-.5,.5],name:`CT`},cp:{refRange:[-.5,.5],name:`CP`}},base:Yf,M:vp,fromBase(e){return bp(G(e,vp.XYZtoLMS))},toBase(e){return G(xp(e),vp.LMStoXYZ)},formats:{ictcp:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <percentage>`]}}});function bp(e){return G(e.map(function(e){return((dp+fp*(e/1e4)**mp)/(1+pp*(e/1e4)**mp))**hp}),vp.LMStoIPT)}function xp(e){return G(e,vp.IPTtoLMS).map(function(e){return 1e4*(Math.max(e**_p-dp,0)/(fp-pp*e**_p))**gp})}function Sp(e,t){[e,t]=J([e,t]);let[n,r,i]=yp.from(e),[a,o,s]=yp.from(t);return 720*Math.sqrt((n-a)**2+.25*(r-o)**2+(i-s)**2)}function Cp(e,t){[e,t]=J([e,t]);let[n,r,i]=Pf.from(e),[a,o,s]=Pf.from(t),c=n-a,l=2*(r-o),u=2*(i-s);return Math.sqrt(c**2+l**2+u**2)}var wp=of.D65,Tp=.42,Ep=1/Tp,Dp=2*Math.PI,Op={cat16:[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],cat16Inv:[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],m1:[[460,451,288],[460,-891,-261],[460,-220,-6300]]},kp={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},Ap={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},jp=180/Math.PI,Mp=Math.PI/180;function Np(e,t){return e.map(e=>{let n=q(t*Math.abs(e)*.01,Tp);return 400*Hd(n,e)/(n+27.13)})}function Pp(e,t){let n=100/t*27.13**Ep;return e.map(e=>{let t=Math.abs(e);return Hd(n*q(t/(400-t),Ep),e)})}function Fp(e){let t=wf(e);t<=Ap.h[0]&&(t+=360);let n=Wd(Ap.h,t)-1,[r,i]=Ap.h.slice(n,n+2),[a,o]=Ap.e.slice(n,n+2),s=Ap.H[n],c=(t-r)/a;return s+100*c/(c+(i-t)/o)}function Ip(e){let t=(e%400+400)%400,n=Math.floor(.01*t);t%=100;let[r,i]=Ap.h.slice(n,n+2),[a,o]=Ap.e.slice(n,n+2);return wf((t*(o*r-a*i)-100*r*o)/(t*(o-a)-100*o))}function Lp(e,t,n,r,i){let a={};a.discounting=i,a.refWhite=e,a.surround=r;let o=e.map(e=>e*100);a.la=t,a.yb=n;let s=o[1],c=G(o,Op.cat16),l=kp[a.surround],u=l[0];a.c=l[1],a.nc=l[2];let d=(1/(5*a.la+1))**4;a.fl=d*a.la+.1*(1-d)*(1-d)*Math.cbrt(5*a.la),a.flRoot=a.fl**.25,a.n=a.yb/s,a.z=1.48+Math.sqrt(a.n),a.nbb=.725*a.n**-.2,a.ncb=a.nbb;let f=i?1:Math.max(Math.min(u*(1-1/3.6*Math.exp((-a.la-42)/92)),1),0);a.dRgb=c.map(e=>Rd(1,s/e,f)),a.dRgbInv=a.dRgb.map(e=>1/e);let p=Np(c.map((e,t)=>e*a.dRgb[t]),a.fl);return a.aW=a.nbb*(2*p[0]+p[1]+.05*p[2]),a}var Rp=Lp(wp,64/Math.PI*.2,20,`average`,!1);function zp(e,t){if(!(e.J!==void 0^e.Q!==void 0))throw Error(`Conversion requires one and only one: 'J' or 'Q'`);if(!(e.C!==void 0^e.M!==void 0^e.s!==void 0))throw Error(`Conversion requires one and only one: 'C', 'M' or 's'`);if(!(e.h!==void 0^e.H!==void 0))throw Error(`Conversion requires one and only one: 'h' or 'H'`);if(e.J===0||e.Q===0)return[0,0,0];let n=0;n=e.h===void 0?Ip(e.H)*Mp:wf(e.h)*Mp;let r=Math.cos(n),i=Math.sin(n),a=0;e.J===void 0?e.Q!==void 0&&(a=.25*t.c*e.Q/((t.aW+4)*t.flRoot)):a=q(e.J,1/2)*.1;let o=0;e.C===void 0?e.M===void 0?e.s!==void 0&&(o=4e-4*e.s**2*(t.aW+4)/t.c):o=e.M/t.flRoot/a:o=e.C/a;let s=q(o*(1.64-.29**t.n)**-.73,10/9),c=.25*(Math.cos(n+2)+3.8),l=t.aW*q(a,2/t.c/t.z),u=5e4/13*t.nc*t.ncb*c,d=l/t.nbb,f=23*(d+.305)*Ud(s,23*u+s*(11*r+108*i));return G(Pp(G([d,f*r,f*i],Op.m1).map(e=>e*1/1403),t.fl).map((e,n)=>e*t.dRgbInv[n]),Op.cat16Inv).map(e=>e/100)}function Bp(e,t){let n=Np(G(e.map(e=>e*100),Op.cat16).map((e,n)=>e*t.dRgb[n]),t.fl),r=n[0]+(-12*n[1]+n[2])/11,i=(n[0]+n[1]-2*n[2])/9,a=(Math.atan2(i,r)%Dp+Dp)%Dp,o=.25*(Math.cos(a+2)+3.8),s=q(5e4/13*t.nc*t.ncb*Ud(o*Math.sqrt(r**2+i**2),n[0]+n[1]+1.05*n[2]+.305),.9)*(1.64-.29**t.n)**.73,c=q(t.nbb*(2*n[0]+n[1]+.05*n[2])/t.aW,.5*t.c*t.z),l=100*q(c,2),u=4/t.c*c*(t.aW+4)*t.flRoot,d=s*c,f=d*t.flRoot,p=wf(a*jp),m=Fp(p);return{J:l,C:d,h:p,s:50*q(t.c*s/(t.aW+4),1/2),Q:u,M:f,H:m}}var Vp=new Y({id:`cam16-jmh`,cssId:`--cam16-jmh`,name:`CAM16-JMh`,coords:{j:{refRange:[0,100],name:`J`},m:{refRange:[0,105],name:`Colorfulness`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:gf,M:Op,fromBase(e){this.ε===void 0&&(this.ε=Object.values(this.coords)[1].refRange[1]/1e5);let t=Bp(e,Rp),n=Math.abs(t.M)<this.ε;return[t.J,n?0:t.M,n?null:t.h]},toBase(e){return zp({J:e[0],M:e[1],h:e[2]},Rp)}}),Hp=of.D65,Up=216/24389,Wp=24389/27;function Gp(e){return 116*(e>Up?Math.cbrt(e):(Wp*e+16)/116)-16}function Kp(e){return e>8?((e+16)/116)**3:e/Wp}function qp(e,t){let[n,r,i]=e,a=[],o=0;if(i===0)return[0,0,0];let s=Kp(i);o=i>0?.00379058511492914*i**2+.608983189401032*i+.9155088574762233:9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;let c=0,l=1/0,u=[0,0,0];for(;c<=15;){a=zp({J:o,C:r,h:n},t);let e=Math.abs(a[1]-s);if(e<l){if(e<=2e-12)return a;u=a,l=e}o-=(a[1]-s)*o/(2*a[1]),c+=1}return u}function Jp(e,t){let n=Gp(e[1]);if(n===0)return[0,0,0];let r=Bp(e,Yp);return[wf(r.h),r.C,n]}var Yp=Lp(Hp,200/Math.PI*Kp(50),Kp(50)*100,`average`,!1),Xp=new Y({id:`hct`,name:`HCT`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},c:{refRange:[0,145],name:`Colorfulness`},t:{refRange:[0,100],name:`Tone`}},base:gf,fromBase(e){this.ε===void 0&&(this.ε=Object.values(this.coords)[1].refRange[1]/1e5);let t=Jp(e,Yp);return t[1]<this.ε&&(t[1]=0,t[0]=null),t},toBase(e){return qp(e,Yp)},formats:{color:{id:`--hct`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}});180/Math.PI;var Zp=Math.PI/180,Qp=[1,.007,.0228];function $p(e){e[1]<0&&(e=Xp.fromBase(Xp.toBase(e)));let t=Math.log(Math.max(1+Qp[2]*e[1]*Yp.flRoot,1))/Qp[2],n=e[0]*Zp,r=t*Math.cos(n),i=t*Math.sin(n);return[e[2],r,i]}function em(e,t){[e,t]=J([e,t]);let[n,r,i]=$p(Xp.from(e)),[a,o,s]=$p(Xp.from(t));return Math.sqrt((n-a)**2+(r-o)**2+(i-s)**2)}var{cos:Z,sin:Q,sqrt:tm,atan2:nm,exp:rm,abs:im,pow:am,PI:om}=Math,sm=[[1.000042977349746,20718877053183e-18,-4361018085669474e-20],[26946201090235744e-21,.9999906145080147,-14898828405401079e-21],[-7941753620756204e-21,12875204405137254e-21,.9997859822609763]],cm=[[.9999570254019492,-2071874272730964e-20,4361733292468361e-20],[-2694517763358666e-20,1.000009385946497,1490098223546482e-20],[7943459292954202e-21,-1287824596735154e-20,1.000214063706999]],lm=[[.7212986433113499,.45344826541531813,-.19288975751942616],[-.788211869495579,1.795241376757236,.0876172451181785],[-.0917700599912156,.45765588659459255,1.2922045513917677]],um=[[1.065107295808859,-.3150044075301121,.1803492381741039],[.4721107713837796,.4271995765962455,.04150680489380985],[-.09156391926309541,-.1736709363194979,.7719790382558294]],dm=[.47229813098762524,.5149184096354483,.5113233386366979],fm=[2.1173067060606283,1.9420552485353544,1.9557096741686448],pm={CAT_TO_HELM:sm,CAT_FROM_HELM:cm,M1:lm,M1_INV:um,M2:[[-.26355622180094096,.4168322883703174,.4926763141656403],[1.8897570508777322,-3.1212232034205774,1.0421666921060384],[.3585108617962056,1.7694028193790368,-1.4120626067695372]],M2_INV:[[.9183897822815021,.5232051237088666,.7065804598090856],[1.0899090574433026,.07005324849041904,.4319776874787044],[1.598895729264209,.22061850068770233,.012506037355220951]]},mm=-.02833024015436984,hm=-.21131429516166544,gm=.2189784817615645,_m=-.06871898981942523,vm=.005506053349515315,ym=-.0641329861299175,bm=-.053592461436994296,xm=-.00954137464208059,Sm=.2676231133101982,Cm=.8934892185255707,wm=.7173169828841472,Tm=.6915224124600773,Em=.48647127559605596,Dm=.9853124591201782,Om=.5385456675962418,km=.12508858146241716,Am=.6768950256217603,jm=-.4963251525324449,Mm=-.09564696283240552,Nm=-.029053748937210654,Pm=1.3346761652952872,Fm=-.1698908144723919,Im=-.195370576218515,Lm=.5330819227283227,Rm=.08863325582067766,zm=.9365540137751136,Bm=.13789738139719568,Vm=.061650260197979936,Hm=.0641970862504494,Um=-.027401052793571013,Wm=-.09900209889026965,Gm=.059635520647228726,Km=-.013586499967803128,qm=.2253393118474472,Jm=-1.5239477450767043,Ym=-1.751157310240011,Xm=-.43576378069144767,Zm=1.060094063845983,Qm=.47931193034584496,$m=-.2622579649434462,eh=.13610794232685908,th=.1168702235362288,nh=-.01617739641422492,rh=.038145638815030566,ih=-28.2*om/180,ah=Z(ih),oh=Q(ih);function sh(e){return mm*Z(e)+hm*Q(e)+gm*Z(2*e)+_m*Q(2*e)+vm*Z(3*e)+ym*Q(3*e)+bm*Z(4*e)+xm*Q(4*e)}function ch(e){return .02833024015436984*Q(e)+hm*Z(e)+-2*gm*Q(2*e)+2*_m*Z(2*e)+-3*vm*Q(3*e)+3*ym*Z(3*e)+-4*bm*Q(4*e)+4*xm*Z(4*e)}function lh(e){return rm(Im*Z(e)+Lm*Q(e)+Rm*Z(2*e)+zm*Q(2*e)+Bm*Z(3*e)+Vm*Q(3*e)+Hm*Z(4*e)+Um*Q(4*e))}function uh(e){let t=e-.5;return rm(Vd(-30,Jm*t+Ym*t*t,30))}function dh(e,t){let n=Xm*Z(e)+Zm*Q(e)+Qm*Z(2*e)+$m*Q(2*e);return rm(Vd(-30,(t-.5)*n,30))}function fh(e){return rm(eh*Z(e)+th*Q(e)+nh*Z(2*e)+rh*Q(2*e))}function ph(e){return 1+Wm*Z(e)+Gm*Q(e)+Km*Z(2*e)+qm*Q(2*e)}function mh(e,t){let n=e*(1-e),r=e+Om*n+km*n*(.5-e)+Am*n*n;return r+=n*(jm*Z(t)+Mm*Q(t)),r}function hh(e,t){let n=jm*Z(t)+Mm*Q(t),r=e;for(let t=0;t<15;t++){let t=r*(1-r),i=1-2*r,a=r+(Om+n)*t+km*t*(.5-r)+Am*t*t-e,o=1+(Om+n)*i+km*(i*(.5-r)-t)+Am*2*t*i;im(o)<1e-10&&(o=1),r-=a/o}return r}function gh(e,t){let n=Nm+Pm*Z(t)+Fm*Q(t),r=e<1?1-e:0;return e*rm(Vd(-30,n*e*r*r,30))}function _h(e,t){let n=Nm+Pm*Z(t)+Fm*Q(t),r=e;for(let t=0;t<12;t++){let t=r<1?1-r:0,i=rm(Vd(-30,n*r*t*t,30)),a=r*i-e,o=n*t*(1-3*r),s=i*(1+r*o);im(s)<1e-10&&(s=1),r-=a/s}return r}var vh=function(e){let[t,n,r]=G(G(e,pm.CAT_TO_HELM),pm.M1),[i,a,o]=G([q(t,dm[0]),q(n,dm[1]),q(r,dm[2])],pm.M2),s=nm(o,a),c=tm(a*a+o*o),l=sh(s),u=s+l;a=c*Z(u),o=c*Q(u);let d=Sm*am(tm(a*a+o*o),Vd(.01,Cm,10)),f=nm(o,a),p=1+wm*Z(f)+Tm*Q(f)+Em*Z(2*f)+Dm*Q(2*f);i+=d*p,s=nm(o,a),i=mh(i,s),s=nm(o,a),i=gh(i,s),s=nm(o,a);let m=lh(s);a*=m,o*=m,s=nm(o,a),c=tm(a*a+o*o);let h=ph(s),g=c>0?am(c,h):0;a=g*Z(s),o=g*Q(s);let _=uh(i);a*=_,o*=_,s=nm(o,a);let v=dh(s,i);a*=v,o*=v,s=nm(o,a),i*=fh(s);let y=a*ah-o*oh,b=a*oh+o*ah;return[i,y,b]},yh=function(e){let[t,n,r]=e,i=n*ah+r*oh,a=-n*oh+r*ah;n=i,r=a;let o=nm(r,n);t/=fh(o),o=nm(r,n);let s=dh(o,t);n/=s,r/=s;let c=uh(t);n/=c,r/=c,o=nm(r,n);let l=tm(n*n+r*r),u=ph(o),d=l>0?am(l,1/u):0;n=d*Z(o),r=d*Q(o),o=nm(r,n);let f=lh(o);n/=f,r/=f,o=nm(r,n),t=_h(t,o),o=nm(r,n),t=hh(t,o);let p=Sm*am(tm(n*n+r*r),Vd(.01,Cm,10)),m=nm(r,n),h=1+wm*Z(m)+Tm*Q(m)+Em*Z(2*m)+Dm*Q(2*m);t-=p*h;let g=nm(r,n);l=tm(n*n+r*r);let _=g;for(let e=0;e<8;e++){let e=_+sh(_)-g,t=1+ch(_);im(t)<1e-10&&(t=1),_-=e/t}n=l*Z(_),r=l*Q(_);let[v,y,b]=G([t,n,r],pm.M2_INV);return G(G([q(v,fm[0]),q(y,fm[1]),q(b,fm[2])],pm.M1_INV),pm.CAT_FROM_HELM)},bh=new Y({id:`helmlab-metric`,name:`Helmlab MetricSpace`,cssId:`--helmlab-metric`,coords:{l:{refRange:[0,1.6],name:`Lightness`},a:{refRange:[-1.5,1.5]},b:{refRange:[-1.5,1.5]}},white:`D65`,base:gf,M:pm,fromBase(e){return vh(e)},toBase(e){return yh(e)}}),xh=-.9155125151657894,Sh=2.9268353744941558,Ch=3.966003089807536,wh=1.9737081170404969,Th=52.473130649294724,Eh=.47897301074925214;function Dh(e,t){[e,t]=J([e,t]);let[n,r,i]=bh.from(e),[a,o,s]=bh.from(t),c=n-a,l=r-o,u=i-s,d=1+xh*((n+a)*.5-.5)**2,f=1+Sh*((Math.sqrt(r**2+i**2)+Math.sqrt(o**2+s**2))*.5),p=(c**2/d**2+Ch*(l**2+u**2)/f**2)**(wh/2);return(p/(1+Th*p))**Eh}var Oh={deltaE76:Gf,deltaECMC:qf,deltaE2000:Mf,deltaEJz:up,deltaEITP:Sp,deltaEOK:Ff,deltaEOK2:Cp,deltaEHCT:em,deltaEHelmlab:Dh};function kh(e){return Math.max(parseFloat(`1e${(e?Math.floor(Math.log10(Math.abs(e))):0)-2}`),1e-6)}var Ah={hct:{method:`hct.c`,jnd:2,deltaEMethod:`hct`,blackWhiteClamp:{}},"hct-tonal":{method:`hct.c`,jnd:0,deltaEMethod:`hct`,blackWhiteClamp:{channel:`hct.t`,min:0,max:100}}};function jh(e,{method:t=tf.gamut_mapping,space:n=void 0,deltaEMethod:r=``,jnd:i=2,blackWhiteClamp:a=void 0}={}){if(e=J(e),Nd(arguments[1])?n=arguments[1]:n||=e.space,n=Y.get(n),Lf(e,n,{epsilon:0}))return e;let o;if(t===`css`)o=Nh(e,{space:n});else if(t===`raytrace`)o=Fh(e,{space:n});else{if(t!==`clip`){Object.prototype.hasOwnProperty.call(Ah,t)&&({method:t,jnd:i,deltaEMethod:r,blackWhiteClamp:a}=Ah[t]);let s=Mf;if(r!==``){for(let e in Oh)if(`deltae`+r.toLowerCase()===e.toLowerCase()){s=Oh[e];break}}i===0&&(i=1e-16);let c=jh(X(e,n),{method:`clip`,space:n});if(s(e,c)>i){if(a&&Object.keys(a).length===3){let t=Y.resolveCoord(a.channel),n=zf(X(e,t.space),t.id);if(K(n)&&(n=0),n>=a.max)return X({space:`xyz-d65`,coords:of.D65},e.space);if(n<=a.min)return X({space:`xyz-d65`,coords:[0,0,0]},e.space)}let r=Y.resolveCoord(t),c=r.space,l=r.id,u=X(e,c);u.coords.forEach((e,t)=>{K(e)&&(u.coords[t]=0)});let d=(r.range||r.refRange)[0],f=kh(i),p=d,m=zf(u,l);for(;m-p>f;){let e=Uf(u);e=jh(e,{space:n,method:`clip`}),s(u,e)-i<f?p=zf(u,l):m=zf(u,l),Hf(u,l,(p+m)/2)}o=X(u,n)}else o=c}else o=X(e,n);if(t===`clip`||!Lf(o,n,{epsilon:0})){let e=Object.values(n.coords).map(e=>e.range||[]);o.coords=o.coords.map((t,n)=>{let[r,i]=e[n];return r!==void 0&&(t=Math.max(r,t)),i!==void 0&&(t=Math.min(t,i)),t})}}return n!==e.space&&(o=X(o,e.space)),e.coords=o.coords,e}jh.returns=`color`;var Mh={WHITE:{space:Pf,coords:[1,0,0],alpha:1},BLACK:{space:Pf,coords:[0,0,0],alpha:1}};function Nh(e,{space:t}={}){let n=.02,r=1e-4;if(e=J(e),t||=e.space,t=Y.get(t),t.isUnbounded)return X(e,t);let i=X(e,Bf),a=i.coords[0];if(a>=1){let n=X(Mh.WHITE,t);return n.alpha=e.alpha,X(n,t)}if(a<=0){let n=X(Mh.BLACK,t);return n.alpha=e.alpha,X(n,t)}if(Lf(i,t,{epsilon:0}))return X(i,t);function o(e){let n=X(e,t),r=Object.values(t.coords);return n.coords=n.coords.map((e,t)=>{if(`range`in r[t]){let[n,i]=r[t].range;return Vd(n,e,i)}return e}),n}let s=0,c=i.coords[1],l=!0,u=Uf(i),d=o(u),f=Ff(d,u);if(f<n)return d;for(;c-s>r;){let e=(s+c)/2;if(u.coords[1]=e,l&&Lf(u,t,{epsilon:0}))s=e;else if(d=o(u),f=Ff(d,u),f<n){if(n-f<r)break;l=!1,s=e}else c=e}return d}function Ph(e,t,n=[0,0,0],r=[1,1,1]){let i=1/0,a=-1/0,o=[];for(let s=0;s<3;s++){let c=e[s],l=t[s]-c,u=n[s],d=r[s];if(o.push(l),Math.abs(l)>1e-12){let e=1/l,t=(u-c)*e,n=(d-c)*e;a=Math.max(Math.min(t,n),a),i=Math.min(Math.max(t,n),i)}else if(c<u||c>d)return[]}return a>i||i<0||(a<0&&(a=i),!isFinite(a))?[]:[e[0]+o[0]*a,e[1]+o[1]*a,e[2]+o[2]*a]}function Fh(e,{space:t}={}){if(e=J(e),t||=e.space,t=Y.get(t),t.isUnbounded)return X(e,t);let n=X(e,Bf),[r,i,a]=n.coords;if(r>=1){let n=X(Mh.WHITE,t);return n.alpha=e.alpha,X(n,t)}if(r<=0){let n=X(Mh.BLACK,t);return n.alpha=e.alpha,X(n,t)}let o=t,s=t.rgbGamut;if(s!==void 0&&(t=s),!Gd(t,_f))throw Error(`An RGB gamut is required`);let[c,l]=Object.values(t.coords)[0].range,u=[l,l,l],d=t.linearGamut;d!==void 0&&(l=X({space:t,coords:u,alpha:e.alpha},d).coords[0],u=[l,l,l],t=d,c=Object.values(t.coords)[0].range[0]);let f=[c,c,c],p=X(n,t);if(!p.coords.every(e=>c<=e&&e<=l)){let e=X({space:Bf,coords:[r,0,a]},t).coords,n=c+1e-12,i=l-1e-12,o=p.coords;for(let s=0;s<4;s++){if(s){let e=X(p,Bf);e.coords[0]=r,e.coords[2]=a,p=X(e,t)}let c=Ph(e,p.coords,f,u);if(c.length===0){p.coords=[...o];break}s&&p.coords.every(e=>n<e&&e<i)&&(e=[...p.coords]),o=c,p.coords=[...c]}}p=X(p,o);let m=Object.values(o.coords);return p.coords=p.coords.map((e,t)=>{if(`range`in m[t]){let[n,r]=m[t].range;return Vd(n,e,r)}return e}),p}var Ih=class extends Y{constructor(e){let t=Y.get(e.base),n=e.chroma??`c`,r=Object.keys(t.coords),i=r.indexOf(n);if(i===-1)throw TypeError(`GamutRelativeColorSpace needs a "${n}" coordinate, got ${t.id}`);let a=Object.fromEntries(Object.entries(t.coords).map(([e,t])=>[e,{...t}]));a[n].range=[0,1],delete a[n].refRange,e.coords??=a,e.formats??={color:{coords:r.map(e=>{if(t.coords[e].type===`angle`)return`<number> | <angle>`;let[r,i]=t.coords[e].range??t.coords[e].refRange??[];return e===n||r===0&&i===1?`<percentage> | <number>`:`<number> | <percentage>`})}},super(e),this.chromaIndex=i,this.method=`${t.id}.${n}`;let o=[[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0]];this.oogChroma=1.01*Math.max(...o.map(e=>t.from(this.gamutSpace,e)[this.chromaIndex]||0))}maxChroma(e){let t=[...e];return t[this.chromaIndex]=this.oogChroma,jh({space:this.base,coords:t},{space:this.gamutSpace,method:this.method,deltaEMethod:`OK`,jnd:0}).coords[this.chromaIndex]}toBase(e){return e=[...e],e.some((e,t)=>t!==this.chromaIndex&&K(e))?e[this.chromaIndex]!==0&&(e[this.chromaIndex]=null):K(e[this.chromaIndex])||(e[this.chromaIndex]*=this.maxChroma(e)),e}fromBase(e){if(e=[...e],e.some((e,t)=>t!==this.chromaIndex&&K(e)))e[this.chromaIndex]!==0&&(e[this.chromaIndex]=null);else if(!K(e[this.chromaIndex])){let t=this.maxChroma(e);e[this.chromaIndex]=t?e[this.chromaIndex]/t:0}return e}};function Lh(e,t={}){if(Array.isArray(e))return e.map(e=>Lh(e,t));let{cssProperty:n=`background-color`,element:r,...i}=t,a=null;try{return J(e,i)}catch(e){a=e}let{CSS:o,getComputedStyle:s}=globalThis;if(Nd(e)&&r&&o&&s&&o.supports(n,e)){let t=r.style[n];e!==t&&(r.style[n]=e);let o=s(r).getPropertyValue(n);if(e!==t&&(r.style[n]=t),o!==e)try{return J(o,i)}catch(e){a=e}else a={message:`Color value is a valid CSS color, but it could not be resolved :(`}}return t.errorMeta&&(t.errorMeta.error=a),null}function Rh(e,t={}){let{precision:n=tf.precision,format:r,inGamut:i=!0,coords:a,alpha:o,commas:s}=t,c,l=J(e),u=r,d=l.parseMeta;d&&!r&&(d.format.canSerialize()&&(r=d.format,u=d.formatId),a??=d.types,o??=d.alphaType,s??=d.commas),u&&(r=l.space.getFormat(r)??Y.findFormat(u)),r||(r=l.space.getFormat(`default`)??Y.DEFAULT_FORMAT,u=r.name),r&&r.space&&r.space!==l.space&&(l=X(l,r.space));let f=l.coords.slice();if(i||=r.toGamut,i&&!Lf(l)&&(f=jh(Uf(l),i===!0?void 0:i).coords),r.type===`custom`){if(r.serialize)c=r.serialize(f,l.alpha,t);else throw TypeError(`format ${u} can only be used to parse colors, not for serialization`)}else{let e=r.name||`color`,t=r.serializeCoords(f,n,a);if(e===`color`){let e=r.id||r.ids?.[0]||l.space.cssId||l.space.id;t.unshift(e)}let i=l.alpha;o!==void 0&&typeof o!=`object`&&(o=typeof o==`string`?{type:o}:{include:o});let u=o?.type??`<number>`,d=o?.include===!0||r.alpha===!0||o?.include!==!1&&r.alpha!==!1&&i<1,p=``;if(s??=r.commas,d){if(n!==null){let e;u===`<percentage>`&&(e=`%`,i*=100),i=Fd(i,{precision:n,unit:e})}p=`${s?`,`:` /`} ${i}`}c=`${e}(${t.join(s?`, `:` `)}${p})`}return c}var zh={toXYZ:[[.6369580483012914,.14461690358620832,.1688809751641721],[.2627002120112671,.6779980715188708,.05930171646986196],[0,.028072693049087428,1.060985057710791]],fromXYZ:[[1.716651187971268,-.355670783776392,-.25336628137366],[-.666684351832489,1.616481236634939,.0157685458139111],[.017639857445311,-.042770613257809,.942103121235474]]},Bh=new _f({id:`rec2020-linear`,cssId:`--rec2020-linear`,name:`Linear REC.2020`,white:`D65`,M:zh}),Vh=new _f({id:`rec2020`,name:`REC.2020`,base:Bh,linearGamut:Bh,toBase(e){return e.map(function(e){let t=e<0?-1:1;return t*(e*t)**2.4})},fromBase(e){return e.map(function(e){let t=e<0?-1:1;return t*(e*t)**(1/2.4)})}}),Hh=new _f({id:`p3-linear`,cssId:`display-p3-linear`,name:`Linear P3`,white:`D65`,M:{toXYZ:[[.4865709486482162,.26566769316909306,.1982172852343625],[.2289745640697488,.6917385218365064,.079286914093745],[0,.04511338185890264,1.043944368900976]],fromXYZ:[[2.493496911941425,-.9313836179191239,-.40271078445071684],[-.8294889695615747,1.7626640603183463,.023624685841943577],[.03584583024378447,-.07617238926804182,.9568845240076872]]}}),Uh={toXYZ:[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],fromXYZ:[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]]},Wh=new _f({id:`srgb-linear`,name:`Linear sRGB`,white:`D65`,M:Uh}),Gh={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]},Kh=[,,,].fill(`<percentage> | <number>[0, 255]`),qh=[,,,].fill(`<number>[0, 255]`),Jh=new _f({id:`srgb`,name:`sRGB`,base:Wh,linearGamut:Wh,fromBase:e=>e.map(e=>{let t=e<0?-1:1,n=e*t;return n>.0031308?t*(1.055*n**(1/2.4)-.055):12.92*e}),toBase:e=>e.map(e=>{let t=e<0?-1:1,n=e*t;return n<=.04045?e/12.92:t*((n+.055)/1.055)**2.4}),formats:{rgb:{coords:Kh},rgb_number:{name:`rgb`,commas:!0,coords:qh,alpha:!1},color:{},rgba:{coords:Kh,commas:!0,alpha:!0},rgba_number:{name:`rgba`,commas:!0,coords:qh},hex:{type:`custom`,toGamut:!0,test:e=>/^#(([a-f0-9]{2}){3,4}|[a-f0-9]{3,4})$/i.test(e),parse(e){e.length<=5&&(e=e.replace(/[a-f0-9]/gi,`$&$&`));let t=[];return e.replace(/[a-f0-9]{2}/gi,e=>{t.push(parseInt(e,16)/255)}),{spaceId:`srgb`,coords:t.slice(0,3),alpha:t.slice(3)[0]}},serialize:(e,t,{collapse:n=!0,alpha:r}={})=>{(r!==!1&&t<1||r===!0)&&e.push(t),e=e.map(e=>Math.round(e*255));let i=n&&e.every(e=>e%17==0);return`#`+e.map(e=>i?(e/17).toString(16):e.toString(16).padStart(2,`0`)).join(``)}},keyword:{type:`custom`,test:e=>/^[a-z]+$/i.test(e),parse(e){e=e.toLowerCase();let t={spaceId:`srgb`,coords:null,alpha:1};if(e===`transparent`?(t.coords=Gh.black,t.alpha=0):t.coords=Gh[e],t.coords)return t}}}}),Yh=new _f({id:`p3`,cssId:`display-p3`,name:`P3`,base:Hh,linearGamut:Hh,fromBase:Jh.fromBase,toBase:Jh.toBase});tf.display_space=Jh;var Xh;if(typeof CSS<`u`&&CSS.supports)for(let e of[Cf,Vh,Yh]){let t=Rh({space:e,coords:e.getMinCoords(),alpha:1});if(CSS.supports(`color`,t)){tf.display_space=e;break}}function Zh(e,{space:t,supports:n=globalThis.CSS?.supports,...r}={}){e=J(e);let i=Rh(e,r);if(!n||n(`color`,i)||!tf.display_space)i=new String(i),i.color=e;else{let a=e;if((e.coords.some(K)||K(e.alpha))&&!(Xh??=n(`color`,`hsl(none 50% 50%)`))&&(a=Uf(e),a.coords=a.coords.map(Id),a.alpha=Id(a.alpha),i=Rh(a,r),n(`color`,i)))return i=new String(i),i.color=a,i;if(t===void 0){t=a.space;let e=t.displaySpaces??t.bases;!t.displaySpaces&&!t.id.startsWith(`xyz-`)&&(e=e.filter(e=>!e.id.startsWith(`xyz-`)));for(let t of e){let e=X(a,t),o=Rh(e,r);if(n(`color`,o))return i=new String(o),i.color=e,i}t=tf.display_space}a=X(a,t),i=new String(Rh(a,r)),i.color=a}return i}function Qh(e,t,{space:n,hue:r=`shorter`}={}){e=J(e),n||=e.space,n=Y.get(n);let i=Object.values(n.coords);[e,t]=[e,t].map(e=>X(e,n));let[a,o]=[e,t].map(e=>e.coords),s=a.map((e,t)=>{let n=i[t],a=o[t];return n.type===`angle`&&([e,a]=Tf(r,[e,a])),$h(e,a)}),c=$h(e.alpha,t.alpha);return{space:n,coords:s,alpha:c}}function $h(e,t){return K(e)||K(t)?e===t?null:0:e-t}function eg(e,t){return e=J(e),t=J(t),e.space===t.space&&e.alpha===t.alpha&&e.coords.every((e,n)=>e===t.coords[n])}var tg=t({getLuminance:()=>ng,register:()=>ig,setLuminance:()=>rg});function ng(e){return zf(e,[gf,`y`])}function rg(e,t){Hf(e,[gf,`y`],t)}function ig(e){Object.defineProperty(e.prototype,"luminance",{get(){return ng(this)},set(e){rg(this,e)}})}function ag(e,t){e=J(e),t=J(t);let n=Math.max(ng(e),0),r=Math.max(ng(t),0);return r>n&&([n,r]=[r,n]),(n+.05)/(r+.05)}var og=.56,sg=.57,cg=.62,lg=.65,ug=.022,dg=1.414,fg=.1,pg=5e-4,mg=1.14,hg=.027,gg=1.14;function _g(e){return e>=ug?e:e+(ug-e)**dg}function vg(e){return(e<0?-1:1)*Math.abs(e)**2.4}function yg(e,t){t=J(t),e=J(e);let n,r,i,a,o,s;t=X(t,`srgb`),[a,o,s]=t.coords.map(e=>K(e)?0:e);let c=vg(a)*.2126729+vg(o)*.7151522+vg(s)*.072175;e=X(e,`srgb`),[a,o,s]=e.coords.map(e=>K(e)?0:e);let l=vg(a)*.2126729+vg(o)*.7151522+vg(s)*.072175,u=_g(c),d=_g(l),f=d>u;return Math.abs(d-u)<pg?r=0:f?(n=d**og-u**sg,r=n*mg):(n=d**lg-u**cg,r=n*gg),i=Math.abs(r)<fg?0:r>0?r-hg:r+hg,i*100}function bg(e,t){e=J(e),t=J(t);let n=Math.max(ng(e),0),r=Math.max(ng(t),0);r>n&&([n,r]=[r,n]);let i=n+r;return i===0?0:(n-r)/i}var xg=5e4;function Sg(e,t){e=J(e),t=J(t);let n=Math.max(ng(e),0),r=Math.max(ng(t),0);return r>n&&([n,r]=[r,n]),r===0?xg:(n-r)/r}function Cg(e,t){e=J(e),t=J(t);let n=zf(e,[Cf,`l`]),r=zf(t,[Cf,`l`]);return Math.abs(n-r)}var wg=216/24389,Tg=24/116,Eg=24389/27,Dg=of.D65,Og=new Y({id:`lab-d65`,name:`Lab D65`,coords:{l:{refRange:[0,100],name:`Lightness`},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:Dg,base:gf,fromBase(e){let t=e.map((e,t)=>e/Dg[t]).map(e=>e>wg?Math.cbrt(e):(Eg*e+16)/116);return[116*t[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])]},toBase(e){let t=[];return t[1]=(e[0]+16)/116,t[0]=e[1]/500+t[1],t[2]=t[1]-e[2]/200,[t[0]>Tg?t[0]**3:(116*t[0]-16)/Eg,e[0]>8?((e[0]+16)/116)**3:e[0]/Eg,t[2]>Tg?t[2]**3:(116*t[2]-16)/Eg].map((e,t)=>e*Dg[t])},formats:{"lab-d65":{coords:[`<number> | <percentage>`,`<number> | <percentage>`,`<number> | <percentage>`]}}}),kg=5**.5*.5+.5;function Ag(e,t){e=J(e),t=J(t);let n=zf(e,[Og,`l`]),r=zf(t,[Og,`l`]),i=Math.abs(n**+kg-r**+kg)**(1/kg)*Math.SQRT2-40;return i<7.5?0:i}var jg=t({contrastAPCA:()=>yg,contrastDeltaPhi:()=>Ag,contrastLstar:()=>Cg,contrastMichelson:()=>bg,contrastWCAG21:()=>ag,contrastWeber:()=>Sg});function Mg(e,t,n){Nd(n)&&(n={algorithm:n});let{algorithm:r,...i}=n||{};if(!r){let e=Object.keys(jg).map(e=>e.replace(/^contrast/,``)).join(`, `);throw TypeError(`contrast() function needs a contrast algorithm. Please specify one of: ${e}`)}e=J(e),t=J(t);for(let n in jg)if(`contrast`+r.toLowerCase()===n.toLowerCase())return jg[n](e,t,i);throw TypeError(`Unknown contrast algorithm: ${r}`)}var Ng=t({register:()=>Ig,uv:()=>Pg,xy:()=>Fg});function Pg(e){let[t,n,r]=Rf(e,gf),i=t+15*n+3*r;return[4*t/i,9*n/i]}function Fg(e){let[t,n,r]=Rf(e,gf),i=t+n+r;return[t/i,n/i]}function Ig(e){Object.defineProperty(e.prototype,"uv",{get(){return Pg(this)}}),Object.defineProperty(e.prototype,"xy",{get(){return Fg(this)}})}function Lg(e,t,n={}){Nd(n)&&(n={method:n});let{method:r=tf.deltaE,...i}=n;for(let n in Oh)if(`deltae`+r.toLowerCase()===n.toLowerCase())return Oh[n](e,t,i);throw TypeError(`Unknown deltaE method: ${r}`)}var Rg=t({darken:()=>Bg,lighten:()=>zg});function zg(e,t=.25){return Hf(e,[Y.get(`oklch`,`lch`),`l`],e=>e*(1+t))}function Bg(e,t=.25){return Hf(e,[Y.get(`oklch`,`lch`),`l`],e=>e*(1-t))}zg.returns=`color`,Bg.returns=`color`;var Vg=t({isRange:()=>Kg,mix:()=>Hg,range:()=>Wg,register:()=>qg,steps:()=>Ug});function Hg(e,t,n,r={}){return[e,t]=[J(e),J(t)],Pd(n)===`object`&&([n,r]=[.5,n]),Wg(e,t,r)(n??.5)}function Ug(e,t,n={}){let r;Kg(e)&&([r,n]=[e,t],[e,t]=r.rangeArgs.colors);let{maxDeltaE:i,deltaEMethod:a,steps:o=2,maxSteps:s=1e3,...c}=n;r||=([e,t]=[J(e),J(t)],Wg(e,t,c));let l=Lg(e,t,a),u=i>0?Math.max(o,Math.ceil(l/i)+1):o,d=[];if(s!==void 0&&(u=Math.min(u,s)),u===1)d=[{p:.5,color:r(.5)}];else{let e=1/(u-1);d=Array.from({length:u},(t,n)=>{let i=n*e;return{p:i,color:r(i)}})}if(i>0){let e=d.reduce((e,t,n)=>{if(n===0)return 0;let r=Lg(t.color,d[n-1].color,a);return Math.max(e,r)},0);for(;e>i;){e=0;for(let t=1;t<d.length&&d.length<s;t++){let n=d[t-1],i=d[t],o=(i.p+n.p)/2,s=r(o);e=Math.max(e,Lg(s,n.color,a),Lg(s,i.color,a)),d.splice(t,0,{p:o,color:r(o)}),t++}}}return d=d.map(e=>e.color),d}function Wg(e,t,n={}){if(Kg(e)){let[n,r]=[e,t];return Wg(...n.rangeArgs.colors,{...n.rangeArgs.options,...r})}let{space:r,outputSpace:i,progression:a,premultiplied:o}=n;e=J(e),t=J(t),e=Uf(e),t=Uf(t);let s={colors:[e,t],options:n};r=r?Y.get(r):Y.registry[tf.interpolationSpace]||e.space,i=i?Y.get(i):r,e=X(e,r),t=X(t,r),e=jh(e),t=jh(t);let c=r.hueId,l=r.hueIndex;if(c){let i=n.hue=n.hue||`shorter`,a=[r,c],[o,s]=[zf(e,a),zf(t,a)];K(o)&&!K(s)?o=s:K(s)&&!K(o)&&(s=o),[o,s]=Tf(i,[o,s]),Hf(e,a,o),Hf(t,a,s)}return K(e.alpha)&&!K(t.alpha)?e.alpha=t.alpha:K(t.alpha)&&!K(e.alpha)&&(t.alpha=e.alpha),o&&(e.coords=Gg(e.coords,e.alpha,l),t.coords=Gg(t.coords,t.alpha,l)),Object.assign(n=>{n=a?a(n):n;let s=e.coords.map((e,r)=>{let i=t.coords[r];return Rd(e,i,n)}),c=Rd(e.alpha,t.alpha,n),u={space:r,coords:s,alpha:c};return o&&(u.coords=Gg(u.coords,c,l,!0)),i!==r&&(u=X(u,i)),u},{rangeArgs:s})}function Gg(e,t,n,r=!1){return K(t)||r&&t===0?e:e.map((e,i)=>i===n||K(e)?e:r?e/t:e*t)}function Kg(e){return Pd(e)===`function`&&!!e.rangeArgs}tf.interpolationSpace=`lab`;function qg(e){e.defineFunction(`mix`,Hg,{returns:`color`}),e.defineFunction(`range`,Wg,{returns:`function<color>`}),e.defineFunction(`steps`,Ug,{returns:`array<color>`})}var Jg=new Y({id:`hsl`,name:`HSL`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:Jh,rgbGamut:Jh,fromBase:e=>{let t=Math.max(...e),n=Math.min(...e),[r,i,a]=e,[o,s,c]=[null,0,(n+t)/2],l=t-n;if(l!==0){switch(s=c===0||c===1?0:(t-c)/Math.min(c,1-c),t){case r:o=(i-a)/l+(i<a?6:0);break;case i:o=(a-r)/l+2;break;case a:o=(r-i)/l+4}o*=60}return s<0&&(o+=180,s=Math.abs(s)),o>=360&&(o-=360),[o,s*100,c*100]},toBase:e=>{let[t,n,r]=e;t%=360,t<0&&(t+=360),n/=100,r/=100;function i(e){let i=(e+t/30)%12,a=n*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(i-3,9-i,1))}return[i(0),i(8),i(4)]},formats:{hsl:{coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]},hsla:{coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`],commas:!0,alpha:!0}}}),Yg=new Y({id:`hsl-p3`,cssId:`--hsl-p3`,name:`HSL P3`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:Yh,rgbGamut:Yh,fromBase:Jg.fromBase,toBase:Jg.toBase}),Xg=new Y({id:`hsl-rec2020`,cssId:`--hsl-rec2020`,name:`HSL Rec.2020`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:Vh,rgbGamut:Vh,fromBase:Jg.fromBase,toBase:Jg.toBase}),Zg=new Y({id:`hsv`,name:`HSV`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},v:{range:[0,100],name:`Value`}},base:Jh,rgbGamut:Jh,fromBase(e){let t=Math.max(...e),n=Math.min(...e),[r,i,a]=e,[o,s,c]=[null,0,t],l=t-n;if(l!==0){switch(t){case r:o=(i-a)/l+(i<a?6:0);break;case i:o=(a-r)/l+2;break;case a:o=(r-i)/l+4}o*=60}return c&&(s=l/c),o>=360&&(o-=360),[o,s*100,c*100]},toBase(e){let[t,n,r]=e;t%=360,t<0&&(t+=360),n/=100,r/=100;function i(e){let i=(e+t/60)%6;return r-r*n*Math.max(0,Math.min(i,4-i,1))}return[i(5),i(3),i(1)]},formats:{color:{id:`--hsv`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),Qg=new Y({id:`hwb`,name:`HWB`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},w:{range:[0,100],name:`Whiteness`},b:{range:[0,100],name:`Blackness`}},base:Zg,rgbGamut:Jh,fromBase(e){let[t,n,r]=e;return[t,r*(100-n)/100,100-r]},toBase(e){let[t,n,r]=e;n/=100,r/=100;let i=n+r;if(i>=1)return[t,0,n/i*100];let a=1-r;return[t,(a===0?0:1-n/a)*100,a*100]},formats:{hwb:{coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),$g=new _f({id:`a98rgb-linear`,cssId:`--a98-rgb-linear`,name:`Linear Adobe® 98 RGB compatible`,white:`D65`,M:{toXYZ:[[.5766690429101305,.1855582379065463,.1882286462349947],[.29734497525053605,.6273635662554661,.07529145849399788],[.02703136138641234,.07068885253582723,.9913375368376388]],fromXYZ:[[2.0415879038107465,-.5650069742788596,-.34473135077832956],[-.9692436362808795,1.8759675015077202,.04155505740717557],[.013444280632031142,-.11836239223101838,1.0151749943912054]]}}),e_=new _f({id:`a98rgb`,cssId:`a98-rgb`,name:`Adobe® 98 RGB compatible`,base:$g,linearGamut:$g,toBase:e=>e.map(e=>Math.abs(e)**(563/256)*Math.sign(e)),fromBase:e=>e.map(e=>Math.abs(e)**(256/563)*Math.sign(e))}),t_=new _f({id:`prophoto-linear`,cssId:`--prophoto-rgb-linear`,name:`Linear ProPhoto`,white:`D50`,base:vf,M:{toXYZ:[[.7977666449006423,.13518129740053308,.0313477341283922],[.2880748288194013,.711835234241873,8993693872564e-17],[0,0,.8251046025104602]],fromXYZ:[[1.3457868816471583,-.25557208737979464,-.05110186497554526],[-.5446307051249019,1.5082477428451468,.02052744743642139],[0,0,1.2119675456389452]]}}),n_=1/512,r_=16/512,i_=new _f({id:`prophoto`,cssId:`prophoto-rgb`,name:`ProPhoto`,base:t_,linearGamut:t_,toBase(e){return e.map(e=>{let t=e<0?-1:1,n=e*t;return n<r_?e/16:t*n**1.8})},fromBase(e){return e.map(e=>{let t=e<0?-1:1,n=e*t;return n>=n_?t*n**(1/1.8):16*e})}}),a_=1.09929682680944,o_=.018053968510807,s_=new _f({id:`--rec2020-oetf`,name:`REC.2020_Scene_Referred`,base:Bh,linearGamut:Bh,referred:`scene`,toBase(e){return e.map(function(e){let t=e<0?-1:1,n=e*t;return n<o_*4.5?e/4.5:t*((n+a_-1)/a_)**(1/.45)})},fromBase(e){return e.map(function(e){let t=e<0?-1:1,n=e*t;return n>=o_?t*(a_*n**.45-.09929682680944008):4.5*e})}}),c_=new Ih({id:`oklch-p3`,cssId:`--oklch-p3`,name:`OKLCh P3`,base:Bf,gamutSpace:Yh}),l_=new Ih({id:`oklch-srgb`,cssId:`--oklch-srgb`,name:`OKLCh sRGB`,base:Bf,gamutSpace:Jh}),u_=new Ih({id:`oklch-rec2020`,cssId:`--oklch-rec2020`,name:`OKLCh Rec.2020`,base:Bf,gamutSpace:Vh}),d_=new Ih({id:`lch-p3`,cssId:`--lch-p3`,name:`LCH P3`,base:Ef,gamutSpace:Yh}),f_=new Ih({id:`lch-srgb`,cssId:`--lch-srgb`,name:`LCH sRGB`,base:Ef,gamutSpace:Jh}),p_=new Ih({id:`lch-rec2020`,cssId:`--lch-rec2020`,name:`LCH Rec.2020`,base:Ef,gamutSpace:Vh}),m_=2*Math.PI,h_={...Pf.M,toLMS:[[.4122214694707629,.5363325372617349,.0514459932675022],[.2119034958178251,.6806995506452344,.1073969535369405],[.0883024591900564,.2817188391361215,.6299787016738222]],toSRGBLinear:[[4.076741636075958,-3.307711539258063,.2309699031821043],[-1.2684379732850315,2.609757349287688,-.341319376002657],[-.0041960761386756,-.7034186179359362,1.7076146940746117]]},g_=[[[-1.8817031,-.80936501],[1.19086277,1.76576728,.59662641,.75515197,.56771245]],[[1.8144408,-1.19445267],[.73956515,-.45954404,.08285427,.12541073,-.14503204]],[[.13110758,1.81333971],[1.35733652,-.00915799,-1.1513021,-.50559606,.00692167]]],__=Number.MAX_VALUE,v_=.206,y_=.03,b_=1.206/1.03;function x_(e,t){let n=e.length;if(n!==t.length)throw Error(`Vectors of size ${n} and ${t.length} are not aligned`);let r=0;return e.forEach((e,n)=>{r+=e*t[n]}),r}function S_(e){return .5*(b_*e-v_+Math.sqrt((b_*e-v_)*(b_*e-v_)+4*y_*b_*e))}function C_(e){return(e**2+v_*e)/(b_*(e+y_))}function w_(e){let[t,n]=e;return[n/t,n/(1-t)]}function T_(e,t){return[.11516993+1/(7.4477897+4.1590124*t+e*(-2.19557347+1.75198401*t+e*(-2.13704948-10.02301043*t+e*(-4.24894561+5.38770819*t+4.69891013*e)))),.11239642+1/(1.6132032-.68124379*t+e*(.40370612+.90148123*t+e*(-.27087943+.6122399*t+e*(.00299215-.45399568*t-.14661872*e))))]}function E_(e,t){let n=G(e,h_.LabtoLMS);return n[0]**=3,n[1]**=3,n[2]**=3,G(n,t,n)}function D_(e,t,n,r){let i=A_(e,t,n,r),a=E_([1,i*e,i*t],n),o=q(1/Math.max(...a),1/3);return[o,o*i]}function O_(e,t,n,r,i,a,o,s){let c;if(s===void 0&&(s=D_(e,t,a,o)),(n-i)*s[1]-(s[0]-i)*r<=0)c=s[1]*i/(r*s[0]+s[1]*(i-n));else{c=s[1]*(i-1)/(r*(s[0]-1)+s[1]*(i-n));let o=n-i,l=r,u=x_(h_.LabtoLMS[0].slice(1),[e,t]),d=x_(h_.LabtoLMS[1].slice(1),[e,t]),f=x_(h_.LabtoLMS[2].slice(1),[e,t]),p=o+l*u,m=o+l*d,h=o+l*f,g=i*(1-c)+c*n,_=c*r,v=g+_*u,y=g+_*d,b=g+_*f,x=v**3,S=y**3,C=b**3,w=3*p*v**2,T=3*m*y**2,ee=3*h*b**2,te=6*p**2*v,ne=6*m**2*y,re=6*h**2*b,ie=x_(a[0],[x,S,C])-1,E=x_(a[0],[w,T,ee]),ae=x_(a[0],[te,ne,re]),oe=E/(E*E-.5*ie*ae),se=-ie*oe,ce=x_(a[1],[x,S,C])-1,le=x_(a[1],[w,T,ee]),ue=x_(a[1],[te,ne,re]),de=le/(le*le-.5*ce*ue),fe=-ce*de,pe=x_(a[2],[x,S,C])-1,me=x_(a[2],[w,T,ee]),he=x_(a[2],[te,ne,re]),ge=me/(me*me-.5*pe*he),_e=-pe*ge;se=oe>=0?se:__,fe=de>=0?fe:__,_e=ge>=0?_e:__,c+=Math.min(se,Math.min(fe,_e))}return c}function k_(e,t,n){let[r,i,a]=e,o=D_(i,a,t,n),s=O_(i,a,r,1,r,t,n,o),c=w_(o),l=s/Math.min(r*c[0],(1-r)*c[1]),u=T_(i,a),d=r*u[0],f=(1-r)*u[1],p=.9*l*Math.sqrt(Math.sqrt(1/(1/d**4+1/f**4)));return d=r*.4,f=(1-r)*.8,[Math.sqrt(1/(1/d**2+1/f**2)),p,s]}function A_(e,t,n,r){let i,a,o,s,c,l,u,d;x_(r[0][0],[e,t])>1?([i,a,o,s,c]=r[0][1],[l,u,d]=n[0]):x_(r[1][0],[e,t])>1?([i,a,o,s,c]=r[1][1],[l,u,d]=n[1]):([i,a,o,s,c]=r[2][1],[l,u,d]=n[2]);let f=i+a*e+o*t+s*e**2+c*e*t,p=x_(h_.LabtoLMS[0].slice(1),[e,t]),m=x_(h_.LabtoLMS[1].slice(1),[e,t]),h=x_(h_.LabtoLMS[2].slice(1),[e,t]),g=1+f*p,_=1+f*m,v=1+f*h,y=g**3,b=_**3,x=v**3,S=3*p*g**2,C=3*m*_**2,w=3*h*v**2,T=6*p**2*g,ee=6*m**2*_,te=6*h**2*v,ne=l*y+u*b+d*x,re=l*S+u*C+d*w,ie=l*T+u*ee+d*te;return f-=ne*re/(re**2-.5*ne*ie),f}function j_(e,t,n){let[r,i,a]=e,o=C_(a),s=null,c=null;if(r=wf(r)/360,o!==0&&o!==1&&i!==0){let e=Math.cos(m_*r),a=Math.sin(m_*r),[l,u,d]=k_([o,e,a],t,n),f=.8,p,m,h,g;i<f?(p=1.25*i,m=0,h=f*l,g=1-h/u):(p=5*(i-.8),m=u,h=.2*u**2*1.25**2/l,g=1-h/(d-u));let _=m+p*h/(1-g*p);s=_*e,c=_*a}return[o,s,c]}function M_(e,t,n){let r=e[0],i=0,a=S_(r),o=Math.sqrt(e[1]**2+e[2]**2),s=.5+Math.atan2(-e[2],-e[1])/m_;if(a!==0&&a!==1&&o!==0){let[a,s,c]=k_([r,e[1]/o,e[2]/o],t,n),l=.8,u,d,f,p;o<s?(d=l*a,f=1-d/s,p=o/(d+f*o),i=p*l):(u=s,d=.2*s**2*1.25**2/a,f=1-d/(c-s),p=(o-u)/(d+f*(o-u)),i=l+.2*p)}let c=Math.abs(i)<1e-4;return c||a===0||Math.abs(1-a)<1e-7?(s=null,c||(i=0)):s=wf(s*360),[s,i,a]}var N_=new Y({id:`okhsl`,name:`Okhsl`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,1],name:`Saturation`},l:{range:[0,1],name:`Lightness`}},base:Pf,gamutSpace:`self`,M:h_,fromBase(e){return M_(e,h_.toSRGBLinear,g_)},toBase(e){return j_(e,h_.toSRGBLinear,g_)},formats:{color:{id:`--okhsl`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}});N_.rgbGamut=new _f({id:`okhsl-prism`,cssId:`--okhsl-prism`,name:`Okhsl Prism`,base:N_,fromBase(e){return Jg.toBase([e[0],e[1]*100,e[2]*100])},toBase(e){let t=Jg.fromBase(e);return t[1]/=100,t[2]/=100,t}});var P_=new Y({id:`oklrab`,name:`Oklrab`,coords:{l:{refRange:[0,1],name:`Lightness`},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:`D65`,base:Pf,fromBase(e){return[S_(e[0]),e[1],e[2]]},toBase(e){return[C_(e[0]),e[1],e[2]]},formats:{color:{coords:[`<percentage> | <number>`,`<number> | <percentage>[-1,1]`,`<number> | <percentage>[-1,1]`]}}}),F_=new Y({id:`oklrch`,name:`Oklrch`,coords:{l:{refRange:[0,1],name:`Lightness`},c:{refRange:[0,.4],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},white:`D65`,base:P_,fromBase:Ef.fromBase,toBase:Ef.toBase,formats:{color:{coords:[`<percentage> | <number>`,`<number> | <percentage>[0,1]`,`<number> | <angle>`]}}}),I_={toSRGBLinear:N_.M.toSRGBLinear};function L_(e,t,n){let[r,i,a]=e;r=wf(r)/360;let o=C_(a),s=null,c=null;if(o!==0&&i!==0){let e=Math.cos(m_*r),l=Math.sin(m_*r),[u,d]=w_(D_(e,l,t,n)),f=.5,p=1-f/u,m=1-i*f/(f+d-d*p*i),h=i*d*f/(f+d-d*p*i);o=a*m;let g=a*h,_=C_(m),v=h*_/m,y=C_(o);g=g*y/o,o=y;let[b,x,S]=E_([_,e*v,l*v],t),C=q(1/Math.max(Math.max(b,x),Math.max(S,0)),1/3);o*=C,g*=C,s=g*e,c=g*l}return[o,s,c]}function R_(e,t,n){let r=e[0],i=0,a=S_(r),o=Math.sqrt(e[1]**2+e[2]**2),s=.5+Math.atan2(-e[2],-e[1])/m_;if(r!==0&&r!==1&&o!==0){let s=e[1]/o,c=e[2]/o,[l,u]=w_(D_(s,c,t,n)),d=.5,f=1-d/l,p=u/(o+r*u),m=p*r,h=p*o,g=C_(m),_=h*g/m,[v,y,b]=E_([g,s*_,c*_],t),x=q(1/Math.max(Math.max(v,y),Math.max(b,0)),1/3);r/=x,o/=x,o=o*S_(r)/r,r=S_(r),a=r/m,i=(d+u)*h/(u*d+u*f*h)}return s=Math.abs(i)<1e-4||a===0?null:wf(s*360),[s,i,a]}var z_=new Y({id:`okhsv`,name:`Okhsv`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,1],name:`Saturation`},v:{range:[0,1],name:`Value`}},base:Pf,gamutSpace:`self`,M:I_,fromBase(e){return R_(e,I_.toSRGBLinear,g_)},toBase(e){return L_(e,I_.toSRGBLinear,g_)},formats:{color:{id:`--okhsv`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}});z_.rgbGamut=new _f({id:`okhsv-prism`,cssId:`--okhsv-prism`,name:`Okhsv Prism`,base:z_,fromBase(e){return Jg.toBase([e[0],e[1]*100,e[2]*100])},toBase(e){let t=Jg.fromBase(e);return t[1]/=100,t[2]/=100,t}});var B_=of.D65,V_=216/24389,H_=24389/27,[U_,W_]=Pg({space:gf,coords:B_}),G_=new Y({id:`luv`,name:`Luv`,coords:{l:{refRange:[0,100],name:`Lightness`},u:{refRange:[-215,215]},v:{refRange:[-215,215]}},white:B_,base:gf,fromBase(e){let t=[Id(e[0]),Id(e[1]),Id(e[2])],n=t[1],[r,i]=Pg({space:gf,coords:t});if(!Number.isFinite(r)||!Number.isFinite(i))return[0,0,0];let a=n<=V_?H_*n:116*Math.cbrt(n)-16;return[a,13*a*(r-U_),13*a*(i-W_)]},toBase(e){let[t,n,r]=e;if(t===0||K(t))return[0,0,0];n=Id(n),r=Id(r);let i=n/(13*t)+U_,a=r/(13*t)+W_,o=t<=8?t/H_:((t+16)/116)**3;return[o*(9*i/(4*a)),o,o*((12-3*i-20*a)/(4*a))]},formats:{color:{id:`--luv`,coords:[`<number> | <percentage>`,`<number> | <percentage>`,`<number> | <percentage>`]}}}),K_=new Y({id:`lchuv`,name:`LChuv`,coords:{l:{refRange:[0,100],name:`Lightness`},c:{refRange:[0,220],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:G_,fromBase:Ef.fromBase,toBase:Ef.toBase,formats:{color:{id:`--lchuv`,coords:[`<number> | <percentage>`,`<number> | <percentage>`,`<number> | <angle>`]}}}),q_=216/24389,J_=24389/27,Y_=Uh.fromXYZ,X_=Y_[0][0],Z_=Y_[0][1],Q_=Y_[0][2],$_=Y_[1][0],ev=Y_[1][1],tv=Y_[1][2],nv=Y_[2][0],rv=Y_[2][1],iv=Y_[2][2];function av(e,t,n){let r=t/(Math.sin(n)-e*Math.cos(n));return r<0?1/0:r}function ov(e){let t=(e+16)**3/1560896,n=t>q_?t:e/J_,r=n*(284517*X_-94839*Q_),i=n*(838422*Q_+769860*Z_+731718*X_),a=n*(632260*Q_-126452*Z_),o=n*(284517*$_-94839*tv),s=n*(838422*tv+769860*ev+731718*$_),c=n*(632260*tv-126452*ev),l=n*(284517*nv-94839*iv),u=n*(838422*iv+769860*rv+731718*nv),d=n*(632260*iv-126452*rv);return{r0s:r/a,r0i:i*e/a,r1s:r/(a+126452),r1i:(i-769860)*e/(a+126452),g0s:o/c,g0i:s*e/c,g1s:o/(c+126452),g1i:(s-769860)*e/(c+126452),b0s:l/d,b0i:u*e/d,b1s:l/(d+126452),b1i:(u-769860)*e/(d+126452)}}function sv(e,t){let n=t/360*Math.PI*2,r=av(e.r0s,e.r0i,n),i=av(e.r1s,e.r1i,n),a=av(e.g0s,e.g0i,n),o=av(e.g1s,e.g1i,n),s=av(e.b0s,e.b0i,n),c=av(e.b1s,e.b1i,n);return Math.min(r,i,a,o,s,c)}var cv=new Y({id:`hsluv`,name:`HSLuv`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:K_,gamutSpace:Jh,rgbGamut:Jh,fromBase(e){let[t,n,r]=[Id(e[0]),Id(e[1]),Id(e[2])],i;return t>99.9999999?(i=0,t=100):t<1e-8?(i=0,t=0):i=n/sv(ov(t),r)*100,[r,i,t]},toBase(e){let[t,n,r]=[Id(e[0]),Id(e[1]),Id(e[2])],i;return r>99.9999999?(r=100,i=0):r<1e-8?(r=0,i=0):i=sv(ov(r),t)/100*n,[r,i,t]},formats:{color:{id:`--hsluv`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),lv=Uh.fromXYZ;lv[0][0],lv[0][1],lv[0][2],lv[1][0],lv[1][1],lv[1][2],lv[2][0],lv[2][1],lv[2][2];function uv(e,t){return Math.abs(t)/Math.sqrt(e**2+1)}function dv(e){let t=uv(e.r0s,e.r0i),n=uv(e.r1s,e.r1i),r=uv(e.g0s,e.g0i),i=uv(e.g1s,e.g1i),a=uv(e.b0s,e.b0i),o=uv(e.b1s,e.b1i);return Math.min(t,n,r,i,a,o)}var fv=new Y({id:`hpluv`,name:`HPLuv`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:K_,gamutSpace:`self`,fromBase(e){let[t,n,r]=[Id(e[0]),Id(e[1]),Id(e[2])],i;return t>99.9999999?(i=0,t=100):t<1e-8?(i=0,t=0):i=n/dv(ov(t))*100,[r,i,t]},toBase(e){let[t,n,r]=[Id(e[0]),Id(e[1]),Id(e[2])],i;return r>99.9999999?(r=100,i=0):r<1e-8?(r=0,i=0):i=dv(ov(r))/100*n,[r,i,t]},formats:{color:{id:`--hpluv`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}});fv.rgbGamut=new _f({id:`hpluv-prism`,cssId:`--hpluv-prism`,name:`HPLuv Prism`,base:fv,fromBase(e){return Jg.toBase(e)},toBase(e){return Jg.fromBase(e)}});var pv=.021,mv=Math.sqrt(pv/3),hv=mv*mv*mv,gv=.978,_v=.058,vv=264.5*Math.PI/180,yv=.7,bv=.37,xv={M1:[[.8154832155941288,.36033406153856506,-.12434135574228214],[.03301008352745078,.9292865057066169,.03612192716575443],[.04818827356456861,.2642841575338424,.6334971784195534]],M1_INV:[[1.2325947975032656,-.5557590239287523,.2736201534771583],[-.040801327874216024,1.112228863738653,-.07142753586443781],[-.07673825928337766,-.42172784577108585,1.5875238558143416]],M2:[[.21193779684470104,.7992121834263127,-.00410075161564345],[2.4672018828033475,-2.9877348024830788,.520532919679731],[-.11390787868068575,1.3932982808117473,-1.279390402131062]],M2_INV:[[.9930001151336143,.32599327253052285,.1294508563171392],[.9930001151336139,-.08708353111074627,-.03861361743004929],[.9930001151336136,-.12386097008215022,-.8351991365871061]]},Sv=[0,.05,.1,.15,.2,.25,.3,.35,.4,.45,.5,.55,.6,.65,.7,.75,.8,.85,.9,.95,1],Cv=[0,.009494013522189627,.02564569838030986,.055259661658689105,.10574901531227408,.16055853320726027,.21405964892993756,.26786230508811226,.3220435246104499,.3739052098520243,.43020997780918835,.4835465162128873,.5399824670411353,.5956710081330342,.6542161666450478,.7115380216519989,.7702762412711669,.8293313467712837,.889406386197059,.9462829573474728,1],wv=Sv.length;function Tv(e){let t=e/(2*hv),n=2*mv*Math.sinh(Math.asinh(t)/3),r=n*n*n+pv*n-e,i=3*n*n+pv,a=6*n,o=2*i*i-r*a;return Math.abs(o)>1e-30&&(n-=2*r*i/o),n}function Ev(e){return e*e*e+pv*e}function Dv(e){let t=Math.max(0,Math.min(1,(e-bv)/.63));return Math.sin(Math.PI*t)**2}function Ov(e,t,n){let r=Math.sqrt(t*t+n*n);if(r<1e-12)return[t,n];let i=Dv(e);if(i<1e-12)return[t,n];let a=Math.atan2(n,t),o=a-vv;o-=Math.round(o/(2*Math.PI))*2*Math.PI;let s=Math.exp(-.5*(o/yv)**2),c=a+_v*i*s;return[r*Math.cos(c),r*Math.sin(c)]}function kv(e,t,n){let r=Math.sqrt(t*t+n*n);if(r<1e-12)return[t,n];let i=Dv(e);if(i<1e-12)return[t,n];let a=Math.atan2(n,t),o=yv*yv,s=_v*i,c=a;for(let e=0;e<8;e++){let e=c-vv;e-=Math.round(e/(2*Math.PI))*2*Math.PI;let t=Math.exp(-.5*e*e/o),n=c+s*t-a,r=1+s*t*(-e/o),i=s*t*(-1/o+e*e/(o*o)),l=2*r*r-n*i;Math.abs(l)>1e-30&&(c-=2*n*r/l)}return[r*Math.cos(c),r*Math.sin(c)]}function Av(e){if(e<=0||e>=1)return e;let t=0,n=wv-1;for(;n-t>1;){let r=t+n>>1;Sv[r]<=e?t=r:n=r}let r=(e-Sv[t])/(Sv[n]-Sv[t]);return Cv[t]+r*(Cv[n]-Cv[t])}function jv(e){if(e<=Cv[0]||e>=Cv[wv-1])return e;let t=0,n=wv-1;for(;n-t>1;){let r=t+n>>1;Cv[r]<=e?t=r:n=r}let r=(e-Cv[t])/(Cv[n]-Cv[t]);return Sv[t]+r*(Sv[n]-Sv[t])}var Mv=new Y({id:`helmgen`,name:`HelmGen`,cssId:`--helmgen`,coords:{l:{refRange:[0,1],name:`Lightness`},a:{refRange:[-.6,.6]},b:{refRange:[-.6,.6]}},white:`D65`,base:gf,M:xv,fromBase(e){let t=G(e,xv.M1),n=Tv(Math.max(t[0],0)),r=Tv(Math.max(t[1],0)),i=Tv(Math.max(t[2],0));{let e=(n+r+i)/3,t=(Math.max(n,r,i)-Math.min(n,r,i))/Math.max(Math.abs(e),1e-30),a=Math.exp(-((t/1e-5)**2));n+=a*(e-n),r+=a*(e-r),i+=a*(e-i)}let[a,o,s]=G([n,r,i],xv.M2);{let e=Math.sqrt(o*o+s*s);if(e>1e-12){let t=e**+gv/e;o*=t,s*=t}}return a=Av(a),[o,s]=Ov(a,o,s),[a,o,s]},toBase(e){let[t,n,r]=e;[n,r]=kv(t,n,r),t=jv(t);{let e=Math.sqrt(n*n+r*r);if(e>1e-12){let t=e**(1/gv)/e;n*=t,r*=t}}let[i,a,o]=G([t,n,r],xv.M2_INV);{let e=(i+a+o)/3,t=(Math.max(i,a,o)-Math.min(i,a,o))/Math.max(Math.abs(e),1e-30),n=Math.exp(-((t/1e-5)**2));i+=n*(e-i),a+=n*(e-a),o+=n*(e-o)}return G([Ev(i),Ev(a),Ev(o)],xv.M1_INV)}}),Nv=new Y({id:`helmgenlch`,name:`HelmGenLCh`,cssId:`--helmgenlch`,coords:{l:{refRange:[0,1],name:`Lightness`},c:{refRange:[0,.65],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},white:`D65`,base:Mv,fromBase:Ef.fromBase,toBase:Ef.toBase}),Pv=new _f({id:`rec2100-linear`,name:`Linear REC.2100`,white:`D65`,M:zh}),Fv=203,Iv=2610/2**14,Lv=2**14/2610,Rv=2523/32,zv=32/2523,Bv=3424/4096,Vv=2413/128,Hv=2392/128,Uv=new _f({id:`rec2100pq`,cssId:`rec2100-pq`,name:`REC.2100-PQ`,base:Pv,linearGamut:Pv,toBase(e){return e.map(function(e){return(Math.max(e**zv-Bv,0)/(Vv-Hv*e**zv))**Lv*1e4/Fv})},fromBase(e){return e.map(function(e){let t=Math.max(e*Fv/1e4,0);return((Bv+Vv*t**Iv)/(1+Hv*t**Iv))**Rv})}}),Wv=.17883277,Gv=.28466892,Kv=.55991073,qv=3.7743,Jv=new _f({id:`rec2100hlg`,cssId:`rec2100-hlg`,name:`REC.2100-HLG`,referred:`scene`,base:Pv,linearGamut:Pv,toBase(e){return e.map(function(e){return e<=.5?e**2/3*qv:(Math.exp((e-Kv)/Wv)+Gv)/12*qv})},fromBase(e){return e.map(function(e){return e/=qv,e<=1/12?q(3*e,.5):Wv*Math.log(12*e-Gv)+Kv})}}),Yv={};ef.add(`chromatic-adaptation-start`,e=>{e.options.method&&(e.M=Zv(e.W1,e.W2,e.options.method))}),ef.add(`chromatic-adaptation-end`,e=>{e.M||=Zv(e.W1,e.W2,e.options.method)});function Xv({id:e,toCone_M:t,fromCone_M:n}){Yv[e]=arguments[0]}function Zv(e,t,n=`Bradford`){let r=Yv[n],[i,a,o]=Ad(r.toCone_M,e),[s,c,l]=Ad(r.toCone_M,t),u=Ad([[s/i,0,0],[0,c/a,0],[0,0,l/o]],r.toCone_M);return Ad(r.fromCone_M,u)}Xv({id:`von Kries`,toCone_M:[[.40024,.7076,-.08081],[-.2263,1.16532,.0457],[0,0,.91822]],fromCone_M:[[1.8599363874558397,-1.1293816185800916,.21989740959619328],[.3611914362417676,.6388124632850422,-6370596838649899e-21],[0,0,1.0890636230968613]]}),Xv({id:`Bradford`,toCone_M:[[.8951,.2664,-.1614],[-.7502,1.7135,.0367],[.0389,-.0685,1.0296]],fromCone_M:[[.9869929054667121,-.14705425642099013,.15996265166373122],[.4323052697233945,.5183602715367774,.049291228212855594],[-.00852866457517732,.04004282165408486,.96848669578755]]}),Xv({id:`CAT02`,toCone_M:[[.7328,.4296,-.1624],[-.7036,1.6975,.0061],[.003,.0136,.9834]],fromCone_M:[[1.0961238208355142,-.27886900021828726,.18274517938277307],[.4543690419753592,.4735331543074117,.07209780371722911],[-.009627608738429355,-.00569803121611342,1.0153256399545427]]}),Xv({id:`CAT16`,toCone_M:[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],fromCone_M:[[1.862067855087233,-1.0112546305316845,.14918677544445172],[.3875265432361372,.6214474419314753,-.008973985167612521],[-.01584149884933386,-.03412293802851557,1.0499644368778496]]}),Object.assign(of,{A:[1.0985,1,.35585],C:[.98074,1,1.18232],D55:[.95682,1,.92149],D75:[.94972,1,1.22638],E:[1,1,1],F2:[.99186,1,.67393],F7:[.95041,1,1.08747],F11:[1.00962,1,.6435]}),of.ACES=[.32168/.33767,1,.34065/.33767];var Qv=new _f({id:`acescg`,cssId:`--acescg`,name:`ACEScg`,coords:{r:{range:[0,65504],name:`Red`},g:{range:[0,65504],name:`Green`},b:{range:[0,65504],name:`Blue`}},referred:`scene`,white:of.ACES,M:{toXYZ:[[.6624541811085053,.13400420645643313,.1561876870049078],[.27222871678091454,.6740817658111484,.05368951740793705],[-.005574649490394108,.004060733528982826,1.0103391003129971]],fromXYZ:[[1.6410233796943257,-.32480329418479,-.23642469523761225],[-.6636628587229829,1.6153315916573379,.016756347685530137],[.011721894328375376,-.008284441996237409,.9883948585390215]]}}),$v=2**-16,ey=-.35828683,ty=(Math.log2(65504)+9.72)/17.52,ny=new _f({id:`acescc`,cssId:`--acescc`,name:`ACEScc`,coords:{r:{range:[ey,ty],name:`Red`},g:{range:[ey,ty],name:`Green`},b:{range:[ey,ty],name:`Blue`}},referred:`scene`,base:Qv,linearGamut:Qv,toBase(e){return e.map(function(e){return e<=-.3013698630136986?(2**(e*17.52-9.72)-$v)*2:e<ty?2**(e*17.52-9.72):65504})},fromBase(e){return e.map(function(e){return e<=0?(Math.log2($v)+9.72)/17.52:e<$v?(Math.log2($v+e*.5)+9.72)/17.52:(Math.log2(e)+9.72)/17.52})}}),ry=t({A98RGB:()=>e_,A98RGB_Linear:()=>$g,ACEScc:()=>ny,ACEScg:()=>Qv,CAM16_JMh:()=>Vp,HCT:()=>Xp,HPLuv:()=>fv,HSL:()=>Jg,HSL_P3:()=>Yg,HSL_REC2020:()=>Xg,HSLuv:()=>cv,HSV:()=>Zg,HWB:()=>Qg,HelmGen:()=>Mv,HelmGenLCh:()=>Nv,Helmlab:()=>bh,ICTCP:()=>yp,JzCzHz:()=>lp,Jzazbz:()=>cp,LCH:()=>Ef,LCH_P3:()=>d_,LCH_REC_2020:()=>p_,LCH_sRGB:()=>f_,LCHuv:()=>K_,Lab:()=>Cf,Lab_D65:()=>Og,Luv:()=>G_,OKLCH:()=>Bf,OKLCH_P3:()=>c_,OKLCH_REC_2020:()=>u_,OKLCH_sRGB:()=>l_,OKLab:()=>Pf,OKLrCH:()=>F_,OKLrab:()=>P_,Okhsl:()=>N_,Okhsv:()=>z_,P3:()=>Yh,P3_Linear:()=>Hh,ProPhoto:()=>i_,ProPhoto_Linear:()=>t_,REC_2020:()=>Vh,REC_2020_Linear:()=>Bh,REC_2020_Scene_Referred:()=>s_,REC_2100_HLG:()=>Jv,REC_2100_Linear:()=>Pv,REC_2100_PQ:()=>Uv,XYZ_ABS_D65:()=>Yf,XYZ_D50:()=>vf,XYZ_D65:()=>gf,sRGB:()=>Jh,sRGB_Linear:()=>Wh}),iy=class e{constructor(...e){let t;if(e.length===1){let n={};typeof e[0]==`object`&&Object.getPrototypeOf(e[0]).constructor===Object&&(e[0]={...e[0]}),t=J(e[0],{parseMeta:n}),n.format&&(this.parseMeta=n)}let n,r,i;t?(n=t.space||t.spaceId,r=t.coords,i=t.alpha):[n,r,i]=e,Object.defineProperty(this,"space",{value:Y.get(n),writable:!1,enumerable:!0,configurable:!0}),this.coords=r?r.slice():[0,0,0],this.alpha=K(i)?i:i===void 0?1:Vd(0,i,1);for(let e in this.space.coords)Object.defineProperty(this,e,{get:()=>this.get(e),set:t=>this.set(e,t)})}get spaceId(){return this.space.id}clone(){return new e(this.space,this.coords,this.alpha)}toJSON(){return{spaceId:this.spaceId,coords:this.coords,alpha:this.alpha}}display(...t){let n=Zh(this,...t);return n.color=new e(n.color),n}static get(t,...n){return Gd(t,this)?t:new e(t,...n)}static try(t,n){if(Gd(t,this))return t;let r=Lh(t,n);return r?new e(r):null}static defineFunction(t,n,r=n){let{instance:i=!0,returns:a}=r,o=function(...t){let r=n(...t);if(a===`color`)r=e.get(r);else if(a===`function<color>`){let t=r;r=function(...n){let r=t(...n);return e.get(r)},Object.assign(r,t)}else a===`array<color>`&&(r=r.map(t=>e.get(t)));return r};t in e||(e[t]=o),i&&(e.prototype[t]=function(...e){return o(this,...e)})}static defineFunctions(t){for(let n in t)e.defineFunction(n,t[n],t[n])}static extend(t){if(t.register)t.register(e);else for(let n in t)e.defineFunction(n,t[n])}};iy.defineFunctions({get:zf,getAll:Rf,set:Hf,setAll:Vf,to:X,equals:eg,inGamut:Lf,toGamut:jh,distance:Wf,deltas:Qh,toString:Rh}),Object.assign(iy,{util:Md,hooks:ef,WHITES:of,Space:Y,spaces:Y.registry,parse:lf,defaults:tf});for(let e of Object.keys(ry))Y.register(ry[e]);for(let e in Y.registry)ay(e,Y.registry[e]);ef.add(`colorspace-init-end`,e=>{ay(e.id,e),e.aliases?.forEach(t=>{ay(t,e)})});function ay(e,t){let n=e.replace(/-/g,`_`);Object.defineProperty(iy.prototype,n,{get(){let n=this.getAll(e);if(typeof Proxy>`u`)return n;let r=new Proxy(n,{has:(e,n)=>{try{return Y.resolveCoord([t,n]),!0}catch{}return Reflect.has(e,n)},get:(e,n,i)=>{if(n&&typeof n!=`symbol`&&!(n in e)&&n in r){let{index:r}=Y.resolveCoord([t,n]);if(r>=0)return e[r]}return Reflect.get(e,n,i)},set:(n,r,i,a)=>{if(r&&typeof r!=`symbol`&&!(r in n)||Number(r)>=0){let{index:a}=Y.resolveCoord([t,r]);if(a>=0)return n[a]=i,this.setAll(e,n),!0}return Reflect.set(n,r,i,a)}});return r},set(t){this.setAll(e,t)},configurable:!0,enumerable:!0})}iy.extend(Oh),iy.extend({deltaE:Lg}),Object.assign(iy,{deltaEMethods:Oh}),iy.extend(Rg),iy.extend({contrast:Mg}),iy.extend(Ng),iy.extend(tg),iy.extend(Vg),iy.extend(jg);var oy=iy;function sy(e,t=1,n=!1){return`hsla(${e}, ${n?50:65}%, ${n?60:40}%, ${t})`}function cy(e,t=1,n=!1){let r=0;for(let t=0;t<e.length;t++)r=e.charCodeAt(t)+((r<<5)-r);return sy((r%360+360)%360,t,n)}var ly=[`vite-plugin-`,`rollup-plugin-`,`webpack-plugin-`,`unplugin-`,`nuxt-`,`eslint-plugin-`,`postcss-`,`vite:`,`rollup:`,`rolldown:`,`webpack:`,`__`];function uy(e){let t=e.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`);return RegExp(`^(?:@[^/]+\\/)?(?:${t})`)}uy(ly);function dy(e,t){let[n,r,i]=new oy(e).to(`srgb`).coords.map(e=>Math.round(Math.max(0,Math.min(1,e??0))*255));return`rgba(${n}, ${r}, ${i}, ${t})`}var fy=I({__name:`DisplayBadge`,props:{text:{},color:{type:[Boolean,Number,String],default:!0},variant:{default:`subtle`},icon:{},as:{},colorScheme:{},rounded:{default:`md`},paddingX:{default:.5},paddingY:{default:.25}},setup(e){let t=e;function n(e){return/^#|^hsl|^rgb|^var\(/.test(e)}let r=kd(()=>t.colorScheme),i=W(()=>r.value===`dark`),a=W(()=>typeof t.color==`string`&&!n(t.color)),o=W(()=>{let{color:e,text:r}=t;if(typeof e==`number`)return sy(e,1,i.value);if(typeof e==`string`&&n(e))return e;if(e===!0&&r)return cy(r,1,i.value)}),s=W(()=>{let{color:e,text:r}=t;if(typeof e==`number`)return sy(e,t.variant===`solid`?1:.12,i.value);if(typeof e==`string`&&n(e))return t.variant===`solid`?e:dy(e,.12);if(e===!0&&r)return cy(r,t.variant===`solid`?1:.12,i.value)}),c=W(()=>{let{color:e,text:r}=t;if(typeof e==`number`)return sy(e,.2,i.value);if(typeof e==`string`&&n(e))return t.variant===`solid`?e:dy(e,.2);if(e===!0&&r)return cy(r,.2,i.value)}),l=W(()=>{let e={padding:`${t.paddingY}em ${t.paddingX}em`,...typeof t.rounded==`number`?{borderRadius:`${t.rounded}em`}:{}};return o.value?t.variant===`solid`?{...e,color:`#fff`,background:s.value,border:`1px solid ${s.value}`}:a.value?{...e,color:o.value,background:s.value}:{...e,color:o.value,background:s.value,border:`1px solid ${c.value}`}:e}),u=W(()=>a.value?`badge-color-${t.color}`:t.color===!1?`bg-#8881 color-muted`:``),d=W(()=>typeof t.rounded==`number`?``:t.rounded===`full`?`rounded-full`:`rounded-md`);return(t,n)=>(R(),B(ac(e.as||`span`),{class:M([`leading-none font-medium inline-flex gap-1 items-center`,[d.value,u.value]]),style:zi(l.value)},{default:gs(()=>[e.icon?(R(),z(`span`,{key:0,class:M(e.icon),"aria-hidden":`true`},null,2)):U(``,!0),lc(t.$slots,`default`,{},()=>[Hl(N(e.text),1)])]),_:3},8,[`class`,`style`]))}}),py=typeof navigator<`u`&&/mac|iphone|ipad|ipod/i.test(navigator.platform||navigator.userAgent),my={mod:py?`meta`:`ctrl`,cmd:`meta`,command:`meta`,super:`meta`,win:`meta`,meta:`meta`,ctrl:`ctrl`,control:`ctrl`,alt:`alt`,option:`alt`,opt:`alt`,shift:`shift`},hy={esc:`Escape`,escape:`Escape`,enter:`Enter`,return:`Enter`,space:` `,tab:`Tab`,up:`ArrowUp`,down:`ArrowDown`,left:`ArrowLeft`,right:`ArrowRight`},gy=[`ctrl`,`alt`,`shift`,`meta`];function _y(e){let t=e.trim().split(`+`).map(e=>e.trim()).filter(Boolean),n=new Set,r=``;for(let e of t){let t=e.toLowerCase(),i=my[t];i==null?r=hy[t]??(e.length===1?e.toLowerCase():e):n.add(i)}return{modifiers:gy.filter(e=>n.has(e)),key:r}}function vy(e){return e.trim().split(/\s+/).filter(Boolean).map(_y)}var yy={meta:`⌘`,ctrl:`⌃`,alt:`⌥`,shift:`⇧`},by={meta:`Win`,ctrl:`Ctrl`,alt:`Alt`,shift:`Shift`},xy={Enter:`↵`,Escape:`Esc`,ArrowUp:`↑`,ArrowDown:`↓`,ArrowLeft:`←`,ArrowRight:`→`," ":`Space`};function Sy(e){let t=e.modifiers.map(e=>(py?yy[e]:by[e])??e),n=xy[e.key]??(e.key.length===1?e.key.toUpperCase():e.key);return[...t,n]}function Cy(e){return vy(e).flatMap(Sy)}var wy={class:`inline-flex gap-0.5 items-center`},Ty={key:1,class:`text-micro color-muted leading-none font-mono px-1.5 border border-base rounded bg-sunken inline-flex h-5 min-w-5 items-center justify-center`},Ey=I({__name:`DisplayKbd`,props:{keys:{}},setup(e){let t=e,n=W(()=>t.keys?Cy(t.keys):[]);return(t,r)=>(R(),z(`span`,wy,[e.keys?(R(!0),z(L,{key:0},cc(n.value,(e,t)=>(R(),z(`kbd`,{key:t,class:`text-micro color-muted leading-none font-mono px-1 border border-base rounded bg-sunken inline-flex h-5 min-w-5 items-center justify-center`},N(e),1))),128)):(R(),z(`kbd`,Ty,[lc(t.$slots,`default`)]))]))}}),Dy=[`type`,`placeholder`,`disabled`,`aria-invalid`],Oy=I({__name:`FormTextInput`,props:gc({icon:{},clearable:{type:Boolean},placeholder:{},type:{default:`text`},size:{default:`md`},disabled:{type:Boolean},invalid:{type:Boolean}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=Ic(e,`modelValue`);return(n,r)=>(R(),z(`label`,{class:M([`px-2 border rounded bg-raised inline-flex gap-2 transition items-center focus-within:ring-2`,[e.size===`sm`?`h-7 text-sm`:`h-9`,e.invalid?`border-red-500/60 focus-within:ring-red-500/40`:`border-base focus-within:ring-primary-500/40`,{"op50 pointer-events-none":e.disabled}]])},[e.icon?(R(),z(`span`,{key:0,class:M([e.icon,`op-fade shrink-0`]),"aria-hidden":`true`},null,2)):U(``,!0),lc(n.$slots,`prefix`),_s(V(`input`,{"onUpdate:modelValue":r[0]||=e=>t.value=e,type:e.type,placeholder:e.placeholder,disabled:e.disabled,"aria-invalid":e.invalid||void 0,class:`color-base outline-none bg-transparent flex-1 min-w-0 placeholder:op-mute`},null,8,Dy),[[gd,t.value]]),e.clearable&&t.value?(R(),z(`button`,{key:1,type:`button`,class:`op-fade shrink-0 transition hover:op100`,"aria-label":`Clear`,onClick:r[1]||=e=>t.value=``},[...r[2]||=[V(`span`,{class:`i-ph:x`,"aria-hidden":`true`},null,-1)]])):U(``,!0),lc(n.$slots,`suffix`)],2))}}),ky=I({__name:`FormSearchField`,props:gc({placeholder:{default:`Search…`},shortcut:{},size:{}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=Ic(e,`modelValue`);return(n,r)=>(R(),B(Oy,{modelValue:t.value,"onUpdate:modelValue":r[0]||=e=>t.value=e,placeholder:e.placeholder,size:e.size,clearable:``,type:`search`},{prefix:gs(()=>[...r[1]||=[V(`span`,{class:`i-ph:magnifying-glass op-fade shrink-0`,"aria-hidden":`true`},null,-1)]]),suffix:gs(()=>[e.shortcut&&!t.value?(R(),B(Ey,{key:0,keys:e.shortcut},null,8,[`keys`])):U(``,!0)]),_:1},8,[`modelValue`,`placeholder`,`size`]))}}),Ay={key:0,class:`flex-1 min-w-0`},jy={key:1,class:`flex gap-1 items-center`},My=I({__name:`LayoutToolbar`,props:{sticky:{type:Boolean,default:!0},glass:{type:Boolean,default:!0}},setup(e){return(t,n)=>(R(),z(`div`,{class:M([`px-3 py-2 border-b border-base flex gap-3 items-center`,[e.sticky?`sticky top-0 z-nav`:``,e.glass?`bg-glass`:`bg-base`]])},[lc(t.$slots,`start`,{},()=>[lc(t.$slots,`default`)]),t.$slots.search?(R(),z(`div`,Ay,[lc(t.$slots,`search`)])):U(``,!0),t.$slots.end?(R(),z(`div`,jy,[lc(t.$slots,`end`)])):U(``,!0)],2))}});function Ny(...e){return e.filter(Boolean).join(` `)}function Py({variant:e=`primary`,size:t=`md`,class:n}={}){let r={primary:`btn-primary`,secondary:`btn-action`,outline:`btn-action`,ghost:`inline-flex items-center justify-center gap-1.5 rounded px2 py1 op75 hover:op100 hover:bg-active transition disabled:pointer-events-none disabled:op30!`,destructive:`btn-action text-error border-error/30!`,link:`inline-flex items-center gap-1.5 color-active hover:underline underline-offset-2`},i=t===`sm`?e===`primary`?`text-sm px-2.5! py-1!`:`text-sm`:t===`lg`?`text-base px-4! py-2!`:``;return Ny(r[e],i,n)}var Fy={connecting:{label:`connecting…`,dot:`bg-neutral-400 animate-pulse`},disconnected:{label:`disconnected`,dot:`bg-error`},unauthorized:{label:`unauthorized`,dot:`bg-warning`},error:{label:`error`,dot:`bg-error`}};function Iy(e,t){if(e===`connected`)return null;let n=Fy[e];return{label:n.label,dot:Ny(`inline-block size-1.5 rounded-full shrink-0`,n.dot),class:Ny(`flex items-center gap-1.5 shrink-0 text-xs color-muted select-none`,t)}}var Ly={connecting:{icon:`i-ph-plugs-connected-duotone`,title:`Connecting…`,body:`Establishing a connection to the devframe server.`,reloadable:!1,spin:!0},disconnected:{icon:`i-ph-plugs-duotone`,title:`Disconnected`,body:`Lost the connection to the devframe server. Reload once it is back up.`,reloadable:!0,spin:!1},unauthorized:{icon:`i-ph-lock-key-duotone`,title:`Not authorized`,body:`This client isn’t authorized. Reopen the link printed by your dev server, then reload.`,reloadable:!0,spin:!1},error:{icon:`i-ph-warning-octagon-duotone`,title:`Connection failed`,body:`Could not reach the devframe server.`,reloadable:!0,spin:!1}};function Ry(e){return e===`connected`?null:Ly[e]}function zy(e){return Ny(`flex flex-col items-center justify-center gap-4 bg-base p-8 text-center`,e)}function By(e=!1,t){return Ny(`text-4xl color-active`,e&&`animate-pulse`,t)}function Vy(e){return Ny(`text-lg font-medium color-base`,e)}function Hy(e){return Ny(`max-w-sm text-sm color-muted`,e)}var Uy=[`top`,`right`,`bottom`,`left`],Wy=[`start`,`end`],Gy=Uy.reduce((e,t)=>e.concat(t,t+`-`+Wy[0],t+`-`+Wy[1]),[]),Ky=Math.min,qy=Math.max,Jy=Math.round,Yy=e=>({x:e,y:e}),Xy={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Zy(e,t,n){return qy(e,Ky(t,n))}function Qy(e,t){return typeof e==`function`?e(t):e}function $y(e){return e.split(`-`)[0]}function eb(e){return e.split(`-`)[1]}function tb(e){return e===`x`?`y`:`x`}function nb(e){return e===`y`?`height`:`width`}function rb(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ib(e){return tb(rb(e))}function ab(e,t,n){n===void 0&&(n=!1);let r=eb(e),i=ib(e),a=nb(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=mb(o)),[o,mb(o)]}function ob(e){let t=mb(e);return[sb(e),t,sb(t)]}function sb(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var cb=[`left`,`right`],lb=[`right`,`left`],ub=[`top`,`bottom`],db=[`bottom`,`top`];function fb(e,t,n){switch(e){case`top`:case`bottom`:return n?t?lb:cb:t?cb:lb;case`left`:case`right`:return t?ub:db;default:return[]}}function pb(e,t,n,r){let i=eb(e),a=fb($y(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(sb)))),a}function mb(e){let t=$y(e);return Xy[t]+e.slice(t.length)}function hb(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function gb(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:hb(e)}function _b(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 vb(e,t,n){let{reference:r,floating:i}=e,a=rb(t),o=ib(t),s=nb(o),c=$y(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=eb(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function yb(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}=Qy(t,e),p=gb(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=_b(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=_b(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 bb=50,xb=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:yb},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=vb(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<bb&&(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}=vb(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Sb=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}=Qy(e,t)||{};if(l==null)return{};let d=gb(u),f={x:n,y:r},p=ib(i),m=nb(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=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,ee=Ky(d[_],T),te=Ky(d[v],T),ne=C-h[m]-te,re=C/2-h[m]/2+w,ie=Zy(ee,re,ne),E=!c.arrow&&eb(i)!=null&&re!==ie&&a.reference[m]/2-(re<ee?ee:te)-h[m]/2<0,ae=E?re<ee?re-ee:re-ne:0;return{[p]:f[p]+ae,data:{[p]:ie,centerOffset:re-ie-ae,...E&&{alignmentOffset:ae}},reset:E}}});function Cb(e,t,n){return(e?[...n.filter(t=>eb(t)===e),...n.filter(t=>eb(t)!==e)]:n.filter(e=>$y(e)===e)).filter(n=>!e||eb(n)===e||(t?sb(n)!==n:!1))}var wb=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=Gy,autoAlignment:u=!0,...d}=Qy(e,t),f=c!==void 0||l===Gy?Cb(c||null,u,l):l,p=r.autoPlacement?.index||0,m=f[p];if(m==null)return{};if(i!==m)return{reset:{placement:f[0]}};let h=await a.detectOverflow(t,d),g=ab(m,n,await(a.isRTL==null?void 0:a.isRTL(o.floating))),_=[h[$y(m)],h[g[0]],h[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:m,overflows:_}],y=f[p+1];if(y)return{data:{index:p+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=eb(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,eb(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:p+1,overflows:v},reset:{placement:x}}}}},Tb=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}=Qy(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=$y(r),_=rb(o),v=$y(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[mb(o)]:ob(o)),x=p!==`none`;!d&&x&&b.push(...pb(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=ab(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`||_===rb(t)||T.every(e=>rb(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=rb(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{}}}},Eb=new Set([`left`,`top`]);async function Db(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=$y(n),s=eb(n),c=rb(n)===`y`,l=Eb.has(o)?-1:1,u=a&&c?-1:1,d=Qy(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 Ob=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 Db(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}}}}},kb=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}=Qy(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=rb(i),p=tb(f),m=u[p],h=u[f],g=(e,t)=>Zy(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}}}}}},Ab=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}=Qy(e,t),c=await i.detectOverflow(t,s),l=$y(n),u=eb(n),d=rb(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=Ky(p-c[m],g),y=Ky(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*qy(c.left,c.right):S=p-2*qy(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 jb(){return typeof window<`u`}function Mb(e){return Fb(e)?(e.nodeName||``).toLowerCase():`#document`}function Nb(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pb(e){return((Fb(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Fb(e){return jb()?e instanceof Node||e instanceof Nb(e).Node:!1}function Ib(e){return jb()?e instanceof Element||e instanceof Nb(e).Element:!1}function Lb(e){return jb()?e instanceof HTMLElement||e instanceof Nb(e).HTMLElement:!1}function Rb(e){return!jb()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Nb(e).ShadowRoot}function zb(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Xb(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Bb(e){return/^(table|td|th)$/.test(Mb(e))}function Vb(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Hb=/transform|translate|scale|rotate|perspective|filter/,Ub=/paint|layout|strict|content/,Wb=e=>!!e&&e!==`none`,Gb;function Kb(e){let t=Ib(e)?Xb(e):e;return Wb(t.transform)||Wb(t.translate)||Wb(t.scale)||Wb(t.rotate)||Wb(t.perspective)||!Jb()&&(Wb(t.backdropFilter)||Wb(t.filter))||Hb.test(t.willChange||``)||Ub.test(t.contain||``)}function qb(e){let t=Qb(e);for(;Lb(t)&&!Yb(t);){if(Kb(t))return t;if(Vb(t))return null;t=Qb(t)}return null}function Jb(){return Gb??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Gb}function Yb(e){return/^(html|body|#document)$/.test(Mb(e))}function Xb(e){return Nb(e).getComputedStyle(e)}function Zb(e){return Ib(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qb(e){if(Mb(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Rb(e)&&e.host||Pb(e);return Rb(t)?t.host:t}function $b(e){let t=Qb(e);return Yb(t)?(e.ownerDocument||e).body:Lb(t)&&zb(t)?t:$b(t)}function ex(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=$b(e),i=r===e.ownerDocument?.body,a=Nb(r);if(i){let e=tx(a);return t.concat(a,a.visualViewport||[],zb(r)?r:[],e&&n?ex(e):[])}return t.concat(r,ex(r,[],n))}function tx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nx(e){let t=Xb(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Lb(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Jy(n)!==a||Jy(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function rx(e){return Ib(e)?e:e.contextElement}function ix(e){let t=rx(e);if(!Lb(t))return Yy(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=nx(t),o=(a?Jy(n.width):n.width)/r,s=(a?Jy(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ax=Yy(0);function ox(e){let t=Nb(e);return!Jb()||!t.visualViewport?ax:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function sx(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Nb(e)}function cx(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=rx(e),o=Yy(1);t&&(r?Ib(r)&&(o=ix(r)):o=ix(e));let s=sx(a,n,r)?ox(a):Yy(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=Nb(a),t=Ib(r)?Nb(r):r,n=e,i=tx(n);for(;i&&t!==n;){let e=ix(i),t=i.getBoundingClientRect(),r=Xb(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=Nb(i),i=tx(n)}}return _b({width:u,height:d,x:c,y:l})}function lx(e,t){let n=Zb(e).scrollLeft;return t?t.left+n:cx(Pb(e)).left+n}function ux(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-lx(e,n),y:n.top+t.scrollTop}}function dx(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Pb(r),s=t?Vb(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Yy(1),u=Yy(0),d=Lb(r);if((d||!a)&&((Mb(r)!==`body`||zb(o))&&(c=Zb(r)),d)){let e=cx(r);l=ix(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ux(o,c):Yy(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 fx(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function px(e){let t=Zb(e),n=e.ownerDocument.body,r=qy(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=qy(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+lx(e),o=-t.scrollTop;return Xb(n).direction===`rtl`&&(a+=qy(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var mx=25;function hx(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Nb(e),a=Pb(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Jb()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(lx(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<=mx&&(s-=o)}return{width:s,height:c,x:l,y:u}}function gx(e,t){let n=cx(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ix(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function _x(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=hx(e,n,t);else if(t===`document`)r=px(Pb(e));else if(Ib(t))r=gx(t,n);else{let n=ox(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return _b(r)}function vx(e,t){let n=t.get(e);if(n)return n;let r=ex(e,[],!1).filter(e=>Ib(e)&&Mb(e)!==`body`),i=null,a=Xb(e).position===`fixed`,o=a?Qb(e):e;for(;Ib(o)&&!Yb(o);){let e=Xb(o),t=Kb(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Qb(o)}return t.set(e,r),r}function yx(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Vb(t)?[]:vx(t,this._c):[].concat(n),r],o=_x(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=_x(t,a[e],i);s=qy(n.top,s),c=Ky(n.right,c),l=Ky(n.bottom,l),u=qy(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function bx(e){let{width:t,height:n}=nx(e);return{width:t,height:n}}function xx(e,t,n){let r=Lb(t),i=Pb(t),a=n===`fixed`,o=cx(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Yy(0);if((r||!a)&&((Mb(t)!==`body`||zb(i))&&(s=Zb(t)),r)){let e=cx(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=lx(i));let l=i&&!r&&!a?ux(i,s):Yy(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 Sx(e){return Xb(e).position===`static`}function Cx(e,t){if(!Lb(e)||Xb(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Pb(e)===n&&(n=n.ownerDocument.body),n}function wx(e,t){let n=Nb(e);if(Vb(e))return n;if(!Lb(e)){let t=Qb(e);for(;t&&!Yb(t);){if(Ib(t)&&!Sx(t))return t;t=Qb(t)}return n}let r=Cx(e,t);for(;r&&Bb(r)&&Sx(r);)r=Cx(r,t);return r&&Yb(r)&&Sx(r)&&!Kb(r)?n:r||qb(e)||n}var Tx=async function(e){let t=this.getOffsetParent||wx,n=this.getDimensions,r=await n(e.floating);return{reference:xx(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ex(e){return Xb(e).direction===`rtl`}var Dx={convertOffsetParentRelativeRectToViewportRelativeRect:dx,getDocumentElement:Pb,getClippingRect:yx,getOffsetParent:wx,getElementRects:Tx,getClientRects:fx,getDimensions:bx,getScale:ix,isElement:Ib,isRTL:Ex},Ox=Ob,kx=wb,Ax=kb,jx=Tb,Mx=Ab,Nx=Sb,Px=(e,t,n)=>{let r=new Map,i=n??{},a={...Dx,...i.platform,_c:r};return xb(e,t,{...i,platform:a})},Fx={disabled:!1,distance:5,skidding:0,container:`body`,boundary:void 0,instantMove:!1,disposeTimeout:150,popperTriggers:[],strategy:`absolute`,preventOverflow:!0,flip:!0,shift:!0,overflowPadding:0,arrowPadding:0,arrowOverflow:!0,autoHideOnMousedown:!1,themes:{tooltip:{placement:`top`,triggers:[`hover`,`focus`,`touch`],hideTriggers:e=>[...e,`click`],delay:{show:200,hide:0},handleResize:!1,html:!1,loadingContent:`...`},dropdown:{placement:`bottom`,triggers:[`click`],delay:0,handleResize:!0,autoHide:!0},menu:{$extend:`dropdown`,triggers:[`hover`,`focus`],popperTriggers:[`hover`],delay:{show:0,hide:400}}}};function Ix(e,t){let n=Fx.themes[e]||{},r;do r=n[t],r===void 0?n.$extend?n=Fx.themes[n.$extend]||{}:(n=null,r=Fx[t]):n=null;while(n);return r}function Lx(e){let t=[e],n=Fx.themes[e]||{};do n.$extend&&!n.$resetCss?(t.push(n.$extend),n=Fx.themes[n.$extend]||{}):n=null;while(n);return t.map(e=>`v-popper--theme-${e}`)}function Rx(e){let t=[e],n=Fx.themes[e]||{};do n.$extend?(t.push(n.$extend),n=Fx.themes[n.$extend]||{}):n=null;while(n);return t}var zx=(()=>{if(typeof window>`u`)return!1;let e=!1;try{let t=Object.defineProperty({},"passive",{get(){e=!0}});window.addEventListener(`test`,null,t)}catch{}return e})(),Bx=typeof window<`u`&&typeof navigator<`u`&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Vx=[`auto`,`top`,`bottom`,`left`,`right`].reduce((e,t)=>e.concat([t,`${t}-start`,`${t}-end`]),[]),Hx={hover:`mouseenter`,focus:`focus`,click:`click`,touch:`touchstart`,pointer:`pointerdown`},Ux={hover:`mouseleave`,focus:`blur`,click:`click`,touch:`touchend`,pointer:`pointerup`};function Wx(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1)}function Gx(){return new Promise(e=>requestAnimationFrame(()=>{requestAnimationFrame(e)}))}var Kx=[],qx=null,Jx={};function Yx(e){let t=Jx[e];return t||=Jx[e]=[],t}var Xx=function(){};typeof window<`u`&&(Xx=window.Element);function $(e){return function(t){return Ix(t.theme,e)}}var Zx=`__floating-vue__popper`,Qx=()=>I({name:`VPopper`,provide(){return{[Zx]:{parentPopper:this}}},inject:{[Zx]:{default:null}},props:{theme:{type:String,required:!0},targetNodes:{type:Function,required:!0},referenceNode:{type:Function,default:null},popperNode:{type:Function,required:!0},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:$(`disabled`)},positioningDisabled:{type:Boolean,default:$(`positioningDisabled`)},placement:{type:String,default:$(`placement`),validator:e=>Vx.includes(e)},delay:{type:[String,Number,Object],default:$(`delay`)},distance:{type:[Number,String],default:$(`distance`)},skidding:{type:[Number,String],default:$(`skidding`)},triggers:{type:Array,default:$(`triggers`)},showTriggers:{type:[Array,Function],default:$(`showTriggers`)},hideTriggers:{type:[Array,Function],default:$(`hideTriggers`)},popperTriggers:{type:Array,default:$(`popperTriggers`)},popperShowTriggers:{type:[Array,Function],default:$(`popperShowTriggers`)},popperHideTriggers:{type:[Array,Function],default:$(`popperHideTriggers`)},container:{type:[String,Object,Xx,Boolean],default:$(`container`)},boundary:{type:[String,Xx],default:$(`boundary`)},strategy:{type:String,validator:e=>[`absolute`,`fixed`].includes(e),default:$(`strategy`)},autoHide:{type:[Boolean,Function],default:$(`autoHide`)},handleResize:{type:Boolean,default:$(`handleResize`)},instantMove:{type:Boolean,default:$(`instantMove`)},eagerMount:{type:Boolean,default:$(`eagerMount`)},popperClass:{type:[String,Array,Object],default:$(`popperClass`)},computeTransformOrigin:{type:Boolean,default:$(`computeTransformOrigin`)},autoMinSize:{type:Boolean,default:$(`autoMinSize`)},autoSize:{type:[Boolean,String],default:$(`autoSize`)},autoMaxSize:{type:Boolean,default:$(`autoMaxSize`)},autoBoundaryMaxSize:{type:Boolean,default:$(`autoBoundaryMaxSize`)},preventOverflow:{type:Boolean,default:$(`preventOverflow`)},overflowPadding:{type:[Number,String],default:$(`overflowPadding`)},arrowPadding:{type:[Number,String],default:$(`arrowPadding`)},arrowOverflow:{type:Boolean,default:$(`arrowOverflow`)},flip:{type:Boolean,default:$(`flip`)},shift:{type:Boolean,default:$(`shift`)},shiftCrossAxis:{type:Boolean,default:$(`shiftCrossAxis`)},noAutoFocus:{type:Boolean,default:$(`noAutoFocus`)},disposeTimeout:{type:Number,default:$(`disposeTimeout`)}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},data(){return{isShown:!1,isMounted:!1,skipTransition:!1,classes:{showFrom:!1,showTo:!1,hideFrom:!1,hideTo:!0},result:{x:0,y:0,placement:``,strategy:this.strategy,arrow:{x:0,y:0,centerOffset:0},transformOrigin:null},randomId:`popper_${[Math.random(),Date.now()].map(e=>e.toString(36).substring(2,10)).join(`_`)}`,shownChildren:new Set,lastAutoHide:!0,pendingHide:!1,containsGlobalTarget:!1,isDisposed:!0,mouseDownContains:!1}},computed:{popperId(){return this.ariaId??this.randomId},shouldMountContent(){return this.eagerMount||this.isMounted},slotData(){return{popperId:this.popperId,isShown:this.isShown,shouldMountContent:this.shouldMountContent,skipTransition:this.skipTransition,autoHide:typeof this.autoHide==`function`?this.lastAutoHide:this.autoHide,show:this.show,hide:this.hide,handleResize:this.handleResize,onResize:this.onResize,classes:{...this.classes,popperClass:this.popperClass},result:this.positioningDisabled?null:this.result,attrs:this.$attrs}},parentPopper(){return this[Zx]?.parentPopper},hasPopperShowTriggerHover(){return this.popperTriggers?.includes(`hover`)||this.popperShowTriggers?.includes(`hover`)}},watch:{shown:`$_autoShowHide`,disabled(e){e?this.dispose():this.init()},async container(){this.isShown&&(this.$_ensureTeleport(),await this.$_computePosition())},triggers:{handler:`$_refreshListeners`,deep:!0},positioningDisabled:`$_refreshListeners`,...[`placement`,`distance`,`skidding`,`boundary`,`strategy`,`overflowPadding`,`arrowPadding`,`preventOverflow`,`shift`,`shiftCrossAxis`,`flip`].reduce((e,t)=>(e[t]=`$_computePosition`,e),{})},created(){this.autoMinSize&&console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.'),this.autoMaxSize&&console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead.")},mounted(){this.init(),this.$_detachPopperNode()},activated(){this.$_autoShowHide()},deactivated(){this.hide()},beforeUnmount(){this.dispose()},methods:{show({event:e=null,skipDelay:t=!1,force:n=!1}={}){this.parentPopper?.lockedChild&&this.parentPopper.lockedChild!==this||(this.pendingHide=!1,(n||!this.disabled)&&(this.parentPopper?.lockedChild===this&&(this.parentPopper.lockedChild=null),this.$_scheduleShow(e,t),this.$emit(`show`),this.$_showFrameLocked=!0,requestAnimationFrame(()=>{this.$_showFrameLocked=!1})),this.$emit(`update:shown`,!0))},hide({event:e=null,skipDelay:t=!1}={}){if(!this.$_hideInProgress){if(this.shownChildren.size>0){this.pendingHide=!0;return}if(this.hasPopperShowTriggerHover&&this.$_isAimingPopper()){this.parentPopper&&(this.parentPopper.lockedChild=this,this.parentPopper.lockedChildTimer&&clearTimeout(this.parentPopper.lockedChildTimer),this.parentPopper.lockedChildTimer=setTimeout(()=>{this.parentPopper.lockedChild===this&&(this.parentPopper.lockedChild.hide({skipDelay:t}),this.parentPopper.lockedChild=null)},1e3));return}this.parentPopper?.lockedChild===this&&(this.parentPopper.lockedChild=null),this.pendingHide=!1,this.$_scheduleHide(e,t),this.$emit(`hide`),this.$emit(`update:shown`,!1)}},init(){this.isDisposed&&(this.isDisposed=!1,this.isMounted=!1,this.$_events=[],this.$_preventShow=!1,this.$_referenceNode=this.referenceNode?.call(this)??this.$el,this.$_targetNodes=this.targetNodes().filter(e=>e.nodeType===e.ELEMENT_NODE),this.$_popperNode=this.popperNode(),this.$_innerNode=this.$_popperNode.querySelector(`.v-popper__inner`),this.$_arrowNode=this.$_popperNode.querySelector(`.v-popper__arrow-container`),this.$_swapTargetAttrs(`title`,`data-original-title`),this.$_detachPopperNode(),this.triggers.length&&this.$_addEventListeners(),this.shown&&this.show())},dispose(){this.isDisposed||(this.isDisposed=!0,this.$_removeEventListeners(),this.hide({skipDelay:!0}),this.$_detachPopperNode(),this.isMounted=!1,this.isShown=!1,this.$_updateParentShownChildren(!1),this.$_swapTargetAttrs(`data-original-title`,`title`))},async onResize(){this.isShown&&(await this.$_computePosition(),this.$emit(`resize`))},async $_computePosition(){if(this.isDisposed||this.positioningDisabled)return;let e={strategy:this.strategy,middleware:[]};(this.distance||this.skidding)&&e.middleware.push(Ox({mainAxis:this.distance,crossAxis:this.skidding}));let t=this.placement.startsWith(`auto`);if(t?e.middleware.push(kx({alignment:this.placement.split(`-`)[1]??``})):e.placement=this.placement,this.preventOverflow&&(this.shift&&e.middleware.push(Ax({padding:this.overflowPadding,boundary:this.boundary,crossAxis:this.shiftCrossAxis})),!t&&this.flip&&e.middleware.push(jx({padding:this.overflowPadding,boundary:this.boundary}))),e.middleware.push(Nx({element:this.$_arrowNode,padding:this.arrowPadding})),this.arrowOverflow&&e.middleware.push({name:`arrowOverflow`,fn:({placement:e,rects:t,middlewareData:n})=>{let r,{centerOffset:i}=n.arrow;return r=e.startsWith(`top`)||e.startsWith(`bottom`)?Math.abs(i)>t.reference.width/2:Math.abs(i)>t.reference.height/2,{data:{overflow:r}}}}),this.autoMinSize||this.autoSize){let t=this.autoSize?this.autoSize:this.autoMinSize?`min`:null;e.middleware.push({name:`autoSize`,fn:({rects:e,placement:n,middlewareData:r})=>{if(r.autoSize?.skip)return{};let i,a;return n.startsWith(`top`)||n.startsWith(`bottom`)?i=e.reference.width:a=e.reference.height,this.$_innerNode.style[t===`min`?`minWidth`:t===`max`?`maxWidth`:`width`]=i==null?null:`${i}px`,this.$_innerNode.style[t===`min`?`minHeight`:t===`max`?`maxHeight`:`height`]=a==null?null:`${a}px`,{data:{skip:!0},reset:{rects:!0}}}})}(this.autoMaxSize||this.autoBoundaryMaxSize)&&(this.$_innerNode.style.maxWidth=null,this.$_innerNode.style.maxHeight=null,e.middleware.push(Mx({boundary:this.boundary,padding:this.overflowPadding,apply:({availableWidth:e,availableHeight:t})=>{this.$_innerNode.style.maxWidth=e==null?null:`${e}px`,this.$_innerNode.style.maxHeight=t==null?null:`${t}px`}})));let n=await Px(this.$_referenceNode,this.$_popperNode,e);Object.assign(this.result,{x:n.x,y:n.y,placement:n.placement,strategy:n.strategy,arrow:{...n.middlewareData.arrow,...n.middlewareData.arrowOverflow}})},$_scheduleShow(e,t=!1){if(this.$_updateParentShownChildren(!0),this.$_hideInProgress=!1,clearTimeout(this.$_scheduleTimer),qx&&this.instantMove&&qx.instantMove&&qx!==this.parentPopper){qx.$_applyHide(!0),this.$_applyShow(!0);return}t?this.$_applyShow():this.$_scheduleTimer=setTimeout(this.$_applyShow.bind(this),this.$_computeDelay(`show`))},$_scheduleHide(e,t=!1){if(this.shownChildren.size>0){this.pendingHide=!0;return}this.$_updateParentShownChildren(!1),this.$_hideInProgress=!0,this.$_scheduleTimer&&clearTimeout(this.$_scheduleTimer),this.isShown&&(qx=this),t?this.$_applyHide():this.$_scheduleTimer=setTimeout(this.$_applyHide.bind(this),this.$_computeDelay(`hide`))},$_computeDelay(e){let t=this.delay;return parseInt(t&&t[e]||t||0)},async $_applyShow(e=!1){this.$_disposeTimer&&clearTimeout(this.$_disposeTimer),this.$_scheduleTimer&&clearTimeout(this.$_scheduleTimer),this.skipTransition=e,!this.isShown&&(this.$_ensureTeleport(),await Gx(),await this.$_computePosition(),await this.$_applyShowEffect(),this.positioningDisabled||this.$_registerEventListeners([...ex(this.$_referenceNode),...ex(this.$_popperNode)],`scroll`,()=>{this.$_computePosition()}))},async $_applyShowEffect(){if(this.$_hideInProgress)return;if(this.computeTransformOrigin){let e=this.$_referenceNode.getBoundingClientRect(),t=this.$_popperNode.querySelector(`.v-popper__wrapper`),n=t.parentNode.getBoundingClientRect(),r=e.x+e.width/2-(n.left+t.offsetLeft),i=e.y+e.height/2-(n.top+t.offsetTop);this.result.transformOrigin=`${r}px ${i}px`}this.isShown=!0,this.$_applyAttrsToTarget({"aria-describedby":this.popperId,"data-popper-shown":``});let e=this.showGroup;if(e){let t;for(let n=0;n<Kx.length;n++)t=Kx[n],t.showGroup!==e&&(t.hide(),t.$emit(`close-group`))}Kx.push(this),document.body.classList.add(`v-popper--some-open`);for(let e of Rx(this.theme))Yx(e).push(this),document.body.classList.add(`v-popper--some-open--${e}`);this.$emit(`apply-show`),this.classes.showFrom=!0,this.classes.showTo=!1,this.classes.hideFrom=!1,this.classes.hideTo=!1,await Gx(),this.classes.showFrom=!1,this.classes.showTo=!0,this.noAutoFocus||this.$_popperNode.focus()},async $_applyHide(e=!1){if(this.shownChildren.size>0){this.pendingHide=!0,this.$_hideInProgress=!1;return}if(this.$_scheduleTimer&&clearTimeout(this.$_scheduleTimer),!this.isShown)return;this.skipTransition=e,Wx(Kx,this),Kx.length===0&&document.body.classList.remove(`v-popper--some-open`);for(let e of Rx(this.theme)){let t=Yx(e);Wx(t,this),t.length===0&&document.body.classList.remove(`v-popper--some-open--${e}`)}qx===this&&(qx=null),this.isShown=!1,this.$_applyAttrsToTarget({"aria-describedby":void 0,"data-popper-shown":void 0}),this.$_disposeTimer&&clearTimeout(this.$_disposeTimer);let t=this.disposeTimeout;t!==null&&(this.$_disposeTimer=setTimeout(()=>{this.$_popperNode&&(this.$_detachPopperNode(),this.isMounted=!1)},t)),this.$_removeEventListeners(`scroll`),this.$emit(`apply-hide`),this.classes.showFrom=!1,this.classes.showTo=!1,this.classes.hideFrom=!0,this.classes.hideTo=!1,await Gx(),this.classes.hideFrom=!1,this.classes.hideTo=!0},$_autoShowHide(){this.shown?this.show():this.hide()},$_ensureTeleport(){if(this.isDisposed)return;let e=this.container;if(typeof e==`string`?e=window.document.querySelector(e):e===!1&&(e=this.$_targetNodes[0].parentNode),!e)throw Error(`No container for popover: ${this.container}`);e.appendChild(this.$_popperNode),this.isMounted=!0},$_addEventListeners(){let e=e=>{(!this.isShown||this.$_hideInProgress)&&(e.usedByTooltip=!0,!this.$_preventShow&&this.show({event:e}))};this.$_registerTriggerListeners(this.$_targetNodes,Hx,this.triggers,this.showTriggers,e),this.$_registerTriggerListeners([this.$_popperNode],Hx,this.popperTriggers,this.popperShowTriggers,e);let t=e=>{e.usedByTooltip||this.hide({event:e})};this.$_registerTriggerListeners(this.$_targetNodes,Ux,this.triggers,this.hideTriggers,t),this.$_registerTriggerListeners([this.$_popperNode],Ux,this.popperTriggers,this.popperHideTriggers,t)},$_registerEventListeners(e,t,n){this.$_events.push({targetNodes:e,eventType:t,handler:n}),e.forEach(e=>e.addEventListener(t,n,zx?{passive:!0}:void 0))},$_registerTriggerListeners(e,t,n,r,i){let a=n;r!=null&&(a=typeof r==`function`?r(a):r),a.forEach(n=>{let r=t[n];r&&this.$_registerEventListeners(e,r,i)})},$_removeEventListeners(e){let t=[];this.$_events.forEach(n=>{let{targetNodes:r,eventType:i,handler:a}=n;!e||e===i?r.forEach(e=>e.removeEventListener(i,a)):t.push(n)}),this.$_events=t},$_refreshListeners(){this.isDisposed||(this.$_removeEventListeners(),this.$_addEventListeners())},$_handleGlobalClose(e,t=!1){this.$_showFrameLocked||(this.hide({event:e}),e.closePopover?this.$emit(`close-directive`):this.$emit(`auto-hide`),t&&(this.$_preventShow=!0,setTimeout(()=>{this.$_preventShow=!1},300)))},$_detachPopperNode(){this.$_popperNode.parentNode&&this.$_popperNode.parentNode.removeChild(this.$_popperNode)},$_swapTargetAttrs(e,t){for(let n of this.$_targetNodes){let r=n.getAttribute(e);r&&(n.removeAttribute(e),n.setAttribute(t,r))}},$_applyAttrsToTarget(e){for(let t of this.$_targetNodes)for(let n in e){let r=e[n];r==null?t.removeAttribute(n):t.setAttribute(n,r)}},$_updateParentShownChildren(e){let t=this.parentPopper;for(;t;)e?t.shownChildren.add(this.randomId):(t.shownChildren.delete(this.randomId),t.pendingHide&&t.hide()),t=t.parentPopper},$_isAimingPopper(){let e=this.$_referenceNode.getBoundingClientRect();if(sS>=e.left&&sS<=e.right&&cS>=e.top&&cS<=e.bottom){let e=this.$_popperNode.getBoundingClientRect(),t=sS-aS,n=cS-oS,r=e.left+e.width/2-aS+(e.top+e.height/2)-oS+e.width+e.height,i=aS+t*r,a=oS+n*r;return lS(aS,oS,i,a,e.left,e.top,e.left,e.bottom)||lS(aS,oS,i,a,e.left,e.top,e.right,e.top)||lS(aS,oS,i,a,e.right,e.top,e.right,e.bottom)||lS(aS,oS,i,a,e.left,e.bottom,e.right,e.bottom)}return!1}},render(){return this.$slots.default(this.slotData)}});if(typeof document<`u`&&typeof window<`u`){if(Bx){let e=!zx||{passive:!0,capture:!0};document.addEventListener(`touchstart`,e=>$x(e,!0),e),document.addEventListener(`touchend`,e=>eS(e,!0),e)}else window.addEventListener(`mousedown`,e=>$x(e,!1),!0),window.addEventListener(`click`,e=>eS(e,!1),!0);window.addEventListener(`resize`,iS)}function $x(e,t){if(Fx.autoHideOnMousedown)tS(e,t);else for(let t=0;t<Kx.length;t++){let n=Kx[t];try{n.mouseDownContains=n.popperNode().contains(e.target)}catch{}}}function eS(e,t){Fx.autoHideOnMousedown||tS(e,t)}function tS(e,t){let n={};for(let r=Kx.length-1;r>=0;r--){let i=Kx[r];try{let r=Array.from(i.shownChildren).some(t=>{let n=Kx.find(e=>e.randomId===t);return n&&n.popperNode().contains(e.target)}),a=i.containsGlobalTarget=i.mouseDownContains||i.popperNode().contains(e.target)||r;i.pendingHide=!1,requestAnimationFrame(()=>{if(i.pendingHide=!1,!n[i.randomId]&&nS(i,a,e)){if(i.$_handleGlobalClose(e,t),!e.closeAllPopover&&e.closePopover&&a){let e=i.parentPopper;for(;e;)n[e.randomId]=!0,e=e.parentPopper;return}let r=i.parentPopper;for(;r&&nS(r,r.containsGlobalTarget,e);)r.$_handleGlobalClose(e,t),r=r.parentPopper}})}catch{}}}function nS(e,t,n){return n.closeAllPopover||n.closePopover&&t||rS(e,n)&&!t}function rS(e,t){if(typeof e.autoHide==`function`){let n=e.autoHide(t);return e.lastAutoHide=n,n}return e.autoHide}function iS(){for(let e=0;e<Kx.length;e++)Kx[e].$_computePosition()}var aS=0,oS=0,sS=0,cS=0;typeof window<`u`&&window.addEventListener(`mousemove`,e=>{aS=sS,oS=cS,sS=e.clientX,cS=e.clientY},zx?{passive:!0}:void 0);function lS(e,t,n,r,i,a,o,s){let c=((o-i)*(t-a)-(s-a)*(e-i))/((s-a)*(n-e)-(o-i)*(r-t)),l=((n-e)*(t-a)-(r-t)*(e-i))/((s-a)*(n-e)-(o-i)*(r-t));return c>=0&&c<=1&&l>=0&&l<=1}var uS=I({extends:Qx(),render(){var e;return mu(`div`,{ref:`reference`,class:[`v-popper`,{"v-popper--shown":this.slotData.isShown}]},(e=this.$slots).default?.call(e,this.slotData))}}),dS=(e=`theme`)=>({computed:{themeClass(){return Lx(this[e])}}}),fS=I({name:`VPopperContent`,mixins:[dS()],props:{popperId:String,theme:String,shown:Boolean,mounted:Boolean,skipTransition:Boolean,autoHide:Boolean,handleResize:Boolean,classes:Object,result:Object},emits:[`hide`,`resize`],mounted(){this.handleResize&&(this.$_resizeObserver=new ResizeObserver(()=>this.$emit(`resize`)),this.$_resizeObserver.observe(this.$refs.inner))},beforeUnmount(){var e;(e=this.$_resizeObserver)==null||e.disconnect()},methods:{toPx(e){return e!=null&&!Number.isNaN(e)?`${e}px`:null}},render(){var e;let{autoHide:t,classes:n,result:r,shown:i}=this;return mu(`div`,{id:this.popperId,ref:`popover`,"data-allow-mismatch":``,class:[`v-popper__popper`,this.themeClass,n.popperClass,{"v-popper__popper--shown":i,"v-popper__popper--hidden":!i,"v-popper__popper--show-from":n.showFrom,"v-popper__popper--show-to":n.showTo,"v-popper__popper--hide-from":n.hideFrom,"v-popper__popper--hide-to":n.hideTo,"v-popper__popper--skip-transition":this.skipTransition,"v-popper__popper--arrow-overflow":r&&r.arrow.overflow,"v-popper__popper--no-positioning":!r}],style:r?{position:r.strategy,transform:`translate3d(${Math.round(r.x)}px,${Math.round(r.y)}px,0)`}:void 0,"aria-hidden":i||t?`false`:`true`,tabindex:t?0:void 0,"data-popper-placement":r?r.placement:void 0,onKeyup:e=>{e.key===`Escape`&&t&&this.$emit(`hide`)}},[mu(`div`,{class:`v-popper__backdrop`,onClick:()=>t&&this.$emit(`hide`)}),mu(`div`,{class:`v-popper__wrapper`,style:r?{transformOrigin:r.transformOrigin}:void 0},[mu(`div`,{ref:`inner`,class:`v-popper__inner`},this.mounted?[mu(`div`,(e=this.$slots).default?.call(e))]:void 0),mu(`div`,{ref:`arrow`,class:`v-popper__arrow-container`,style:r?{left:this.toPx(r.arrow.x),top:this.toPx(r.arrow.y)}:void 0},[mu(`div`,{class:`v-popper__arrow-outer`}),mu(`div`,{class:`v-popper__arrow-inner`})])])])}}),pS={methods:{show(...e){return this.$refs.popper.show(...e)},hide(...e){return this.$refs.popper.hide(...e)},dispose(...e){return this.$refs.popper.dispose(...e)},onResize(...e){return this.$refs.popper.onResize(...e)}}},mS=function(){};typeof window<`u`&&(mS=window.Element);var hS=I({name:`VPopperWrapper`,mixins:[pS,dS(`finalTheme`)],props:{theme:{type:String,default:null},referenceNode:{type:Function,default:null},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:void 0},positioningDisabled:{type:Boolean,default:void 0},placement:{type:String,default:void 0},delay:{type:[String,Number,Object],default:void 0},distance:{type:[Number,String],default:void 0},skidding:{type:[Number,String],default:void 0},triggers:{type:Array,default:void 0},showTriggers:{type:[Array,Function],default:void 0},hideTriggers:{type:[Array,Function],default:void 0},popperTriggers:{type:Array,default:void 0},popperShowTriggers:{type:[Array,Function],default:void 0},popperHideTriggers:{type:[Array,Function],default:void 0},container:{type:[String,Object,mS,Boolean],default:void 0},boundary:{type:[String,mS],default:void 0},strategy:{type:String,default:void 0},autoHide:{type:[Boolean,Function],default:void 0},handleResize:{type:Boolean,default:void 0},instantMove:{type:Boolean,default:void 0},eagerMount:{type:Boolean,default:void 0},popperClass:{type:[String,Array,Object],default:void 0},computeTransformOrigin:{type:Boolean,default:void 0},autoMinSize:{type:Boolean,default:void 0},autoSize:{type:[Boolean,String],default:void 0},autoMaxSize:{type:Boolean,default:void 0},autoBoundaryMaxSize:{type:Boolean,default:void 0},preventOverflow:{type:Boolean,default:void 0},overflowPadding:{type:[Number,String],default:void 0},arrowPadding:{type:[Number,String],default:void 0},arrowOverflow:{type:Boolean,default:void 0},flip:{type:Boolean,default:void 0},shift:{type:Boolean,default:void 0},shiftCrossAxis:{type:Boolean,default:void 0},noAutoFocus:{type:Boolean,default:void 0},disposeTimeout:{type:Number,default:void 0}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},computed:{finalTheme(){return this.theme??this.$options.vPopperTheme}},methods:{getTargetNodes(){return Array.from(this.$el.children).filter(e=>e!==this.$refs.popperContent.$el)}},render(){return mu(uS,{ref:`popper`,...this.$props,theme:this.finalTheme,targetNodes:this.getTargetNodes,popperNode:()=>this.$refs.popperContent.$el,class:[this.themeClass],onShow:()=>this.$emit(`show`),onHide:()=>this.$emit(`hide`),"onUpdate:shown":e=>this.$emit(`update:shown`,e),onApplyShow:()=>this.$emit(`apply-show`),onApplyHide:()=>this.$emit(`apply-hide`),onCloseGroup:()=>this.$emit(`close-group`),onCloseDirective:()=>this.$emit(`close-directive`),onAutoHide:()=>this.$emit(`auto-hide`),onResize:()=>this.$emit(`resize`)},{default:({popperId:e,isShown:t,shouldMountContent:n,skipTransition:r,autoHide:i,show:a,hide:o,handleResize:s,onResize:c,classes:l,result:u})=>{var d;return[(d=this.$slots).default?.call(d,{shown:t,show:a,hide:o}),mu(fS,{ref:`popperContent`,popperId:e,theme:this.finalTheme,shown:t,mounted:n,skipTransition:r,autoHide:i,handleResize:s,classes:l,result:u,onHide:o,onResize:c},{default:()=>{var e;return(e=this.$slots).popper?.call(e,{shown:t,hide:o})}})]}})}});function gS(e,t){return{...hS,name:e,vPopperTheme:t}}gS(`VDropdown`,`dropdown`),gS(`VMenu`,`menu`),gS(`VTooltip`,`tooltip`);var _S=Qx(),vS=I({name:`VTooltipDirective`,mixins:[pS],inheritAttrs:!1,props:{theme:{type:String,default:`tooltip`},html:{type:Boolean,default:e=>Ix(e.theme,`html`)},content:{type:[String,Number,Function],default:null},loadingContent:{type:String,default:e=>Ix(e.theme,`loadingContent`)},targetNodes:{type:Function,required:!0}},data(){return{asyncContent:null}},computed:{isContentAsync(){return typeof this.content==`function`},loading(){return this.isContentAsync&&this.asyncContent==null},finalContent(){return this.isContentAsync?this.loading?this.loadingContent:this.asyncContent:this.content}},watch:{content:{handler(){this.fetchContent(!0)},immediate:!0},async finalContent(){await this.$nextTick(),this.$refs.popper.onResize()}},created(){this.$_fetchId=0},methods:{fetchContent(e){if(typeof this.content==`function`&&this.$_isShown&&(e||!this.$_loading&&this.asyncContent==null)){this.asyncContent=null,this.$_loading=!0;let e=++this.$_fetchId,t=this.content(this);t.then?t.then(t=>this.onResult(e,t)):this.onResult(e,t)}},onResult(e,t){e===this.$_fetchId&&(this.$_loading=!1,this.asyncContent=t)},onShow(){this.$_isShown=!0,this.fetchContent()},onHide(){this.$_isShown=!1}},render(){return mu(_S,{ref:`popper`,...this.$attrs,theme:this.theme,targetNodes:this.targetNodes,popperNode:()=>this.$refs.popperContent.$el,onApplyShow:this.onShow,onApplyHide:this.onHide},{default:({popperId:e,isShown:t,shouldMountContent:n,skipTransition:r,autoHide:i,hide:a,handleResize:o,onResize:s,classes:c,result:l})=>mu(fS,{ref:`popperContent`,class:{"v-popper--tooltip-loading":this.loading},popperId:e,theme:this.theme,shown:t,mounted:n,skipTransition:r,autoHide:i,handleResize:o,classes:c,result:l,onHide:a,onResize:s},{default:()=>this.html?mu(`div`,{innerHTML:this.finalContent}):mu(`div`,{textContent:this.finalContent})})})}}),yS=`v-popper--has-tooltip`;function bS(e,t){let n=e.placement;if(!n&&t)for(let e of Vx)t[e]&&(n=e);return n||=Ix(e.theme||`tooltip`,`placement`),n}function xS(e,t,n){let r,i=typeof t;return r=i===`string`?{content:t}:t&&i===`object`?t:{content:!1},r.placement=bS(r,n),r.targetNodes=()=>[e],r.referenceNode=()=>e,r}var SS,CS,wS=0;function TS(){if(SS)return;CS=Ao([]),SS=Td({name:`VTooltipDirectiveApp`,setup(){return{directives:CS}},render(){return this.directives.map(e=>mu(vS,{...e.options,shown:e.shown||e.options.shown,key:e.id}))},devtools:{hide:!0}});let e=document.createElement(`div`);document.body.appendChild(e),SS.mount(e)}function ES(e,t,n){TS();let r=Ao(xS(e,t,n)),i=Ao(!1),a={id:wS++,options:r,shown:i};return CS.value.push(a),e.classList&&e.classList.add(yS),e.$_popper={options:r,item:a,show(){i.value=!0},hide(){i.value=!1}}}function DS(e){if(e.$_popper){let t=CS.value.indexOf(e.$_popper.item);t!==-1&&CS.value.splice(t,1),delete e.$_popper,delete e.$_popperOldShown,delete e.$_popperMountTarget}e.classList&&e.classList.remove(yS)}function OS(e,{value:t,modifiers:n}){let r=xS(e,t,n);if(!r.content||Ix(r.theme||`tooltip`,`disabled`))DS(e);else{let i;e.$_popper?(i=e.$_popper,i.options.value=r):i=ES(e,t,n),t.shown!==void 0&&t.shown!==e.$_popperOldShown&&(e.$_popperOldShown=t.shown,t.shown?i.show():i.hide())}}var kS={beforeMount:OS,updated:OS,beforeUnmount(e){DS(e)}},AS=I({__name:`ActionIconButton`,props:{as:{},to:{},href:{},icon:{},tooltip:{},active:{type:Boolean},disabled:{type:Boolean},label:{},compact:{type:Boolean},activeClass:{}},setup(e){let t=e,n=W(()=>t.as?t.as:t.href!=null||t.to!=null?`a`:`button`),r=W(()=>n.value===`a`),i=W(()=>n.value===`button`),a=W(()=>t.compact?`btn-icon-compact`:`btn-icon`),o=W(()=>t.compact?`w-auto! h-auto! p-[0.25em]`:`w-auto! h-auto! p-[0.5em]`),s=W(()=>t.active?t.activeClass||`color-active bg-active op100`:``);return(t,c)=>_s((R(),B(ac(n.value),{type:i.value?`button`:void 0,class:M([a.value,o.value,s.value,{"pointer-events-none op-mute":e.disabled&&!i.value}]),href:r.value?e.href??e.to:void 0,to:e.as&&e.to!=null?e.to:void 0,disabled:i.value?e.disabled:void 0,"aria-disabled":e.disabled&&!i.value||void 0,"aria-label":e.label??e.tooltip,"aria-pressed":e.active||void 0},{default:gs(()=>[e.icon?(R(),z(`span`,{key:0,class:M(e.icon),"aria-hidden":`true`},null,2)):U(``,!0),lc(t.$slots,`default`),lc(t.$slots,`badge`)]),_:3},8,[`type`,`class`,`href`,`to`,`disabled`,`aria-disabled`,`aria-label`,`aria-pressed`])),[[F(kS),e.tooltip]])}}),jS=I({__name:`FeedbackSpinner`,props:{size:{default:`1em`}},setup(e){let t=e,n=W(()=>typeof t.size==`number`?`${t.size}px`:t.size);return(e,t)=>(R(),z(`span`,{class:`border-2 border-current border-t-transparent rounded-full inline-block animate-spin`,style:zi({width:n.value,height:n.value}),role:`status`,"aria-label":`Loading`},null,4))}});function MS(e,t){return ra()?(ia(e,t),!0):!1}var NS=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var PS=Object.prototype.toString,FS=e=>PS.call(e)===`[object Object]`;function IS(e){let t;function n(){return t||=e(),t}return n.reset=async()=>{let e=t;t=void 0,e&&await e},n}function LS(e){return Array.isArray(e)?e:[e]}function RS(e,t=1e3,n={}){let{immediate:r=!0,immediateCallback:i=!1}=n,a=null,o=jo(!1);function s(){a&&=(clearInterval(a),null)}function c(){o.value=!1,s()}function l(){let n=Po(t);n<=0||(o.value=!0,i&&e(),s(),o.value&&(a=setInterval(e,n)))}return r&&NS&&l(),(ko(t)||typeof t==`function`)&&MS(ws(t,()=>{o.value&&NS&&l()})),MS(c),{isActive:bo(o),pause:c,resume:l}}function zS(e,t,n={}){let{immediate:r=!0,immediateCallback:i=!1}=n,a=jo(!1),o;function s(){o&&=(clearTimeout(o),void 0)}function c(){a.value=!1,s()}function l(...n){i&&e(),s(),a.value=!0,o=setTimeout(()=>{a.value=!1,o=void 0,e(...n)},Po(t))}return r&&(a.value=!0,NS&&l()),MS(c),{isPending:bo(a),start:l,stop:c}}function BS(e,t,n){return ws(e,t,{...n,immediate:!0})}var VS=NS?window:void 0;NS&&window.document;var HS=NS?window.navigator:void 0;NS&&window.location;function US(e){let t=Po(e);return t?.$el??t}function WS(...e){let t=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),n=W(()=>{let t=LS(Po(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return BS(()=>[n.value?.map(e=>US(e))??[VS].filter(e=>e!=null),LS(Po(n.value?e[1]:e[0])),LS(F(n.value?e[2]:e[1])),Po(n.value?e[3]:e[2])],([e,n,r,i],a,o)=>{if(!e?.length||!n?.length||!r?.length)return;let s=FS(i)?{...i}:i,c=e.flatMap(e=>n.flatMap(n=>r.map(r=>t(e,n,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}function GS(){let e=jo(!1),t=Ql();return t&&Js(()=>{e.value=!0},t),e}function KS(e){let t=GS();return W(()=>(t.value,!!e()))}function qS(e,t={}){let{immediate:n=!0,fpsLimit:r=null,window:i=VS,once:a=!1}=t,o=jo(!1),s=W(()=>{let e=Po(r);return e?1e3/e:null}),c=0,l=null;function u(t){if(!o.value||!i)return;c||=t;let n=t-c;if(s.value&&n<s.value){l=i.requestAnimationFrame(u);return}if(c=t,e({delta:n,timestamp:t}),a){o.value=!1,l=null;return}l=i.requestAnimationFrame(u)}function d(){!o.value&&i&&(o.value=!0,c=0,l=i.requestAnimationFrame(u))}function f(){o.value=!1,l!=null&&i&&(i.cancelAnimationFrame(l),l=null)}return n&&d(),MS(f),{isActive:bo(o),pause:f,resume:d}}function JS(e,t={}){let{controls:n=!1,navigator:r=HS}=t,i=KS(()=>r&&`permissions`in r),a=jo(),o=typeof e==`string`?{name:e}:e,s=jo(),c=()=>{s.value=a.value?.state??`prompt`};WS(a,`change`,c,{passive:!0});let l=IS(async()=>{if(i.value){if(!a.value)try{a.value=await r.permissions.query(o)}catch{a.value=void 0}finally{c()}if(n)return P(a.value)}});return l(),n?{state:s,isSupported:i,query:l}:s}function YS(e={}){let{navigator:t=HS,read:n=!1,source:r,copiedDuring:i=1500,legacy:a=!1}=e,o=KS(()=>t&&`clipboard`in t),s=JS(`clipboard-read`),c=JS(`clipboard-write`),l=W(()=>o.value||a),u=jo(``),d=jo(!1),f=jo(!1),p=zS(()=>d.value=!1,i,{immediate:!1}),m=0;async function h(){let e=!(o.value&&b(s.value));if(!e)try{u.value=await t.clipboard.readText()}catch{e=!0}e&&(u.value=y())}l.value&&n&&WS([`copy`,`cut`],h,{passive:!0});async function g(e){let n=e??Po(r);if(l.value&&n!=null){f.value=!0;let e=!(o.value&&b(c.value));if(!e)try{let e=_(n);await t.clipboard.write([e])}catch{e=!0}if(e){if(typeof n==`string`)u.value=n,v(n);else{let e=++m,t=await n();t!=null&&e===m&&(u.value=t,v(t))}}d.value=!0,p.start(),f.value=!1}}function _(e){return typeof e==`string`?(u.value=e,new ClipboardItem({"text/plain":e})):new ClipboardItem({"text/plain":e().then((e=``)=>(u.value=e,new Blob([e],{type:`text/plain`})))})}function v(e){let t=document.createElement(`textarea`);t.value=e,t.style.position=`absolute`,t.style.opacity=`0`,t.setAttribute(`readonly`,``),document.body.appendChild(t),t.select(),document.execCommand(`copy`),t.remove()}function y(){var e,t;return((e=document)==null||(t=e.getSelection)==null||(t=t.call(e))==null?void 0:t.toString())??``}function b(e){return e===`granted`||e===`prompt`}return{copyPending:bo(f),isSupported:l,text:bo(u),copied:bo(d),copy:g}}function XS(e){if(`interval`in e||`immediate`in e){let{interval:t=`requestAnimationFrame`,immediate:n=!0}=e;return t===`requestAnimationFrame`?e=>qS(e,{immediate:n}):n=>RS(n,t,e)}return qS}function ZS(e={}){let{controls:t=!1,scheduler:n=XS(e)}=e,r=jo(new Date),i=n(()=>r.value=new Date);return t?{now:r,...i}:r}var QS=[{max:6e4,value:1e3,name:`second`},{max:276e4,value:6e4,name:`minute`},{max:72e6,value:36e5,name:`hour`},{max:5184e5,value:864e5,name:`day`},{max:24192e5,value:6048e5,name:`week`},{max:28512e6,value:2592e6,name:`month`},{max:1/0,value:31536e6,name:`year`}],$S={justNow:`just now`,past:e=>/\d/.test(e)?`${e} ago`:e,future:e=>/\d/.test(e)?`in ${e}`:e,month:(e,t)=>e===1?t?`last month`:`next month`:`${e} month${e>1?`s`:``}`,year:(e,t)=>e===1?t?`last year`:`next year`:`${e} year${e>1?`s`:``}`,day:(e,t)=>e===1?t?`yesterday`:`tomorrow`:`${e} day${e>1?`s`:``}`,week:(e,t)=>e===1?t?`last week`:`next week`:`${e} week${e>1?`s`:``}`,hour:e=>`${e} hour${e>1?`s`:``}`,minute:e=>`${e} minute${e>1?`s`:``}`,second:e=>`${e} second${e>1?`s`:``}`,invalid:``};function eC(e){return e.toISOString().slice(0,10)}function tC(e){if(`updateInterval`in e){let{updateInterval:t=3e4}=e;return e=>RS(e,t)}return e=>RS(e,3e4)}function nC(e,t={}){let{controls:n=!1,scheduler:r=tC(t)}=t,{now:i,...a}=ZS({scheduler:r,controls:!0}),o=W(()=>rC(new Date(Po(e)),t,Po(i)));return n?{timeAgo:o,...a}:o}function rC(e,t={},n=Date.now()){let{max:r,messages:i=$S,fullDateFormatter:a=eC,units:o=QS,showSecond:s=!1,rounding:c=`round`}=t,l=typeof c==`number`?e=>+e.toFixed(c):Math[c],u=+n-e,d=Math.abs(u);function f(e,t){return l(Math.abs(e)/t.value)}function p(e,t){let n=f(e,t),r=e>0,i=m(t.name,n,r);return m(r?`past`:`future`,i,r)}function m(e,t,n){let r=i[e];return typeof r==`function`?r(t,n):r.replace(`{0}`,t.toString())}if(d<6e4&&!s)return i.justNow;if(typeof r==`number`&&d>r)return a(new Date(e));if(typeof r==`string`){let t=o.find(e=>e.name===r)?.max;if(t&&d>t)return a(new Date(e))}for(let[e,t]of o.entries()){if(f(u,t)<=0&&o[e-1])return p(u,o[e-1]);if(d<t.max)return p(u,t)}return i.invalid}function iC(e){return e?e.flatMap(e=>e.type===L?iC(e.children):[e]):[]}var aC=I({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=iC(n.default()),r=e.findIndex(e=>e.type!==Dl);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?Kl(t,i.props):t,o=Vl({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),oC=[`area`,`img`,`input`],sC=I({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&oC.includes(r)?()=>mu(r,t):r===`template`?()=>mu(aC,t,{default:n.default}):()=>mu(e.as,t,{default:n.default})}}),cC=I({__name:`BaseSeparator`,props:{orientation:{type:String,required:!1,default:`horizontal`},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=[`horizontal`,`vertical`];function r(e){return n.includes(e)}let i=W(()=>r(t.orientation)?t.orientation:`horizontal`),a=W(()=>i.value===`vertical`?t.orientation:void 0),o=W(()=>t.decorative?{role:`none`}:{"aria-orientation":a.value,role:`separator`});return(e,t)=>(R(),B(F(sC),Kl({as:e.as,"as-child":e.asChild,"data-orientation":i.value},o.value),{default:gs(()=>[lc(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`data-orientation`]))}}),lC=I({__name:`Separator`,props:{orientation:{type:String,required:!1,default:`horizontal`},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(R(),B(cC,Wi(Bl(t)),{default:gs(()=>[lc(e.$slots,`default`)]),_:3},16))}}),uC={key:0,class:`text-micro color-faint tracking-wide font-medium my-2 flex gap-2 select-none uppercase items-center`},dC=I({__name:`LayoutSeparator`,props:{orientation:{default:`horizontal`},label:{}},setup(e){return(t,n)=>e.label||t.$slots.default?(R(),z(`div`,uC,[n[0]||=V(`span`,{class:`border-t border-base flex-1`},null,-1),lc(t.$slots,`default`,{},()=>[Hl(N(e.label),1)]),n[1]||=V(`span`,{class:`border-t border-base flex-1`},null,-1)])):(R(),B(F(lC),{key:1,orientation:e.orientation,class:M([`bg-#8882 shrink-0`,e.orientation===`vertical`?`mx-2 w-px self-stretch`:`my-2 h-px w-full`])},null,8,[`orientation`,`class`]))}}),fC={info:{icon:`i-ph:info-duotone`,color:`dark:text-blue-200 text-blue-600`,bg:`bg-blue`,label:`Info`},warn:{icon:`i-ph:warning-duotone`,color:`dark:text-amber-200 text-amber-600`,bg:`bg-amber`,label:`Warning`},error:{icon:`i-ph:x-circle-duotone`,color:`dark:text-red-200 text-red-600`,bg:`bg-red`,label:`Error`},success:{icon:`i-ph:check-circle-duotone`,color:`dark:text-green-200 text-green-600`,bg:`bg-green`,label:`Success`},debug:{icon:`i-ph:bug-duotone`,color:`dark:text-violet-200 text-violet-600`,bg:`bg-violet`,label:`Debug`}},pC={server:{icon:`i-ph:hexagon-duotone`,color:`text-green-600 dark:text-green-200`,label:`Server`},browser:{icon:`i-ph:globe-simple-duotone`,color:`text-amber-600 dark:text-amber-200`,label:`Browser`}},mC={error:0,warn:1,info:2,success:3,debug:4},hC=I({__name:`MessageTag`,props:{text:{},kind:{},as:{}},setup(e){return(t,n)=>(R(),B(fy,{text:e.text,as:e.as,rounded:e.kind===`label`?`full`:e.kind===`category`?.4:`md`,class:M([`text-xs`,e.kind===`category`?`border-l-3!`:``])},null,8,[`text`,`as`,`rounded`,`class`]))}}),gC={class:`h-full of-y-auto border-l border-base p-4`},_C={class:`flex items-start gap-2 mb-3`},vC={class:`flex-1 font-medium text-lg`},yC={class:`flex flex-wrap items-center gap-2 mb-3 text-xs`},bC={class:`capitalize`},xC={key:1,class:`flex items-center gap-1 text-amber`},SC=[`title`],CC={key:2,class:`flex items-center gap-0.5 op40`},wC={key:0,class:`text-sm op80 mb-3 whitespace-pre-wrap`},TC={key:1,class:`flex flex-wrap gap-1 mb-3`},EC={key:2,class:`flex flex-wrap gap-1.5 mb-3`},DC=[`onClick`],OC={key:4,class:`flex items-start gap-1.5 text-sm op60 mb-3 break-all`},kC={key:5,class:`text-sm mb-3 bg-gray/5 rounded p-2`},AC={key:0,class:`font-mono text-xs`},jC={key:1,class:`text-xs op70 mt-1`},MC={key:2,class:`text-xs op50 mt-1 font-mono`},NC={key:6,class:`mb-3`},PC={class:`group relative`},FC={class:`text-xs bg-gray/5 rounded p-2 of-x-auto whitespace-pre-wrap font-mono`},IC={key:7,class:`flex flex-wrap gap-3 mb-3 text-xs op50`},LC={key:0,class:`flex items-center gap-1`},RC={key:1,class:`flex items-center gap-1`},zC={class:`flex flex-col gap-1 text-xs op40 font-mono`},BC=I({__name:`MessageDetail`,props:{entry:{},canOpenFile:{type:Boolean},canActivate:{type:Boolean}},emits:[`close`,`dismiss`,`openFile`,`activate`,`toggleCategory`,`toggleLabel`],setup(e,{emit:t}){let n=e,r=t,i=nC(W(()=>n.entry.timestamp)),{copy:a,copied:o}=YS(),s=W(()=>pC[n.entry.from]);function c(e){return new Date(e).toLocaleTimeString()}function l(e){let t=e.file;return e.line&&(t+=`:${e.line}`),e.column&&(t+=`:${e.column}`),t}return(t,n)=>(R(),z(`div`,gC,[V(`div`,_C,[V(`div`,vC,N(e.entry.message),1),H(AS,{icon:`i-ph:trash-duotone`,tooltip:`Dismiss`,label:`Dismiss`,onClick:n[0]||=t=>r(`dismiss`,e.entry.id)}),H(AS,{icon:`i-ph:x`,tooltip:`Close detail`,label:`Close detail`,onClick:n[1]||=e=>r(`close`)})]),V(`div`,yC,[V(`span`,{class:M([`flex items-center gap-1`,F(fC)[e.entry.level].color])},[V(`div`,{class:M([F(fC)[e.entry.level].icon,`w-3.5 h-3.5`])},null,2),V(`span`,bC,N(e.entry.level),1)],2),s.value?(R(),z(`span`,{key:0,class:M([`flex items-center gap-1`,s.value.color])},[V(`div`,{class:M([s.value.icon,`w-3.5 h-3.5`])},null,2),Hl(` `+N(s.value.label),1)],2)):U(``,!0),e.entry.status===`loading`?(R(),z(`span`,xC,[H(jS,{size:`0.75rem`}),n[5]||=Hl(` Loading `,-1)])):U(``,!0),V(`span`,{class:`op40`,title:c(e.entry.timestamp)},N(F(i)),9,SC),e.entry.notify?(R(),z(`span`,CC,[...n[6]||=[V(`div`,{class:`i-ph:bell-duotone w-3.5 h-3.5`},null,-1),Hl(` notify `,-1)]])):U(``,!0)]),e.entry.description?(R(),z(`div`,wC,N(e.entry.description),1)):U(``,!0),e.entry.category||e.entry.labels?.length?(R(),z(`div`,TC,[e.entry.category?(R(),B(hC,{key:0,text:e.entry.category,kind:`category`,as:`button`,class:`cursor-pointer`,onClick:n[2]||=t=>r(`toggleCategory`,e.entry.category)},null,8,[`text`])):U(``,!0),(R(!0),z(L,null,cc(e.entry.labels,e=>(R(),B(hC,{key:e,text:e,kind:`label`,as:`button`,class:`cursor-pointer`,onClick:t=>r(`toggleLabel`,e)},null,8,[`text`,`onClick`]))),128))])):U(``,!0),e.canActivate&&e.entry.actions?.length?(R(),z(`div`,EC,[(R(!0),z(L,null,cc(e.entry.actions,e=>(R(),z(`button`,{key:e.id,type:`button`,class:`flex items-center gap-1.5 text-sm px-2 py-1 rounded border border-base hover:bg-active transition`,onClick:t=>r(`activate`,e)},[n[7]||=V(`div`,{class:`i-ph:arrow-square-out-duotone w-3.5 h-3.5`},null,-1),Hl(` `+N(e.label),1)],8,DC))),128))])):U(``,!0),e.entry.filePosition&&e.canOpenFile?(R(),z(`button`,{key:3,type:`button`,class:`flex items-start gap-1.5 text-left text-sm color-active hover:underline mb-3 break-all`,onClick:n[3]||=t=>r(`openFile`,e.entry)},[n[8]||=V(`div`,{class:`i-ph:file-code-duotone w-4 h-4 flex-none mt-0.5`},null,-1),V(`span`,null,N(l(e.entry.filePosition)),1)])):e.entry.filePosition?(R(),z(`div`,OC,[n[9]||=V(`div`,{class:`i-ph:file-code-duotone w-4 h-4 flex-none mt-0.5`},null,-1),V(`span`,null,N(l(e.entry.filePosition)),1)])):U(``,!0),e.entry.elementPosition?(R(),z(`div`,kC,[n[10]||=V(`div`,{class:`op50 text-xs mb-1`},` Element `,-1),e.entry.elementPosition.selector?(R(),z(`div`,AC,N(e.entry.elementPosition.selector),1)):U(``,!0),e.entry.elementPosition.description?(R(),z(`div`,jC,N(e.entry.elementPosition.description),1)):U(``,!0),e.entry.elementPosition.boundingBox?(R(),z(`div`,MC,N(e.entry.elementPosition.boundingBox.x)+`, `+N(e.entry.elementPosition.boundingBox.y)+` (`+N(e.entry.elementPosition.boundingBox.width)+` × `+N(e.entry.elementPosition.boundingBox.height)+`) `,1)):U(``,!0)])):U(``,!0),e.entry.stacktrace?(R(),z(`div`,NC,[n[11]||=V(`div`,{class:`op50 text-xs mb-1`},` Stack Trace `,-1),V(`div`,PC,[V(`pre`,FC,N(e.entry.stacktrace),1),H(AS,{compact:``,class:`absolute top-1.5 right-1.5 op0 group-hover:op100 text-xs bg-base border border-base`,icon:F(o)?`i-ph:check`:`i-ph:copy`,tooltip:`Copy`,label:`Copy stack trace`,onClick:n[4]||=t=>F(a)(e.entry.stacktrace)},null,8,[`icon`])])])):U(``,!0),e.entry.autoDismiss||e.entry.autoDelete?(R(),z(`div`,IC,[e.entry.autoDismiss?(R(),z(`span`,LC,[n[12]||=V(`div`,{class:`i-ph:bell-slash-duotone w-3.5 h-3.5`},null,-1),Hl(` Auto-dismiss: `+N(e.entry.autoDismiss/1e3)+`s `,1)])):U(``,!0),e.entry.autoDelete?(R(),z(`span`,RC,[n[13]||=V(`div`,{class:`i-ph:timer-duotone w-3.5 h-3.5`},null,-1),Hl(` Auto-delete: `+N(e.entry.autoDelete/1e3)+`s `,1)])):U(``,!0)])):U(``,!0),H(dC),V(`div`,zC,[V(`span`,null,`ID: `+N(e.entry.id),1),V(`span`,null,N(c(e.entry.timestamp))+` (`+N(new Date(e.entry.timestamp).toLocaleDateString())+`)`,1)])]))}}),VC={class:`text-xs op-fade`},HC={class:`flex flex-wrap items-center gap-0.5`},UC=[`onClick`],WC=I({__name:`FilterToggles`,props:{label:{},items:{},active:{},styles:{},tag:{}},emits:[`toggle`],setup(e){function t(e,t){return e.size>0&&!e.has(t)}return(n,r)=>(R(),z(L,null,[V(`span`,VC,N(e.label),1),V(`div`,HC,[(R(!0),z(L,null,cc(e.items,r=>(R(),z(`button`,{key:r,type:`button`,class:M([`rounded flex items-center transition`,[e.tag?`p-0.5`:`px-1.5 py-0.5 gap-0.5 text-xs`,!e.tag&&!t(e.active,r)&&e.styles?.[r]?.color||``,t(e.active,r)?`op50 saturate-10 hover:op85 hover:saturate-50`:`op85 hover:op100`]]),onClick:e=>n.$emit(`toggle`,r)},[e.tag?(R(),B(hC,{key:0,text:r,kind:e.tag},null,8,[`text`,`kind`])):(R(),z(L,{key:1},[e.styles?.[r]?.icon?(R(),z(`div`,{key:0,class:M([e.styles[r].icon,`w-3.5 h-3.5`])},null,2)):U(``,!0),V(`span`,null,N(e.styles?.[r]?.label||r),1)],64))],10,UC))),128))])],64))}}),GC={class:`border-base border-b px-3 py-2 flex flex-wrap items-center gap-1`},KC=I({__name:`MessageFilterBar`,props:{filters:{}},setup(e){let{filters:t}=e;return(e,n)=>(R(),z(`div`,GC,[H(WC,{label:`Level`,items:F(t).allLevels,active:F(t).activeLevels,styles:F(fC),onToggle:F(t).toggleLevel},null,8,[`items`,`active`,`styles`,`onToggle`]),H(dC,{orientation:`vertical`,class:`!h-4`}),H(WC,{label:`From`,items:F(t).allSources,active:F(t).activeSources,styles:F(pC),onToggle:n[0]||=e=>F(t).toggleSource(e)},null,8,[`items`,`active`,`styles`]),F(t).allCategories.length>0?(R(),z(L,{key:0},[H(dC,{orientation:`vertical`,class:`!h-4`}),H(WC,{label:`Category`,items:F(t).allCategories,active:F(t).activeCategories,tag:`category`,onToggle:F(t).toggleCategory},null,8,[`items`,`active`,`onToggle`])],64)):U(``,!0),F(t).allLabels.length>0?(R(),z(L,{key:1},[H(dC,{orientation:`vertical`,class:`!h-4`}),H(WC,{label:`Labels`,items:F(t).allLabels,active:F(t).activeLabels,tag:`label`,onToggle:F(t).toggleLabel},null,8,[`items`,`active`,`onToggle`])],64)):U(``,!0)]))}}),qC={class:`px-6 py-10 text-center op-fade flex flex-col gap-2 items-center justify-center`},JC={key:0,class:`text-sm color-base font-medium`},YC={key:1,class:`text-xs op-mute max-w-prose`},XC={key:2,class:`mt-2 flex gap-2 items-center`},ZC=I({__name:`FeedbackEmptyState`,props:{title:{},icon:{}},setup(e){return(t,n)=>(R(),z(`div`,qC,[lc(t.$slots,`icon`,{},()=>[e.icon?(R(),z(`span`,{key:0,class:M([e.icon,`text-3xl op-mute`]),"aria-hidden":`true`},null,2)):U(``,!0)]),e.title||t.$slots.default?(R(),z(`div`,JC,[lc(t.$slots,`default`,{},()=>[Hl(N(e.title),1)])])):U(``,!0),t.$slots.hint?(R(),z(`div`,YC,[lc(t.$slots,`hint`)])):U(``,!0),t.$slots.actions?(R(),z(`div`,XC,[lc(t.$slots,`actions`)])):U(``,!0)]))}}),QC={class:`flex items-start gap-2 relative`},$C={class:`flex-1 min-w-0 space-y-0.5`},ew={class:`flex items-center gap-2`},tw=[`title`],nw={key:0,class:`text-xs op80 whitespace-pre-wrap`},rw={key:1,class:`flex flex-wrap items-center gap-1`},iw=I({__name:`MessageItem`,props:{entry:{},compact:{type:Boolean}},setup(e){let t=e,n=nC(()=>t.entry.timestamp);return(t,r)=>(R(),z(`div`,QC,[V(`div`,{class:M([`w-2px flex-none absolute left-0 top-4px bottom-4px rounded-r`,[F(fC)[e.entry.level]?.bg||`bg-gray`]])},null,2),e.entry.status===`loading`?(R(),B(jS,{key:0,size:`1rem`,class:`flex-none mt-0.5 op50`})):(R(),z(`div`,{key:1,class:M([`flex-none mt-0.5 w-4 h-4`,[F(fC)[e.entry.level]?.icon,F(fC)[e.entry.level]?.color]])},null,2)),V(`div`,$C,[V(`div`,ew,[V(`div`,{class:M([`flex-1 min-w-0 truncate text-sm font-medium`,[e.entry.status===`loading`?`op60`:``]])},N(e.entry.message),3),e.compact?U(``,!0):(R(),z(`span`,{key:0,class:`text-xs op40 flex-none`,title:new Date(e.entry.timestamp).toLocaleString()},N(F(n)),9,tw)),lc(t.$slots,`actions`)]),e.entry.description?(R(),z(`div`,nw,N(e.entry.description),1)):U(``,!0),!e.compact&&(e.entry.category||e.entry.labels?.length)?(R(),z(`div`,rw,[e.entry.category?(R(),B(hC,{key:0,text:e.entry.category,kind:`category`},null,8,[`text`])):U(``,!0),(R(!0),z(L,null,cc(e.entry.labels,e=>(R(),B(hC,{key:e,text:e,kind:`label`},null,8,[`text`]))),128))])):U(``,!0)])]))}}),aw={class:`h-full of-y-auto`},ow=[`data-selected`,`onClick`],sw=I({__name:`MessageList`,props:{entries:{},selectedId:{}},emits:[`select`,`dismiss`],setup(e){return(t,n)=>(R(),z(`div`,aw,[e.entries.length===0?(R(),B(ZC,{key:0,icon:`i-ph:tray-duotone`,title:`No messages`})):U(``,!0),(R(!0),z(L,null,cc(e.entries,n=>(R(),z(`div`,{key:n.id,"data-selected":e.selectedId===n.id||void 0,class:M([`w-full text-left border-b border-base hover:bg-active transition text-sm group cursor-pointer`,[e.selectedId===n.id?`bg-active`:``]]),onClick:e=>t.$emit(`select`,n.id)},[H(iw,{entry:n,class:`px-3 py-2.5`},{actions:gs(()=>[H(AS,{compact:``,class:`op0 group-hover:op100 flex-none text-xs`,icon:`i-ph:trash-duotone`,tooltip:`Dismiss`,label:`Dismiss`,onClick:xd(e=>t.$emit(`dismiss`,n.id),[`stop`])},null,8,[`onClick`])]),_:2},1032,[`entry`])],10,ow))),128))]))}}),cw={class:`w-full h-full grid grid-rows-[max-content_1fr]`},lw=I({__name:`MessagesView`,props:{filters:{},canOpenFile:{type:Boolean},canActivate:{type:Boolean}},emits:[`dismiss`,`openFile`,`persist`,`activate`],setup(e,{emit:t}){let n=e,r=t,i=Ao(null),a=W(()=>i.value==null?null:n.filters.allEntries.find(e=>e.id===i.value)??null);ws(a,e=>{e?.autoDelete&&r(`persist`,e.id)});function o(e){i.value=i.value===e?null:e}function s(e){r(`dismiss`,e),i.value===e&&(i.value=null)}return(t,n)=>(R(),z(`div`,cw,[H(KC,{filters:e.filters},null,8,[`filters`]),V(`div`,{class:M([`h-full of-hidden`,a.value?`grid grid-cols-[1fr_1fr]`:``])},[H(sw,{entries:e.filters.filteredEntries,"selected-id":i.value,onSelect:o,onDismiss:s},null,8,[`entries`,`selected-id`]),a.value?(R(),B(BC,{key:0,entry:a.value,"can-open-file":e.canOpenFile,"can-activate":e.canActivate,onClose:n[0]||=e=>i.value=null,onDismiss:s,onOpenFile:n[1]||=e=>r(`openFile`,e),onActivate:n[2]||=e=>r(`activate`,e),onToggleCategory:e.filters.toggleCategory,onToggleLabel:e.filters.toggleLabel},null,8,[`entry`,`can-open-file`,`can-activate`,`onToggleCategory`,`onToggleLabel`])):U(``,!0)],2)]))}}),uw=I({__name:`ActionButton`,props:{as:{},to:{},href:{},icon:{},variant:{default:`action`},size:{default:`md`},loading:{type:Boolean},disabled:{type:Boolean}},setup(e){let t=e,n=W(()=>t.as?t.as:t.href!=null||t.to!=null?`a`:`button`),r=W(()=>n.value===`a`),i=W(()=>n.value===`button`),a=W(()=>t.size===`sm`),o=W(()=>t.variant===`primary`?a.value?`btn-primary text-sm`:`btn-primary`:t.variant===`text`?a.value?`btn-text text-sm`:`btn-text`:a.value?`btn-action-sm`:`btn-action`),s=W(()=>t.disabled||t.loading);return(t,a)=>(R(),B(ac(n.value),{class:M([o.value,{"pointer-events-none op-mute":s.value&&!i.value}]),href:r.value?e.href??e.to:void 0,to:e.as&&e.to!=null?e.to:void 0,disabled:i.value?s.value:void 0,"aria-disabled":s.value||void 0,"aria-busy":e.loading||void 0},{default:gs(()=>[e.loading?(R(),B(jS,{key:0,size:`1em`})):e.icon?(R(),z(`span`,{key:1,class:M(e.icon),"aria-hidden":`true`},null,2)):U(``,!0),lc(t.$slots,`default`)]),_:3},8,[`class`,`href`,`to`,`disabled`,`aria-disabled`,`aria-busy`]))}}),dw=I({__name:`MessageToolbarActions`,props:{filters:{}},emits:[`dismissFiltered`,`clear`],setup(e){let{filters:t}=e;return(e,n)=>(R(),z(L,null,[H(AS,{class:`text-sm`,icon:F(t).sortIcon,tooltip:F(t).sortLabel,label:`Change sort order`,onClick:F(t).cycleSortMode},null,8,[`icon`,`tooltip`,`onClick`]),F(t).hasActiveFilter?(R(),z(L,{key:0},[H(uw,{variant:`text`,size:`sm`,icon:`i-ph:funnel-x-duotone`,onClick:F(t).resetFilters},{default:gs(()=>[...n[2]||=[Hl(` Reset `,-1)]]),_:1},8,[`onClick`]),F(t).filteredCount>0?(R(),B(uw,{key:0,variant:`text`,size:`sm`,icon:`i-ph:trash-duotone`,onClick:n[0]||=t=>e.$emit(`dismissFiltered`)},{default:gs(()=>[...n[3]||=[Hl(` Dismiss filtered `,-1)]]),_:1})):U(``,!0)],64)):F(t).totalCount>0?(R(),B(uw,{key:1,variant:`text`,size:`sm`,icon:`i-ph:trash-duotone`,onClick:n[1]||=t=>e.$emit(`clear`)},{default:gs(()=>[...n[4]||=[Hl(` Dismiss all `,-1)]]),_:1})):U(``,!0),H(dC,{orientation:`vertical`,class:`!h-4`})],64))}}),fw=[`newest`,`oldest`,`level`],pw={newest:`Newest first`,oldest:`Oldest first`,level:`By severity`},mw={newest:`i-ph:sort-descending-duotone`,oldest:`i-ph:sort-ascending-duotone`,level:`i-ph:warning-diamond-duotone`};function hw(e){let t=Ao(``),n=Ao(`newest`),r=Ao(new Set),i=Ao(new Set),a=Ao(new Set),o=Ao(new Set),s=W(()=>Po(e));function c(){let e=fw.indexOf(n.value);n.value=fw[(e+1)%fw.length]}function l(e,t){e.has(t)?e.delete(t):e.add(t)}let u=W(()=>{let e=new Set;for(let t of s.value)for(let n of t.labels??[])e.add(n);return Array.from(e).sort()}),d=W(()=>{let e=new Set;for(let t of s.value)t.category&&e.add(t.category);return Array.from(e).sort()}),f=W(()=>r.value.size>0||i.value.size>0||a.value.size>0||o.value.size>0||t.value.length>0);function p(){r.value.clear(),i.value.clear(),a.value.clear(),o.value.clear(),t.value=``}let m=W(()=>{let e=s.value;if(r.value.size>0&&(e=e.filter(e=>r.value.has(e.level))),i.value.size>0&&(e=e.filter(e=>i.value.has(e.from))),a.value.size>0&&(e=e.filter(e=>e.category!=null&&a.value.has(e.category))),o.value.size>0&&(e=e.filter(e=>e.labels?.some(e=>o.value.has(e)))),t.value){let n=t.value.toLowerCase();e=e.filter(e=>e.message.toLowerCase().includes(n)||e.description?.toLowerCase().includes(n)||e.from?.toLowerCase().includes(n)||e.category?.toLowerCase().includes(n)||e.labels?.some(e=>e.toLowerCase().includes(n)))}return n.value===`oldest`?[...e]:n.value===`level`?e.toSorted((e,t)=>mC[e.level]-mC[t.level]):e.toReversed()});return _o({search:t,sortBy:n,sortLabel:W(()=>pw[n.value]),sortIcon:W(()=>mw[n.value]),cycleSortMode:c,activeLevels:r,activeSources:i,activeCategories:a,activeLabels:o,toggleLevel:e=>l(r.value,e),toggleSource:e=>l(i.value,e),toggleCategory:e=>l(a.value,e),toggleLabel:e=>l(o.value,e),allLevels:Object.keys(fC),allSources:Object.keys(pC),allCategories:d,allLabels:u,hasActiveFilter:f,resetFilters:p,allEntries:s,filteredEntries:m,totalCount:W(()=>s.value.length),filteredCount:W(()=>m.value.length)})}var gw=`devframe:messages:updated`,_w=new WeakMap;function vw(e){let t=_w.get(e);if(t)return t;t=_o({entries:[]}),_w.set(e,t);let n=new Map,r=null,i=Promise.resolve();function a(){return i=i.then(async()=>{let i=r==null?await e.call(`devframes:plugin:messages:list`):await e.call(`devframes:plugin:messages:list`,r);i.full&&n.clear();for(let e of i.removedIds)n.delete(e);for(let e of i.entries)n.set(e.id,e);t.entries=Array.from(n.values()),r=i.version}).catch(()=>{}),i}let o=e.client.definitions.get(gw);if(o){let e=o.handler;o.handler=(...t)=>(a(),e?.(...t))}else e.client.register({name:gw,type:`action`,handler:()=>{a()}});return a(),e.events.on(`rpc:is-trusted:updated`,e=>{e&&a()}),t}var yw={class:`h-full w-full grid grid-rows-[max-content_1fr] bg-base color-base font-sans`},bw={class:`flex gap-2 items-center`},xw={class:`min-h-0`},Sw={class:`flex flex-col gap-1`},Cw=I({__name:`App`,props:{rpc:{}},setup(e){let t=e,n=vw(t.rpc),r=hw(()=>n.entries),i=Ao(t.rpc.status);Zs(t.rpc.events.on(`connection:status`,e=>{i.value=e}));let a=W(()=>Iy(i.value)),o=W(()=>Ry(i.value));function s(){location.reload()}let c=Ao(t.rpc.services.has(`@devframes/service-open`));Js(()=>{t.rpc.services.state().then(e=>{c.value=t.rpc.services.has(`@devframes/service-open`),e.on(`updated`,()=>c.value=t.rpc.services.has(`@devframes/service-open`))}).catch(()=>{})});let l=W(()=>t.rpc.connectionMeta.backend!==`static`&&c.value),u=Ao(!1);Js(()=>{t.rpc.sharedState.get(`devframe:docks`,{initialValue:null}).then(e=>{u.value=e.value()!=null,e.on(`updated`,e=>u.value=e!=null)}).catch(()=>{})});async function d(e){let n=t.rpc.callOptional;if(e.kind===`activate`){if(t.rpc.connectionMeta.backend===`static`&&typeof BroadcastChannel<`u`){let t=new BroadcastChannel(`devframe:docks:activate`);t.postMessage(P(e.activate)),t.close();return}await n(`hub:docks:activate`,e.activate);return}e.kind===`command`&&await n(`hub:commands:execute`,e.command.id,...e.command.params??[])}async function f(e){await t.rpc.call(`devframes:plugin:messages:remove`,e)}async function p(){for(let e of r.filteredEntries)await t.rpc.call(`devframes:plugin:messages:remove`,e.id)}async function m(){await t.rpc.call(`devframes:plugin:messages:clear`)}async function h(e){await t.rpc.call(`devframes:plugin:messages:update`,e,{autoDelete:0})}async function g(e){if(!e.filePosition)return;let{file:n,line:r,column:i}=e.filePosition;await t.rpc.services.get(`@devframes/service-open`)?.rpc.call(`open-in-editor`,{path:n,line:r,column:i})}return(e,t)=>(R(),z(`div`,yw,[H(My,{glass:!1,class:`h-nav`},{search:gs(()=>[V(`div`,bw,[o.value?U(``,!0):(R(),B(ky,{key:0,modelValue:F(r).search,"onUpdate:modelValue":t[0]||=e=>F(r).search=e,size:`sm`,placeholder:`Search messages…`,class:`max-w-64`},null,8,[`modelValue`])),F(r).totalCount>0?(R(),B(fy,{key:1,color:!1,class:`text-xs font-mono`},{default:gs(()=>[F(r).filteredCount===F(r).totalCount?(R(),z(L,{key:1},[Hl(N(F(r).totalCount),1)],64)):(R(),z(L,{key:0},[Hl(N(F(r).filteredCount)+`/`+N(F(r).totalCount),1)],64))]),_:1})):U(``,!0)])]),end:gs(()=>[o.value?U(``,!0):(R(),B(dw,{key:0,filters:F(r),onDismissFiltered:p,onClear:m},null,8,[`filters`])),a.value?(R(),z(`span`,{key:1,class:M(a.value.class)},[V(`span`,{class:M(a.value.dot)},null,2),Hl(` `+N(a.value.label),1)],2)):U(``,!0)]),default:gs(()=>[t[1]||=V(`div`,{class:`flex items-center gap-1.5 shrink-0 font-semibold text-sm select-none`},[V(`span`,{class:`i-ph-notification-duotone text-base color-active`}),V(`span`,null,`Messages`)],-1)]),_:1}),V(`div`,xw,[o.value?(R(),z(`div`,{key:0,class:M(F(zy)(`h-full`))},[V(`span`,{class:M([o.value.icon,F(By)(o.value.spin)])},null,2),V(`div`,Sw,[V(`p`,{class:M(F(Vy)())},N(o.value.title),3),V(`p`,{class:M(F(Hy)())},N(o.value.body),3)]),o.value.reloadable?(R(),z(`button`,{key:0,type:`button`,class:M(F(Py)({variant:`primary`,size:`sm`})),onClick:s},[...t[2]||=[V(`span`,{class:`i-ph-arrow-clockwise`},null,-1),Hl(` Reload `,-1)]],2)):U(``,!0)],2)):(R(),B(lw,{key:1,filters:F(r),"can-open-file":l.value,"can-activate":u.value,onDismiss:f,onPersist:h,onOpenFile:g,onActivate:d},null,8,[`filters`,`can-open-file`,`can-activate`]))])]))}});function ww(e){return ii(e)}async function Tw(e,t={}){let n=t.rpc??await ww(),r=Td(Cw,{rpc:n});return r.mount(e),{rpc:n,dispose(){r.unmount()}}}var Ew=window.matchMedia(`(prefers-color-scheme: dark)`);function Dw(e){document.documentElement.classList.toggle(`dark`,e),document.documentElement.classList.toggle(`light`,!e)}Dw(Ew.matches),Ew.addEventListener(`change`,e=>Dw(e.matches));var Ow=document.getElementById(`app`);if(!Ow)throw Error(`#app mount node missing from index.html`);Tw(Ow).catch(e=>{Ow.textContent=`Failed to connect: ${e instanceof Error?e.message:String(e)}`});
|