@cartanova/qgrid-cli 2.19.0 → 2.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/dist/application/qgrid/qgrid-response-format.js +14 -5
- package/bundle/dist/application/qgrid/qgrid-run-lifecycle.js +8 -3
- package/bundle/dist/application/qgrid/qgrid.frame.js +3 -2
- package/bundle/src/application/qgrid/qgrid-response-format.test.ts +14 -4
- package/bundle/src/application/qgrid/qgrid-response-format.ts +18 -2
- package/bundle/src/application/qgrid/qgrid-run-lifecycle.test.ts +23 -1
- package/bundle/src/application/qgrid/qgrid-run-lifecycle.ts +14 -2
- package/bundle/src/application/qgrid/qgrid.frame.ts +3 -1
- package/bundle/web-dist/client/assets/{index-DYYtV8Qx.js → index-DvW4Yb82.js} +3 -3
- package/bundle/web-dist/client/assets/{logs-CbDtQif1.js → logs-DAif2re1.js} +1 -1
- package/bundle/web-dist/client/assets/{monit-DtW8o_yF.js → monit-DYczkiu0.js} +1 -1
- package/bundle/web-dist/client/assets/{routes-Dw227enb.js → routes--6kS1pgJ.js} +1 -1
- package/bundle/web-dist/client/assets/{settings-BXmAToY1.js → settings-Dah87LB2.js} +1 -1
- package/bundle/web-dist/client/assets/{show-5qj6wFgp.js → show-DQWFaVDW.js} +1 -1
- package/bundle/web-dist/client/assets/{tokens-D8L8AC4v.js → tokens-CIHja806.js} +1 -1
- package/bundle/web-dist/client/assets/{use-oauth-login-flow-BcEUkszt.js → use-oauth-login-flow-DeJCqHDJ.js} +1 -1
- package/bundle/web-dist/client/assets/{use-update-token-mutation-Ca0n_WnM.js → use-update-token-mutation-Cn_Po_rH.js} +1 -1
- package/bundle/web-dist/client/assets/{voice-D-c1Eyp3.js → voice-6i785ieC.js} +1 -1
- package/bundle/web-dist/client/index.html +1 -1
- package/bundle/web-dist/server/entry-server.generated.js +1 -1
- package/package.json +1 -1
- package/skills/qgrid/references/decision-rationale.md +1 -1
- package/skills/qgrid/references/request-log-run-lifecycle.md +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes--6kS1pgJ.js","assets/rolldown-runtime-XKyaHtl9.js","assets/vendor-react-8xo7RSum.js","assets/vendor-tanstack-6B86itGS.js","assets/use-oauth-login-flow-DeJCqHDJ.js","assets/clsx-DB0hHKMi.js","assets/cost-CZzlCFS2.js","assets/use-update-token-mutation-Cn_Po_rH.js","assets/logs-DAif2re1.js","assets/refresh-cw-BtYoFHVw.js","assets/request-model-Dl31cZdf.js","assets/monit-DYczkiu0.js","assets/settings-Dah87LB2.js","assets/plus-Bab0ACnC.js","assets/tokens-CIHja806.js","assets/voice-6i785ieC.js","assets/TimedPlayer-cuEgYA3Q.js","assets/show-DQWFaVDW.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{n as e,r as t,t as n}from"./rolldown-runtime-XKyaHtl9.js";import{i as r,n as i,r as a,t as o}from"./vendor-react-8xo7RSum.js";import{A as s,C as c,D as l,E as u,M as d,O as f,S as p,T as m,_ as h,a as g,b as _,c as v,f as y,g as b,h as x,i as S,j as C,k as w,l as T,m as E,n as D,o as O,p as k,r as A,s as ee,t as j,u as M,v as te,w as N,x as ne,y as re}from"./vendor-tanstack-6B86itGS.js";(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)}})();function ie(e){let t;if(e.then(e=>(t=e,e),f)?.catch?.(f),t!==void 0)return{data:t}}function ae(e,t,n){let r=e.getMutationCache(),i=e.getQueryCache(),a=n?.defaultOptions?.deserializeData??e.getDefaultOptions().hydrate?.deserializeData;t.mutations?.forEach(({state:t,...i})=>{r.build(e,{...e.getDefaultOptions().hydrate?.mutations,...n?.defaultOptions?.mutations,...i},t)}),t.queries?.forEach(({queryKey:t,state:r,queryHash:o,meta:s,promise:c,dehydratedAt:l,queryType:u})=>{let d=c?ie(c):void 0,p=r.data===void 0?d?.data:r.data,m=p===void 0?p:a?a(p):p,h=i.get(o),g=h?.state.status===`pending`,_=h?.state.fetchStatus===`fetching`;if(h){let e=d&&l>h.state.dataUpdatedAt;if(r.dataUpdatedAt>h.state.dataUpdatedAt||e){let{fetchStatus:e,...t}=r;h.setState({...t,data:m,...r.status===`pending`&&m!==void 0&&{status:`success`,dataUpdatedAt:l,...!_&&{fetchStatus:`idle`}}})}}else h=i.build(e,{...e.getDefaultOptions().hydrate?.queries,...n?.defaultOptions?.queries,queryKey:t,queryHash:o,meta:s,_type:u},{...r,data:m,fetchStatus:`idle`,status:r.status===`pending`&&m!==void 0?`success`:r.status,...r.status===`pending`&&m!==void 0&&{dataUpdatedAt:l}});c&&!d&&!g&&!_&&l>h.state.dataUpdatedAt&&h.fetch(void 0,{initialPromise:Promise.resolve(c).then(a)}).catch(f)})}var oe=class extends p{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new h({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=P(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=P(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=P(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=P(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){_.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>u(t,e))}findAll(e={}){return this.getAll().filter(t=>u(e,t))}notify(e){_.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return _.batch(()=>Promise.all(e.map(e=>e.continue().catch(f))))}};function P(e){return e.options.scope?.id}var se=class extends p{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??m(r,t),a=this.get(i);return a||(a=new te({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){_.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>l(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>l(e,t)):t}notify(e){_.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){_.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){_.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ce=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new se,this.#t=e.mutationCache||new oe,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ne.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=re.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(s(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=c(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return _.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;_.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return _.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=_.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(f).catch(f)}invalidateQueries(e,t={}){return _.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=_.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(f)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(f)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(s(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(s(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(f).catch(f)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(f).catch(f)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return re.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(N(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{w(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(N(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{w(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=m(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===C&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},le=t(o(),1),F=t(r()),I=a(),ue=(0,F.forwardRef)(({title:e,titleId:t,...n},r)=>(0,I.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,I.jsx)(`title`,{id:t,children:e}):null,(0,I.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M2 10v3m4-7v11m4-14v18m4-13v7m4-10v13m4-8v3`})]})),de=(0,F.forwardRef)(({title:e,titleId:t,...n},r)=>(0,I.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,I.jsx)(`title`,{id:t,children:e}):null,(0,I.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,I.jsx)(`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}),(0,I.jsx)(`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5M10 9H8m8 4H8m8 4H8`})]})]})),fe=(0,F.forwardRef)(({title:e,titleId:t,...n},r)=>(0,I.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,I.jsx)(`title`,{id:t,children:e}):null,(0,I.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,I.jsx)(`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`}),(0,I.jsx)(`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`})]})]})),pe=(0,F.forwardRef)(({title:e,titleId:t,...n},r)=>(0,I.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,I.jsx)(`title`,{id:t,children:e}):null,(0,I.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,I.jsx)(`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`}),(0,I.jsx)(`circle`,{cx:16.5,cy:7.5,r:.5,fill:`currentColor`})]})]})),me=(0,F.forwardRef)(({title:e,titleId:t,...n},r)=>(0,I.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,I.jsx)(`title`,{id:t,children:e}):null,(0,I.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,I.jsx)(`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0a2.34 2.34 0 0 0 3.319 1.915a2.34 2.34 0 0 1 2.33 4.033a2.34 2.34 0 0 0 0 3.831a2.34 2.34 0 0 1-2.33 4.033a2.34 2.34 0 0 0-3.319 1.915a2.34 2.34 0 0 1-4.659 0a2.34 2.34 0 0 0-3.32-1.915a2.34 2.34 0 0 1-2.33-4.033a2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`}),(0,I.jsx)(`circle`,{cx:12,cy:12,r:3})]})]})),he=(0,F.forwardRef)(({title:e,titleId:t,...n},r)=>(0,I.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,I.jsx)(`title`,{id:t,children:e}):null,(0,I.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 19h8M4 17l6-6l-6-6`})]})),ge=[{label:`Overview`,items:[{title:`Dashboard`,path:`/`,icon:fe}]},{label:`Manage`,items:[{title:`Tokens`,path:`/tokens`,icon:pe},{title:`Request Logs`,shortTitle:`Logs`,path:`/logs`,icon:de},{title:`Server Logs`,shortTitle:`Server`,path:`/monit`,icon:he},{title:`Settings`,path:`/settings`,icon:me}]},{label:`Playground`,items:[{title:`Voice`,path:`/voice`,icon:ue}]}],_e=ge.flatMap(e=>e.items);function ve(e,t){return e===`/`?t===`/`||t===``:t.startsWith(e)}function ye(){let e=A({select:e=>e.location.pathname});return(0,I.jsx)(`nav`,{className:`md:hidden shrink-0 border-t border-sand-200/60 bg-sand-50/95 backdrop-blur-sm pb-[env(safe-area-inset-bottom)]`,children:(0,I.jsx)(`div`,{className:`flex`,children:_e.map(t=>{let n=ve(t.path,e);return(0,I.jsxs)(M,{to:t.path,className:`flex-1 flex flex-col items-center gap-0.5 py-2 no-underline transition-colors duration-150 ${n?`text-sienna-600`:`text-sand-500`}`,children:[(0,I.jsx)(t.icon,{className:`size-5 ${n?`text-sienna-500`:`text-sand-400`}`}),(0,I.jsx)(`span`,{className:`text-[10px] ${n?`font-medium`:``}`,children:t.shortTitle??t.title})]},t.path)})})})}function be(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var xe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Se=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ce={};function we(e,t){return((t||Ce).jsx?Se:xe).test(e)}var Te=/[ \t\n\f\r]/g;function Ee(e){return typeof e==`object`?e.type===`text`&&De(e.value):De(e)}function De(e){return e.replace(Te,``)===``}var Oe=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Oe.prototype.normal={},Oe.prototype.property={},Oe.prototype.space=void 0;function ke(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Oe(n,r,t)}function Ae(e){return e.toLowerCase()}var je=class{constructor(e,t){this.attribute=t,this.property=e}};je.prototype.attribute=``,je.prototype.booleanish=!1,je.prototype.boolean=!1,je.prototype.commaOrSpaceSeparated=!1,je.prototype.commaSeparated=!1,je.prototype.defined=!1,je.prototype.mustUseProperty=!1,je.prototype.number=!1,je.prototype.overloadedBoolean=!1,je.prototype.property=``,je.prototype.spaceSeparated=!1,je.prototype.space=void 0;var Me=e({boolean:()=>L,booleanish:()=>Pe,commaOrSpaceSeparated:()=>Le,commaSeparated:()=>Ie,number:()=>R,overloadedBoolean:()=>Fe,spaceSeparated:()=>z}),Ne=0,L=Re(),Pe=Re(),Fe=Re(),R=Re(),z=Re(),Ie=Re(),Le=Re();function Re(){return 2**++Ne}var ze=Object.keys(Me),Be=class extends je{constructor(e,t,n,r){let i=-1;if(super(e,t),Ve(this,`space`,r),typeof n==`number`)for(;++i<ze.length;){let e=ze[i];Ve(this,ze[i],(n&Me[e])===Me[e])}}};Be.prototype.defined=!0;function Ve(e,t,n){n&&(e[t]=n)}function He(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Be(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Ae(r)]=r,n[Ae(a.attribute)]=r}return new Oe(t,n,e.space)}var Ue=He({properties:{ariaActiveDescendant:null,ariaAtomic:Pe,ariaAutoComplete:null,ariaBusy:Pe,ariaChecked:Pe,ariaColCount:R,ariaColIndex:R,ariaColSpan:R,ariaControls:z,ariaCurrent:null,ariaDescribedBy:z,ariaDetails:null,ariaDisabled:Pe,ariaDropEffect:z,ariaErrorMessage:null,ariaExpanded:Pe,ariaFlowTo:z,ariaGrabbed:Pe,ariaHasPopup:null,ariaHidden:Pe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:z,ariaLevel:R,ariaLive:null,ariaModal:Pe,ariaMultiLine:Pe,ariaMultiSelectable:Pe,ariaOrientation:null,ariaOwns:z,ariaPlaceholder:null,ariaPosInSet:R,ariaPressed:Pe,ariaReadOnly:Pe,ariaRelevant:null,ariaRequired:Pe,ariaRoleDescription:z,ariaRowCount:R,ariaRowIndex:R,ariaRowSpan:R,ariaSelected:Pe,ariaSetSize:R,ariaSort:null,ariaValueMax:R,ariaValueMin:R,ariaValueNow:R,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function We(e,t){return t in e?e[t]:t}function Ge(e,t){return We(e,t.toLowerCase())}var Ke=He({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Ie,acceptCharset:z,accessKey:z,action:null,allow:null,allowFullScreen:L,allowPaymentRequest:L,allowUserMedia:L,alt:null,as:null,async:L,autoCapitalize:null,autoComplete:z,autoFocus:L,autoPlay:L,blocking:z,capture:null,charSet:null,checked:L,cite:null,className:z,cols:R,colSpan:null,content:null,contentEditable:Pe,controls:L,controlsList:z,coords:R|Ie,crossOrigin:null,data:null,dateTime:null,decoding:null,default:L,defer:L,dir:null,dirName:null,disabled:L,download:Fe,draggable:Pe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:L,formTarget:null,headers:z,height:R,hidden:Fe,high:R,href:null,hrefLang:null,htmlFor:z,httpEquiv:z,id:null,imageSizes:null,imageSrcSet:null,inert:L,inputMode:null,integrity:null,is:null,isMap:L,itemId:null,itemProp:z,itemRef:z,itemScope:L,itemType:z,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:L,low:R,manifest:null,max:null,maxLength:R,media:null,method:null,min:null,minLength:R,multiple:L,muted:L,name:null,nonce:null,noModule:L,noValidate:L,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:L,optimum:R,pattern:null,ping:z,placeholder:null,playsInline:L,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:L,referrerPolicy:null,rel:z,required:L,reversed:L,rows:R,rowSpan:R,sandbox:z,scope:null,scoped:L,seamless:L,selected:L,shadowRootClonable:L,shadowRootDelegatesFocus:L,shadowRootMode:null,shape:null,size:R,sizes:null,slot:null,span:R,spellCheck:Pe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:R,step:null,style:null,tabIndex:R,target:null,title:null,translate:null,type:null,typeMustMatch:L,useMap:null,value:Pe,width:R,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:z,axis:null,background:null,bgColor:null,border:R,borderColor:null,bottomMargin:R,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:L,declare:L,event:null,face:null,frame:null,frameBorder:null,hSpace:R,leftMargin:R,link:null,longDesc:null,lowSrc:null,marginHeight:R,marginWidth:R,noResize:L,noHref:L,noShade:L,noWrap:L,object:null,profile:null,prompt:null,rev:null,rightMargin:R,rules:null,scheme:null,scrolling:Pe,standby:null,summary:null,text:null,topMargin:R,valueType:null,version:null,vAlign:null,vLink:null,vSpace:R,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:L,disableRemotePlayback:L,prefix:null,property:null,results:R,security:null,unselectable:null},space:`html`,transform:Ge}),qe=He({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Le,accentHeight:R,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:R,amplitude:R,arabicForm:null,ascent:R,attributeName:null,attributeType:null,azimuth:R,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:R,by:null,calcMode:null,capHeight:R,className:z,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:R,diffuseConstant:R,direction:null,display:null,dur:null,divisor:R,dominantBaseline:null,download:L,dx:null,dy:null,edgeMode:null,editable:null,elevation:R,enableBackground:null,end:null,event:null,exponent:R,externalResourcesRequired:null,fill:null,fillOpacity:R,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ie,g2:Ie,glyphName:Ie,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:R,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:R,horizOriginX:R,horizOriginY:R,id:null,ideographic:R,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:R,k:R,k1:R,k2:R,k3:R,k4:R,kernelMatrix:Le,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:R,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:R,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:R,overlineThickness:R,paintOrder:null,panose1:null,path:null,pathLength:R,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:z,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:R,pointsAtY:R,pointsAtZ:R,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Le,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Le,rev:Le,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Le,requiredFeatures:Le,requiredFonts:Le,requiredFormats:Le,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:R,specularExponent:R,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:R,strikethroughThickness:R,string:null,stroke:null,strokeDashArray:Le,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:R,strokeOpacity:R,strokeWidth:null,style:null,surfaceScale:R,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Le,tabIndex:R,tableValues:null,target:null,targetX:R,targetY:R,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Le,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:R,underlineThickness:R,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:R,values:null,vAlphabetic:R,vMathematical:R,vectorEffect:null,vHanging:R,vIdeographic:R,version:null,vertAdvY:R,vertOriginX:R,vertOriginY:R,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:R,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:We}),Je=He({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Ye=He({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Ge}),Xe=He({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ze={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Qe=/[A-Z]/g,$e=/-[a-z]/g,et=/^data[-\w.:]+$/i;function tt(e,t){let n=Ae(t),r=t,i=je;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&et.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace($e,rt);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!$e.test(e)){let n=e.replace(Qe,nt);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Be}return new i(r,t)}function nt(e){return`-`+e.toLowerCase()}function rt(e){return e.charAt(1).toUpperCase()}var it=ke([Ue,Ke,Je,Ye,Xe],`html`),at=ke([Ue,qe,Je,Ye,Xe],`svg`);function ot(e){return e.join(` `).trim()}var st=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
3
3
|
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),ct=n(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(st());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),lt=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),ut=n(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(ct()),i=lt();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a})),dt=pt(`end`),ft=pt(`start`);function pt(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function mt(e){let t=ft(e),n=dt(e);if(t&&n)return{start:t,end:n}}function ht(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?_t(e.position):`start`in e||`end`in e?_t(e):`line`in e||`column`in e?gt(e):``}function gt(e){return vt(e&&e.line)+`:`+vt(e&&e.column)}function _t(e){return gt(e&&e.start)+`-`+gt(e&&e.end)}function vt(e){return e&&typeof e==`number`?e:1}var yt=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=ht(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};yt.prototype.file=``,yt.prototype.name=``,yt.prototype.reason=``,yt.prototype.message=``,yt.prototype.stack=``,yt.prototype.column=void 0,yt.prototype.line=void 0,yt.prototype.ancestors=void 0,yt.prototype.cause=void 0,yt.prototype.fatal=void 0,yt.prototype.place=void 0,yt.prototype.ruleId=void 0,yt.prototype.source=void 0;var bt=t(ut(),1),xt={}.hasOwnProperty,St=new Map,Ct=/[A-Z]/g,wt=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Tt=new Set([`td`,`th`]),Et=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Dt(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Rt(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Lt(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?at:it,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Ot(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Ot(e,t,n){if(t.type===`element`)return kt(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return At(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Mt(e,t,n);if(t.type===`mdxjsEsm`)return jt(e,t);if(t.type===`root`)return Nt(e,t,n);if(t.type===`text`)return Pt(e,t)}function kt(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=at,e.schema=i),e.ancestors.push(t);let a=Wt(e,t.tagName,!1),o=zt(e,t),s=Vt(e,t);return wt.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Ee(e)})),Ft(e,o,a,t),It(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function At(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Gt(e,t.position)}function jt(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Gt(e,t.position)}function Mt(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=at,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Wt(e,t.name,!0),o=Bt(e,t),s=Vt(e,t);return Ft(e,o,a,t),It(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Nt(e,t,n){let r={};return It(r,Vt(e,t)),e.create(t,e.Fragment,r,n)}function Pt(e,t){return t.value}function Ft(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function It(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Lt(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Rt(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=ft(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function zt(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&xt.call(t.properties,i)){let a=Ht(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Tt.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Bt(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Gt(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Gt(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Vt(e,t){let n=[],r=-1,i=e.passKeys?new Map:St;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Ot(e,a,o);s!==void 0&&n.push(s)}return n}function Ht(e,t,n){let r=tt(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?be(n):ot(n)),r.property===`style`){let t=typeof n==`object`?n:Ut(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Kt(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Ze[r.property]||r.property:r.attribute,n]}}function Ut(e,t){try{return(0,bt.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new yt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Et+`#cannot-parse-style-attribute`,r}}function Wt(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=we(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=we(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return xt.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Gt(e)}function Gt(e,t){let n=new yt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Et+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Kt(e){let t={},n;for(n in e)xt.call(e,n)&&(t[qt(n)]=e[n]);return t}function qt(e){let t=e.replace(Ct,Jt);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Jt(e){return`-`+e.toLowerCase()}var Yt={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},Xt={};function Zt(e,t){let n=t||Xt;return Qt(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Qt(e,t,n){if(en(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return $t(e.children,t,n)}return Array.isArray(e)?$t(e,t,n):``}function $t(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Qt(e[i],t,n);return r.join(``)}function en(e){return!!(e&&typeof e==`object`)}var tn=document.createElement(`i`);function nn(e){let t=`&`+e+`;`;tn.innerHTML=t;let n=tn.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function rn(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function an(e,t){return e.length>0?(rn(e,e.length,0,t),e):t}var on={}.hasOwnProperty;function sn(e){let t={},n=-1;for(;++n<e.length;)cn(t,e[n]);return t}function cn(e,t){let n;for(n in t){let r=(on.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){on.call(r,a)||(r[a]=[]);let e=i[a];ln(r[a],Array.isArray(e)?e:e?[e]:[])}}}function ln(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);rn(e,0,0,r)}function un(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function dn(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var fn=xn(/[A-Za-z]/),pn=xn(/[\dA-Za-z]/),mn=xn(/[#-'*+\--9=?A-Z^-~]/);function hn(e){return e!==null&&(e<32||e===127)}var gn=xn(/\d/),_n=xn(/[\dA-Fa-f]/),vn=xn(/[!-/:-@[-`{-~]/);function B(e){return e!==null&&e<-2}function V(e){return e!==null&&(e<0||e===32)}function H(e){return e===-2||e===-1||e===32}var yn=xn(/\p{P}|\p{S}/u),bn=xn(/\s/);function xn(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Sn(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&pn(e.charCodeAt(n+1))&&pn(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function U(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return H(r)?(e.enter(n),s(r)):t(r)}function s(r){return H(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Cn={tokenize:wn};function wn(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),U(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return B(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Tn={tokenize:Dn},En={tokenize:On};function Dn(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return rn(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(En,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(En,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return B(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;rn(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function On(e,t,n){return U(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function kn(e){if(e===null||V(e)||bn(e))return 1;if(yn(e))return 2}function An(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var jn={name:`attention`,resolveAll:Mn,tokenize:Nn};function Mn(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Pn(d,-c),Pn(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=an(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=an(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=an(l,An(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=an(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=an(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,rn(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Nn(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=kn(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=kn(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Pn(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Fn={name:`autolink`,tokenize:In};function In(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return fn(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||pn(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||pn(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||hn(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):mn(t)?(e.consume(t),l):n(t)}function u(e){return pn(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||pn(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Ln={partial:!0,tokenize:Rn};function Rn(e,t,n){return r;function r(t){return H(t)?U(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||B(e)?t(e):n(e)}}var zn={continuation:{tokenize:Vn},exit:Hn,name:`blockQuote`,tokenize:Bn};function Bn(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return H(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Vn(e,t,n){let r=this;return i;function i(t){return H(t)?U(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(zn,t,n)(r)}}function Hn(e){e.exit(`blockQuote`)}var Un={name:`characterEscape`,tokenize:Wn};function Wn(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return vn(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Gn={name:`characterReference`,tokenize:Kn};function Kn(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=pn,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=_n,u):(e.enter(`characterReferenceValue`),a=7,o=gn,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===pn&&!nn(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var qn={partial:!0,tokenize:Xn},Jn={concrete:!0,name:`codeFenced`,tokenize:Yn};function Yn(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),H(t)?U(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||B(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(qn,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||B(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):H(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),U(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||B(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||B(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&H(t)?U(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||B(t)?e.check(qn,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||B(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),H(t)?U(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),H(t)?U(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||B(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Xn(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Zn={name:`codeIndented`,tokenize:$n},Qn={partial:!0,tokenize:er};function $n(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),U(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):B(t)?e.attempt(Qn,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||B(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function er(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):U(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):B(e)?i(e):n(e)}}var tr={name:`codeText`,previous:rr,resolve:nr,tokenize:ir};function nr(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function rr(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function ir(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||B(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var ar=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&or(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),or(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),or(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);or(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);or(this.left,t.reverse())}}}};function or(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function sr(e){let t={},n=-1,r,i,a,o,s,c,l,u=new ar(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,cr(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return rn(e,0,1/0,u.slice(0)),!l}function cr(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var lr={resolve:dr,tokenize:fr},ur={partial:!0,tokenize:pr};function dr(e){return sr(e),e}function fr(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):B(t)?e.check(ur,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function pr(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),U(e,a,`linePrefix`)}function a(i){if(i===null||B(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function mr(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||hn(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||B(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||V(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||hn(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function hr(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):B(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||B(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!H(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function gr(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),U(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||B(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function _r(e,t){let n;return r;function r(i){return B(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):H(i)?U(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var vr={name:`definition`,tokenize:br},yr={partial:!0,tokenize:xr};function br(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return hr.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=dn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return V(t)?_r(e,l)(t):l(t)}function l(t){return mr(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(yr,d,d)(t)}function d(t){return H(t)?U(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||B(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function xr(e,t,n){return r;function r(t){return V(t)?_r(e,i)(t):n(t)}function i(t){return gr(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return H(t)?U(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||B(e)?t(e):n(e)}}var Sr={name:`hardBreakEscape`,tokenize:Cr};function Cr(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return B(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var wr={name:`headingAtx`,resolve:Tr,tokenize:Er};function Tr(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},rn(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Er(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||V(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||B(n)?(e.exit(`atxHeading`),t(n)):H(n)?U(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||V(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Dr=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Or=[`pre`,`script`,`style`,`textarea`],kr={concrete:!0,name:`htmlFlow`,resolveTo:Mr,tokenize:Nr},Ar={partial:!0,tokenize:Fr},jr={partial:!0,tokenize:Pr};function Mr(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Nr(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:ne):fn(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):fn(a)?(e.consume(a),i=4,r.interrupt?t:ne):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ne):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return fn(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||V(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Or.includes(l)?(i=1,r.interrupt?t(s):O(s)):Dr.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||pn(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return H(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||fn(t)?(e.consume(t),b):H(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||pn(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):H(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):H(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||B(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||V(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||H(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||B(t)?O(t):H(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),re):t===63&&i===3?(e.consume(t),ne):t===93&&i===5?(e.consume(t),N):B(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Ar,ie,k)(t)):t===null||B(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(jr,A,ie)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||B(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),ne):O(t)}function M(t){return t===47?(e.consume(t),o=``,te):O(t)}function te(t){if(t===62){let n=o.toLowerCase();return Or.includes(n)?(e.consume(t),re):O(t)}return fn(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),te):O(t)}function N(t){return t===93?(e.consume(t),ne):O(t)}function ne(t){return t===62?(e.consume(t),re):t===45&&i===2?(e.consume(t),ne):O(t)}function re(t){return t===null||B(t)?(e.exit(`htmlFlowData`),ie(t)):(e.consume(t),re)}function ie(n){return e.exit(`htmlFlow`),t(n)}}function Pr(e,t,n){let r=this;return i;function i(t){return B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Fr(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Ln,t,n)}}var Ir={name:`htmlText`,tokenize:Lr};function Lr(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):fn(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):fn(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):B(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):B(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):B(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):B(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return fn(t)?(e.consume(t),S):n(t)}function S(t){return t===45||pn(t)?(e.consume(t),S):C(t)}function C(t){return B(t)?(o=C,M(t)):H(t)?(e.consume(t),C):j(t)}function w(t){return t===45||pn(t)?(e.consume(t),w):t===47||t===62||V(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||fn(t)?(e.consume(t),E):B(t)?(o=T,M(t)):H(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||pn(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):B(t)?(o=D,M(t)):H(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):B(t)?(o=O,M(t)):H(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):B(t)?(o=k,M(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||V(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||V(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return H(t)?U(e,N,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):N(t)}function N(t){return e.enter(`htmlTextData`),o(t)}}var Rr={name:`labelEnd`,resolveAll:Hr,resolveTo:Ur,tokenize:Wr},zr={tokenize:Gr},Br={tokenize:Kr},Vr={tokenize:qr};function Hr(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&rn(e,0,e.length,n),e}function Ur(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=an(s,e.slice(a+1,a+r+3)),s=an(s,[[`enter`,u,t]]),s=an(s,An(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=an(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=an(s,e.slice(o+1)),s=an(s,[[`exit`,c,t]]),rn(e,a,e.length,s),e}function Wr(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(dn(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(zr,u,o?u:d)(t):t===91?e.attempt(Br,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Vr,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Gr(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return V(t)?_r(e,a)(t):a(t)}function a(t){return t===41?u(t):mr(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return V(t)?_r(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?gr(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return V(t)?_r(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Kr(e,t,n){let r=this;return i;function i(t){return hr.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(dn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function qr(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Jr={name:`labelStartImage`,resolveAll:Rr.resolveAll,tokenize:Yr};function Yr(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Xr={name:`labelStartLink`,resolveAll:Rr.resolveAll,tokenize:Zr};function Zr(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Qr={name:`lineEnding`,tokenize:$r};function $r(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),U(e,t,`linePrefix`)}}var ei={name:`thematicBreak`,tokenize:ti};function ti(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||B(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),H(t)?U(e,s,`whitespace`)(t):s(t))}}var ni={continuation:{tokenize:oi},exit:ci,name:`list`,tokenize:ai},ri={partial:!0,tokenize:li},ii={partial:!0,tokenize:si};function ai(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:gn(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(ei,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return gn(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Ln,r.interrupt?n:u,e.attempt(ri,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return H(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function oi(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Ln,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,U(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!H(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ii,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,U(e,e.attempt(ni,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function si(e,t,n){let r=this;return U(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function ci(e){e.exit(this.containerState.type)}function li(e,t,n){let r=this;return U(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!H(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var ui={name:`setextUnderline`,resolveTo:di,tokenize:fi};function di(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function fi(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),H(t)?U(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||B(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var pi={tokenize:mi};function mi(e){let t=this,n=e.attempt(Ln,r,e.attempt(this.parser.constructs.flowInitial,i,U(e,e.attempt(this.parser.constructs.flow,i,e.attempt(lr,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var hi={resolveAll:yi()},gi=vi(`string`),_i=vi(`text`);function vi(e){return{resolveAll:yi(e===`text`?bi:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function yi(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function bi(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var xi=e({attentionMarkers:()=>ki,contentInitial:()=>Ci,disable:()=>Ai,document:()=>Si,flow:()=>Ti,flowInitial:()=>wi,insideSpan:()=>Oi,string:()=>Ei,text:()=>Di}),Si={42:ni,43:ni,45:ni,48:ni,49:ni,50:ni,51:ni,52:ni,53:ni,54:ni,55:ni,56:ni,57:ni,62:zn},Ci={91:vr},wi={[-2]:Zn,[-1]:Zn,32:Zn},Ti={35:wr,42:ei,45:[ui,ei],60:kr,61:ui,95:ei,96:Jn,126:Jn},Ei={38:Gn,92:Un},Di={[-5]:Qr,[-4]:Qr,[-3]:Qr,33:Jr,38:Gn,42:jn,60:[Fn,Ir],91:Xr,92:[Sr,Un],93:Rr,95:jn,96:tr},Oi={null:[jn,hi]},ki={null:[42,95]},Ai={null:[]};function ji(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=an(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=An(a,l.events,l),l.events):[]}function f(e,t){return Ni(p(e),t)}function p(e){return Mi(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){B(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&rn(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Mi(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Ni(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
4
4
|
`;break;case-3:o=`\r
|
|
@@ -99,6 +99,6 @@ import{n as e,r as t,t as n}from"./rolldown-runtime-XKyaHtl9.js";import{i as r,n
|
|
|
99
99
|
|
|
100
100
|
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=Lh,c=!Ng.jitless,l=c&&Rh.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?py([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function gy(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!rg(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>lg(e,r,Pg())))}),t)}var _y=J(`$ZodUnion`,(e,t)=>{lv.init(e,t),q(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),q(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),q(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),q(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Sh(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>gy(t,r,e,i)):gy(o,r,e,i)}}),vy=J(`$ZodIntersection`,(e,t)=>{lv.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>by(e,t,n)):by(e,i,a)}});function yy(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(zh(e)&&zh(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=yy(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=yy(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function by(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=yy(t.value,n.value);if(!c.valid){if(rg(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var xy=J(`$ZodRecord`,(e,t)=>{lv.init(e,t);let n=Ng.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!zh(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>lg(e,i,Pg())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...ag(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...ag(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&R_.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>lg(e,i,Pg())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...ag(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...ag(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Sy=J(`$ZodEnum`,(e,t)=>{lv.init(e,t);let n=gh(t.entries),r=new Set(n);e._zod.values=r,q(e,`pattern`,e=>{let t=gh(e.def.entries).filter(e=>Vh.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Hh(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Cy=J(`$ZodLiteral`,(e,t)=>{lv.init(e,t);let n=new Set(t.values);e._zod.values=n,q(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Hh(e):e?Hh(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),wy=J(`$ZodTransform`,(e,t)=>{lv.init(e,t),e._zod.optin=`optional`,Ng.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Mg(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new jg;return n.value=i,n}});function Ty(e,t){return e.value=t.issues.length?void 0:t.value,e}var Ey=J(`$ZodOptional`,(e,t)=>{lv.init(e,t),q(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,q(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),q(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Sh(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Ty(e,t)):Ty(e,r)}return t.innerType._zod.run(e,n)}}),Dy=J(`$ZodExactOptional`,(e,t)=>{Ey.init(e,t),q(e,`values`,e=>e.def.innerType._zod.values),q(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Oy=J(`$ZodNullable`,(e,t)=>{lv.init(e,t),q(e,`optin`,e=>e.def.innerType._zod.optin),q(e,`optout`,e=>e.def.innerType._zod.optout),q(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Sh(t.source)}|null)$`):void 0}),q(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),ky=J(`$ZodDefault`,(e,t)=>{lv.init(e,t),e._zod.optin=`defaulted`,q(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ay(e,t)):Ay(r,t)}});function Ay(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var jy=J(`$ZodPrefault`,(e,t)=>{lv.init(e,t),e._zod.optin=`defaulted`,q(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),My=J(`$ZodNonOptional`,(e,t)=>{lv.init(e,t),q(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Ny(t,e)):Ny(i,e)}});function Ny(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Py(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>lg(e,r,Pg()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Fy=J(`$ZodCatch`,(e,t)=>{lv.init(e,t),q(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),q(e,`optout`,e=>e.def.innerType._zod.optout),q(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Py(e,r,t,n)):Py(e,r,t,n)}}),Iy=J(`$ZodPipe`,(e,t)=>{lv.init(e,t),q(e,`values`,e=>e.def.in._zod.values),q(e,`optin`,e=>e.def.in._zod.optin),q(e,`optout`,e=>e.def.out._zod.optout),q(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ly(e,t.in,n)):Ly(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ly(e,t.out,n)):Ly(r,t.out,n)}});function Ly(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Ry=J(`$ZodReadonly`,(e,t)=>{lv.init(e,t),q(e,`propValues`,e=>e.def.innerType._zod.propValues),q(e,`values`,e=>e.def.innerType._zod.values),q(e,`optin`,e=>e.def.innerType?._zod?.optin),q(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(zy):zy(r)}});function zy(e){return e.memo||(e.value=Object.freeze(e.value)),e}var By=J(`$ZodLazy`,(e,t)=>{lv.init(e,t),Th(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),q(e,`pattern`,e=>e.innerType?._zod?.pattern),q(e,`propValues`,e=>e.innerType?._zod?.propValues),q(e,`optin`,e=>e.innerType?._zod?.optin??void 0),q(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Vy=J(`$ZodCustom`,(e,t)=>{U_.init(e,t),lv.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Hy(t,n,r,e));Hy(i,n,r,e)}});function Hy(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(mg(e))}}var Uy=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Wy=`~memo`,Gy=[];function Ky(e){return typeof e==`object`&&!!e}function qy(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Jy=new WeakMap,Yy=0,Xy=1,Zy=2;function Qy(e,t,n){let r=Jy.get(e);if(r!==void 0)return r?Zy:Yy;if(t.has(e))return Zy;t.add(e);let i=Yy,a=e=>{if(i!==Zy&&e?._zod){let r=Qy(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=Yy;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Xy:o.value?._zod?Qy(o.value,t,n):Yy;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Dh(c);s(e?o(e,!0):Xy),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Qy(r,t,!1):Xy);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),$y(e,i)}function $y(e,t){return t!==Xy&&Jy.set(e,t===Zy),t}function eb(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var tb,nb=[],rb={alloc(e,t,n){let r=tb;if(!r)return n;tb=void 0;let i={value:n,issues:null};return r.set(t.value,i),nb.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&ab(n,e.value))throw new Uy;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Qy(e,new Set,!1);if(i===Yy)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Zy||r?n=!0:r=!0}let l=s.value;if(!Ky(l))return t(s,c);let u=c[Wy];u||(u={buckets:new WeakMap,backEdges:void 0},c[Wy]=u);let d;i===c?d=a:(d=eb(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...qy(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;tb=d;let p=nb.length,m=t(s,c);tb=void 0;let h=nb.length>p?nb.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?qy(e.issues):Gy),e)):(h&&(h.issues=m.issues.length?qy(m.issues):Gy),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function ib(){return rb}function ab(e,t){let n=e[Wy]?.backEdges;return n!==void 0&&Ky(t)&&n.has(t)}var ob=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(pg(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Wh(e.values[0])}`:`Invalid option: expected one of ${_h(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${_h(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function sb(){return{localeError:ob()}}var cb,lb=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ub(){return new lb}(cb=globalThis).__zod_globalRegistry??(cb.__zod_globalRegistry=ub());var db=globalThis.__zod_globalRegistry;function fb(e){return e.checks&&=[...e.checks],e}function pb(e,t){return new e(fb({type:`string`,...K(t)}))}function mb(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...K(t)})}function hb(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...K(t)})}function gb(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...K(t)})}function _b(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...K(t)})}function vb(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...K(t)})}function yb(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...K(t)})}function bb(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...K(t)})}function xb(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...K(t)})}function Sb(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...K(t)})}function Cb(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...K(t)})}function wb(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...K(t)})}function Tb(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...K(t)})}function Eb(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...K(t)})}function Db(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...K(t)})}function Ob(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...K(t)})}function kb(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...K(t)})}function Ab(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...K(t)})}function jb(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...K(t)})}function Mb(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...K(t)})}function Nb(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...K(t)})}function Pb(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...K(t)})}function Fb(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...K(t)})}function Ib(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...K(t)})}function Lb(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...K(t)})}function Rb(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...K(t)})}function zb(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...K(t)})}function Bb(e,t){return new e(fb({type:`number`,checks:[],...K(t)}))}function Vb(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...K(t)})}function Hb(e,t){return new e({type:`boolean`,...K(t)})}function Ub(e,t){return new e({type:`null`,...K(t)})}function Wb(e){return new e({type:`unknown`})}function Gb(e,t){return new e({type:`never`,...K(t)})}function Kb(e,t){return new e({type:`date`,...K(t)})}function qb(e,t){return new K_({check:`less_than`,...K(t),value:e,inclusive:!1})}function Jb(e,t){return new K_({check:`less_than`,...K(t),value:e,inclusive:!0})}function Yb(e,t){return new q_({check:`greater_than`,...K(t),value:e,inclusive:!1})}function Xb(e,t){return new q_({check:`greater_than`,...K(t),value:e,inclusive:!0})}function Zb(e,t){return new J_({check:`multiple_of`,...K(t),value:e})}function Qb(e,t){return new X_({check:`max_length`,...K(t),maximum:e})}function $b(e,t){return new Z_({check:`min_length`,...K(t),minimum:e})}function ex(e,t){return new Q_({check:`length_equals`,...K(t),length:e})}function tx(e,t){return new ev({check:`string_format`,format:`regex`,...K(t),pattern:e})}function nx(e){return new tv({check:`string_format`,format:`lowercase`,...K(e)})}function rx(e){return new nv({check:`string_format`,format:`uppercase`,...K(e)})}function ix(e,t){return new rv({check:`string_format`,format:`includes`,...K(t),includes:e})}function ax(e,t){return new iv({check:`string_format`,format:`starts_with`,...K(t),prefix:e})}function ox(e,t){return new av({check:`string_format`,format:`ends_with`,...K(t),suffix:e})}function sx(e){return new ov({check:`overwrite`,tx:e})}function cx(e){return sx(t=>t.normalize(e))}function lx(){return sx(e=>e.trim())}function ux(){return sx(e=>e.toLowerCase())}function dx(){return sx(e=>e.toUpperCase())}function fx(){return sx(e=>Fh(e))}function px(e,t,n){return new e({type:`array`,element:t,...K(n)})}function mx(e,t,n){let r=K(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function hx(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...K(n)})}function gx(e,t){let n=_x(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(mg(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(mg(r))}},e(t.value,t)),t);return n}function _x(e,t){let n=new U_({check:`custom`,...K(t)});return n._zod.check=e,n}function vx(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Eh(e,t,n[t]);return e}function yx(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??db,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function bx(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function xx(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,xx(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&vx(o.schema,c),t.io===`input`&&jx(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Sx(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Cx(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Sx(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Sx(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
101
101
|
|
|
102
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function wx(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;wx(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Tx=new Set([`type`,`properties`,`required`,`additionalProperties`]),Ex=[`oneOf`,`anyOf`];function Dx(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ox(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Tx.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Dx(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Eh(n,r,e.length===1?e[0]:Ox(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Dx(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function kx(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Tx)if(t in e)return;let n=t.filter(e=>Ex.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ox(t);else{let e=n[0],i=Ex.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Ox([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,vx(e,r))}function Ax(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):vx(i,s),vx(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())wx(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])kx(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}vx(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Eh(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Nx(t,`input`,e.processors),output:Nx(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function jx(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return jx(r.element,n);if(r.type===`set`)return jx(r.valueType,n);if(r.type===`lazy`)return jx(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return jx(r.innerType,n);if(r.type===`intersection`)return jx(r.left,n)||jx(r.right,n);if(r.type===`record`||r.type===`map`)return jx(r.keyType,n)||jx(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:jx(r.in,n)||jx(r.out,n);if(r.type===`object`){for(let e in r.shape)if(jx(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(jx(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(jx(e,n))return!0;return!!(r.rest&&jx(r.rest,n))}return!1}var Mx=(e,t={})=>n=>{let r=yx({...n,processors:t});return xx(e,r),Cx(r,e),Ax(r,e)},Nx=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=yx({...i??{},target:a,io:t,processors:n});return xx(e,o),Cx(o,e),Ax(o,e)},Px=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Fx=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ix=(e,t)=>{Px(e,`minimum`,t),Fx(e,`maximum`,t)},Lx=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Rx=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},zx=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Bx=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Vx=(e,t)=>Px(e,`minimum`,t.minimum),Hx=(e,t)=>Fx(e,`maximum`,t.maximum),Ux=e=>(t,n)=>{Bx(t,n.format);let[r,i]=e[n.format];Px(t,`minimum`,r),Fx(t,`maximum`,i)},Wx={greater_than:(e,t)=>Px(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Fx(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Lx(e,t.value),number_format:Ux(Kh),bigint_format:Ux(qh),min_length:Vx,max_length:Hx,length_equals:(e,t)=>Ix(e,t.length),min_size:Vx,max_size:Hx,size_equals:(e,t)=>Ix(e,t.size),string_format:(e,t)=>{Bx(e,t.format),t.pattern&&Rx(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>zx(e,t.mime)};function Gx(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Wx[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Px(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Px(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Fx(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Fx(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Lx(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&zx(t,i.mime);for(let e of i.patterns??[])Rx(t,e);return t}var Kx={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},qx=new Map([[Gv,E_],[qv,D_]]),Jx=e=>qx.get(e)??e,Yx=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Gx(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Kx[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Jx);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Xx=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Gx(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):bx(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Zx=(e,t,n,r)=>{n.type=`boolean`},Qx=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},$x=(e,t,n,r)=>{n.not={}},eS=(e,t,n,r)=>{bx(e,t,n,r,`Date cannot be represented in JSON Schema`)},tS=(e,t,n,r)=>{let i=e._zod.def,a=gh(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},nS=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(bx(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(bx(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},rS=(e,t,n,r)=>{bx(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},iS=(e,t,n,r)=>{bx(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},aS=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Gx(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=xx(a.element,t,{...r,path:[...r.path,`items`]})};function oS(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?oS(t.out):t.type===`catch`?oS(t.innerType):e._zod.optin}var sS=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&bx(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Eh(i.properties,e,xx(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?oS(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=xx(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},cS=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>xx(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},lS=(e,t,n,r)=>{let i=e._zod.def,a=xx(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=xx(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function uS(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=uS(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>uS(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?R_:L_).source)),p}var dS=new WeakMap;function fS(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of dS.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=uS(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var pS=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Gx(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=xx(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)Eh(i.patternProperties,Jx(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=xx(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=dS.get(t);n||(n=[],dS.set(t,n),t.deferred.push(()=>fS(t))),n.push(e)}i.additionalProperties=xx(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&oS(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},mS=(e,t,n,r)=>{let i=e._zod.def,a=xx(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},hS=(e,t,n,r)=>{let i=e._zod.def;xx(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},gS=Symbol();function _S(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(bx(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),gS):JSON.parse(o)}var vS=(e,t,n,r)=>{let i=e._zod.def;xx(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=_S(i.defaultValue,e,t,n,r);o!==gS&&(n.default=o)},yS=(e,t,n,r)=>{let i=e._zod.def;xx(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=_S(i.defaultValue,e,t,n,r);o!==gS&&(n._prefault=o)},bS=(e,t,n,r)=>{let i=e._zod.def;xx(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{bx(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},xS=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;xx(o,t,r);let s=t.seen.get(e);s.ref=o},SS=(e,t,n,r)=>{let i=e._zod.def;xx(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},CS=(e,t,n,r)=>{let i=e._zod.def;xx(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},wS=(e,t,n,r)=>{let i=e._zod.innerType;xx(i,t,r);let a=t.seen.get(e);a.ref=i},TS=new WeakSet([Object.prototype,Error.prototype]);function ES(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var DS=J(`ZodError`,(e,t)=>{Bg.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);TS.has(n)||(TS.add(n),ES(n,`format`,e=>t=>Ug(e,t)),ES(n,`flatten`,e=>t=>Hg(e,t)),ES(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,vh,2)}),ES(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,vh,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),OS=Gg(DS),kS=Kg(DS),AS=qg(DS),jS=Yg(DS),MS=t_(DS),NS=n_(DS),PS=r_(DS),FS=i_(DS),IS=a_(DS),LS=o_(DS),RS=s_(DS),zS=c_(DS);function BS(){Ng.localeError||Pg(sb())}function VS(){Ng.memoizer||Pg({memoizer:ib()})}var HS=J(`ZodType`,(e,t)=>(BS(),lv.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Nh(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Uh(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(fw(e,t))},superRefine(e,t){return this.check(pw(e,t))},overwrite(e){return this.check(sx(e))},optional(){return GC(this)},exactOptional(){return qC(this)},nullable(){return YC(this)},nullish(){return GC(YC(this))},nonoptional(e){return tw(this,e)},array(){return kC(this)},or(e){return NC([this,e])},and(e){return FC(this,e)},transform(e){return aw(this,UC(e))},default(e){return ZC(this,e)},prefault(e){return $C(this,e)},catch(e){return rw(this,e)},pipe(e){return aw(this,e)},readonly(){return sw(this)},describe(e){let t=this.clone();return db.add(t,{description:e}),t},meta(...e){if(e.length===0)return db.get(this);let t=this.clone();return db.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return _g(this,`~standard`,{...fv(this),jsonSchema:{input:Nx(this,`input`),output:Nx(this,`output`)}})},set"~standard"(e){gg(this,`~standard`,e)},parse:function e(t,n){return OS(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await kS(this,t,n,{callee:e})},safeParse(e,t){return AS(this,e,t)},async safeParseAsync(e,t){return jS(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){gg(this,`spa`,e)},validate(e,t){return Qg(this,e,t)},validateAsync(e,t){return e_(this,e,t)},encode:function e(t,n){return MS(this,t,n,{callee:e})},decode:function e(t,n){return NS(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await PS(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await FS(this,t,n,{callee:e})},safeEncode(e,t){return IS(this,e,t)},safeDecode(e,t){return LS(this,e,t)},async safeEncodeAsync(e,t){return RS(this,e,t)},async safeDecodeAsync(e,t){return zS(this,e,t)},toJSONSchema(e){return Mx(this,{})(e)},get description(){return db.get(this)?.description},get _def(){return this._zod.def}}),US=J(`_ZodString`,(e,t)=>{pv.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yx(e,t,n,r)},vg({format:e=>Gx(e).format??null,minLength:e=>Gx(e).minimum??null,maxLength:e=>Gx(e).maximum??null},{regex(...e){return this.check(tx(...e))},includes(...e){return this.check(ix(...e))},startsWith(...e){return this.check(ax(...e))},endsWith(...e){return this.check(ox(...e))},min(...e){return this.check($b(...e))},max(...e){return this.check(Qb(...e))},length(...e){return this.check(ex(...e))},nonempty(...e){return this.check($b(1,...e))},lowercase(e){return this.check(nx(e))},uppercase(e){return this.check(rx(e))},trim(){return this.check(lx())},normalize(...e){return this.check(cx(...e))},toLowerCase(){return this.check(ux())},toUpperCase(){return this.check(dx())},slugify(){return this.check(fx())}})),WS=J(`ZodString`,(e,t)=>{pv.init(e,t),US.init(e,t)},{email(e){return this.check(mb(XS,e))},url(e){return this.check(bb($S,e))},jwt(e){return this.check(Fb(mC,e))},emoji(e){return this.check(xb(eC,e))},guid(e){return this.check(hb(ZS,e))},uuid(e){return this.check(gb(QS,e))},uuidv4(e){return this.check(_b(QS,e))},uuidv6(e){return this.check(vb(QS,e))},uuidv7(e){return this.check(yb(QS,e))},nanoid(e){return this.check(Sb(tC,e))},cuid(e){return this.check(Cb(nC,e))},cuid2(e){return this.check(wb(rC,e))},ulid(e){return this.check(Tb(iC,e))},base64(e){return this.check(Mb(dC,e))},base64url(e){return this.check(Nb(fC,e))},xid(e){return this.check(Eb(aC,e))},ksuid(e){return this.check(Db(oC,e))},ipv4(e){return this.check(Ob(sC,e))},ipv6(e){return this.check(kb(cC,e))},cidrv4(e){return this.check(Ab(lC,e))},cidrv6(e){return this.check(jb(uC,e))},e164(e){return this.check(Pb(pC,e))},datetime(e){return this.check(Ib(KS,e))},date(e){return this.check(Lb(qS,e))},time(e){return this.check(Rb(JS,e))},duration(e){return this.check(zb(YS,e))}});function Y(e){return pb(WS,e)}var GS=J(`ZodStringFormat`,(e,t)=>{mv.init(e,t),US.init(e,t)}),KS=J(`ZodISODateTime`,(e,t)=>{Nv.init(e,t),GS.init(e,t)}),qS=J(`ZodISODate`,(e,t)=>{Pv.init(e,t),GS.init(e,t)}),JS=J(`ZodISOTime`,(e,t)=>{Fv.init(e,t),GS.init(e,t)}),YS=J(`ZodISODuration`,(e,t)=>{Iv.init(e,t),GS.init(e,t)}),XS=J(`ZodEmail`,(e,t)=>{_v.init(e,t),GS.init(e,t)}),ZS=J(`ZodGUID`,(e,t)=>{hv.init(e,t),GS.init(e,t)}),QS=J(`ZodUUID`,(e,t)=>{gv.init(e,t),GS.init(e,t)}),$S=J(`ZodURL`,(e,t)=>{Tv.init(e,t),GS.init(e,t)}),eC=J(`ZodEmoji`,(e,t)=>{Ev.init(e,t),GS.init(e,t)}),tC=J(`ZodNanoID`,(e,t)=>{Dv.init(e,t),GS.init(e,t)}),nC=J(`ZodCUID`,(e,t)=>{Ov.init(e,t),GS.init(e,t)}),rC=J(`ZodCUID2`,(e,t)=>{kv.init(e,t),GS.init(e,t)}),iC=J(`ZodULID`,(e,t)=>{Av.init(e,t),GS.init(e,t)}),aC=J(`ZodXID`,(e,t)=>{jv.init(e,t),GS.init(e,t)}),oC=J(`ZodKSUID`,(e,t)=>{Mv.init(e,t),GS.init(e,t)}),sC=J(`ZodIPv4`,(e,t)=>{Lv.init(e,t),GS.init(e,t)}),cC=J(`ZodIPv6`,(e,t)=>{Bv.init(e,t),GS.init(e,t)}),lC=J(`ZodCIDRv4`,(e,t)=>{Vv.init(e,t),GS.init(e,t)}),uC=J(`ZodCIDRv6`,(e,t)=>{Uv.init(e,t),GS.init(e,t)}),dC=J(`ZodBase64`,(e,t)=>{Kv.init(e,t),GS.init(e,t)}),fC=J(`ZodBase64URL`,(e,t)=>{Yv.init(e,t),GS.init(e,t)}),pC=J(`ZodE164`,(e,t)=>{Xv.init(e,t),GS.init(e,t)}),mC=J(`ZodJWT`,(e,t)=>{Qv.init(e,t),GS.init(e,t)}),hC=J(`ZodNumber`,(e,t)=>{$v.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xx(e,t,n,r),e.isFinite=!0},vg({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Gx(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Gx(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Gx(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Gx(e).format??null},{gt(e,t){return this.check(Yb(e,t))},gte(e,t){return this.check(Xb(e,t))},min(e,t){return this.check(Xb(e,t))},lt(e,t){return this.check(qb(e,t))},lte(e,t){return this.check(Jb(e,t))},max(e,t){return this.check(Jb(e,t))},int(e){return this.check(X(e))},safe(e){return this.check(X(e))},positive(e){return this.check(Yb(0,e))},nonnegative(e){return this.check(Xb(0,e))},negative(e){return this.check(qb(0,e))},nonpositive(e){return this.check(Jb(0,e))},multipleOf(e,t){return this.check(Zb(e,t))},step(e,t){return this.check(Zb(e,t))},finite(){return this}}));function gC(e){return Bb(hC,e)}var _C=J(`ZodNumberFormat`,(e,t)=>{ey.init(e,t),hC.init(e,t)});function X(e){return Vb(_C,e)}var vC=J(`ZodBoolean`,(e,t)=>{ty.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zx(e,t,n,r)});function yC(e){return Hb(vC,e)}var bC=J(`ZodNull`,(e,t)=>{ny.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qx(e,t,n,r)});function xC(e){return Ub(bC,e)}var SC=J(`ZodUnknown`,(e,t)=>{ry.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function CC(){return Wb(SC)}var wC=J(`ZodNever`,(e,t)=>{iy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$x(e,t,n,r)});function TC(e){return Gb(wC,e)}var EC=J(`ZodDate`,(e,t)=>{ay.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eS(e,t,n,r),e.min=(t,n)=>e.check(Xb(t,n)),e.max=(t,n)=>e.check(Jb(t,n))},vg({minDate:e=>{let{minimum:t}=Gx(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=Gx(e);return t?new Date(t):null}},{}));function DC(e){return Kb(EC,e)}var OC=J(`ZodArray`,(e,t)=>{VS(),ly.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aS(e,t,n,r),e.element=t.element},{min(e,t){return this.check($b(e,t))},nonempty(e){return this.check($b(1,e))},max(e,t){return this.check(Qb(e,t))},length(e,t){return this.check(ex(e,t))},unwrap(){return this.element}});function kC(e,t){return px(OC,e,t)}var AC=J(`ZodObject`,(e,t)=>{VS(),hy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sS(e,t,n,r),wg(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return zC(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Nh(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Nh(this._zod.def,{catchall:CC()}))},loose(){return this.clone(Nh(this._zod.def,{catchall:CC()}))},strict(){return this.clone(Nh(this._zod.def,{catchall:TC()}))},strip(){return this.clone(Nh(this._zod.def,{catchall:void 0}))},extend(e){return Zh(this,e)},safeExtend(e){return $h(this,e)},merge(e){return eg(this,e)},pick(e){return Jh(this,e)},omit(e){return Xh(this,e)},partial(...e){return tg(WC,this,e[0])},exactPartial(...e){return tg(KC,this,e[0],`exactPartial`)},required(...e){return ng(ew,this,e[0])}});function Z(e,t){return new AC({type:`object`,shape:e??{},...K(t)})}function jC(e,t){return new AC({type:`object`,shape:e,catchall:CC(),...K(t)})}var MC=J(`ZodUnion`,(e,t)=>{_y.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cS(e,t,n,r),e.options=t.options});function NC(e,t){return new MC({type:`union`,options:e,...K(t)})}var PC=J(`ZodIntersection`,(e,t)=>{vy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lS(e,t,n,r)});function FC(e,t){return new PC({type:`intersection`,left:e,right:t})}var IC=J(`ZodRecord`,(e,t)=>{VS(),xy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pS(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function LC(e,t,n){return!t||!t._zod?new IC({type:`record`,keyType:Y(),valueType:e,...K(t)}):new IC({type:`record`,keyType:e,valueType:t,...K(n)})}var RC=J(`ZodEnum`,(e,t)=>{Sy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tS(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new RC({...t,checks:[],...K(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new RC({...t,checks:[],...K(r),entries:i})}});function zC(e,t){return new RC({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...K(t)})}var BC=J(`ZodLiteral`,(e,t)=>{Cy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nS(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function VC(e,t){return new BC({type:`literal`,values:Array.isArray(e)?e:[e],...K(t)})}var HC=J(`ZodTransform`,(e,t)=>{VS(),wy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iS(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Mg(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(mg(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(mg(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function UC(e){return new HC({type:`transform`,transform:e})}var WC=J(`ZodOptional`,(e,t)=>{Ey.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>CS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function GC(e){return new WC({type:`optional`,innerType:e})}var KC=J(`ZodExactOptional`,(e,t)=>{Dy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>CS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qC(e){return new KC({type:`optional`,innerType:e})}var JC=J(`ZodNullable`,(e,t)=>{Oy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function YC(e){return new JC({type:`nullable`,innerType:e})}var XC=J(`ZodDefault`,(e,t)=>{ky.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ZC(e,t){return new XC({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Bh(t)}})}var QC=J(`ZodPrefault`,(e,t)=>{jy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $C(e,t){return new QC({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Bh(t)}})}var ew=J(`ZodNonOptional`,(e,t)=>{My.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function tw(e,t){return new ew({type:`nonoptional`,innerType:e,...K(t)})}var nw=J(`ZodCatch`,(e,t)=>{Fy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function rw(e,t){return new nw({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Eg(t)})}var iw=J(`ZodPipe`,(e,t)=>{Iy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xS(e,t,n,r),e.in=t.in,e.out=t.out});function aw(e,t){return new iw({type:`pipe`,in:e,out:t})}var ow=J(`ZodReadonly`,(e,t)=>{Ry.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>SS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sw(e){return new ow({type:`readonly`,innerType:e})}var cw=J(`ZodLazy`,(e,t)=>{By.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wS(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function lw(e){return new cw({type:`lazy`,getter:e})}var uw=J(`ZodCustom`,(e,t)=>{Vy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rS(e,t,n,r)});function dw(e,t){return mx(uw,e??(()=>!0),t)}function fw(e,t={}){return hx(uw,e,t)}function pw(e,t){return gx(e,t)}function mw(e){let t=lw(()=>NC([Y(e),gC(),yC(),xC(),kC(t),LC(Y(),t)]));return t}var hw=t(ed(),1),gw={"common.all":`All`,"common.backToList":`Back to List`,"common.cancel":`Cancel`,"common.close":`Close`,"common.confirm":`Confirm`,"common.create":`Create`,"common.createdAt":`Created At`,"common.delete":`Delete`,"common.edit":`Edit`,"common.login":`Login`,"common.logout":`Logout`,"common.manage":`Manage`,"common.results":e=>Fw(e,{one:`${e} result`,other:`${e} results`}),"common.save":`Save`,"common.search":`Search`,"common.searchPlaceholder":`Search...`,"common.searchType":`Search Type`,"common.sort":`Sort`,"confirm.delete":`Are you sure you want to delete?`,"confirm.save":`Do you want to save?`,"dashboard.adminMenu":`Admin Menu`,"dashboard.createdAt":`Joined`,"dashboard.email":`Email`,"dashboard.loginRequired":`Please login to continue.`,"dashboard.name":`Name`,"dashboard.role":`Role`,"dashboard.title":`Admin Dashboard`,"dashboard.welcome":`Welcome!`,"delete.confirm.description":`This action cannot be undone. This will permanently delete this item.`,"delete.confirm.title":`Are you sure?`,"entity.create":e=>`Create ${e}`,"entity.edit":(e,t)=>`Edit ${e} (#${t})`,"entity.list":e=>`${e} List`,"entity.listManage":e=>`Manage ${e} List`,"error.alreadyProcessed":`Already processed`,"error.badRequest":`Bad request`,"error.detail":e=>e,"error.duplicateRow":`Duplicate data`,"error.forbidden":`Forbidden`,"error.internalServerError":`Internal server error`,"error.notFound":`Not found`,"error.serviceUnavailable":`Service unavailable`,"setting.invalidValue":e=>`Invalid setting value: ${e}`,"setting.unknownKey":e=>`Unknown setting key ${e}`,"qgrid.dispatcherFailed":e=>`${e} dispatcher failed to initialize`,"qgrid.dispatcherStarting":e=>`${e} dispatcher is starting up. Please retry shortly`,"qgrid.grokCapabilityUnavailable":e=>`Grok capability unavailable: ${e}`,"qgrid.grokCapacity":`All Grok tokens are at their in-flight request cap. Please retry shortly`,"qgrid.grokContentPolicy":e=>`Grok generation blocked by content policy: ${e}`,"qgrid.grokInvalidRequest":e=>`Invalid Grok request: ${e}`,"qgrid.openaiVoiceInvalidRequest":e=>`Invalid OpenAI voice request: ${e}`,"qgrid.grokLoginFailed":e=>`Grok login failed: ${e}`,"qgrid.grokNotOAuthToken":`Grok login returned credentials that are not an xAI OAuth token`,"qgrid.grokNoWorkers":e=>`No Grok token is available: ${e}`,"qgrid.grokRateLimited":e=>`All Grok tokens are rate limited. Retry after ${e} seconds`,"qgrid.grokOnDemandExcluded":e=>`All Grok tokens are excluded because on-demand billing is enabled at xAI: ${e}. Turn off on-demand billing, or add another account`,"qgrid.grokZdrVideoUnavailable":e=>`Grok video is unavailable because Zero Data Retention is on for: ${e}. Turn off the data-retention opt-out at xAI, or use a non-ZDR account`,"qgrid.invalidInput":e=>`qgrid: invalid input: ${e}`,"qgrid.requestBodyTooLarge":e=>`Request body exceeds the ${e} MiB limit`,"qgrid.videoJobNotFound":`video job not found`,"error.unauthorized":`Unauthorized`,notFound:(e,t)=>`${e} ID ${t} not found`,"validation.email":`Invalid email format`,"validation.maxLength":(e,t)=>`${e} must be at most ${t} characters`,"validation.minLength":(e,t)=>`${e} must be at least ${t} characters`,"validation.required":e=>`${e} is required`,"validation.url":`Invalid URL format`},_w={"common.all":`전체`,"common.backToList":`목록으로`,"common.cancel":`취소`,"common.close":`닫기`,"common.confirm":`확인`,"common.create":`생성`,"common.createdAt":`등록`,"common.delete":`삭제`,"common.edit":`수정`,"common.login":`로그인`,"common.logout":`로그아웃`,"common.manage":`관리`,"common.results":e=>`${e}개 결과`,"common.save":`저장`,"common.search":`검색`,"common.searchPlaceholder":`검색...`,"common.searchType":`검색 유형`,"common.sort":`정렬`,"confirm.delete":`정말 삭제하시겠습니까?`,"confirm.save":`저장하시겠습니까?`,"dashboard.adminMenu":`관리 메뉴`,"dashboard.createdAt":`가입일`,"dashboard.email":`이메일`,"dashboard.loginRequired":`로그인이 필요합니다.`,"dashboard.name":`이름`,"dashboard.role":`역할`,"dashboard.title":`관리자 대시보드`,"dashboard.welcome":`환영합니다!`,"delete.confirm.description":`이 작업은 취소할 수 없습니다. 항목이 영구적으로 삭제됩니다.`,"delete.confirm.title":`정말 삭제하시겠습니까?`,"entity.create":e=>`${e} 생성`,"entity.edit":(e,t)=>`${e} 수정 (#${t})`,"entity.list":e=>`${e} 목록`,"entity.listManage":e=>`${e} 목록 관리`,"error.alreadyProcessed":`이미 처리되었습니다`,"error.badRequest":`잘못된 요청입니다`,"error.detail":e=>e,"error.duplicateRow":`중복된 데이터입니다`,"error.entityNotFound":(e,t)=>`존재하지 않는 ${e} ID ${t}`,"error.forbidden":`권한이 없습니다`,"error.internalServerError":`서버 오류가 발생했습니다`,"error.notFound":`찾을 수 없습니다`,"error.serviceUnavailable":`서비스를 사용할 수 없습니다`,"setting.invalidValue":e=>`설정 값이 올바르지 않습니다: ${e}`,"setting.unknownKey":e=>`알 수 없는 설정 키 ${e}`,"qgrid.dispatcherFailed":e=>`${e} dispatcher 초기화에 실패했습니다`,"qgrid.dispatcherStarting":e=>`${e} dispatcher 기동 중입니다. 잠시 후 다시 시도해주세요`,"qgrid.grokCapabilityUnavailable":e=>`Grok 기능을 사용할 수 없습니다: ${e}`,"qgrid.grokCapacity":`모든 Grok 토큰이 동시 요청 한도에 도달했습니다. 잠시 후 다시 시도해주세요`,"qgrid.grokContentPolicy":e=>`콘텐츠 정책 위반으로 Grok 생성이 차단되었습니다: ${e}`,"qgrid.grokInvalidRequest":e=>`잘못된 Grok 요청입니다: ${e}`,"qgrid.openaiVoiceInvalidRequest":e=>`잘못된 OpenAI 음성 요청입니다: ${e}`,"qgrid.grokLoginFailed":e=>`Grok 로그인에 실패했습니다: ${e}`,"qgrid.grokNotOAuthToken":`Grok 로그인 결과가 xAI OAuth 토큰이 아닙니다`,"qgrid.grokNoWorkers":e=>`사용 가능한 Grok 토큰이 없습니다: ${e}`,"qgrid.grokRateLimited":e=>`모든 Grok 토큰이 요청 한도에 걸렸습니다. ${e}초 후 다시 시도해주세요`,"qgrid.grokOnDemandExcluded":e=>`xAI에서 on-demand 과금이 켜져 있어 모든 Grok 토큰이 제외되었습니다: ${e}. on-demand 과금을 끄거나 다른 계정을 추가해주세요`,"qgrid.grokZdrVideoUnavailable":e=>`Zero Data Retention이 켜져 있어 Grok 비디오를 사용할 수 없습니다: ${e}. xAI에서 data-retention opt-out을 끄거나 ZDR이 아닌 계정을 사용해주세요`,"qgrid.invalidInput":e=>`qgrid: 잘못된 입력입니다: ${e}`,"qgrid.requestBodyTooLarge":e=>`요청 본문이 ${e} MiB 제한을 초과했습니다`,"qgrid.videoJobNotFound":`비디오 작업을 찾을 수 없습니다`,"error.unauthorized":`인증이 필요합니다`,"error.unknownSearchField":e=>`구현되지 않은 검색 필드 ${e}`,notFound:(e,t)=>`존재하지 않는 ${e} ID ${t}`,"validation.email":`올바른 이메일 형식이 아닙니다`,"validation.maxLength":(e,t)=>`${e}${Iw(e,`은는`)} 최대 ${t}자까지 입력할 수 있습니다`,"validation.minLength":(e,t)=>`${e}${Iw(e,`은는`)} 최소 ${t}자 이상이어야 합니다`,"validation.required":e=>`${Iw(e,`은는`)} 필수입니다`,"validation.url":`올바른 URL 형식이 아닙니다`},vw=`ko`,yw=[`ko`,`en`],bw=vw;function xw(e){bw=e}function Sw(){return bw}var Cw={"rc.asyncSelect.loading":`로딩 중...`,"rc.asyncSelect.noOptions":`옵션이 없습니다`,"rc.asyncSelect.noResults":`검색 결과가 없습니다`,"rc.asyncSelect.selectPlaceholder":`선택하세요...`,"rc.combobox.noResults":`검색 결과가 없습니다`,"rc.combobox.selectPlaceholder":`선택하세요...`,"rc.datePicker.pickDate":`날짜 선택`,"rc.datePicker.placeholder":`날짜 선택`,"rc.datePicker.selectDate":`날짜 선택`,"rc.dateSelectorMultiple.addDate":`날짜 추가`,"rc.dateSelectorMultiple.dateRange":`기간`,"rc.dateSelectorMultiple.placeholder":`날짜 선택`,"rc.dateSelectorMultiple.singleDate":`단일`,"rc.fileInput.browseFiles":`파일 찾기`,"rc.fileInput.dropZone":`파일을 드래그하거나 클릭하여 업로드`,"rc.fileInput.filePlaceholder":`파일`,"rc.fileInput.imagePlaceholder":`이미지`,"rc.fileInput.maxFilesExceeded":e=>`최대 ${e}개 파일만 업로드 가능합니다`,"rc.fileInput.pending":`대기 중`,"rc.fileInput.remove":`제거`,"rc.fileInput.uploadFailed":`업로드 실패`,"rc.fileInput.uploading":`업로드 중...`,"rc.monthPickerMultiple.addMonth":`월 추가`,"rc.monthPickerMultiple.dateRange":`기간`,"rc.monthPickerMultiple.endDate":`종료일`,"rc.monthPickerMultiple.placeholder":`월 선택`,"rc.monthPickerMultiple.singleDate":`단일`,"rc.monthPickerMultiple.startDate":`시작일`,"rc.multiSelect.clear":`전체 해제`,"rc.multiSelect.close":`닫기`,"rc.multiSelect.moreItems":e=>`+${e}개 더보기`,"rc.multiSelect.noOptions":`옵션이 없습니다`,"rc.multiSelect.noOptionsSelected":`선택된 옵션이 없습니다`,"rc.multiSelect.noResults":`검색 결과가 없습니다`,"rc.multiSelect.optionsCount":e=>`${e}개 옵션`,"rc.multiSelect.selectAll":`전체 선택`,"rc.multiSelect.selectPlaceholder":`선택하세요...`,"rc.pagination.next":`다음`,"rc.pagination.previous":`이전`,"rc.pagination.showing":(e,t,n)=>`${n}개 중 ${e}-${t}`,"rc.calendar.month.0":`1월`,"rc.calendar.month.1":`2월`,"rc.calendar.month.2":`3월`,"rc.calendar.month.3":`4월`,"rc.calendar.month.4":`5월`,"rc.calendar.month.5":`6월`,"rc.calendar.month.6":`7월`,"rc.calendar.month.7":`8월`,"rc.calendar.month.8":`9월`,"rc.calendar.month.9":`10월`,"rc.calendar.month.10":`11월`,"rc.calendar.month.11":`12월`,"rc.sonamuFilter.title":`소나무 필터`,"rc.sonamuFilter.apply":`적용`,"rc.sonamuFilter.reset":`초기화`,"rc.sonamuFilter.addRule":`규칙 추가`,"rc.sonamuFilter.noRulesYet":`아직 규칙이 없습니다. "+ 규칙 추가"를 클릭하여 시작하세요.`,"rc.sonamuFilter.selectField":`필드 선택`,"rc.sonamuFilter.selectOperator":`연산자 선택`,"rc.sonamuFilter.selectOperatorFirst":`먼저 연산자를 선택하세요`,"rc.sonamuFilter.enterValue":`값 입력`,"rc.sonamuFilter.enterNumber":`숫자 입력`,"rc.sonamuFilter.notSupported":`지원하지 않음`,"rc.sonamuFilter.startDate":`시작일`,"rc.sonamuFilter.endDate":`종료일`,"rc.sonamuFilter.appliedFilters":`🌲 적용된 소나무 필터`,"rc.common.cancel":`취소`,"rc.common.save":`저장`},ww={"rc.asyncSelect.loading":`Loading...`,"rc.asyncSelect.noOptions":`No options`,"rc.asyncSelect.noResults":`No results`,"rc.asyncSelect.selectPlaceholder":`Select...`,"rc.combobox.noResults":`No results`,"rc.combobox.selectPlaceholder":`Select...`,"rc.datePicker.pickDate":`Pick date`,"rc.datePicker.placeholder":`Pick date`,"rc.datePicker.selectDate":`Select date`,"rc.dateSelectorMultiple.addDate":`Add date`,"rc.dateSelectorMultiple.dateRange":`Range`,"rc.dateSelectorMultiple.placeholder":`Pick date`,"rc.dateSelectorMultiple.singleDate":`Single`,"rc.fileInput.browseFiles":`Browse files`,"rc.fileInput.dropZone":`Drag files here or click to upload`,"rc.fileInput.filePlaceholder":`File`,"rc.fileInput.imagePlaceholder":`Image`,"rc.fileInput.maxFilesExceeded":e=>`Maximum ${e} files allowed`,"rc.fileInput.pending":`Pending`,"rc.fileInput.remove":`Remove`,"rc.fileInput.uploadFailed":`Upload failed`,"rc.fileInput.uploading":`Uploading...`,"rc.monthPickerMultiple.addMonth":`Add month`,"rc.monthPickerMultiple.dateRange":`Range`,"rc.monthPickerMultiple.endDate":`End date`,"rc.monthPickerMultiple.placeholder":`Pick month`,"rc.monthPickerMultiple.singleDate":`Single`,"rc.monthPickerMultiple.startDate":`Start date`,"rc.multiSelect.clear":`Clear all`,"rc.multiSelect.close":`Close`,"rc.multiSelect.moreItems":e=>`+${e} more`,"rc.multiSelect.noOptions":`No options`,"rc.multiSelect.noOptionsSelected":`No options selected`,"rc.multiSelect.noResults":`No results`,"rc.multiSelect.optionsCount":e=>`${e} options`,"rc.multiSelect.selectAll":`Select all`,"rc.multiSelect.selectPlaceholder":`Select...`,"rc.pagination.next":`Next`,"rc.pagination.previous":`Previous`,"rc.pagination.showing":(e,t,n)=>`Showing ${e}-${t} of ${n}`,"rc.calendar.month.0":`January`,"rc.calendar.month.1":`February`,"rc.calendar.month.2":`March`,"rc.calendar.month.3":`April`,"rc.calendar.month.4":`May`,"rc.calendar.month.5":`June`,"rc.calendar.month.6":`July`,"rc.calendar.month.7":`August`,"rc.calendar.month.8":`September`,"rc.calendar.month.9":`October`,"rc.calendar.month.10":`November`,"rc.calendar.month.11":`December`,"rc.sonamuFilter.title":`Sonamu Filter`,"rc.sonamuFilter.apply":`Apply`,"rc.sonamuFilter.reset":`Reset`,"rc.sonamuFilter.addRule":`Add Rule`,"rc.sonamuFilter.noRulesYet":`No rules yet. Click "+ Add Rule" to start.`,"rc.sonamuFilter.selectField":`Select field`,"rc.sonamuFilter.selectOperator":`Operator`,"rc.sonamuFilter.selectOperatorFirst":`Select operator first`,"rc.sonamuFilter.enterValue":`Enter value`,"rc.sonamuFilter.enterNumber":`Enter number`,"rc.sonamuFilter.notSupported":`Not supported`,"rc.sonamuFilter.startDate":`Start date`,"rc.sonamuFilter.endDate":`End date`,"rc.sonamuFilter.appliedFilters":`🌲 Applied SonamuFilters`,"rc.common.cancel":`Cancel`,"rc.common.save":`Save`},Tw={"entity.RequestLog":`RequestLog`,"entity.RequestLog.id":`ID`,"entity.RequestLog.created_at":`등록일시`,"entity.RequestLog.token_name":`토큰 이름`,"entity.RequestLog.project_name":`프로젝트 이름`,"entity.RequestLog.model_name":`모델 이름`,"entity.RequestLog.requested_model_name":`요청 모델 이름 (fallback 전)`,"entity.RequestLog.fallback_count":`모델 fallback 횟수`,"entity.RequestLog.user_prompt":`사용자 프롬프트`,"entity.RequestLog.system_prompt":`시스템 프롬프트`,"entity.RequestLog.response":`llm 응답 전문`,"entity.RequestLog.input_tokens":`입력 토큰`,"entity.RequestLog.output_tokens":`출력 토큰`,"entity.RequestLog.cache_read_tokens":`캐시 읽기 토큰`,"entity.RequestLog.cache_creation_tokens":`캐시 생성 토큰`,"entity.RequestLog.cache_creation_5m_tokens":`5분 TTL 캐시 생성 토큰`,"entity.RequestLog.cache_creation_1h_tokens":`1시간 TTL 캐시 생성 토큰`,"entity.RequestLog.duration_ms":`응답 소요시간(ms)`,"entity.RequestLog.ttft_ms":`first gen TTFT(ms)`,"entity.RequestLog.cost_usd":`API 비용`,"entity.RequestLog.cost_source":`비용 출처(provider/pricing_table/mixed)`,"entity.RequestLog.image_cost_usd":`이미지 생성 비용`,"entity.RequestLog.image_cost_method":`이미지 비용 계산 방식`,"entity.RequestLog.service_tier":`Requested OpenAI service tier`,"entity.RequestLog.effort":`effort level`,"entity.RequestLog.history":`inject_items 히스토리`,"entity.RequestLog.input_images":`현재 user turn 입력 이미지`,"entity.RequestLog.tools":`요청에 장착된 tool 정의 목록`,"entity.RequestLog.json_schema":`structured output 요청의 JSON Schema 원문 (detail 의 response 타입 표시용)`,"entity.RequestLog.status":`실행 상태`,"entity.RequestLog.error_message":`에러 메시지`,"entity.RequestLog.response_json_ok":`structured(jsonSchema) 요청의 응답 JSON 파싱 성공 여부. 비structured 요청은 null`,"entity.RequestLog.tool_call_count":`tool call 횟수`,"entity.RequestLog.is_image_generation":`이미지 생성 turn 여부 (quota 귀속용)`,"entity.RequestLog.is_structured":`structured output(jsonSchema) 요청 여부 (목록 구분 표시용)`,"entity.RequestLog.media_kind":`미디어 엔드포인트 종류(image/video/stt/tts). 텍스트 요청은 null (목록 Fmt 표시용)`,"enum.RequestLogOrderBy.id-desc":`ID최신순`,"enum.RequestLogOrderBy.id-asc":`ID오래된순`,"enum.RequestLogOrderBy.created_at-desc":`등록일시최신순`,"enum.RequestLogOrderBy.created_at-asc":`등록일시오래된순`,"enum.RequestLogOrderBy.ttft_ms-desc":`TTFT긴순`,"enum.RequestLogOrderBy.ttft_ms-asc":`TTFT짧은순`,"enum.RequestLogOrderBy.duration_ms-desc":`소요시간긴순`,"enum.RequestLogOrderBy.duration_ms-asc":`소요시간짧은순`,"enum.RequestLogOrderBy.input_tokens-desc":`입력토큰많은순`,"enum.RequestLogOrderBy.input_tokens-asc":`입력토큰적은순`,"enum.RequestLogOrderBy.output_tokens-desc":`출력토큰많은순`,"enum.RequestLogOrderBy.output_tokens-asc":`출력토큰적은순`,"enum.RequestLogOrderBy.cache_read_tokens-desc":`캐시읽기많은순`,"enum.RequestLogOrderBy.cache_read_tokens-asc":`캐시읽기적은순`,"enum.RequestLogOrderBy.cache_creation_tokens-desc":`캐시생성많은순`,"enum.RequestLogOrderBy.cache_creation_tokens-asc":`캐시생성적은순`,"enum.RequestLogOrderBy.cost_usd-desc":`비용높은순`,"enum.RequestLogOrderBy.cost_usd-asc":`비용낮은순`,"enum.RequestLogSearchField.id":`ID`,"enum.RequestLogSearchField.token_name":`토큰이름`,"enum.RequestLogSearchField.user_prompt":`사용자 프롬프트`,"enum.RequestLogStatus.running":`실행 중`,"enum.RequestLogStatus.succeeded":`성공`,"enum.RequestLogStatus.error":`에러`,"enum.RequestLogStatus.aborted":`중단`,"enum.RequestLogMediaKind.image":`이미지`,"enum.RequestLogMediaKind.video":`비디오`,"enum.RequestLogMediaKind.stt":`음성 인식`,"enum.RequestLogMediaKind.tts":`음성 합성`,"entity.RequestLogStep":`RequestLogStep`,"entity.RequestLogStep.id":`ID`,"entity.RequestLogStep.created_at":`등록일시`,"entity.RequestLogStep.request_log":`부모 request log ID`,"entity.RequestLogStep.step_index":`ai-sdk step number (0-based)`,"entity.RequestLogStep.type":`step 타입`,"entity.RequestLogStep.model_name":`실제 serving 모델`,"entity.RequestLogStep.requested_model_name":`요청 모델 (fallback 전)`,"entity.RequestLogStep.fallback_count":`모델 fallback 횟수`,"entity.RequestLogStep.input_tokens":`입력 토큰 (generate)`,"entity.RequestLogStep.output_tokens":`출력 토큰 (generate)`,"entity.RequestLogStep.cache_read_tokens":`캐시 읽기 토큰`,"entity.RequestLogStep.cache_creation_tokens":`캐시 생성 토큰`,"entity.RequestLogStep.cache_creation_5m_tokens":`5분 TTL 캐시 생성 토큰`,"entity.RequestLogStep.cache_creation_1h_tokens":`1시간 TTL 캐시 생성 토큰`,"entity.RequestLogStep.cost_usd":`step 비용 (micro-USD)`,"entity.RequestLogStep.cost_source":`비용 출처(provider/pricing_table)`,"entity.RequestLogStep.duration_ms":`소요시간(ms)`,"entity.RequestLogStep.ttft_ms":`Gen TTFT(ms)`,"entity.RequestLogStep.finish_reason":`완료 사유`,"entity.RequestLogStep.reasoning_text":`reasoning 텍스트`,"entity.RequestLogStep.reasoning_tokens":`reasoning 토큰 수`,"entity.RequestLogStep.tool_call_index":`같은 step 내 tool call 순서`,"entity.RequestLogStep.tool_call_id":`tool call ID`,"entity.RequestLogStep.tool_name":`tool 이름`,"entity.RequestLogStep.tool_args":`tool 인자 (JSON string)`,"entity.RequestLogStep.tool_result":`tool 결과 (JSON string)`,"entity.RequestLogStep.tool_duration_ms":`tool 실행 소요시간(ms)`,"entity.RequestLogStep.error":`step 에러 메시지`,"enum.RequestLogStepType.generate":`LLM 생성`,"enum.RequestLogStepType.tool_call":`Tool 호출`,"enum.RequestLogStepOrderBy.id-asc":`ID순`,"enum.RequestLogStepSearchField.id":`ID`,"entity.Setting":`Setting`,"entity.Setting.id":`ID`,"entity.Setting.created_at":`등록일시`,"entity.Setting.key":`설정 키 (예: slack.enabled)`,"entity.Setting.value":`설정 값 (문자열 저장, 앱에서 파싱·검증)`,"entity.Setting.updated_at":`최종 수정일시`,"enum.SettingOrderBy.key-asc":`키순`,"enum.SettingSearchField.key":`키`,"entity.Token":`Token`,"entity.Token.id":`ID`,"entity.Token.created_at":`등록일시`,"entity.Token.provider":`프로바이더`,"entity.Token.credentials":`인증 정보 (JSONB)`,"entity.Token.name":`토큰 이름`,"entity.Token.active":`활성 여부`,"entity.Token.reauth_required":`인증 만료로 재로그인이 필요한지 여부`,"entity.Token.ord":`정렬 순서`,"entity.Token.quota_threshold":`quota 사용률 임계치(%). null이면 미설정`,"entity.Token.weight":`가중 라운드로빈 라우팅 가중치 (1..100)`,"entity.Token.keepalive_enabled":`Anthropic 5시간 토큰 윈도우 keepalive 사용 여부`,"enum.TokenOrderBy.id-desc":`ID최신순`,"enum.TokenOrderBy.ord-asc":`순서순`,"enum.TokenSearchField.id":`ID`,"enum.TokenSearchField.name":`이름`},Ew={ko:{...Cw,...Tw,..._w},en:{...ww,...gw}};function Dw(e,t){let n=Ew[t];if(n?.[e]!==void 0)return n[e];if(t!==vw&&Ew[vw]?.[e]!==void 0)return Ew[vw][e];for(let n of yw)if(n!==t&&n!==vw&&Ew[n]?.[e]!==void 0)return Ew[n][e];return e}function Ow(e){return Dw(e,Sw())}Ow.locale=e=>t=>Dw(t,e),Ow.enumLabels=e=>new Proxy({},{get(t,n){if(typeof n!=`symbol`)return Dw(`enum.${e}.${n}`,Sw())}});function kw(e,t){return typeof t==`string`&&(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d{1,3})?)?(Z|[+-]\d{2}:\d{2})?$/.test(t)||/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}[+-]\d{2}:\d{2}$/.test(t))&&new Date(t).toString()!==`Invalid Date`?new Date(t):t}Xm.defaults.transformResponse=[e=>{if(typeof e==`string`)try{return JSON.parse(e,kw)}catch{return e}return e}],Xm.interceptors.request.use(e=>(e.headers[`Accept-Language`]=Sw(),e));async function Q(e){try{return(await Xm({...e})).data}catch(e){if(Xm.isAxiosError(e)&&e.response?.data){let t=e.response.data;throw new Aw(e.response.status,t.message,t.issues)}throw e}}var Aw=class extends Error{code;message;issues;isSonamuError;constructor(e,t,n){super(t),this.code=e,this.message=t,this.issues=n,this.isSonamuError=!0}};function jw(e){return e&&e.isSonamuError===!0}var Mw=zC([`both`,`list`,`count`]);Z({semanticQuery:Z({embedding:kC(gC()).min(1024).max(1024),threshold:gC().optional(),method:zC([`cosine`,`l2`,`inner_product`]).optional()})});function Nw(e){return NC([e,e.array()])}Y().regex(/([0-9]{4}-[0-9]{2}-[0-9]{2}( [0-9]{2}:[0-9]{2}:[0-9]{2})*)$/,{message:`잘못된 SQLDate 타입`}).min(10).max(19).describe(`SQLDateTimeString`),Z({name:Y(),url:Y(),mime_type:Y(),size:gC()});function Pw(e,t,n,r={}){let{enabled:i=!0,retry:a=3,retryInterval:o=3e3}=r,[s,c]=(0,F.useState)({isConnected:!1,error:null,retryCount:0,isEnded:!1}),l=(0,F.useRef)(null),u=(0,F.useRef)(null),d=(0,F.useRef)(n);(0,F.useEffect)(()=>{d.current=n},[n]);let f=()=>{if(i)try{l.current&&=(l.current.close(),null),u.current&&=(clearTimeout(u.current),null);let n=hw.default.stringify(t),r=new fh(n?`${e}?${n}`:e,{fetch:(e,t)=>globalThis.fetch(e,{...t,headers:{...t?.headers,"Accept-Language":Sw()}})});l.current=r,c(e=>({...e,isConnected:!1,error:null,isEnded:!1})),r.onopen=()=>{c(e=>({...e,isConnected:!0,error:null,retryCount:0,isEnded:!1}))},r.onerror=e=>{l.current===r&&(r.close(),c(e=>({...e,isConnected:!1,error:`Connection failed`,isEnded:!1})),c(e=>e.retryCount<a?(u.current=setTimeout(()=>{u.current!==null&&(c(e=>({...e,retryCount:e.retryCount+1,isEnded:!1})),f())},o),e):(l.current=null,{...e,error:`Connection failed after ${a} attempts`})))},r.addEventListener(`end`,()=>{if(l.current===r&&(r.close(),l.current=null,c(e=>({...e,isConnected:!1,error:null,isEnded:!0})),d.current.end)){let e=d.current.end;e(`end`)}}),Object.keys(d.current).forEach(e=>{let t=d.current[e];t&&r.addEventListener(e,n=>{if(l.current===r){try{let e=JSON.parse(n.data,kw);t(e)}catch(t){console.error(`Failed to parse SSE data for event ${e}:`,t)}c(e=>({...e,isEnded:!1}))}})}),r.onmessage=e=>{if(l.current===r)try{let t=JSON.parse(e.data,kw),n=d.current.message;n&&n(t)}catch(e){console.error(`Failed to parse SSE message:`,e)}}}catch(e){c(t=>({...t,error:e instanceof Error?e.message:`Unknown error`,isConnected:!1,isEnded:!1}))}};return(0,F.useEffect)(()=>(i&&(c({isConnected:!1,error:null,retryCount:0,isEnded:!1}),f()),()=>{l.current&&=(l.current.close(),null),u.current&&=(clearTimeout(u.current),null)}),[e,JSON.stringify(t),i]),s}function Fw(e,t){let n=e===0&&t.zero||e===1&&t.one||t.other;return typeof n==`function`?n(e):n??e.toString()}function Iw(e,t){let n=(()=>{let t=e.charCodeAt(e.length-1);return t<44032||t>55203?!1:(t-44032)%28!=0})();return e+{은는:n?`은`:`는`,이가:n?`이`:`가`,을를:n?`을`:`를`,과와:n?`과`:`와`,으로:n?`으로`:`로`}[t]}function Lw(e){let t=new Set,n=[];for(let r of e.pages)for(let e of r?.rows??[]){let r=e?.id;if(r!==null){if(t.has(r))continue;t.add(r)}n.push(e)}let r=e.pages[0]?.total??0;return{pages:e.pages,pageParams:e.pageParams,rows:n,total:r}}function Rw(e){let[t,n]=(0,F.useState)(!1),r=(0,F.useCallback)(async()=>{n(!0);try{await e.refetch()}finally{n(!1)}},[e]);return{...e,refresh:r,isRefreshing:t}}var zw;(function(e){async function t(e,t){return Q({method:`GET`,url:`/api/token/findById?${hw.default.stringify({subset:e,id:t})}`})}e.getToken=t;let n=e.getTokenQueryOptions=(e,n)=>x({queryKey:[`Token`,`getToken`,e,n],queryFn:()=>t(e,n)});e.useToken=(e,t,r)=>Rw(b({...n(e,t),...r}));async function r(e,t){return Q({method:`GET`,url:`/api/token/findMany?${hw.default.stringify({subset:e,rawParams:t})}`})}e.getTokens=r;let i=e.getTokensQueryOptions=(e,t)=>x({queryKey:[`Token`,`getTokens`,e,t],queryFn:()=>r(e,t)});e.useTokens=(e,t,n)=>Rw(b({...i(e,t),...n}));let a=e.getTokensInfiniteQueryOptions=(e,t)=>E({queryKey:[`Token`,`getTokens`,`infinite`,e,t],queryFn:({pageParam:n})=>r(e,{...t,page:n}),initialPageParam:1,getNextPageParam:(e,t)=>{let n=e?.total??0;return t.reduce((e,t)=>e+(t?.rows?.length??0),0)<n?t.length+1:void 0},select:Lw});e.useTokensInfinite=(e,t,n)=>Rw(y({...a(e,t),...n}));async function o(e){return Q({method:`POST`,url:`/api/token/reorder`,data:{ids:e}})}e.reorder=o,e.useReorderMutation=()=>k({mutationFn:e=>zw.reorder(e.ids)});async function s(e){return Q({method:`POST`,url:`/api/token/del`,data:{ids:e}})}e.del=s,e.useDelMutation=()=>k({mutationFn:e=>zw.del(e.ids)})})(zw||={});var Bw;(function(e){async function t(e,t){return Q({method:`GET`,url:`/api/setting/findById?${hw.default.stringify({subset:e,id:t})}`})}e.getSetting=t;let n=e.getSettingQueryOptions=(e,n)=>x({queryKey:[`Setting`,`getSetting`,e,n],queryFn:()=>t(e,n)});e.useSetting=(e,t,r)=>Rw(b({...n(e,t),...r}));async function r(e,t){return Q({method:`GET`,url:`/api/setting/findMany?${hw.default.stringify({subset:e,rawParams:t})}`})}e.getSettings=r;let i=e.getSettingsQueryOptions=(e,t)=>x({queryKey:[`Setting`,`getSettings`,e,t],queryFn:()=>r(e,t)});e.useSettings=(e,t,n)=>Rw(b({...i(e,t),...n}));let a=e.getSettingsInfiniteQueryOptions=(e,t)=>E({queryKey:[`Setting`,`getSettings`,`infinite`,e,t],queryFn:({pageParam:n})=>r(e,{...t,page:n}),initialPageParam:1,getNextPageParam:(e,t)=>{let n=e?.total??0;return t.reduce((e,t)=>e+(t?.rows?.length??0),0)<n?t.length+1:void 0},select:Lw});e.useSettingsInfinite=(e,t,n)=>Rw(y({...a(e,t),...n}));async function o(){return Q({method:`GET`,url:`/api/setting/listSettings`})}e.getSettingList=o;let s=e.getSettingListQueryOptions=()=>x({queryKey:[`Setting`,`getSettingList`],queryFn:()=>o()});e.useSettingList=e=>Rw(b({...s(),...e}));async function c(e,t){return Q({method:`POST`,url:`/api/setting/updateSetting`,data:{key:e,value:t}})}e.updateSetting=c,e.useUpdateSettingMutation=()=>k({mutationFn:e=>Bw.updateSetting(e.key,e.value)});async function l(e){return Q({method:`POST`,url:`/api/setting/resetSetting`,data:{key:e}})}e.resetSetting=l,e.useResetSettingMutation=()=>k({mutationFn:e=>Bw.resetSetting(e.key)});async function u(){return Q({method:`POST`,url:`/api/setting/triggerExpiryReminder`})}e.triggerExpiryReminder=u,e.useTriggerExpiryReminderMutation=()=>k({mutationFn:e=>Bw.triggerExpiryReminder()})})(Bw||={});var Vw;(function(e){async function t(e,t){return Q({method:`GET`,url:`/api/requestLogStep/findById?${hw.default.stringify({subset:e,id:t})}`})}e.getRequestLogStep=t;let n=e.getRequestLogStepQueryOptions=(e,n)=>x({queryKey:[`RequestLogStep`,`getRequestLogStep`,e,n],queryFn:()=>t(e,n)});e.useRequestLogStep=(e,t,r)=>Rw(b({...n(e,t),...r}));async function r(e,t){return Q({method:`GET`,url:`/api/requestLogStep/findMany?${hw.default.stringify({subset:e,rawParams:t})}`})}e.getRequestLogSteps=r;let i=e.getRequestLogStepsQueryOptions=(e,t)=>x({queryKey:[`RequestLogStep`,`getRequestLogSteps`,e,t],queryFn:()=>r(e,t)});e.useRequestLogSteps=(e,t,n)=>Rw(b({...i(e,t),...n}));let a=e.getRequestLogStepsInfiniteQueryOptions=(e,t)=>E({queryKey:[`RequestLogStep`,`getRequestLogSteps`,`infinite`,e,t],queryFn:({pageParam:n})=>r(e,{...t,page:n}),initialPageParam:1,getNextPageParam:(e,t)=>{let n=e?.total??0;return t.reduce((e,t)=>e+(t?.rows?.length??0),0)<n?t.length+1:void 0},select:Lw});e.useRequestLogStepsInfinite=(e,t,n)=>Rw(y({...a(e,t),...n}));async function o(e){return Q({method:`POST`,url:`/api/requestLogStep/save`,data:{spa:e}})}e.save=o,e.useSaveMutation=()=>k({mutationFn:e=>Vw.save(e.spa)});async function s(e){return Q({method:`POST`,url:`/api/requestLogStep/del`,data:{ids:e}})}e.del=s,e.useDelMutation=()=>k({mutationFn:e=>Vw.del(e.ids)})})(Vw||={});var Hw;(function(e){async function t(e,t){return Q({method:`GET`,url:`/api/requestLog/findById?${hw.default.stringify({subset:e,id:t})}`})}e.getRequestLog=t;let n=e.getRequestLogQueryOptions=(e,n)=>x({queryKey:[`RequestLog`,`getRequestLog`,e,n],queryFn:()=>t(e,n)});e.useRequestLog=(e,t,r)=>Rw(b({...n(e,t),...r}));async function r(e,t){return Q({method:`GET`,url:`/api/requestLog/findMany?${hw.default.stringify({subset:e,rawParams:t})}`})}e.getRequestLogs=r;let i=e.getRequestLogsQueryOptions=(e,t)=>x({queryKey:[`RequestLog`,`getRequestLogs`,e,t],queryFn:()=>r(e,t)});e.useRequestLogs=(e,t,n)=>Rw(b({...i(e,t),...n}));let a=e.getRequestLogsInfiniteQueryOptions=(e,t)=>E({queryKey:[`RequestLog`,`getRequestLogs`,`infinite`,e,t],queryFn:({pageParam:n})=>r(e,{...t,page:n}),initialPageParam:1,getNextPageParam:(e,t)=>{let n=e?.total??0;return t.reduce((e,t)=>e+(t?.rows?.length??0),0)<n?t.length+1:void 0},select:Lw});e.useRequestLogsInfinite=(e,t,n)=>Rw(y({...a(e,t),...n}));async function o(e){return Q({method:`POST`,url:`/api/requestLog/save`,data:{spa:e}})}e.save=o,e.useSaveMutation=()=>k({mutationFn:e=>Hw.save(e.spa)});async function s(e){return Q({method:`GET`,url:`/api/requestLog/responseTypeTs?${hw.default.stringify({id:e})}`})}e.responseTypeTs=s;let c=e.responseTypeTsQueryOptions=e=>x({queryKey:[`RequestLog`,`responseTypeTs`,e],queryFn:()=>s(e)});e.useResponseTypeTs=(e,t)=>Rw(b({...c(e),...t}));async function l(e){return Q({method:`GET`,url:`/api/requestLog/toolsView?${hw.default.stringify({id:e})}`})}e.toolsView=l;let u=e.toolsViewQueryOptions=e=>x({queryKey:[`RequestLog`,`toolsView`,e],queryFn:()=>l(e)});e.useToolsView=(e,t)=>Rw(b({...u(e),...t}));async function d(e){return Q({method:`POST`,url:`/api/requestLog/del`,data:{ids:e}})}e.del=d,e.useDelMutation=()=>k({mutationFn:e=>Hw.del(e.ids)})})(Hw||={});var Uw;(function(e){async function t(e){return Q({method:`POST`,url:`/api/qgrid/query`,data:{args:e}})}e.query=t,e.useQueryMutation=()=>k({mutationFn:e=>Uw.query(e.args)});async function n(e){return Q({method:`POST`,url:`/api/qgrid/prepareStream`,data:{args:e}})}e.prepareStream=n,e.usePrepareStreamMutation=()=>k({mutationFn:e=>Uw.prepareStream(e.args)});function r(e,t,n){return Pw(`/api/qgrid/queryStream`,e,t,n)}e.useQueryStream=r;async function i(e){return Q({method:`POST`,url:`/api/qgrid/createRun`,data:{input:e}})}e.createRun=i,e.useCreateRunMutation=()=>k({mutationFn:e=>Uw.createRun(e.input)});async function a(e){return Q({method:`POST`,url:`/api/qgrid/appendStep`,data:{input:e}})}e.appendStep=a,e.useAppendStepMutation=()=>k({mutationFn:e=>Uw.appendStep(e.input)});async function o(e){return Q({method:`POST`,url:`/api/qgrid/finishRun`,data:{input:e}})}e.finishRun=o,e.useFinishRunMutation=()=>k({mutationFn:e=>Uw.finishRun(e.input)});async function s(){return Q({method:`GET`,url:`/api/qgrid/stats`})}e.stats=s;let c=e.statsQueryOptions=()=>x({queryKey:[`Qgrid`,`stats`],queryFn:()=>s()});e.useStats=e=>Rw(b({...c(),...e}));async function l(e){return Q({method:`GET`,url:`/api/qgrid/totalCost?${hw.default.stringify({params:e})}`})}e.totalCost=l;let u=e.totalCostQueryOptions=e=>x({queryKey:[`Qgrid`,`totalCost`,e],queryFn:()=>l(e)});e.useTotalCost=(e,t)=>Rw(b({...u(e),...t}));async function d(){return Q({method:`GET`,url:`/api/qgrid/projectNames`})}e.projectNames=d;let f=e.projectNamesQueryOptions=()=>x({queryKey:[`Qgrid`,`projectNames`],queryFn:()=>d()});e.useProjectNames=e=>Rw(b({...f(),...e}));async function p(){return Q({method:`GET`,url:`/api/qgrid/modelNames`})}e.modelNames=p;let m=e.modelNamesQueryOptions=()=>x({queryKey:[`Qgrid`,`modelNames`],queryFn:()=>p()});e.useModelNames=e=>Rw(b({...m(),...e}));async function h(e,t,n){return Q({method:`POST`,url:`/api/qgrid/addToken`,data:{provider:e,credentials:t,name:n}})}e.addToken=h,e.useAddTokenMutation=()=>k({mutationFn:e=>Uw.addToken(e.provider,e.credentials,e.name)});async function g(e,t,n,r,i){return Q({method:`POST`,url:`/api/qgrid/updateToken`,data:{id:e,name:t,quotaThreshold:n,weight:r,keepaliveEnabled:i}})}e.updateToken=g;async function _(e){return Q({method:`POST`,url:`/api/qgrid/removeToken`,data:{id:e}})}e.removeToken=_,e.useRemoveTokenMutation=()=>k({mutationFn:e=>Uw.removeToken(e.id)});async function v(e){return Q({method:`POST`,url:`/api/qgrid/toggleToken`,data:{id:e}})}e.toggleToken=v,e.useToggleTokenMutation=()=>k({mutationFn:e=>Uw.toggleToken(e.id)});async function y(e){return Q({method:`POST`,url:`/api/qgrid/oauthStart`,data:{name:e}})}e.oauthStart=y,e.useOauthStartMutation=()=>k({mutationFn:e=>Uw.oauthStart(e.name)});async function S(e){return Q({method:`POST`,url:`/api/qgrid/oauthComplete`,data:{pastedCode:e}})}e.oauthComplete=S,e.useOauthCompleteMutation=()=>k({mutationFn:e=>Uw.oauthComplete(e.pastedCode)});async function C(e){return Q({method:`POST`,url:`/api/qgrid/oauthStartOpenAI`,data:{name:e}})}e.oauthStartOpenAI=C,e.useOauthStartOpenAIMutation=()=>k({mutationFn:e=>Uw.oauthStartOpenAI(e.name)});async function w(e){return Q({method:`POST`,url:`/api/qgrid/oauthStartGrok`,data:{name:e}})}e.oauthStartGrok=w,e.useOauthStartGrokMutation=()=>k({mutationFn:e=>Uw.oauthStartGrok(e.name)});async function T(e){return Q({method:`POST`,url:`/api/qgrid/oauthStartGrokDevice`,data:{name:e}})}e.oauthStartGrokDevice=T,e.useOauthStartGrokDeviceMutation=()=>k({mutationFn:e=>Uw.oauthStartGrokDevice(e.name)});async function E(e){return Q({method:`POST`,url:`/api/qgrid/oauthPollGrokDevice`,data:{deviceCode:e}})}e.oauthPollGrokDevice=E,e.useOauthPollGrokDeviceMutation=()=>k({mutationFn:e=>Uw.oauthPollGrokDevice(e.deviceCode)});async function D(e){return Q({method:`POST`,url:`/api/qgrid/generateImages`,data:{params:e}})}e.generateImages=D,e.useGenerateImagesMutation=()=>k({mutationFn:e=>Uw.generateImages(e.params)});async function O(e){return Q({method:`POST`,url:`/api/qgrid/videoStart`,data:{params:e}})}e.videoStart=O,e.useVideoStartMutation=()=>k({mutationFn:e=>Uw.videoStart(e.params)});async function A(e){return Q({method:`POST`,url:`/api/qgrid/videoStatus`,data:{params:e}})}e.videoStatus=A,e.useVideoStatusMutation=()=>k({mutationFn:e=>Uw.videoStatus(e.params)});async function ee(e){return Q({method:`POST`,url:`/api/qgrid/transcribe`,data:{params:e}})}e.transcribe=ee,e.useTranscribeMutation=()=>k({mutationFn:e=>Uw.transcribe(e.params)});async function j(e){return Q({method:`POST`,url:`/api/qgrid/speak`,data:{params:e}})}e.speak=j,e.useSpeakMutation=()=>k({mutationFn:e=>Uw.speak(e.params)});async function M(e){return Q({method:`GET`,url:`/api/qgrid/usage?${hw.default.stringify({tokenId:e})}`})}e.usage=M;let te=e.usageQueryOptions=e=>x({queryKey:[`Qgrid`,`usage`,e],queryFn:()=>M(e)});e.useUsage=(e,t)=>Rw(b({...te(e),...t}));async function N(){return Q({method:`GET`,url:`/api/qgrid/health`})}e.health=N;let ne=e.healthQueryOptions=()=>x({queryKey:[`Qgrid`,`health`],queryFn:()=>N()});e.useHealth=e=>Rw(b({...ne(),...e}))})(Uw||={});var Ww;(function(e){async function t(e){return Q({method:`GET`,url:`/api/monit/monitLogs?${hw.default.stringify({cursor:e})}`})}e.monitLogs=t;let n=e.monitLogsQueryOptions=e=>x({queryKey:[`Monit`,`monitLogs`,e],queryFn:()=>t(e)});e.useMonitLogs=(e,t)=>Rw(b({...n(e),...t}));async function r(){return Q({method:`GET`,url:`/api/monit/monitInfo`})}e.monitInfo=r;let i=e.monitInfoQueryOptions=()=>x({queryKey:[`Monit`,`monitInfo`],queryFn:()=>r()});e.useMonitInfo=e=>Rw(b({...i(),...e}));async function a(){return Q({method:`GET`,url:`/api/monit/monitStats`})}e.monitStats=a;let o=e.monitStatsQueryOptions=()=>x({queryKey:[`Monit`,`monitStats`],queryFn:()=>a()});e.useMonitStats=e=>Rw(b({...o(),...e}))})(Ww||={}),Hw.useRequestLogs,Hw.useRequestLogsInfinite,Vw.useRequestLogSteps,Vw.useRequestLogStepsInfinite,Bw.useSettings,Bw.useSettingsInfinite,zw.useTokens,zw.useTokensInfinite;function Gw(e,t){return e.flatMap(e=>{let n=t?e.images??[]:[];return e.role===`user`?[{type:`message`,role:`user`,content:[{type:`input_text`,text:e.text},...n.map(e=>({type:`input_image`,image_url:e}))]}]:[...e.text?[{type:`message`,role:`assistant`,content:[{type:`output_text`,text:e.text}]}]:[],...n.length?[{type:`message`,role:`user`,content:[{type:`input_text`,text:`Previously generated assistant images (reference for follow-up edits):`},...n.map(e=>({type:`input_image`,image_url:e}))]}]:[]]})}function Kw(e){return e.flatMap(e=>e.type===`image`?[`data:${e.mediaType??`image/png`};base64,${e.data}`]:[])}function qw(e,t){return e.filter(e=>e.active&&e.provider===t).toSorted((e,t)=>e.ord-t.ord||e.name.localeCompare(t.name))}function Jw(e,t){return t!==void 0&&!e.some(e=>e.active&&e.provider===t)}function Yw(e,t,n){return!e||!n||t.some(t=>t.name===e)?e:``}function Xw(e,t){return e.model!==t.model||e.system!==t.system||e.tokenName!==t.tokenName}function Zw(e){return e?{tokenName:e}:{}}var Qw=t(i(),1);function $w(e){let t=e.indexOf(`,`),n=e.slice(0,t).match(/^data:image\/(png|jpeg|webp);base64$/)?.[1];if(!n)return{extension:`—`,bytes:0};let r=e.endsWith(`==`)?2:+!!e.endsWith(`=`);return{extension:n===`jpeg`?`jpg`:n,bytes:Math.max(0,Math.floor((e.length-t-1)*3/4)-r)}}function eT(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(2)} MB`}function tT({url:e,onClose:t}){let n=(0,F.useRef)(null),[r,i]=(0,F.useState)(null),[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(!1),l=$w(e);return(0,F.useEffect)(()=>{let e=n.current;return e?.showModal(),()=>e?.close()},[]),(0,Qw.createPortal)((0,I.jsx)(`dialog`,{ref:n,"aria-labelledby":`chat-image-preview-title`,onCancel:e=>{e.preventDefault(),t()},className:`m-0 h-dvh max-h-none w-screen max-w-none overflow-hidden bg-transparent p-0 backdrop:bg-black/65`,children:(0,I.jsx)(`div`,{className:`grid size-full place-items-center p-4`,onClick:e=>{e.target===e.currentTarget&&t()},children:(0,I.jsxs)(`div`,{className:`w-[min(1100px,calc(100vw-2rem))] max-h-[calc(100dvh-2rem)] overflow-hidden rounded-2xl bg-white text-sand-900 shadow-xl`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-sand-100 px-4 py-3`,children:[(0,I.jsx)(`h2`,{id:`chat-image-preview-title`,className:`text-sm font-semibold`,children:`이미지 미리보기`}),(0,I.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`이미지 미리보기 닫기`,className:`grid size-8 place-items-center rounded-full hover:bg-sand-100`,children:(0,I.jsx)(su,{className:`size-4`})})]}),(0,I.jsx)(`div`,{className:`max-h-[calc(100dvh-13rem)] overflow-auto bg-sand-100 p-3`,style:{backgroundImage:`conic-gradient(#e8e4df 25%, #fff 0 50%, #e8e4df 0 75%, #fff 0)`,backgroundSize:`20px 20px`},children:s?(0,I.jsx)(`p`,{role:`alert`,className:`p-8 text-center text-danger-500`,children:`이미지를 불러올 수 없습니다.`}):(0,I.jsx)(`img`,{src:e,alt:`확대된 채팅 이미지`,onLoad:e=>i({width:e.currentTarget.naturalWidth,height:e.currentTarget.naturalHeight}),onError:()=>c(!0),className:a?`block max-w-none`:`mx-auto block max-h-[calc(100dvh-15rem)] max-w-full object-contain`})}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-t border-sand-100 px-4 py-3`,children:[(0,I.jsxs)(`dl`,{className:`flex flex-wrap gap-x-5 gap-y-1 text-xs tabular-nums`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{className:`text-sand-400`,children:`확장자`}),(0,I.jsx)(`dd`,{className:`mt-1 uppercase`,children:l.extension})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{className:`text-sand-400`,children:`파일 용량`}),(0,I.jsx)(`dd`,{className:`mt-1`,children:eT(l.bytes)})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{className:`text-sand-400`,children:`해상도`}),(0,I.jsx)(`dd`,{className:`mt-1`,children:r?`${r.width} × ${r.height} px`:`—`})]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,I.jsx)(`button`,{type:`button`,disabled:!r||s,onClick:()=>o(e=>!e),className:`text-sand-600 hover:underline disabled:opacity-40`,children:a?`화면에 맞추기`:`원본 크기`}),(0,I.jsx)(`a`,{href:e,download:`qgrid-image.${l.extension}`,className:`text-sienna-500 hover:underline`,children:`다운로드`})]})]})]})})}),document.body)}var nT=`qgrid_chat`,rT=`anthropic/claude-fable-5-1`,iT=[{label:`OpenAI`,models:[`openai/gpt-6-astra`,`openai/gpt-6.1-sol`,`openai/gpt-6.1-terra`,`openai/gpt-6-sol`,`openai/gpt-6-luna`,`openai/gpt-5.6-terra`,`openai/gpt-5.6-sol`,`openai/gpt-5.6-luna`]},{label:`Anthropic`,models:[`anthropic/claude-fable-5-1`,`anthropic/claude-fable-5`,`anthropic/claude-opus-5-5`,`anthropic/claude-opus-5`,`anthropic/claude-sonnet-5-5`,`anthropic/claude-sonnet-5`,`anthropic/claude-haiku-5-5`,`anthropic/claude-opus-4-8`,`anthropic/claude-opus-4-7`,`anthropic/claude-opus-4-6`,`anthropic/claude-opus-4-5`,`anthropic/claude-sonnet-4-6`,`anthropic/claude-haiku-4-5`]},{label:`Grok`,models:[`grok/grok-4.7`,`grok/grok-4.7-build-fast`,`grok/grok-4.6`,`grok/grok-4.5`]}],aT=[`low`,`medium`,`high`],oT=new Map([[`openai`,`OpenAI`],[`anthropic`,`Anthropic`],[`grok`,`Grok`]]);function sT(e,t,n){let r=n!==void 0&&Jw(n,t);return/NO_OPENAI_WORKERS|no ready openai workers|no anthropic tokens available/i.test(e)||r&&/기동 중입니다/.test(e)?`사용 가능한 ${t?oT.get(t)??t:``} 토큰이 없습니다. Tokens 페이지에서 토큰을 추가해주세요.`:e}function cT(e){return e>=.01?`$${e.toFixed(2)}`:`$${e.toFixed(4)}`}var lT=4,uT=1536;async function dT(e){let t=await createImageBitmap(e),n=Math.min(1,uT/Math.max(t.width,t.height)),r=document.createElement(`canvas`);return r.width=Math.max(1,Math.round(t.width*n)),r.height=Math.max(1,Math.round(t.height*n)),r.getContext(`2d`).drawImage(t,0,0,r.width,r.height),t.close(),r.toDataURL(`image/jpeg`,.85)}function fT(){let[e,t]=(0,F.useState)(!1),[n,r]=(0,F.useState)(!1),[i,a]=(0,F.useState)([]),[o,s]=(0,F.useState)(``),[c,l]=(0,F.useState)(rT),[u,d]=(0,F.useState)(``),[f,p]=(0,F.useState)(``),[m,h]=(0,F.useState)(``),[g,_]=(0,F.useState)(!1),[v,y]=(0,F.useState)(null),[b,x]=(0,F.useState)(!1),[S,C]=(0,F.useState)([]),[w,T]=(0,F.useState)(null),E=(0,F.useRef)(null);(0,F.useEffect)(()=>()=>E.current?.abort(),[]);let D=(0,F.useRef)(void 0),O=(0,F.useRef)(void 0),k=(0,F.useRef)(null),A=(0,F.useRef)(null),ee=(0,F.useRef)(null),j=c.split(`/`)[0],te=j===`openai`||j===`grok`,{data:N}=zw.useTokens(`A`,{orderBy:`ord-asc`},{enabled:e}),ne=(0,F.useMemo)(()=>qw(N?.rows??[],j),[j,N?.rows]),re=N?.rows!==void 0,ie=(0,F.useRef)(void 0);(0,F.useEffect)(()=>{ie.current=N?.rows},[N?.rows]);let ae=N?.rows!==void 0&&Jw(N.rows,j);(0,F.useEffect)(()=>{te||C([])},[te]),(0,F.useEffect)(()=>{d(e=>Yw(e,ne,re))},[re,ne]);let oe=async e=>{if(!e)return;let t=lT-S.length,n=await Promise.all([...e].slice(0,t).map(e=>dT(e).catch(()=>null)));C(e=>[...e,...n.filter(e=>e!==null)].slice(0,lT))},P=e=>{a(t=>{let n=t[t.length-1];return!n||n.role!==`assistant`?t:[...t.slice(0,-1),e(n)]})},se=e=>{let t=sT(e,O.current?.model.split(`/`)[0],ie.current);P(e=>e.status===`streaming`?{...e,status:`error`,error:t}:e),y(null),x(!1)},ce=Uw.useQueryStream({streamId:v??``},{delta:({text:e})=>{P(t=>t.status===`streaming`?{...t,text:t.text+e}:t)},toolCall:()=>{se(`tool call 응답은 채팅에서 지원하지 않습니다`)},done:e=>{D.current=e.runContext?.threadCoord,P(t=>({...t,text:e.text||t.text,images:Kw(Array.isArray(e.content)?e.content:[e.content]),status:`done`,meta:{model:e.model,tokenName:e.tokenName,durationMs:e.durationMs,costUsd:e.costUsd,requestLogId:e.requestLogId,fallback:(e.modelFallbacks?.length??0)>0}}))},error:({message:e})=>{se(e)},end:()=>{P(e=>e.status===`streaming`?{...e,status:`error`,error:`응답 완료 전에 스트림이 종료되었습니다`}:e),y(null),x(!1)}},{enabled:v!==null,retry:0});(0,F.useEffect)(()=>{v!==null&&ce.error&&se(ce.error)},[ce.error]),(0,F.useEffect)(()=>{k.current?.scrollTo({top:k.current.scrollHeight})},[i,e]),(0,F.useEffect)(()=>{e&&A.current?.focus()},[e]);let le=async()=>{let e=o.trim();if(!e||b)return;let t=m.trim(),n=Yw(u,ne,re),r={model:c,system:t,tokenName:n};O.current&&Xw(O.current,r)&&(D.current=void 0),O.current=r;let l=te?S:[],d=Gw(i,te),p=new AbortController;E.current=p;let h={role:`user`,text:e};l.length>0&&(h.images=l),a(e=>[...e,h,{role:`assistant`,text:``,status:`streaming`}]),s(``),C([]),x(!0);try{let r={prompt:e,model:c,projectName:nT,...Zw(n)};if(t&&(r.system=t),f&&(r.effort=f),l.length>0&&(r.input=l.map(e=>({type:`image`,url:e}))),d.length>0&&(r.history=JSON.stringify(d)),D.current&&(r.runContext={threadCoord:D.current}),te){let e=await Q({method:`POST`,url:`/api/qgrid/query`,data:{args:{...r,imageGeneration:`auto`}},signal:p.signal});if(E.current!==p||p.signal.aborted)return;D.current=e.runContext?.threadCoord,P(t=>({...t,text:e.text,images:Kw(e.content),status:`done`,meta:{model:e.model,tokenName:e.tokenName,durationMs:e.durationMs,costUsd:e.costUsd,requestLogId:e.requestLogId,fallback:(e.modelFallbacks?.length??0)>0}})),x(!1),E.current=null;return}let{streamId:i}=await Uw.prepareStream(r);if(E.current!==p||p.signal.aborted)return;y(i)}catch(e){if(E.current!==p||p.signal.aborted)return;se(e instanceof Error?e.message:String(e)),E.current=null}},ue=()=>{E.current?.abort(),E.current=null,P(e=>e.status===`streaming`?{...e,status:`aborted`}:e),y(null),x(!1)};return(0,I.jsxs)(`div`,{className:`fixed bottom-5 right-5 z-40`,children:[w&&(0,I.jsx)(tT,{url:w,onClose:()=>T(null)},w),e?(0,I.jsxs)(`div`,{onAnimationEnd:()=>{n&&(t(!1),r(!1))},className:`flex flex-col w-[min(400px,calc(100vw-2.5rem))] h-[min(640px,calc(100dvh-7rem))] bg-white rounded-2xl shadow-[0_16px_48px_rgba(44,36,24,0.18),0_0_0_1px_rgba(227,218,204,0.6)] overflow-hidden origin-bottom-right ${n?`chat-panel-pop-out`:`chat-panel-pop`}`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2.5 px-4 py-2.5 border-b border-sand-100 shrink-0`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`text-[14px] font-semibold text-sand-900 leading-tight`,children:`채팅`}),(0,I.jsxs)(`p`,{className:`text-[11px] text-sand-400 truncate leading-tight`,children:[c,f?` · ${f}`:``,u?` · ${u}`:``]})]}),(0,I.jsxs)(`div`,{className:`ml-auto flex items-center gap-0.5`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>_(e=>!e),title:`모델·토큰·effort·system prompt 설정`,className:`size-8 grid place-items-center rounded-full transition-colors duration-150 ${g?`text-sienna-500 bg-sienna-50`:`text-sand-500 hover:text-sand-700 hover:bg-sand-100`}`,children:(0,I.jsx)(au,{className:`size-4`})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>{b&&ue(),a([]),D.current=void 0,O.current=void 0},disabled:i.length===0,title:`새 대화`,className:`size-8 grid place-items-center rounded-full text-sand-500 hover:text-sand-700 hover:bg-sand-100 disabled:opacity-40 transition-colors duration-150`,children:(0,I.jsx)(iu,{className:`size-4`})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>{window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?t(!1):r(!0)},title:`닫기`,className:`size-8 grid place-items-center rounded-full text-sand-500 hover:text-sand-700 hover:bg-sand-100 transition-colors duration-150`,children:(0,I.jsx)(su,{className:`size-4.5`})})]})]}),g&&(0,I.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-sand-100 bg-sand-50/60 shrink-0 flex flex-col gap-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`select`,{value:c,onChange:e=>l(e.target.value),disabled:b,className:`min-w-0 flex-1 rounded-xl border border-sand-200/80 bg-white px-2 py-1.5 text-[12px] text-sand-800 focus:outline-none focus:border-sienna-300 disabled:opacity-50`,children:iT.map(e=>(0,I.jsx)(`optgroup`,{label:e.label,children:e.models.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))},e.label))}),(0,I.jsxs)(`select`,{value:f,onChange:e=>p(e.target.value),disabled:b,className:`rounded-xl border border-sand-200/80 bg-white px-2 py-1.5 text-[12px] text-sand-600 focus:outline-none focus:border-sienna-300 disabled:opacity-50`,children:[(0,I.jsx)(`option`,{value:``,children:`effort 기본`}),aT.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})]}),(0,I.jsxs)(`select`,{value:u,onChange:e=>d(e.target.value),disabled:b,"aria-label":`요청 토큰`,className:`w-full rounded-xl border border-sand-200/80 bg-white px-2 py-1.5 text-[12px] text-sand-700 focus:outline-none focus:border-sienna-300 disabled:opacity-50`,children:[(0,I.jsx)(`option`,{value:``,children:`토큰 자동 분배`}),ne.map(e=>(0,I.jsx)(`option`,{value:e.name,children:e.name},e.name))]}),(0,I.jsx)(`textarea`,{value:m,onChange:e=>h(e.target.value),disabled:b,placeholder:`system prompt (선택)`,rows:2,className:`w-full resize-none rounded-xl border border-sand-200/80 bg-white px-2.5 py-1.5 text-[12px] text-sand-800 placeholder:text-sand-400 focus:outline-none focus:border-sienna-300 disabled:opacity-50`})]}),(0,I.jsx)(`div`,{ref:k,className:`flex-1 overflow-y-auto main-scroll px-3.5 py-3`,children:i.length===0?(0,I.jsx)(`div`,{className:`h-full grid place-items-center`,children:(0,I.jsxs)(`div`,{className:`text-center px-4`,children:[(0,I.jsx)(`img`,{src:cu,alt:``,className:`mx-auto mb-2.5 size-14 rounded-[35%] object-cover`}),(0,I.jsx)(`p`,{className:`text-[13px] text-sand-600`,children:`가용 토큰에게 바로 물어보세요.`}),(0,I.jsxs)(`p`,{className:`mt-1 text-[11px] text-sand-400`,children:[`대화는 저장되지 않고, 요청은`,` `,(0,I.jsx)(M,{to:`/logs`,search:{project:nT,page:1},className:`text-sienna-500 hover:underline`,children:`request log`}),`에 기록됩니다.`]})]})}):(0,I.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:i.map((e,t)=>e.role===`user`?(0,I.jsxs)(`div`,{className:`self-end max-w-[80%] flex flex-col items-end gap-1`,children:[e.images&&(0,I.jsx)(`div`,{className:`flex flex-wrap justify-end gap-1`,children:e.images.map((e,t)=>(0,I.jsx)(`button`,{type:`button`,onClick:()=>T(e),"aria-label":`첨부 이미지 ${t+1} 크게 보기`,className:`cursor-zoom-in rounded-xl`,children:(0,I.jsx)(`img`,{src:e,alt:``,className:`size-24 rounded-xl object-cover`})},t))}),(0,I.jsx)(`div`,{className:`rounded-[18px] rounded-br-[5px] bg-sienna-600 px-3.5 py-2 text-[13px] leading-relaxed text-white whitespace-pre-wrap break-words`,children:e.text})]},t):(0,I.jsxs)(`div`,{className:`self-start max-w-[88%] min-w-0`,children:[(0,I.jsxs)(`div`,{className:`rounded-[18px] rounded-bl-[5px] bg-sand-100 px-3.5 py-2`,children:[e.images?.map((e,t)=>(0,I.jsxs)(`div`,{className:`my-1.5`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>T(e),"aria-label":`생성된 이미지 ${t+1} 크게 보기`,className:`block w-full cursor-zoom-in rounded-xl`,children:(0,I.jsx)(`img`,{src:e,alt:`생성된 이미지 ${t+1}`,onLoad:()=>k.current?.scrollTo({top:k.current.scrollHeight}),className:`w-full rounded-xl object-contain bg-white`})}),(0,I.jsx)(`a`,{href:e,download:`qgrid-image-${t+1}.${e.startsWith(`data:image/jpeg;`)?`jpg`:e.startsWith(`data:image/webp;`)?`webp`:`png`}`,className:`mt-1 inline-block text-[11px] text-sienna-500 hover:underline`,children:`이미지 다운로드`})]},t)),e.text?(0,I.jsx)(`div`,{className:`prose prose-sm prose-qgrid max-w-none text-[13px] leading-relaxed break-words`,children:(0,I.jsx)(Zo,{remarkPlugins:[tu],children:e.text})}):e.status===`streaming`?(0,I.jsxs)(`span`,{className:`inline-flex gap-1 py-1.5 px-0.5`,"aria-label":`응답 대기 중`,children:[(0,I.jsx)(`span`,{className:`chat-typing-dot`}),(0,I.jsx)(`span`,{className:`chat-typing-dot [animation-delay:150ms]`}),(0,I.jsx)(`span`,{className:`chat-typing-dot [animation-delay:300ms]`})]}):null,e.status===`aborted`&&(0,I.jsx)(`p`,{className:`mt-1 text-[10px] text-sand-400`,children:`중단됨`}),e.status===`error`&&(0,I.jsx)(`p`,{className:`mt-1 text-[12px] text-danger-500 break-words`,children:e.error})]}),e.meta&&(0,I.jsxs)(M,{to:e.meta.requestLogId===void 0?`/logs`:`/requests/show`,search:e.meta.requestLogId===void 0?{project:nT,page:1}:{id:e.meta.requestLogId},className:`mt-1 ml-1.5 inline-block text-[10px] tabular-nums text-sand-400 hover:text-sienna-500 transition-colors duration-150`,title:`request log 보기`,children:[e.meta.model,e.meta.fallback&&` (폴백)`,e.meta.tokenName?` · ${e.meta.tokenName}`:``,` · ${(e.meta.durationMs/1e3).toFixed(1)}s · ${cT(e.meta.costUsd)}`]})]},t))})}),ae&&(0,I.jsxs)(`div`,{className:`px-4 py-1.5 border-t border-caution-400/30 bg-caution-400/10 text-[11px] text-caution-500 shrink-0`,children:[oT.get(j)??j,` 토큰이 등록되어 있지 않습니다.`,` `,(0,I.jsx)(M,{to:`/tokens`,className:`font-medium underline hover:text-caution-400`,children:`Tokens 페이지`}),`에서 추가해주세요.`]}),(0,I.jsxs)(`div`,{className:`px-3 py-2.5 border-t border-sand-100 shrink-0`,children:[S.length>0&&(0,I.jsx)(`div`,{className:`flex gap-1.5 pb-2`,children:S.map((e,t)=>(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>T(e),"aria-label":`첨부할 이미지 ${t+1} 크게 보기`,className:`cursor-zoom-in rounded-xl`,children:(0,I.jsx)(`img`,{src:e,alt:``,className:`size-12 rounded-xl object-cover`})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>C(e=>e.filter((e,n)=>n!==t)),title:`첨부 제거`,className:`absolute -top-1.5 -right-1.5 size-4.5 grid place-items-center rounded-full bg-sand-800 text-white hover:bg-sand-700`,children:(0,I.jsx)(su,{className:`size-2.5`})})]},t))}),(0,I.jsxs)(`div`,{className:`flex items-end gap-1.5`,children:[te&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`input`,{ref:ee,type:`file`,accept:`image/*`,multiple:!0,hidden:!0,onChange:e=>{oe(e.target.files),e.target.value=``}}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>ee.current?.click(),disabled:b||S.length>=lT,title:`이미지 첨부`,className:`size-9 shrink-0 grid place-items-center rounded-full text-sand-500 hover:text-sand-700 hover:bg-sand-100 disabled:opacity-40 transition-colors duration-150`,children:(0,I.jsx)(ru,{className:`size-4.5`})})]}),(0,I.jsx)(`textarea`,{ref:A,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),le())},placeholder:`메시지 입력...`,rows:1,className:`min-w-0 flex-1 resize-none [field-sizing:content] max-h-28 rounded-[20px] border border-sand-200/80 bg-sand-50/60 px-4 py-2 text-[13px] leading-relaxed text-sand-800 placeholder:text-sand-400 focus:outline-none focus:border-sienna-300 focus:bg-white transition-colors duration-150`}),b?(0,I.jsx)(`button`,{type:`button`,onClick:ue,title:`응답 중단`,className:`size-9 shrink-0 grid place-items-center rounded-full border border-sand-200/80 text-sand-600 hover:bg-sand-100 active:scale-[0.96] transition-all duration-150`,children:(0,I.jsx)(ou,{className:`size-3.5`})}):(0,I.jsx)(`button`,{type:`button`,onClick:()=>void le(),disabled:!o.trim(),title:`전송`,className:`size-9 shrink-0 grid place-items-center rounded-full bg-sienna-600 text-white hover:bg-sienna-700 disabled:opacity-40 active:scale-[0.96] transition-all duration-150`,children:(0,I.jsx)(nu,{className:`size-4.5`})})]})]})]}):(0,I.jsx)(`button`,{type:`button`,onClick:()=>t(!0),title:`채팅 열기`,"aria-label":`채팅 열기`,className:`block size-15 rounded-[35%] overflow-hidden shadow-[0_6px_20px_rgba(44,36,24,0.25)] hover:scale-105 active:scale-[0.96] transition-transform duration-150`,children:(0,I.jsx)(`img`,{src:cu,alt:``,className:`size-full object-cover`})})]})}var pT=`2.19.0`;function mT({className:e}){let t=A({select:e=>e.location.pathname});return(0,I.jsxs)(`aside`,{className:`hidden md:flex w-[200px] bg-sand-50 flex-col shrink-0 border-r border-sand-200/40 ${e??``}`,children:[(0,I.jsx)(`div`,{className:`h-11 flex items-center px-4 border-b border-sand-200/30`,children:(0,I.jsx)(`span`,{className:`text-[13px] font-semibold text-sand-800 tracking-tight`,children:`Qgrid`})}),(0,I.jsx)(`nav`,{className:`flex-1 px-2.5 py-3 space-y-4 overflow-y-auto`,children:ge.map(e=>(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`px-2 pb-1.5`,children:(0,I.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.08em] text-sand-400 font-medium`,children:e.label})}),(0,I.jsx)(`div`,{className:`space-y-0.5`,children:e.items.map(e=>{let n=ve(e.path,t);return(0,I.jsxs)(M,{to:e.path,className:`flex items-center gap-2 px-2 py-[6px] rounded-[7px] text-[13px] no-underline transition-all duration-150 ${n?`bg-sand-200/60 text-sand-900 font-medium`:`text-sand-500 hover:bg-sand-100 hover:text-sand-700`}`,style:n?{boxShadow:`0 0.5px 1px rgba(0,0,0,0.04), inset 0 0.5px 0 rgba(255,255,255,0.6)`}:void 0,children:[(0,I.jsx)(e.icon,{className:`size-[15px] shrink-0 ${n?`text-sienna-500`:`text-sand-400`}`}),(0,I.jsx)(`span`,{children:e.title})]},e.path)})})]},e.label))}),(0,I.jsx)(`div`,{className:`px-4 py-3 border-t border-sand-200/30`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`div`,{className:`size-1.5 rounded-full bg-sage-400`}),(0,I.jsxs)(`span`,{className:`text-[10px] text-sand-400`,children:[`v`,pT]})]})})]})}var hT=new Map(Object.entries({"/":`Dashboard`,"/tokens":`Tokens`,"/logs":`Request Logs`,"/monit":`Server Logs`,"/voice":`Voice`}));function gT(e){return e.startsWith(`/requests/show`)?{parent:`Request Logs`,parentPath:`/logs`,current:`Detail`}:{current:hT.get(e)??e}}function _T(){let e=gT(A({select:e=>e.location.pathname}));return(0,I.jsx)(`div`,{className:`toolbar-glass h-11 shrink-0 flex items-center px-5`,children:(0,I.jsxs)(`nav`,{className:`flex items-center gap-1.5 text-[13px]`,children:[e.parent&&e.parentPath&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(M,{to:e.parentPath,className:`text-sand-400 hover:text-sand-600 transition-colors no-underline`,children:e.parent}),(0,I.jsx)(`span`,{className:`text-sand-300 select-none`,children:`/`})]}),(0,I.jsx)(`span`,{className:`font-medium text-sand-800`,children:e.current})]})})}var vT=[`/login`,`/signup`];function yT({children:e}){(0,F.useEffect)(()=>{let e=navigator.language.split(`-`)[0],t=yw.find(t=>t===e);t!==void 0&&xw(t)},[]);let t=A({select:e=>e.location.pathname}),n=!vT.includes(t);return(0,I.jsxs)(`div`,{className:`flex h-screen w-full bg-sand-100 overflow-hidden font-sans`,children:[n&&(0,I.jsx)(mT,{}),(0,I.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden min-w-0`,children:[n&&(0,I.jsx)(_T,{}),(0,I.jsx)(`main`,{className:`flex-1 overflow-y-auto main-scroll content-inset`,children:(0,I.jsx)(`div`,{className:`px-3 py-4 sm:px-6 sm:py-5 md:px-8`,children:(0,I.jsx)(F.Suspense,{fallback:(0,I.jsx)(`div`,{className:`text-sand-400 text-center py-8 text-sm`,children:`로딩 중...`}),children:e})})}),n&&(0,I.jsx)(ye,{})]}),n&&(0,I.jsx)(fT,{})]})}var bT={"rc.asyncSelect.loading":`Loading...`,"rc.asyncSelect.noOptions":`No options`,"rc.asyncSelect.noResults":`No results`,"rc.asyncSelect.selectPlaceholder":`Select...`,"rc.combobox.noResults":`No results`,"rc.combobox.selectPlaceholder":`Select...`,"rc.datePicker.pickDate":`Pick date`,"rc.datePicker.placeholder":`Pick date`,"rc.datePicker.selectDate":`Select date`,"rc.dateSelectorMultiple.addDate":`Add date`,"rc.dateSelectorMultiple.dateRange":`Range`,"rc.dateSelectorMultiple.placeholder":`Pick date`,"rc.dateSelectorMultiple.singleDate":`Single`,"rc.fileInput.browseFiles":`Browse files`,"rc.fileInput.dropZone":`Drag files here or click to upload`,"rc.fileInput.filePlaceholder":`File`,"rc.fileInput.imagePlaceholder":`Image`,"rc.fileInput.maxFilesExceeded":e=>`Maximum ${e} files allowed`,"rc.fileInput.pending":`Pending`,"rc.fileInput.remove":`Remove`,"rc.fileInput.uploadFailed":`Upload failed`,"rc.fileInput.uploading":`Uploading...`,"rc.monthPickerMultiple.addMonth":`Add month`,"rc.monthPickerMultiple.dateRange":`Range`,"rc.monthPickerMultiple.endDate":`End date`,"rc.monthPickerMultiple.placeholder":`Pick month`,"rc.monthPickerMultiple.singleDate":`Single`,"rc.monthPickerMultiple.startDate":`Start date`,"rc.multiSelect.clear":`Clear all`,"rc.multiSelect.close":`Close`,"rc.multiSelect.moreItems":e=>`+${e} more`,"rc.multiSelect.noOptions":`No options`,"rc.multiSelect.noOptionsSelected":`No options selected`,"rc.multiSelect.noResults":`No results`,"rc.multiSelect.optionsCount":e=>`${e} options`,"rc.multiSelect.selectAll":`Select all`,"rc.multiSelect.selectPlaceholder":`Select...`,"rc.pagination.next":`Next`,"rc.pagination.previous":`Previous`,"rc.pagination.showing":(e,t,n)=>`Showing ${e}-${t} of ${n}`,"rc.calendar.month.0":`January`,"rc.calendar.month.1":`February`,"rc.calendar.month.2":`March`,"rc.calendar.month.3":`April`,"rc.calendar.month.4":`May`,"rc.calendar.month.5":`June`,"rc.calendar.month.6":`July`,"rc.calendar.month.7":`August`,"rc.calendar.month.8":`September`,"rc.calendar.month.9":`October`,"rc.calendar.month.10":`November`,"rc.calendar.month.11":`December`,"rc.sonamuFilter.title":`Sonamu Filter`,"rc.sonamuFilter.apply":`Apply`,"rc.sonamuFilter.reset":`Reset`,"rc.sonamuFilter.addRule":`Add Rule`,"rc.sonamuFilter.noRulesYet":`No rules yet. Click "+ Add Rule" to start.`,"rc.sonamuFilter.selectField":`Select field`,"rc.sonamuFilter.selectOperator":`Operator`,"rc.sonamuFilter.selectOperatorFirst":`Select operator first`,"rc.sonamuFilter.enterValue":`Enter value`,"rc.sonamuFilter.enterNumber":`Enter number`,"rc.sonamuFilter.notSupported":`Not supported`,"rc.sonamuFilter.startDate":`Start date`,"rc.sonamuFilter.endDate":`End date`,"rc.sonamuFilter.appliedFilters":`🌲 Applied SonamuFilters`,"rc.common.cancel":`Cancel`,"rc.common.save":`Save`},xT=Object.create(null),ST=e=>({}),CT=new Proxy(xT,{get(e,t){return ST()[t]??xT[t]},has(e,t){return t in ST()||t in xT},set(e,t,n){let r=ST(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=ST(!0);return delete n[t],!0},ownKeys(){let e=ST(!0);return Object.keys(e)}});CT.NODE_ENV;function wT(e,t){return typeof process<`u`?{}[e]??t:typeof Deno<`u`?Deno.env.get(e)??t:typeof Bun<`u`?Bun.env[e]??t:t}Object.freeze({get BETTER_AUTH_SECRET(){return wT(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return wT(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return wT(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return wT(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return wT(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return wT(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return wT(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});function TT(){let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,`writable`)?e.writable:e.set!==void 0}function ET(e){let t=e.split(`
|
|
102
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function wx(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;wx(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Tx=new Set([`type`,`properties`,`required`,`additionalProperties`]),Ex=[`oneOf`,`anyOf`];function Dx(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ox(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Tx.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Dx(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Eh(n,r,e.length===1?e[0]:Ox(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Dx(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function kx(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Tx)if(t in e)return;let n=t.filter(e=>Ex.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ox(t);else{let e=n[0],i=Ex.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Ox([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,vx(e,r))}function Ax(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):vx(i,s),vx(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())wx(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])kx(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}vx(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Eh(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Nx(t,`input`,e.processors),output:Nx(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function jx(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return jx(r.element,n);if(r.type===`set`)return jx(r.valueType,n);if(r.type===`lazy`)return jx(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return jx(r.innerType,n);if(r.type===`intersection`)return jx(r.left,n)||jx(r.right,n);if(r.type===`record`||r.type===`map`)return jx(r.keyType,n)||jx(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:jx(r.in,n)||jx(r.out,n);if(r.type===`object`){for(let e in r.shape)if(jx(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(jx(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(jx(e,n))return!0;return!!(r.rest&&jx(r.rest,n))}return!1}var Mx=(e,t={})=>n=>{let r=yx({...n,processors:t});return xx(e,r),Cx(r,e),Ax(r,e)},Nx=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=yx({...i??{},target:a,io:t,processors:n});return xx(e,o),Cx(o,e),Ax(o,e)},Px=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Fx=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ix=(e,t)=>{Px(e,`minimum`,t),Fx(e,`maximum`,t)},Lx=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Rx=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},zx=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Bx=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Vx=(e,t)=>Px(e,`minimum`,t.minimum),Hx=(e,t)=>Fx(e,`maximum`,t.maximum),Ux=e=>(t,n)=>{Bx(t,n.format);let[r,i]=e[n.format];Px(t,`minimum`,r),Fx(t,`maximum`,i)},Wx={greater_than:(e,t)=>Px(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Fx(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Lx(e,t.value),number_format:Ux(Kh),bigint_format:Ux(qh),min_length:Vx,max_length:Hx,length_equals:(e,t)=>Ix(e,t.length),min_size:Vx,max_size:Hx,size_equals:(e,t)=>Ix(e,t.size),string_format:(e,t)=>{Bx(e,t.format),t.pattern&&Rx(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>zx(e,t.mime)};function Gx(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Wx[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Px(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Px(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Fx(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Fx(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Lx(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&zx(t,i.mime);for(let e of i.patterns??[])Rx(t,e);return t}var Kx={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},qx=new Map([[Gv,E_],[qv,D_]]),Jx=e=>qx.get(e)??e,Yx=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Gx(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Kx[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Jx);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Xx=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Gx(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):bx(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Zx=(e,t,n,r)=>{n.type=`boolean`},Qx=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},$x=(e,t,n,r)=>{n.not={}},eS=(e,t,n,r)=>{bx(e,t,n,r,`Date cannot be represented in JSON Schema`)},tS=(e,t,n,r)=>{let i=e._zod.def,a=gh(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},nS=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(bx(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(bx(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},rS=(e,t,n,r)=>{bx(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},iS=(e,t,n,r)=>{bx(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},aS=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Gx(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=xx(a.element,t,{...r,path:[...r.path,`items`]})};function oS(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?oS(t.out):t.type===`catch`?oS(t.innerType):e._zod.optin}var sS=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&bx(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Eh(i.properties,e,xx(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?oS(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=xx(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},cS=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>xx(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},lS=(e,t,n,r)=>{let i=e._zod.def,a=xx(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=xx(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function uS(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=uS(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>uS(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?R_:L_).source)),p}var dS=new WeakMap;function fS(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of dS.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=uS(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var pS=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Gx(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=xx(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)Eh(i.patternProperties,Jx(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=xx(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=dS.get(t);n||(n=[],dS.set(t,n),t.deferred.push(()=>fS(t))),n.push(e)}i.additionalProperties=xx(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&oS(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},mS=(e,t,n,r)=>{let i=e._zod.def,a=xx(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},hS=(e,t,n,r)=>{let i=e._zod.def;xx(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},gS=Symbol();function _S(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(bx(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),gS):JSON.parse(o)}var vS=(e,t,n,r)=>{let i=e._zod.def;xx(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=_S(i.defaultValue,e,t,n,r);o!==gS&&(n.default=o)},yS=(e,t,n,r)=>{let i=e._zod.def;xx(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=_S(i.defaultValue,e,t,n,r);o!==gS&&(n._prefault=o)},bS=(e,t,n,r)=>{let i=e._zod.def;xx(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{bx(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},xS=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;xx(o,t,r);let s=t.seen.get(e);s.ref=o},SS=(e,t,n,r)=>{let i=e._zod.def;xx(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},CS=(e,t,n,r)=>{let i=e._zod.def;xx(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},wS=(e,t,n,r)=>{let i=e._zod.innerType;xx(i,t,r);let a=t.seen.get(e);a.ref=i},TS=new WeakSet([Object.prototype,Error.prototype]);function ES(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var DS=J(`ZodError`,(e,t)=>{Bg.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);TS.has(n)||(TS.add(n),ES(n,`format`,e=>t=>Ug(e,t)),ES(n,`flatten`,e=>t=>Hg(e,t)),ES(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,vh,2)}),ES(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,vh,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),OS=Gg(DS),kS=Kg(DS),AS=qg(DS),jS=Yg(DS),MS=t_(DS),NS=n_(DS),PS=r_(DS),FS=i_(DS),IS=a_(DS),LS=o_(DS),RS=s_(DS),zS=c_(DS);function BS(){Ng.localeError||Pg(sb())}function VS(){Ng.memoizer||Pg({memoizer:ib()})}var HS=J(`ZodType`,(e,t)=>(BS(),lv.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Nh(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Uh(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(fw(e,t))},superRefine(e,t){return this.check(pw(e,t))},overwrite(e){return this.check(sx(e))},optional(){return GC(this)},exactOptional(){return qC(this)},nullable(){return YC(this)},nullish(){return GC(YC(this))},nonoptional(e){return tw(this,e)},array(){return kC(this)},or(e){return NC([this,e])},and(e){return FC(this,e)},transform(e){return aw(this,UC(e))},default(e){return ZC(this,e)},prefault(e){return $C(this,e)},catch(e){return rw(this,e)},pipe(e){return aw(this,e)},readonly(){return sw(this)},describe(e){let t=this.clone();return db.add(t,{description:e}),t},meta(...e){if(e.length===0)return db.get(this);let t=this.clone();return db.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return _g(this,`~standard`,{...fv(this),jsonSchema:{input:Nx(this,`input`),output:Nx(this,`output`)}})},set"~standard"(e){gg(this,`~standard`,e)},parse:function e(t,n){return OS(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await kS(this,t,n,{callee:e})},safeParse(e,t){return AS(this,e,t)},async safeParseAsync(e,t){return jS(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){gg(this,`spa`,e)},validate(e,t){return Qg(this,e,t)},validateAsync(e,t){return e_(this,e,t)},encode:function e(t,n){return MS(this,t,n,{callee:e})},decode:function e(t,n){return NS(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await PS(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await FS(this,t,n,{callee:e})},safeEncode(e,t){return IS(this,e,t)},safeDecode(e,t){return LS(this,e,t)},async safeEncodeAsync(e,t){return RS(this,e,t)},async safeDecodeAsync(e,t){return zS(this,e,t)},toJSONSchema(e){return Mx(this,{})(e)},get description(){return db.get(this)?.description},get _def(){return this._zod.def}}),US=J(`_ZodString`,(e,t)=>{pv.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yx(e,t,n,r)},vg({format:e=>Gx(e).format??null,minLength:e=>Gx(e).minimum??null,maxLength:e=>Gx(e).maximum??null},{regex(...e){return this.check(tx(...e))},includes(...e){return this.check(ix(...e))},startsWith(...e){return this.check(ax(...e))},endsWith(...e){return this.check(ox(...e))},min(...e){return this.check($b(...e))},max(...e){return this.check(Qb(...e))},length(...e){return this.check(ex(...e))},nonempty(...e){return this.check($b(1,...e))},lowercase(e){return this.check(nx(e))},uppercase(e){return this.check(rx(e))},trim(){return this.check(lx())},normalize(...e){return this.check(cx(...e))},toLowerCase(){return this.check(ux())},toUpperCase(){return this.check(dx())},slugify(){return this.check(fx())}})),WS=J(`ZodString`,(e,t)=>{pv.init(e,t),US.init(e,t)},{email(e){return this.check(mb(XS,e))},url(e){return this.check(bb($S,e))},jwt(e){return this.check(Fb(mC,e))},emoji(e){return this.check(xb(eC,e))},guid(e){return this.check(hb(ZS,e))},uuid(e){return this.check(gb(QS,e))},uuidv4(e){return this.check(_b(QS,e))},uuidv6(e){return this.check(vb(QS,e))},uuidv7(e){return this.check(yb(QS,e))},nanoid(e){return this.check(Sb(tC,e))},cuid(e){return this.check(Cb(nC,e))},cuid2(e){return this.check(wb(rC,e))},ulid(e){return this.check(Tb(iC,e))},base64(e){return this.check(Mb(dC,e))},base64url(e){return this.check(Nb(fC,e))},xid(e){return this.check(Eb(aC,e))},ksuid(e){return this.check(Db(oC,e))},ipv4(e){return this.check(Ob(sC,e))},ipv6(e){return this.check(kb(cC,e))},cidrv4(e){return this.check(Ab(lC,e))},cidrv6(e){return this.check(jb(uC,e))},e164(e){return this.check(Pb(pC,e))},datetime(e){return this.check(Ib(KS,e))},date(e){return this.check(Lb(qS,e))},time(e){return this.check(Rb(JS,e))},duration(e){return this.check(zb(YS,e))}});function Y(e){return pb(WS,e)}var GS=J(`ZodStringFormat`,(e,t)=>{mv.init(e,t),US.init(e,t)}),KS=J(`ZodISODateTime`,(e,t)=>{Nv.init(e,t),GS.init(e,t)}),qS=J(`ZodISODate`,(e,t)=>{Pv.init(e,t),GS.init(e,t)}),JS=J(`ZodISOTime`,(e,t)=>{Fv.init(e,t),GS.init(e,t)}),YS=J(`ZodISODuration`,(e,t)=>{Iv.init(e,t),GS.init(e,t)}),XS=J(`ZodEmail`,(e,t)=>{_v.init(e,t),GS.init(e,t)}),ZS=J(`ZodGUID`,(e,t)=>{hv.init(e,t),GS.init(e,t)}),QS=J(`ZodUUID`,(e,t)=>{gv.init(e,t),GS.init(e,t)}),$S=J(`ZodURL`,(e,t)=>{Tv.init(e,t),GS.init(e,t)}),eC=J(`ZodEmoji`,(e,t)=>{Ev.init(e,t),GS.init(e,t)}),tC=J(`ZodNanoID`,(e,t)=>{Dv.init(e,t),GS.init(e,t)}),nC=J(`ZodCUID`,(e,t)=>{Ov.init(e,t),GS.init(e,t)}),rC=J(`ZodCUID2`,(e,t)=>{kv.init(e,t),GS.init(e,t)}),iC=J(`ZodULID`,(e,t)=>{Av.init(e,t),GS.init(e,t)}),aC=J(`ZodXID`,(e,t)=>{jv.init(e,t),GS.init(e,t)}),oC=J(`ZodKSUID`,(e,t)=>{Mv.init(e,t),GS.init(e,t)}),sC=J(`ZodIPv4`,(e,t)=>{Lv.init(e,t),GS.init(e,t)}),cC=J(`ZodIPv6`,(e,t)=>{Bv.init(e,t),GS.init(e,t)}),lC=J(`ZodCIDRv4`,(e,t)=>{Vv.init(e,t),GS.init(e,t)}),uC=J(`ZodCIDRv6`,(e,t)=>{Uv.init(e,t),GS.init(e,t)}),dC=J(`ZodBase64`,(e,t)=>{Kv.init(e,t),GS.init(e,t)}),fC=J(`ZodBase64URL`,(e,t)=>{Yv.init(e,t),GS.init(e,t)}),pC=J(`ZodE164`,(e,t)=>{Xv.init(e,t),GS.init(e,t)}),mC=J(`ZodJWT`,(e,t)=>{Qv.init(e,t),GS.init(e,t)}),hC=J(`ZodNumber`,(e,t)=>{$v.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xx(e,t,n,r),e.isFinite=!0},vg({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Gx(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Gx(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Gx(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Gx(e).format??null},{gt(e,t){return this.check(Yb(e,t))},gte(e,t){return this.check(Xb(e,t))},min(e,t){return this.check(Xb(e,t))},lt(e,t){return this.check(qb(e,t))},lte(e,t){return this.check(Jb(e,t))},max(e,t){return this.check(Jb(e,t))},int(e){return this.check(X(e))},safe(e){return this.check(X(e))},positive(e){return this.check(Yb(0,e))},nonnegative(e){return this.check(Xb(0,e))},negative(e){return this.check(qb(0,e))},nonpositive(e){return this.check(Jb(0,e))},multipleOf(e,t){return this.check(Zb(e,t))},step(e,t){return this.check(Zb(e,t))},finite(){return this}}));function gC(e){return Bb(hC,e)}var _C=J(`ZodNumberFormat`,(e,t)=>{ey.init(e,t),hC.init(e,t)});function X(e){return Vb(_C,e)}var vC=J(`ZodBoolean`,(e,t)=>{ty.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zx(e,t,n,r)});function yC(e){return Hb(vC,e)}var bC=J(`ZodNull`,(e,t)=>{ny.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qx(e,t,n,r)});function xC(e){return Ub(bC,e)}var SC=J(`ZodUnknown`,(e,t)=>{ry.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function CC(){return Wb(SC)}var wC=J(`ZodNever`,(e,t)=>{iy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$x(e,t,n,r)});function TC(e){return Gb(wC,e)}var EC=J(`ZodDate`,(e,t)=>{ay.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eS(e,t,n,r),e.min=(t,n)=>e.check(Xb(t,n)),e.max=(t,n)=>e.check(Jb(t,n))},vg({minDate:e=>{let{minimum:t}=Gx(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=Gx(e);return t?new Date(t):null}},{}));function DC(e){return Kb(EC,e)}var OC=J(`ZodArray`,(e,t)=>{VS(),ly.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aS(e,t,n,r),e.element=t.element},{min(e,t){return this.check($b(e,t))},nonempty(e){return this.check($b(1,e))},max(e,t){return this.check(Qb(e,t))},length(e,t){return this.check(ex(e,t))},unwrap(){return this.element}});function kC(e,t){return px(OC,e,t)}var AC=J(`ZodObject`,(e,t)=>{VS(),hy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sS(e,t,n,r),wg(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return zC(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Nh(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Nh(this._zod.def,{catchall:CC()}))},loose(){return this.clone(Nh(this._zod.def,{catchall:CC()}))},strict(){return this.clone(Nh(this._zod.def,{catchall:TC()}))},strip(){return this.clone(Nh(this._zod.def,{catchall:void 0}))},extend(e){return Zh(this,e)},safeExtend(e){return $h(this,e)},merge(e){return eg(this,e)},pick(e){return Jh(this,e)},omit(e){return Xh(this,e)},partial(...e){return tg(WC,this,e[0])},exactPartial(...e){return tg(KC,this,e[0],`exactPartial`)},required(...e){return ng(ew,this,e[0])}});function Z(e,t){return new AC({type:`object`,shape:e??{},...K(t)})}function jC(e,t){return new AC({type:`object`,shape:e,catchall:CC(),...K(t)})}var MC=J(`ZodUnion`,(e,t)=>{_y.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cS(e,t,n,r),e.options=t.options});function NC(e,t){return new MC({type:`union`,options:e,...K(t)})}var PC=J(`ZodIntersection`,(e,t)=>{vy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lS(e,t,n,r)});function FC(e,t){return new PC({type:`intersection`,left:e,right:t})}var IC=J(`ZodRecord`,(e,t)=>{VS(),xy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pS(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function LC(e,t,n){return!t||!t._zod?new IC({type:`record`,keyType:Y(),valueType:e,...K(t)}):new IC({type:`record`,keyType:e,valueType:t,...K(n)})}var RC=J(`ZodEnum`,(e,t)=>{Sy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tS(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new RC({...t,checks:[],...K(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new RC({...t,checks:[],...K(r),entries:i})}});function zC(e,t){return new RC({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...K(t)})}var BC=J(`ZodLiteral`,(e,t)=>{Cy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nS(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function VC(e,t){return new BC({type:`literal`,values:Array.isArray(e)?e:[e],...K(t)})}var HC=J(`ZodTransform`,(e,t)=>{VS(),wy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iS(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Mg(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(mg(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(mg(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function UC(e){return new HC({type:`transform`,transform:e})}var WC=J(`ZodOptional`,(e,t)=>{Ey.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>CS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function GC(e){return new WC({type:`optional`,innerType:e})}var KC=J(`ZodExactOptional`,(e,t)=>{Dy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>CS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qC(e){return new KC({type:`optional`,innerType:e})}var JC=J(`ZodNullable`,(e,t)=>{Oy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function YC(e){return new JC({type:`nullable`,innerType:e})}var XC=J(`ZodDefault`,(e,t)=>{ky.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ZC(e,t){return new XC({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Bh(t)}})}var QC=J(`ZodPrefault`,(e,t)=>{jy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $C(e,t){return new QC({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Bh(t)}})}var ew=J(`ZodNonOptional`,(e,t)=>{My.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function tw(e,t){return new ew({type:`nonoptional`,innerType:e,...K(t)})}var nw=J(`ZodCatch`,(e,t)=>{Fy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function rw(e,t){return new nw({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Eg(t)})}var iw=J(`ZodPipe`,(e,t)=>{Iy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xS(e,t,n,r),e.in=t.in,e.out=t.out});function aw(e,t){return new iw({type:`pipe`,in:e,out:t})}var ow=J(`ZodReadonly`,(e,t)=>{Ry.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>SS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sw(e){return new ow({type:`readonly`,innerType:e})}var cw=J(`ZodLazy`,(e,t)=>{By.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wS(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function lw(e){return new cw({type:`lazy`,getter:e})}var uw=J(`ZodCustom`,(e,t)=>{Vy.init(e,t),HS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rS(e,t,n,r)});function dw(e,t){return mx(uw,e??(()=>!0),t)}function fw(e,t={}){return hx(uw,e,t)}function pw(e,t){return gx(e,t)}function mw(e){let t=lw(()=>NC([Y(e),gC(),yC(),xC(),kC(t),LC(Y(),t)]));return t}var hw=t(ed(),1),gw={"common.all":`All`,"common.backToList":`Back to List`,"common.cancel":`Cancel`,"common.close":`Close`,"common.confirm":`Confirm`,"common.create":`Create`,"common.createdAt":`Created At`,"common.delete":`Delete`,"common.edit":`Edit`,"common.login":`Login`,"common.logout":`Logout`,"common.manage":`Manage`,"common.results":e=>Fw(e,{one:`${e} result`,other:`${e} results`}),"common.save":`Save`,"common.search":`Search`,"common.searchPlaceholder":`Search...`,"common.searchType":`Search Type`,"common.sort":`Sort`,"confirm.delete":`Are you sure you want to delete?`,"confirm.save":`Do you want to save?`,"dashboard.adminMenu":`Admin Menu`,"dashboard.createdAt":`Joined`,"dashboard.email":`Email`,"dashboard.loginRequired":`Please login to continue.`,"dashboard.name":`Name`,"dashboard.role":`Role`,"dashboard.title":`Admin Dashboard`,"dashboard.welcome":`Welcome!`,"delete.confirm.description":`This action cannot be undone. This will permanently delete this item.`,"delete.confirm.title":`Are you sure?`,"entity.create":e=>`Create ${e}`,"entity.edit":(e,t)=>`Edit ${e} (#${t})`,"entity.list":e=>`${e} List`,"entity.listManage":e=>`Manage ${e} List`,"error.alreadyProcessed":`Already processed`,"error.badRequest":`Bad request`,"error.detail":e=>e,"error.duplicateRow":`Duplicate data`,"error.forbidden":`Forbidden`,"error.internalServerError":`Internal server error`,"error.notFound":`Not found`,"error.serviceUnavailable":`Service unavailable`,"setting.invalidValue":e=>`Invalid setting value: ${e}`,"setting.unknownKey":e=>`Unknown setting key ${e}`,"qgrid.dispatcherFailed":e=>`${e} dispatcher failed to initialize`,"qgrid.dispatcherStarting":e=>`${e} dispatcher is starting up. Please retry shortly`,"qgrid.grokCapabilityUnavailable":e=>`Grok capability unavailable: ${e}`,"qgrid.grokCapacity":`All Grok tokens are at their in-flight request cap. Please retry shortly`,"qgrid.grokContentPolicy":e=>`Grok generation blocked by content policy: ${e}`,"qgrid.grokInvalidRequest":e=>`Invalid Grok request: ${e}`,"qgrid.openaiVoiceInvalidRequest":e=>`Invalid OpenAI voice request: ${e}`,"qgrid.grokLoginFailed":e=>`Grok login failed: ${e}`,"qgrid.grokNotOAuthToken":`Grok login returned credentials that are not an xAI OAuth token`,"qgrid.grokNoWorkers":e=>`No Grok token is available: ${e}`,"qgrid.grokRateLimited":e=>`All Grok tokens are rate limited. Retry after ${e} seconds`,"qgrid.grokOnDemandExcluded":e=>`All Grok tokens are excluded because on-demand billing is enabled at xAI: ${e}. Turn off on-demand billing, or add another account`,"qgrid.grokZdrVideoUnavailable":e=>`Grok video is unavailable because Zero Data Retention is on for: ${e}. Turn off the data-retention opt-out at xAI, or use a non-ZDR account`,"qgrid.invalidInput":e=>`qgrid: invalid input: ${e}`,"qgrid.requestBodyTooLarge":e=>`Request body exceeds the ${e} MiB limit`,"qgrid.videoJobNotFound":`video job not found`,"error.unauthorized":`Unauthorized`,notFound:(e,t)=>`${e} ID ${t} not found`,"validation.email":`Invalid email format`,"validation.maxLength":(e,t)=>`${e} must be at most ${t} characters`,"validation.minLength":(e,t)=>`${e} must be at least ${t} characters`,"validation.required":e=>`${e} is required`,"validation.url":`Invalid URL format`},_w={"common.all":`전체`,"common.backToList":`목록으로`,"common.cancel":`취소`,"common.close":`닫기`,"common.confirm":`확인`,"common.create":`생성`,"common.createdAt":`등록`,"common.delete":`삭제`,"common.edit":`수정`,"common.login":`로그인`,"common.logout":`로그아웃`,"common.manage":`관리`,"common.results":e=>`${e}개 결과`,"common.save":`저장`,"common.search":`검색`,"common.searchPlaceholder":`검색...`,"common.searchType":`검색 유형`,"common.sort":`정렬`,"confirm.delete":`정말 삭제하시겠습니까?`,"confirm.save":`저장하시겠습니까?`,"dashboard.adminMenu":`관리 메뉴`,"dashboard.createdAt":`가입일`,"dashboard.email":`이메일`,"dashboard.loginRequired":`로그인이 필요합니다.`,"dashboard.name":`이름`,"dashboard.role":`역할`,"dashboard.title":`관리자 대시보드`,"dashboard.welcome":`환영합니다!`,"delete.confirm.description":`이 작업은 취소할 수 없습니다. 항목이 영구적으로 삭제됩니다.`,"delete.confirm.title":`정말 삭제하시겠습니까?`,"entity.create":e=>`${e} 생성`,"entity.edit":(e,t)=>`${e} 수정 (#${t})`,"entity.list":e=>`${e} 목록`,"entity.listManage":e=>`${e} 목록 관리`,"error.alreadyProcessed":`이미 처리되었습니다`,"error.badRequest":`잘못된 요청입니다`,"error.detail":e=>e,"error.duplicateRow":`중복된 데이터입니다`,"error.entityNotFound":(e,t)=>`존재하지 않는 ${e} ID ${t}`,"error.forbidden":`권한이 없습니다`,"error.internalServerError":`서버 오류가 발생했습니다`,"error.notFound":`찾을 수 없습니다`,"error.serviceUnavailable":`서비스를 사용할 수 없습니다`,"setting.invalidValue":e=>`설정 값이 올바르지 않습니다: ${e}`,"setting.unknownKey":e=>`알 수 없는 설정 키 ${e}`,"qgrid.dispatcherFailed":e=>`${e} dispatcher 초기화에 실패했습니다`,"qgrid.dispatcherStarting":e=>`${e} dispatcher 기동 중입니다. 잠시 후 다시 시도해주세요`,"qgrid.grokCapabilityUnavailable":e=>`Grok 기능을 사용할 수 없습니다: ${e}`,"qgrid.grokCapacity":`모든 Grok 토큰이 동시 요청 한도에 도달했습니다. 잠시 후 다시 시도해주세요`,"qgrid.grokContentPolicy":e=>`콘텐츠 정책 위반으로 Grok 생성이 차단되었습니다: ${e}`,"qgrid.grokInvalidRequest":e=>`잘못된 Grok 요청입니다: ${e}`,"qgrid.openaiVoiceInvalidRequest":e=>`잘못된 OpenAI 음성 요청입니다: ${e}`,"qgrid.grokLoginFailed":e=>`Grok 로그인에 실패했습니다: ${e}`,"qgrid.grokNotOAuthToken":`Grok 로그인 결과가 xAI OAuth 토큰이 아닙니다`,"qgrid.grokNoWorkers":e=>`사용 가능한 Grok 토큰이 없습니다: ${e}`,"qgrid.grokRateLimited":e=>`모든 Grok 토큰이 요청 한도에 걸렸습니다. ${e}초 후 다시 시도해주세요`,"qgrid.grokOnDemandExcluded":e=>`xAI에서 on-demand 과금이 켜져 있어 모든 Grok 토큰이 제외되었습니다: ${e}. on-demand 과금을 끄거나 다른 계정을 추가해주세요`,"qgrid.grokZdrVideoUnavailable":e=>`Zero Data Retention이 켜져 있어 Grok 비디오를 사용할 수 없습니다: ${e}. xAI에서 data-retention opt-out을 끄거나 ZDR이 아닌 계정을 사용해주세요`,"qgrid.invalidInput":e=>`qgrid: 잘못된 입력입니다: ${e}`,"qgrid.requestBodyTooLarge":e=>`요청 본문이 ${e} MiB 제한을 초과했습니다`,"qgrid.videoJobNotFound":`비디오 작업을 찾을 수 없습니다`,"error.unauthorized":`인증이 필요합니다`,"error.unknownSearchField":e=>`구현되지 않은 검색 필드 ${e}`,notFound:(e,t)=>`존재하지 않는 ${e} ID ${t}`,"validation.email":`올바른 이메일 형식이 아닙니다`,"validation.maxLength":(e,t)=>`${e}${Iw(e,`은는`)} 최대 ${t}자까지 입력할 수 있습니다`,"validation.minLength":(e,t)=>`${e}${Iw(e,`은는`)} 최소 ${t}자 이상이어야 합니다`,"validation.required":e=>`${Iw(e,`은는`)} 필수입니다`,"validation.url":`올바른 URL 형식이 아닙니다`},vw=`ko`,yw=[`ko`,`en`],bw=vw;function xw(e){bw=e}function Sw(){return bw}var Cw={"rc.asyncSelect.loading":`로딩 중...`,"rc.asyncSelect.noOptions":`옵션이 없습니다`,"rc.asyncSelect.noResults":`검색 결과가 없습니다`,"rc.asyncSelect.selectPlaceholder":`선택하세요...`,"rc.combobox.noResults":`검색 결과가 없습니다`,"rc.combobox.selectPlaceholder":`선택하세요...`,"rc.datePicker.pickDate":`날짜 선택`,"rc.datePicker.placeholder":`날짜 선택`,"rc.datePicker.selectDate":`날짜 선택`,"rc.dateSelectorMultiple.addDate":`날짜 추가`,"rc.dateSelectorMultiple.dateRange":`기간`,"rc.dateSelectorMultiple.placeholder":`날짜 선택`,"rc.dateSelectorMultiple.singleDate":`단일`,"rc.fileInput.browseFiles":`파일 찾기`,"rc.fileInput.dropZone":`파일을 드래그하거나 클릭하여 업로드`,"rc.fileInput.filePlaceholder":`파일`,"rc.fileInput.imagePlaceholder":`이미지`,"rc.fileInput.maxFilesExceeded":e=>`최대 ${e}개 파일만 업로드 가능합니다`,"rc.fileInput.pending":`대기 중`,"rc.fileInput.remove":`제거`,"rc.fileInput.uploadFailed":`업로드 실패`,"rc.fileInput.uploading":`업로드 중...`,"rc.monthPickerMultiple.addMonth":`월 추가`,"rc.monthPickerMultiple.dateRange":`기간`,"rc.monthPickerMultiple.endDate":`종료일`,"rc.monthPickerMultiple.placeholder":`월 선택`,"rc.monthPickerMultiple.singleDate":`단일`,"rc.monthPickerMultiple.startDate":`시작일`,"rc.multiSelect.clear":`전체 해제`,"rc.multiSelect.close":`닫기`,"rc.multiSelect.moreItems":e=>`+${e}개 더보기`,"rc.multiSelect.noOptions":`옵션이 없습니다`,"rc.multiSelect.noOptionsSelected":`선택된 옵션이 없습니다`,"rc.multiSelect.noResults":`검색 결과가 없습니다`,"rc.multiSelect.optionsCount":e=>`${e}개 옵션`,"rc.multiSelect.selectAll":`전체 선택`,"rc.multiSelect.selectPlaceholder":`선택하세요...`,"rc.pagination.next":`다음`,"rc.pagination.previous":`이전`,"rc.pagination.showing":(e,t,n)=>`${n}개 중 ${e}-${t}`,"rc.calendar.month.0":`1월`,"rc.calendar.month.1":`2월`,"rc.calendar.month.2":`3월`,"rc.calendar.month.3":`4월`,"rc.calendar.month.4":`5월`,"rc.calendar.month.5":`6월`,"rc.calendar.month.6":`7월`,"rc.calendar.month.7":`8월`,"rc.calendar.month.8":`9월`,"rc.calendar.month.9":`10월`,"rc.calendar.month.10":`11월`,"rc.calendar.month.11":`12월`,"rc.sonamuFilter.title":`소나무 필터`,"rc.sonamuFilter.apply":`적용`,"rc.sonamuFilter.reset":`초기화`,"rc.sonamuFilter.addRule":`규칙 추가`,"rc.sonamuFilter.noRulesYet":`아직 규칙이 없습니다. "+ 규칙 추가"를 클릭하여 시작하세요.`,"rc.sonamuFilter.selectField":`필드 선택`,"rc.sonamuFilter.selectOperator":`연산자 선택`,"rc.sonamuFilter.selectOperatorFirst":`먼저 연산자를 선택하세요`,"rc.sonamuFilter.enterValue":`값 입력`,"rc.sonamuFilter.enterNumber":`숫자 입력`,"rc.sonamuFilter.notSupported":`지원하지 않음`,"rc.sonamuFilter.startDate":`시작일`,"rc.sonamuFilter.endDate":`종료일`,"rc.sonamuFilter.appliedFilters":`🌲 적용된 소나무 필터`,"rc.common.cancel":`취소`,"rc.common.save":`저장`},ww={"rc.asyncSelect.loading":`Loading...`,"rc.asyncSelect.noOptions":`No options`,"rc.asyncSelect.noResults":`No results`,"rc.asyncSelect.selectPlaceholder":`Select...`,"rc.combobox.noResults":`No results`,"rc.combobox.selectPlaceholder":`Select...`,"rc.datePicker.pickDate":`Pick date`,"rc.datePicker.placeholder":`Pick date`,"rc.datePicker.selectDate":`Select date`,"rc.dateSelectorMultiple.addDate":`Add date`,"rc.dateSelectorMultiple.dateRange":`Range`,"rc.dateSelectorMultiple.placeholder":`Pick date`,"rc.dateSelectorMultiple.singleDate":`Single`,"rc.fileInput.browseFiles":`Browse files`,"rc.fileInput.dropZone":`Drag files here or click to upload`,"rc.fileInput.filePlaceholder":`File`,"rc.fileInput.imagePlaceholder":`Image`,"rc.fileInput.maxFilesExceeded":e=>`Maximum ${e} files allowed`,"rc.fileInput.pending":`Pending`,"rc.fileInput.remove":`Remove`,"rc.fileInput.uploadFailed":`Upload failed`,"rc.fileInput.uploading":`Uploading...`,"rc.monthPickerMultiple.addMonth":`Add month`,"rc.monthPickerMultiple.dateRange":`Range`,"rc.monthPickerMultiple.endDate":`End date`,"rc.monthPickerMultiple.placeholder":`Pick month`,"rc.monthPickerMultiple.singleDate":`Single`,"rc.monthPickerMultiple.startDate":`Start date`,"rc.multiSelect.clear":`Clear all`,"rc.multiSelect.close":`Close`,"rc.multiSelect.moreItems":e=>`+${e} more`,"rc.multiSelect.noOptions":`No options`,"rc.multiSelect.noOptionsSelected":`No options selected`,"rc.multiSelect.noResults":`No results`,"rc.multiSelect.optionsCount":e=>`${e} options`,"rc.multiSelect.selectAll":`Select all`,"rc.multiSelect.selectPlaceholder":`Select...`,"rc.pagination.next":`Next`,"rc.pagination.previous":`Previous`,"rc.pagination.showing":(e,t,n)=>`Showing ${e}-${t} of ${n}`,"rc.calendar.month.0":`January`,"rc.calendar.month.1":`February`,"rc.calendar.month.2":`March`,"rc.calendar.month.3":`April`,"rc.calendar.month.4":`May`,"rc.calendar.month.5":`June`,"rc.calendar.month.6":`July`,"rc.calendar.month.7":`August`,"rc.calendar.month.8":`September`,"rc.calendar.month.9":`October`,"rc.calendar.month.10":`November`,"rc.calendar.month.11":`December`,"rc.sonamuFilter.title":`Sonamu Filter`,"rc.sonamuFilter.apply":`Apply`,"rc.sonamuFilter.reset":`Reset`,"rc.sonamuFilter.addRule":`Add Rule`,"rc.sonamuFilter.noRulesYet":`No rules yet. Click "+ Add Rule" to start.`,"rc.sonamuFilter.selectField":`Select field`,"rc.sonamuFilter.selectOperator":`Operator`,"rc.sonamuFilter.selectOperatorFirst":`Select operator first`,"rc.sonamuFilter.enterValue":`Enter value`,"rc.sonamuFilter.enterNumber":`Enter number`,"rc.sonamuFilter.notSupported":`Not supported`,"rc.sonamuFilter.startDate":`Start date`,"rc.sonamuFilter.endDate":`End date`,"rc.sonamuFilter.appliedFilters":`🌲 Applied SonamuFilters`,"rc.common.cancel":`Cancel`,"rc.common.save":`Save`},Tw={"entity.RequestLog":`RequestLog`,"entity.RequestLog.id":`ID`,"entity.RequestLog.created_at":`등록일시`,"entity.RequestLog.token_name":`토큰 이름`,"entity.RequestLog.project_name":`프로젝트 이름`,"entity.RequestLog.model_name":`모델 이름`,"entity.RequestLog.requested_model_name":`요청 모델 이름 (fallback 전)`,"entity.RequestLog.fallback_count":`모델 fallback 횟수`,"entity.RequestLog.user_prompt":`사용자 프롬프트`,"entity.RequestLog.system_prompt":`시스템 프롬프트`,"entity.RequestLog.response":`llm 응답 전문`,"entity.RequestLog.input_tokens":`입력 토큰`,"entity.RequestLog.output_tokens":`출력 토큰`,"entity.RequestLog.cache_read_tokens":`캐시 읽기 토큰`,"entity.RequestLog.cache_creation_tokens":`캐시 생성 토큰`,"entity.RequestLog.cache_creation_5m_tokens":`5분 TTL 캐시 생성 토큰`,"entity.RequestLog.cache_creation_1h_tokens":`1시간 TTL 캐시 생성 토큰`,"entity.RequestLog.duration_ms":`응답 소요시간(ms)`,"entity.RequestLog.ttft_ms":`first gen TTFT(ms)`,"entity.RequestLog.cost_usd":`API 비용`,"entity.RequestLog.cost_source":`비용 출처(provider/pricing_table/mixed)`,"entity.RequestLog.image_cost_usd":`이미지 생성 비용`,"entity.RequestLog.image_cost_method":`이미지 비용 계산 방식`,"entity.RequestLog.service_tier":`Requested OpenAI service tier`,"entity.RequestLog.effort":`effort level`,"entity.RequestLog.history":`inject_items 히스토리`,"entity.RequestLog.input_images":`현재 user turn 입력 이미지`,"entity.RequestLog.tools":`요청에 장착된 tool 정의 목록`,"entity.RequestLog.json_schema":`structured output 요청의 JSON Schema 원문 (detail 의 response 타입 표시용)`,"entity.RequestLog.status":`실행 상태`,"entity.RequestLog.error_message":`에러 메시지`,"entity.RequestLog.response_json_ok":`structured(jsonSchema) 요청의 응답 JSON 파싱 성공 여부. 비structured 요청은 null`,"entity.RequestLog.tool_call_count":`tool call 횟수`,"entity.RequestLog.is_image_generation":`이미지 생성 turn 여부 (quota 귀속용)`,"entity.RequestLog.is_structured":`structured output(jsonSchema) 요청 여부 (목록 구분 표시용)`,"entity.RequestLog.media_kind":`미디어 엔드포인트 종류(image/video/stt/tts). 텍스트 요청은 null (목록 Fmt 표시용)`,"enum.RequestLogOrderBy.id-desc":`ID최신순`,"enum.RequestLogOrderBy.id-asc":`ID오래된순`,"enum.RequestLogOrderBy.created_at-desc":`등록일시최신순`,"enum.RequestLogOrderBy.created_at-asc":`등록일시오래된순`,"enum.RequestLogOrderBy.ttft_ms-desc":`TTFT긴순`,"enum.RequestLogOrderBy.ttft_ms-asc":`TTFT짧은순`,"enum.RequestLogOrderBy.duration_ms-desc":`소요시간긴순`,"enum.RequestLogOrderBy.duration_ms-asc":`소요시간짧은순`,"enum.RequestLogOrderBy.input_tokens-desc":`입력토큰많은순`,"enum.RequestLogOrderBy.input_tokens-asc":`입력토큰적은순`,"enum.RequestLogOrderBy.output_tokens-desc":`출력토큰많은순`,"enum.RequestLogOrderBy.output_tokens-asc":`출력토큰적은순`,"enum.RequestLogOrderBy.cache_read_tokens-desc":`캐시읽기많은순`,"enum.RequestLogOrderBy.cache_read_tokens-asc":`캐시읽기적은순`,"enum.RequestLogOrderBy.cache_creation_tokens-desc":`캐시생성많은순`,"enum.RequestLogOrderBy.cache_creation_tokens-asc":`캐시생성적은순`,"enum.RequestLogOrderBy.cost_usd-desc":`비용높은순`,"enum.RequestLogOrderBy.cost_usd-asc":`비용낮은순`,"enum.RequestLogSearchField.id":`ID`,"enum.RequestLogSearchField.token_name":`토큰이름`,"enum.RequestLogSearchField.user_prompt":`사용자 프롬프트`,"enum.RequestLogStatus.running":`실행 중`,"enum.RequestLogStatus.succeeded":`성공`,"enum.RequestLogStatus.error":`에러`,"enum.RequestLogStatus.aborted":`중단`,"enum.RequestLogMediaKind.image":`이미지`,"enum.RequestLogMediaKind.video":`비디오`,"enum.RequestLogMediaKind.stt":`음성 인식`,"enum.RequestLogMediaKind.tts":`음성 합성`,"entity.RequestLogStep":`RequestLogStep`,"entity.RequestLogStep.id":`ID`,"entity.RequestLogStep.created_at":`등록일시`,"entity.RequestLogStep.request_log":`부모 request log ID`,"entity.RequestLogStep.step_index":`ai-sdk step number (0-based)`,"entity.RequestLogStep.type":`step 타입`,"entity.RequestLogStep.model_name":`실제 serving 모델`,"entity.RequestLogStep.requested_model_name":`요청 모델 (fallback 전)`,"entity.RequestLogStep.fallback_count":`모델 fallback 횟수`,"entity.RequestLogStep.input_tokens":`입력 토큰 (generate)`,"entity.RequestLogStep.output_tokens":`출력 토큰 (generate)`,"entity.RequestLogStep.cache_read_tokens":`캐시 읽기 토큰`,"entity.RequestLogStep.cache_creation_tokens":`캐시 생성 토큰`,"entity.RequestLogStep.cache_creation_5m_tokens":`5분 TTL 캐시 생성 토큰`,"entity.RequestLogStep.cache_creation_1h_tokens":`1시간 TTL 캐시 생성 토큰`,"entity.RequestLogStep.cost_usd":`step 비용 (micro-USD)`,"entity.RequestLogStep.cost_source":`비용 출처(provider/pricing_table)`,"entity.RequestLogStep.duration_ms":`소요시간(ms)`,"entity.RequestLogStep.ttft_ms":`Gen TTFT(ms)`,"entity.RequestLogStep.finish_reason":`완료 사유`,"entity.RequestLogStep.reasoning_text":`reasoning 텍스트`,"entity.RequestLogStep.reasoning_tokens":`reasoning 토큰 수`,"entity.RequestLogStep.tool_call_index":`같은 step 내 tool call 순서`,"entity.RequestLogStep.tool_call_id":`tool call ID`,"entity.RequestLogStep.tool_name":`tool 이름`,"entity.RequestLogStep.tool_args":`tool 인자 (JSON string)`,"entity.RequestLogStep.tool_result":`tool 결과 (JSON string)`,"entity.RequestLogStep.tool_duration_ms":`tool 실행 소요시간(ms)`,"entity.RequestLogStep.error":`step 에러 메시지`,"enum.RequestLogStepType.generate":`LLM 생성`,"enum.RequestLogStepType.tool_call":`Tool 호출`,"enum.RequestLogStepOrderBy.id-asc":`ID순`,"enum.RequestLogStepSearchField.id":`ID`,"entity.Setting":`Setting`,"entity.Setting.id":`ID`,"entity.Setting.created_at":`등록일시`,"entity.Setting.key":`설정 키 (예: slack.enabled)`,"entity.Setting.value":`설정 값 (문자열 저장, 앱에서 파싱·검증)`,"entity.Setting.updated_at":`최종 수정일시`,"enum.SettingOrderBy.key-asc":`키순`,"enum.SettingSearchField.key":`키`,"entity.Token":`Token`,"entity.Token.id":`ID`,"entity.Token.created_at":`등록일시`,"entity.Token.provider":`프로바이더`,"entity.Token.credentials":`인증 정보 (JSONB)`,"entity.Token.name":`토큰 이름`,"entity.Token.active":`활성 여부`,"entity.Token.reauth_required":`인증 만료로 재로그인이 필요한지 여부`,"entity.Token.ord":`정렬 순서`,"entity.Token.quota_threshold":`quota 사용률 임계치(%). null이면 미설정`,"entity.Token.weight":`가중 라운드로빈 라우팅 가중치 (1..100)`,"entity.Token.keepalive_enabled":`Anthropic 5시간 토큰 윈도우 keepalive 사용 여부`,"enum.TokenOrderBy.id-desc":`ID최신순`,"enum.TokenOrderBy.ord-asc":`순서순`,"enum.TokenSearchField.id":`ID`,"enum.TokenSearchField.name":`이름`},Ew={ko:{...Cw,...Tw,..._w},en:{...ww,...gw}};function Dw(e,t){let n=Ew[t];if(n?.[e]!==void 0)return n[e];if(t!==vw&&Ew[vw]?.[e]!==void 0)return Ew[vw][e];for(let n of yw)if(n!==t&&n!==vw&&Ew[n]?.[e]!==void 0)return Ew[n][e];return e}function Ow(e){return Dw(e,Sw())}Ow.locale=e=>t=>Dw(t,e),Ow.enumLabels=e=>new Proxy({},{get(t,n){if(typeof n!=`symbol`)return Dw(`enum.${e}.${n}`,Sw())}});function kw(e,t){return typeof t==`string`&&(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d{1,3})?)?(Z|[+-]\d{2}:\d{2})?$/.test(t)||/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}[+-]\d{2}:\d{2}$/.test(t))&&new Date(t).toString()!==`Invalid Date`?new Date(t):t}Xm.defaults.transformResponse=[e=>{if(typeof e==`string`)try{return JSON.parse(e,kw)}catch{return e}return e}],Xm.interceptors.request.use(e=>(e.headers[`Accept-Language`]=Sw(),e));async function Q(e){try{return(await Xm({...e})).data}catch(e){if(Xm.isAxiosError(e)&&e.response?.data){let t=e.response.data;throw new Aw(e.response.status,t.message,t.issues)}throw e}}var Aw=class extends Error{code;message;issues;isSonamuError;constructor(e,t,n){super(t),this.code=e,this.message=t,this.issues=n,this.isSonamuError=!0}};function jw(e){return e&&e.isSonamuError===!0}var Mw=zC([`both`,`list`,`count`]);Z({semanticQuery:Z({embedding:kC(gC()).min(1024).max(1024),threshold:gC().optional(),method:zC([`cosine`,`l2`,`inner_product`]).optional()})});function Nw(e){return NC([e,e.array()])}Y().regex(/([0-9]{4}-[0-9]{2}-[0-9]{2}( [0-9]{2}:[0-9]{2}:[0-9]{2})*)$/,{message:`잘못된 SQLDate 타입`}).min(10).max(19).describe(`SQLDateTimeString`),Z({name:Y(),url:Y(),mime_type:Y(),size:gC()});function Pw(e,t,n,r={}){let{enabled:i=!0,retry:a=3,retryInterval:o=3e3}=r,[s,c]=(0,F.useState)({isConnected:!1,error:null,retryCount:0,isEnded:!1}),l=(0,F.useRef)(null),u=(0,F.useRef)(null),d=(0,F.useRef)(n);(0,F.useEffect)(()=>{d.current=n},[n]);let f=()=>{if(i)try{l.current&&=(l.current.close(),null),u.current&&=(clearTimeout(u.current),null);let n=hw.default.stringify(t),r=new fh(n?`${e}?${n}`:e,{fetch:(e,t)=>globalThis.fetch(e,{...t,headers:{...t?.headers,"Accept-Language":Sw()}})});l.current=r,c(e=>({...e,isConnected:!1,error:null,isEnded:!1})),r.onopen=()=>{c(e=>({...e,isConnected:!0,error:null,retryCount:0,isEnded:!1}))},r.onerror=e=>{l.current===r&&(r.close(),c(e=>({...e,isConnected:!1,error:`Connection failed`,isEnded:!1})),c(e=>e.retryCount<a?(u.current=setTimeout(()=>{u.current!==null&&(c(e=>({...e,retryCount:e.retryCount+1,isEnded:!1})),f())},o),e):(l.current=null,{...e,error:`Connection failed after ${a} attempts`})))},r.addEventListener(`end`,()=>{if(l.current===r&&(r.close(),l.current=null,c(e=>({...e,isConnected:!1,error:null,isEnded:!0})),d.current.end)){let e=d.current.end;e(`end`)}}),Object.keys(d.current).forEach(e=>{let t=d.current[e];t&&r.addEventListener(e,n=>{if(l.current===r){try{let e=JSON.parse(n.data,kw);t(e)}catch(t){console.error(`Failed to parse SSE data for event ${e}:`,t)}c(e=>({...e,isEnded:!1}))}})}),r.onmessage=e=>{if(l.current===r)try{let t=JSON.parse(e.data,kw),n=d.current.message;n&&n(t)}catch(e){console.error(`Failed to parse SSE message:`,e)}}}catch(e){c(t=>({...t,error:e instanceof Error?e.message:`Unknown error`,isConnected:!1,isEnded:!1}))}};return(0,F.useEffect)(()=>(i&&(c({isConnected:!1,error:null,retryCount:0,isEnded:!1}),f()),()=>{l.current&&=(l.current.close(),null),u.current&&=(clearTimeout(u.current),null)}),[e,JSON.stringify(t),i]),s}function Fw(e,t){let n=e===0&&t.zero||e===1&&t.one||t.other;return typeof n==`function`?n(e):n??e.toString()}function Iw(e,t){let n=(()=>{let t=e.charCodeAt(e.length-1);return t<44032||t>55203?!1:(t-44032)%28!=0})();return e+{은는:n?`은`:`는`,이가:n?`이`:`가`,을를:n?`을`:`를`,과와:n?`과`:`와`,으로:n?`으로`:`로`}[t]}function Lw(e){let t=new Set,n=[];for(let r of e.pages)for(let e of r?.rows??[]){let r=e?.id;if(r!==null){if(t.has(r))continue;t.add(r)}n.push(e)}let r=e.pages[0]?.total??0;return{pages:e.pages,pageParams:e.pageParams,rows:n,total:r}}function Rw(e){let[t,n]=(0,F.useState)(!1),r=(0,F.useCallback)(async()=>{n(!0);try{await e.refetch()}finally{n(!1)}},[e]);return{...e,refresh:r,isRefreshing:t}}var zw;(function(e){async function t(e,t){return Q({method:`GET`,url:`/api/token/findById?${hw.default.stringify({subset:e,id:t})}`})}e.getToken=t;let n=e.getTokenQueryOptions=(e,n)=>x({queryKey:[`Token`,`getToken`,e,n],queryFn:()=>t(e,n)});e.useToken=(e,t,r)=>Rw(b({...n(e,t),...r}));async function r(e,t){return Q({method:`GET`,url:`/api/token/findMany?${hw.default.stringify({subset:e,rawParams:t})}`})}e.getTokens=r;let i=e.getTokensQueryOptions=(e,t)=>x({queryKey:[`Token`,`getTokens`,e,t],queryFn:()=>r(e,t)});e.useTokens=(e,t,n)=>Rw(b({...i(e,t),...n}));let a=e.getTokensInfiniteQueryOptions=(e,t)=>E({queryKey:[`Token`,`getTokens`,`infinite`,e,t],queryFn:({pageParam:n})=>r(e,{...t,page:n}),initialPageParam:1,getNextPageParam:(e,t)=>{let n=e?.total??0;return t.reduce((e,t)=>e+(t?.rows?.length??0),0)<n?t.length+1:void 0},select:Lw});e.useTokensInfinite=(e,t,n)=>Rw(y({...a(e,t),...n}));async function o(e){return Q({method:`POST`,url:`/api/token/reorder`,data:{ids:e}})}e.reorder=o,e.useReorderMutation=()=>k({mutationFn:e=>zw.reorder(e.ids)});async function s(e){return Q({method:`POST`,url:`/api/token/del`,data:{ids:e}})}e.del=s,e.useDelMutation=()=>k({mutationFn:e=>zw.del(e.ids)})})(zw||={});var Bw;(function(e){async function t(e,t){return Q({method:`GET`,url:`/api/setting/findById?${hw.default.stringify({subset:e,id:t})}`})}e.getSetting=t;let n=e.getSettingQueryOptions=(e,n)=>x({queryKey:[`Setting`,`getSetting`,e,n],queryFn:()=>t(e,n)});e.useSetting=(e,t,r)=>Rw(b({...n(e,t),...r}));async function r(e,t){return Q({method:`GET`,url:`/api/setting/findMany?${hw.default.stringify({subset:e,rawParams:t})}`})}e.getSettings=r;let i=e.getSettingsQueryOptions=(e,t)=>x({queryKey:[`Setting`,`getSettings`,e,t],queryFn:()=>r(e,t)});e.useSettings=(e,t,n)=>Rw(b({...i(e,t),...n}));let a=e.getSettingsInfiniteQueryOptions=(e,t)=>E({queryKey:[`Setting`,`getSettings`,`infinite`,e,t],queryFn:({pageParam:n})=>r(e,{...t,page:n}),initialPageParam:1,getNextPageParam:(e,t)=>{let n=e?.total??0;return t.reduce((e,t)=>e+(t?.rows?.length??0),0)<n?t.length+1:void 0},select:Lw});e.useSettingsInfinite=(e,t,n)=>Rw(y({...a(e,t),...n}));async function o(){return Q({method:`GET`,url:`/api/setting/listSettings`})}e.getSettingList=o;let s=e.getSettingListQueryOptions=()=>x({queryKey:[`Setting`,`getSettingList`],queryFn:()=>o()});e.useSettingList=e=>Rw(b({...s(),...e}));async function c(e,t){return Q({method:`POST`,url:`/api/setting/updateSetting`,data:{key:e,value:t}})}e.updateSetting=c,e.useUpdateSettingMutation=()=>k({mutationFn:e=>Bw.updateSetting(e.key,e.value)});async function l(e){return Q({method:`POST`,url:`/api/setting/resetSetting`,data:{key:e}})}e.resetSetting=l,e.useResetSettingMutation=()=>k({mutationFn:e=>Bw.resetSetting(e.key)});async function u(){return Q({method:`POST`,url:`/api/setting/triggerExpiryReminder`})}e.triggerExpiryReminder=u,e.useTriggerExpiryReminderMutation=()=>k({mutationFn:e=>Bw.triggerExpiryReminder()})})(Bw||={});var Vw;(function(e){async function t(e,t){return Q({method:`GET`,url:`/api/requestLogStep/findById?${hw.default.stringify({subset:e,id:t})}`})}e.getRequestLogStep=t;let n=e.getRequestLogStepQueryOptions=(e,n)=>x({queryKey:[`RequestLogStep`,`getRequestLogStep`,e,n],queryFn:()=>t(e,n)});e.useRequestLogStep=(e,t,r)=>Rw(b({...n(e,t),...r}));async function r(e,t){return Q({method:`GET`,url:`/api/requestLogStep/findMany?${hw.default.stringify({subset:e,rawParams:t})}`})}e.getRequestLogSteps=r;let i=e.getRequestLogStepsQueryOptions=(e,t)=>x({queryKey:[`RequestLogStep`,`getRequestLogSteps`,e,t],queryFn:()=>r(e,t)});e.useRequestLogSteps=(e,t,n)=>Rw(b({...i(e,t),...n}));let a=e.getRequestLogStepsInfiniteQueryOptions=(e,t)=>E({queryKey:[`RequestLogStep`,`getRequestLogSteps`,`infinite`,e,t],queryFn:({pageParam:n})=>r(e,{...t,page:n}),initialPageParam:1,getNextPageParam:(e,t)=>{let n=e?.total??0;return t.reduce((e,t)=>e+(t?.rows?.length??0),0)<n?t.length+1:void 0},select:Lw});e.useRequestLogStepsInfinite=(e,t,n)=>Rw(y({...a(e,t),...n}));async function o(e){return Q({method:`POST`,url:`/api/requestLogStep/save`,data:{spa:e}})}e.save=o,e.useSaveMutation=()=>k({mutationFn:e=>Vw.save(e.spa)});async function s(e){return Q({method:`POST`,url:`/api/requestLogStep/del`,data:{ids:e}})}e.del=s,e.useDelMutation=()=>k({mutationFn:e=>Vw.del(e.ids)})})(Vw||={});var Hw;(function(e){async function t(e,t){return Q({method:`GET`,url:`/api/requestLog/findById?${hw.default.stringify({subset:e,id:t})}`})}e.getRequestLog=t;let n=e.getRequestLogQueryOptions=(e,n)=>x({queryKey:[`RequestLog`,`getRequestLog`,e,n],queryFn:()=>t(e,n)});e.useRequestLog=(e,t,r)=>Rw(b({...n(e,t),...r}));async function r(e,t){return Q({method:`GET`,url:`/api/requestLog/findMany?${hw.default.stringify({subset:e,rawParams:t})}`})}e.getRequestLogs=r;let i=e.getRequestLogsQueryOptions=(e,t)=>x({queryKey:[`RequestLog`,`getRequestLogs`,e,t],queryFn:()=>r(e,t)});e.useRequestLogs=(e,t,n)=>Rw(b({...i(e,t),...n}));let a=e.getRequestLogsInfiniteQueryOptions=(e,t)=>E({queryKey:[`RequestLog`,`getRequestLogs`,`infinite`,e,t],queryFn:({pageParam:n})=>r(e,{...t,page:n}),initialPageParam:1,getNextPageParam:(e,t)=>{let n=e?.total??0;return t.reduce((e,t)=>e+(t?.rows?.length??0),0)<n?t.length+1:void 0},select:Lw});e.useRequestLogsInfinite=(e,t,n)=>Rw(y({...a(e,t),...n}));async function o(e){return Q({method:`POST`,url:`/api/requestLog/save`,data:{spa:e}})}e.save=o,e.useSaveMutation=()=>k({mutationFn:e=>Hw.save(e.spa)});async function s(e){return Q({method:`GET`,url:`/api/requestLog/responseTypeTs?${hw.default.stringify({id:e})}`})}e.responseTypeTs=s;let c=e.responseTypeTsQueryOptions=e=>x({queryKey:[`RequestLog`,`responseTypeTs`,e],queryFn:()=>s(e)});e.useResponseTypeTs=(e,t)=>Rw(b({...c(e),...t}));async function l(e){return Q({method:`GET`,url:`/api/requestLog/toolsView?${hw.default.stringify({id:e})}`})}e.toolsView=l;let u=e.toolsViewQueryOptions=e=>x({queryKey:[`RequestLog`,`toolsView`,e],queryFn:()=>l(e)});e.useToolsView=(e,t)=>Rw(b({...u(e),...t}));async function d(e){return Q({method:`POST`,url:`/api/requestLog/del`,data:{ids:e}})}e.del=d,e.useDelMutation=()=>k({mutationFn:e=>Hw.del(e.ids)})})(Hw||={});var Uw;(function(e){async function t(e){return Q({method:`POST`,url:`/api/qgrid/query`,data:{args:e}})}e.query=t,e.useQueryMutation=()=>k({mutationFn:e=>Uw.query(e.args)});async function n(e){return Q({method:`POST`,url:`/api/qgrid/prepareStream`,data:{args:e}})}e.prepareStream=n,e.usePrepareStreamMutation=()=>k({mutationFn:e=>Uw.prepareStream(e.args)});function r(e,t,n){return Pw(`/api/qgrid/queryStream`,e,t,n)}e.useQueryStream=r;async function i(e){return Q({method:`POST`,url:`/api/qgrid/createRun`,data:{input:e}})}e.createRun=i,e.useCreateRunMutation=()=>k({mutationFn:e=>Uw.createRun(e.input)});async function a(e){return Q({method:`POST`,url:`/api/qgrid/appendStep`,data:{input:e}})}e.appendStep=a,e.useAppendStepMutation=()=>k({mutationFn:e=>Uw.appendStep(e.input)});async function o(e){return Q({method:`POST`,url:`/api/qgrid/finishRun`,data:{input:e}})}e.finishRun=o,e.useFinishRunMutation=()=>k({mutationFn:e=>Uw.finishRun(e.input)});async function s(){return Q({method:`GET`,url:`/api/qgrid/stats`})}e.stats=s;let c=e.statsQueryOptions=()=>x({queryKey:[`Qgrid`,`stats`],queryFn:()=>s()});e.useStats=e=>Rw(b({...c(),...e}));async function l(e){return Q({method:`GET`,url:`/api/qgrid/totalCost?${hw.default.stringify({params:e})}`})}e.totalCost=l;let u=e.totalCostQueryOptions=e=>x({queryKey:[`Qgrid`,`totalCost`,e],queryFn:()=>l(e)});e.useTotalCost=(e,t)=>Rw(b({...u(e),...t}));async function d(){return Q({method:`GET`,url:`/api/qgrid/projectNames`})}e.projectNames=d;let f=e.projectNamesQueryOptions=()=>x({queryKey:[`Qgrid`,`projectNames`],queryFn:()=>d()});e.useProjectNames=e=>Rw(b({...f(),...e}));async function p(){return Q({method:`GET`,url:`/api/qgrid/modelNames`})}e.modelNames=p;let m=e.modelNamesQueryOptions=()=>x({queryKey:[`Qgrid`,`modelNames`],queryFn:()=>p()});e.useModelNames=e=>Rw(b({...m(),...e}));async function h(e,t,n){return Q({method:`POST`,url:`/api/qgrid/addToken`,data:{provider:e,credentials:t,name:n}})}e.addToken=h,e.useAddTokenMutation=()=>k({mutationFn:e=>Uw.addToken(e.provider,e.credentials,e.name)});async function g(e,t,n,r,i){return Q({method:`POST`,url:`/api/qgrid/updateToken`,data:{id:e,name:t,quotaThreshold:n,weight:r,keepaliveEnabled:i}})}e.updateToken=g;async function _(e){return Q({method:`POST`,url:`/api/qgrid/removeToken`,data:{id:e}})}e.removeToken=_,e.useRemoveTokenMutation=()=>k({mutationFn:e=>Uw.removeToken(e.id)});async function v(e){return Q({method:`POST`,url:`/api/qgrid/toggleToken`,data:{id:e}})}e.toggleToken=v,e.useToggleTokenMutation=()=>k({mutationFn:e=>Uw.toggleToken(e.id)});async function y(e){return Q({method:`POST`,url:`/api/qgrid/oauthStart`,data:{name:e}})}e.oauthStart=y,e.useOauthStartMutation=()=>k({mutationFn:e=>Uw.oauthStart(e.name)});async function S(e){return Q({method:`POST`,url:`/api/qgrid/oauthComplete`,data:{pastedCode:e}})}e.oauthComplete=S,e.useOauthCompleteMutation=()=>k({mutationFn:e=>Uw.oauthComplete(e.pastedCode)});async function C(e){return Q({method:`POST`,url:`/api/qgrid/oauthStartOpenAI`,data:{name:e}})}e.oauthStartOpenAI=C,e.useOauthStartOpenAIMutation=()=>k({mutationFn:e=>Uw.oauthStartOpenAI(e.name)});async function w(e){return Q({method:`POST`,url:`/api/qgrid/oauthStartGrok`,data:{name:e}})}e.oauthStartGrok=w,e.useOauthStartGrokMutation=()=>k({mutationFn:e=>Uw.oauthStartGrok(e.name)});async function T(e){return Q({method:`POST`,url:`/api/qgrid/oauthStartGrokDevice`,data:{name:e}})}e.oauthStartGrokDevice=T,e.useOauthStartGrokDeviceMutation=()=>k({mutationFn:e=>Uw.oauthStartGrokDevice(e.name)});async function E(e){return Q({method:`POST`,url:`/api/qgrid/oauthPollGrokDevice`,data:{deviceCode:e}})}e.oauthPollGrokDevice=E,e.useOauthPollGrokDeviceMutation=()=>k({mutationFn:e=>Uw.oauthPollGrokDevice(e.deviceCode)});async function D(e){return Q({method:`POST`,url:`/api/qgrid/generateImages`,data:{params:e}})}e.generateImages=D,e.useGenerateImagesMutation=()=>k({mutationFn:e=>Uw.generateImages(e.params)});async function O(e){return Q({method:`POST`,url:`/api/qgrid/videoStart`,data:{params:e}})}e.videoStart=O,e.useVideoStartMutation=()=>k({mutationFn:e=>Uw.videoStart(e.params)});async function A(e){return Q({method:`POST`,url:`/api/qgrid/videoStatus`,data:{params:e}})}e.videoStatus=A,e.useVideoStatusMutation=()=>k({mutationFn:e=>Uw.videoStatus(e.params)});async function ee(e){return Q({method:`POST`,url:`/api/qgrid/transcribe`,data:{params:e}})}e.transcribe=ee,e.useTranscribeMutation=()=>k({mutationFn:e=>Uw.transcribe(e.params)});async function j(e){return Q({method:`POST`,url:`/api/qgrid/speak`,data:{params:e}})}e.speak=j,e.useSpeakMutation=()=>k({mutationFn:e=>Uw.speak(e.params)});async function M(e){return Q({method:`GET`,url:`/api/qgrid/usage?${hw.default.stringify({tokenId:e})}`})}e.usage=M;let te=e.usageQueryOptions=e=>x({queryKey:[`Qgrid`,`usage`,e],queryFn:()=>M(e)});e.useUsage=(e,t)=>Rw(b({...te(e),...t}));async function N(){return Q({method:`GET`,url:`/api/qgrid/health`})}e.health=N;let ne=e.healthQueryOptions=()=>x({queryKey:[`Qgrid`,`health`],queryFn:()=>N()});e.useHealth=e=>Rw(b({...ne(),...e}))})(Uw||={});var Ww;(function(e){async function t(e){return Q({method:`GET`,url:`/api/monit/monitLogs?${hw.default.stringify({cursor:e})}`})}e.monitLogs=t;let n=e.monitLogsQueryOptions=e=>x({queryKey:[`Monit`,`monitLogs`,e],queryFn:()=>t(e)});e.useMonitLogs=(e,t)=>Rw(b({...n(e),...t}));async function r(){return Q({method:`GET`,url:`/api/monit/monitInfo`})}e.monitInfo=r;let i=e.monitInfoQueryOptions=()=>x({queryKey:[`Monit`,`monitInfo`],queryFn:()=>r()});e.useMonitInfo=e=>Rw(b({...i(),...e}));async function a(){return Q({method:`GET`,url:`/api/monit/monitStats`})}e.monitStats=a;let o=e.monitStatsQueryOptions=()=>x({queryKey:[`Monit`,`monitStats`],queryFn:()=>a()});e.useMonitStats=e=>Rw(b({...o(),...e}))})(Ww||={}),Hw.useRequestLogs,Hw.useRequestLogsInfinite,Vw.useRequestLogSteps,Vw.useRequestLogStepsInfinite,Bw.useSettings,Bw.useSettingsInfinite,zw.useTokens,zw.useTokensInfinite;function Gw(e,t){return e.flatMap(e=>{let n=t?e.images??[]:[];return e.role===`user`?[{type:`message`,role:`user`,content:[{type:`input_text`,text:e.text},...n.map(e=>({type:`input_image`,image_url:e}))]}]:[...e.text?[{type:`message`,role:`assistant`,content:[{type:`output_text`,text:e.text}]}]:[],...n.length?[{type:`message`,role:`user`,content:[{type:`input_text`,text:`Previously generated assistant images (reference for follow-up edits):`},...n.map(e=>({type:`input_image`,image_url:e}))]}]:[]]})}function Kw(e){return e.flatMap(e=>e.type===`image`?[`data:${e.mediaType??`image/png`};base64,${e.data}`]:[])}function qw(e,t){return e.filter(e=>e.active&&e.provider===t).toSorted((e,t)=>e.ord-t.ord||e.name.localeCompare(t.name))}function Jw(e,t){return t!==void 0&&!e.some(e=>e.active&&e.provider===t)}function Yw(e,t,n){return!e||!n||t.some(t=>t.name===e)?e:``}function Xw(e,t){return e.model!==t.model||e.system!==t.system||e.tokenName!==t.tokenName}function Zw(e){return e?{tokenName:e}:{}}var Qw=t(i(),1);function $w(e){let t=e.indexOf(`,`),n=e.slice(0,t).match(/^data:image\/(png|jpeg|webp);base64$/)?.[1];if(!n)return{extension:`—`,bytes:0};let r=e.endsWith(`==`)?2:+!!e.endsWith(`=`);return{extension:n===`jpeg`?`jpg`:n,bytes:Math.max(0,Math.floor((e.length-t-1)*3/4)-r)}}function eT(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(2)} MB`}function tT({url:e,onClose:t}){let n=(0,F.useRef)(null),[r,i]=(0,F.useState)(null),[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(!1),l=$w(e);return(0,F.useEffect)(()=>{let e=n.current;return e?.showModal(),()=>e?.close()},[]),(0,Qw.createPortal)((0,I.jsx)(`dialog`,{ref:n,"aria-labelledby":`chat-image-preview-title`,onCancel:e=>{e.preventDefault(),t()},className:`m-0 h-dvh max-h-none w-screen max-w-none overflow-hidden bg-transparent p-0 backdrop:bg-black/65`,children:(0,I.jsx)(`div`,{className:`grid size-full place-items-center p-4`,onClick:e=>{e.target===e.currentTarget&&t()},children:(0,I.jsxs)(`div`,{className:`w-[min(1100px,calc(100vw-2rem))] max-h-[calc(100dvh-2rem)] overflow-hidden rounded-2xl bg-white text-sand-900 shadow-xl`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-sand-100 px-4 py-3`,children:[(0,I.jsx)(`h2`,{id:`chat-image-preview-title`,className:`text-sm font-semibold`,children:`이미지 미리보기`}),(0,I.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`이미지 미리보기 닫기`,className:`grid size-8 place-items-center rounded-full hover:bg-sand-100`,children:(0,I.jsx)(su,{className:`size-4`})})]}),(0,I.jsx)(`div`,{className:`max-h-[calc(100dvh-13rem)] overflow-auto bg-sand-100 p-3`,style:{backgroundImage:`conic-gradient(#e8e4df 25%, #fff 0 50%, #e8e4df 0 75%, #fff 0)`,backgroundSize:`20px 20px`},children:s?(0,I.jsx)(`p`,{role:`alert`,className:`p-8 text-center text-danger-500`,children:`이미지를 불러올 수 없습니다.`}):(0,I.jsx)(`img`,{src:e,alt:`확대된 채팅 이미지`,onLoad:e=>i({width:e.currentTarget.naturalWidth,height:e.currentTarget.naturalHeight}),onError:()=>c(!0),className:a?`block max-w-none`:`mx-auto block max-h-[calc(100dvh-15rem)] max-w-full object-contain`})}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-t border-sand-100 px-4 py-3`,children:[(0,I.jsxs)(`dl`,{className:`flex flex-wrap gap-x-5 gap-y-1 text-xs tabular-nums`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{className:`text-sand-400`,children:`확장자`}),(0,I.jsx)(`dd`,{className:`mt-1 uppercase`,children:l.extension})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{className:`text-sand-400`,children:`파일 용량`}),(0,I.jsx)(`dd`,{className:`mt-1`,children:eT(l.bytes)})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{className:`text-sand-400`,children:`해상도`}),(0,I.jsx)(`dd`,{className:`mt-1`,children:r?`${r.width} × ${r.height} px`:`—`})]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,I.jsx)(`button`,{type:`button`,disabled:!r||s,onClick:()=>o(e=>!e),className:`text-sand-600 hover:underline disabled:opacity-40`,children:a?`화면에 맞추기`:`원본 크기`}),(0,I.jsx)(`a`,{href:e,download:`qgrid-image.${l.extension}`,className:`text-sienna-500 hover:underline`,children:`다운로드`})]})]})]})})}),document.body)}var nT=`qgrid_chat`,rT=`anthropic/claude-fable-5-1`,iT=[{label:`OpenAI`,models:[`openai/gpt-6-astra`,`openai/gpt-6.1-sol`,`openai/gpt-6.1-terra`,`openai/gpt-6-sol`,`openai/gpt-6-luna`,`openai/gpt-5.6-terra`,`openai/gpt-5.6-sol`,`openai/gpt-5.6-luna`]},{label:`Anthropic`,models:[`anthropic/claude-fable-5-1`,`anthropic/claude-fable-5`,`anthropic/claude-opus-5-5`,`anthropic/claude-opus-5`,`anthropic/claude-sonnet-5-5`,`anthropic/claude-sonnet-5`,`anthropic/claude-haiku-5-5`,`anthropic/claude-opus-4-8`,`anthropic/claude-opus-4-7`,`anthropic/claude-opus-4-6`,`anthropic/claude-opus-4-5`,`anthropic/claude-sonnet-4-6`,`anthropic/claude-haiku-4-5`]},{label:`Grok`,models:[`grok/grok-4.7`,`grok/grok-4.7-build-fast`,`grok/grok-4.6`,`grok/grok-4.5`]}],aT=[`low`,`medium`,`high`],oT=new Map([[`openai`,`OpenAI`],[`anthropic`,`Anthropic`],[`grok`,`Grok`]]);function sT(e,t,n){let r=n!==void 0&&Jw(n,t);return/NO_OPENAI_WORKERS|no ready openai workers|no anthropic tokens available/i.test(e)||r&&/기동 중입니다/.test(e)?`사용 가능한 ${t?oT.get(t)??t:``} 토큰이 없습니다. Tokens 페이지에서 토큰을 추가해주세요.`:e}function cT(e){return e>=.01?`$${e.toFixed(2)}`:`$${e.toFixed(4)}`}var lT=4,uT=1536;async function dT(e){let t=await createImageBitmap(e),n=Math.min(1,uT/Math.max(t.width,t.height)),r=document.createElement(`canvas`);return r.width=Math.max(1,Math.round(t.width*n)),r.height=Math.max(1,Math.round(t.height*n)),r.getContext(`2d`).drawImage(t,0,0,r.width,r.height),t.close(),r.toDataURL(`image/jpeg`,.85)}function fT(){let[e,t]=(0,F.useState)(!1),[n,r]=(0,F.useState)(!1),[i,a]=(0,F.useState)([]),[o,s]=(0,F.useState)(``),[c,l]=(0,F.useState)(rT),[u,d]=(0,F.useState)(``),[f,p]=(0,F.useState)(``),[m,h]=(0,F.useState)(``),[g,_]=(0,F.useState)(!1),[v,y]=(0,F.useState)(null),[b,x]=(0,F.useState)(!1),[S,C]=(0,F.useState)([]),[w,T]=(0,F.useState)(null),E=(0,F.useRef)(null);(0,F.useEffect)(()=>()=>E.current?.abort(),[]);let D=(0,F.useRef)(void 0),O=(0,F.useRef)(void 0),k=(0,F.useRef)(null),A=(0,F.useRef)(null),ee=(0,F.useRef)(null),j=c.split(`/`)[0],te=j===`openai`||j===`grok`,{data:N}=zw.useTokens(`A`,{orderBy:`ord-asc`},{enabled:e}),ne=(0,F.useMemo)(()=>qw(N?.rows??[],j),[j,N?.rows]),re=N?.rows!==void 0,ie=(0,F.useRef)(void 0);(0,F.useEffect)(()=>{ie.current=N?.rows},[N?.rows]);let ae=N?.rows!==void 0&&Jw(N.rows,j);(0,F.useEffect)(()=>{te||C([])},[te]),(0,F.useEffect)(()=>{d(e=>Yw(e,ne,re))},[re,ne]);let oe=async e=>{if(!e)return;let t=lT-S.length,n=await Promise.all([...e].slice(0,t).map(e=>dT(e).catch(()=>null)));C(e=>[...e,...n.filter(e=>e!==null)].slice(0,lT))},P=e=>{a(t=>{let n=t[t.length-1];return!n||n.role!==`assistant`?t:[...t.slice(0,-1),e(n)]})},se=e=>{let t=sT(e,O.current?.model.split(`/`)[0],ie.current);P(e=>e.status===`streaming`?{...e,status:`error`,error:t}:e),y(null),x(!1)},ce=Uw.useQueryStream({streamId:v??``},{delta:({text:e})=>{P(t=>t.status===`streaming`?{...t,text:t.text+e}:t)},toolCall:()=>{se(`tool call 응답은 채팅에서 지원하지 않습니다`)},done:e=>{D.current=e.runContext?.threadCoord,P(t=>({...t,text:e.text||t.text,images:Kw(Array.isArray(e.content)?e.content:[e.content]),status:`done`,meta:{model:e.model,tokenName:e.tokenName,durationMs:e.durationMs,costUsd:e.costUsd,requestLogId:e.requestLogId,fallback:(e.modelFallbacks?.length??0)>0}}))},error:({message:e})=>{se(e)},end:()=>{P(e=>e.status===`streaming`?{...e,status:`error`,error:`응답 완료 전에 스트림이 종료되었습니다`}:e),y(null),x(!1)}},{enabled:v!==null,retry:0});(0,F.useEffect)(()=>{v!==null&&ce.error&&se(ce.error)},[ce.error]),(0,F.useEffect)(()=>{k.current?.scrollTo({top:k.current.scrollHeight})},[i,e]),(0,F.useEffect)(()=>{e&&A.current?.focus()},[e]);let le=async()=>{let e=o.trim();if(!e||b)return;let t=m.trim(),n=Yw(u,ne,re),r={model:c,system:t,tokenName:n};O.current&&Xw(O.current,r)&&(D.current=void 0),O.current=r;let l=te?S:[],d=Gw(i,te),p=new AbortController;E.current=p;let h={role:`user`,text:e};l.length>0&&(h.images=l),a(e=>[...e,h,{role:`assistant`,text:``,status:`streaming`}]),s(``),C([]),x(!0);try{let r={prompt:e,model:c,projectName:nT,...Zw(n)};if(t&&(r.system=t),f&&(r.effort=f),l.length>0&&(r.input=l.map(e=>({type:`image`,url:e}))),d.length>0&&(r.history=JSON.stringify(d)),D.current&&(r.runContext={threadCoord:D.current}),te){let e=await Q({method:`POST`,url:`/api/qgrid/query`,data:{args:{...r,imageGeneration:`auto`}},signal:p.signal});if(E.current!==p||p.signal.aborted)return;D.current=e.runContext?.threadCoord,P(t=>({...t,text:e.text,images:Kw(e.content),status:`done`,meta:{model:e.model,tokenName:e.tokenName,durationMs:e.durationMs,costUsd:e.costUsd,requestLogId:e.requestLogId,fallback:(e.modelFallbacks?.length??0)>0}})),x(!1),E.current=null;return}let{streamId:i}=await Uw.prepareStream(r);if(E.current!==p||p.signal.aborted)return;y(i)}catch(e){if(E.current!==p||p.signal.aborted)return;se(e instanceof Error?e.message:String(e)),E.current=null}},ue=()=>{E.current?.abort(),E.current=null,P(e=>e.status===`streaming`?{...e,status:`aborted`}:e),y(null),x(!1)};return(0,I.jsxs)(`div`,{className:`fixed bottom-5 right-5 z-40`,children:[w&&(0,I.jsx)(tT,{url:w,onClose:()=>T(null)},w),e?(0,I.jsxs)(`div`,{onAnimationEnd:()=>{n&&(t(!1),r(!1))},className:`flex flex-col w-[min(400px,calc(100vw-2.5rem))] h-[min(640px,calc(100dvh-7rem))] bg-white rounded-2xl shadow-[0_16px_48px_rgba(44,36,24,0.18),0_0_0_1px_rgba(227,218,204,0.6)] overflow-hidden origin-bottom-right ${n?`chat-panel-pop-out`:`chat-panel-pop`}`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2.5 px-4 py-2.5 border-b border-sand-100 shrink-0`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`text-[14px] font-semibold text-sand-900 leading-tight`,children:`채팅`}),(0,I.jsxs)(`p`,{className:`text-[11px] text-sand-400 truncate leading-tight`,children:[c,f?` · ${f}`:``,u?` · ${u}`:``]})]}),(0,I.jsxs)(`div`,{className:`ml-auto flex items-center gap-0.5`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>_(e=>!e),title:`모델·토큰·effort·system prompt 설정`,className:`size-8 grid place-items-center rounded-full transition-colors duration-150 ${g?`text-sienna-500 bg-sienna-50`:`text-sand-500 hover:text-sand-700 hover:bg-sand-100`}`,children:(0,I.jsx)(au,{className:`size-4`})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>{b&&ue(),a([]),D.current=void 0,O.current=void 0},disabled:i.length===0,title:`새 대화`,className:`size-8 grid place-items-center rounded-full text-sand-500 hover:text-sand-700 hover:bg-sand-100 disabled:opacity-40 transition-colors duration-150`,children:(0,I.jsx)(iu,{className:`size-4`})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>{window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?t(!1):r(!0)},title:`닫기`,className:`size-8 grid place-items-center rounded-full text-sand-500 hover:text-sand-700 hover:bg-sand-100 transition-colors duration-150`,children:(0,I.jsx)(su,{className:`size-4.5`})})]})]}),g&&(0,I.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-sand-100 bg-sand-50/60 shrink-0 flex flex-col gap-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`select`,{value:c,onChange:e=>l(e.target.value),disabled:b,className:`min-w-0 flex-1 rounded-xl border border-sand-200/80 bg-white px-2 py-1.5 text-[12px] text-sand-800 focus:outline-none focus:border-sienna-300 disabled:opacity-50`,children:iT.map(e=>(0,I.jsx)(`optgroup`,{label:e.label,children:e.models.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))},e.label))}),(0,I.jsxs)(`select`,{value:f,onChange:e=>p(e.target.value),disabled:b,className:`rounded-xl border border-sand-200/80 bg-white px-2 py-1.5 text-[12px] text-sand-600 focus:outline-none focus:border-sienna-300 disabled:opacity-50`,children:[(0,I.jsx)(`option`,{value:``,children:`effort 기본`}),aT.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})]}),(0,I.jsxs)(`select`,{value:u,onChange:e=>d(e.target.value),disabled:b,"aria-label":`요청 토큰`,className:`w-full rounded-xl border border-sand-200/80 bg-white px-2 py-1.5 text-[12px] text-sand-700 focus:outline-none focus:border-sienna-300 disabled:opacity-50`,children:[(0,I.jsx)(`option`,{value:``,children:`토큰 자동 분배`}),ne.map(e=>(0,I.jsx)(`option`,{value:e.name,children:e.name},e.name))]}),(0,I.jsx)(`textarea`,{value:m,onChange:e=>h(e.target.value),disabled:b,placeholder:`system prompt (선택)`,rows:2,className:`w-full resize-none rounded-xl border border-sand-200/80 bg-white px-2.5 py-1.5 text-[12px] text-sand-800 placeholder:text-sand-400 focus:outline-none focus:border-sienna-300 disabled:opacity-50`})]}),(0,I.jsx)(`div`,{ref:k,className:`flex-1 overflow-y-auto main-scroll px-3.5 py-3`,children:i.length===0?(0,I.jsx)(`div`,{className:`h-full grid place-items-center`,children:(0,I.jsxs)(`div`,{className:`text-center px-4`,children:[(0,I.jsx)(`img`,{src:cu,alt:``,className:`mx-auto mb-2.5 size-14 rounded-[35%] object-cover`}),(0,I.jsx)(`p`,{className:`text-[13px] text-sand-600`,children:`가용 토큰에게 바로 물어보세요.`}),(0,I.jsxs)(`p`,{className:`mt-1 text-[11px] text-sand-400`,children:[`대화는 저장되지 않고, 요청은`,` `,(0,I.jsx)(M,{to:`/logs`,search:{project:nT,page:1},className:`text-sienna-500 hover:underline`,children:`request log`}),`에 기록됩니다.`]})]})}):(0,I.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:i.map((e,t)=>e.role===`user`?(0,I.jsxs)(`div`,{className:`self-end max-w-[80%] flex flex-col items-end gap-1`,children:[e.images&&(0,I.jsx)(`div`,{className:`flex flex-wrap justify-end gap-1`,children:e.images.map((e,t)=>(0,I.jsx)(`button`,{type:`button`,onClick:()=>T(e),"aria-label":`첨부 이미지 ${t+1} 크게 보기`,className:`cursor-zoom-in rounded-xl`,children:(0,I.jsx)(`img`,{src:e,alt:``,className:`size-24 rounded-xl object-cover`})},t))}),(0,I.jsx)(`div`,{className:`rounded-[18px] rounded-br-[5px] bg-sienna-600 px-3.5 py-2 text-[13px] leading-relaxed text-white whitespace-pre-wrap break-words`,children:e.text})]},t):(0,I.jsxs)(`div`,{className:`self-start max-w-[88%] min-w-0`,children:[(0,I.jsxs)(`div`,{className:`rounded-[18px] rounded-bl-[5px] bg-sand-100 px-3.5 py-2`,children:[e.images?.map((e,t)=>(0,I.jsxs)(`div`,{className:`my-1.5`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>T(e),"aria-label":`생성된 이미지 ${t+1} 크게 보기`,className:`block w-full cursor-zoom-in rounded-xl`,children:(0,I.jsx)(`img`,{src:e,alt:`생성된 이미지 ${t+1}`,onLoad:()=>k.current?.scrollTo({top:k.current.scrollHeight}),className:`w-full rounded-xl object-contain bg-white`})}),(0,I.jsx)(`a`,{href:e,download:`qgrid-image-${t+1}.${e.startsWith(`data:image/jpeg;`)?`jpg`:e.startsWith(`data:image/webp;`)?`webp`:`png`}`,className:`mt-1 inline-block text-[11px] text-sienna-500 hover:underline`,children:`이미지 다운로드`})]},t)),e.text?(0,I.jsx)(`div`,{className:`prose prose-sm prose-qgrid max-w-none text-[13px] leading-relaxed break-words`,children:(0,I.jsx)(Zo,{remarkPlugins:[tu],children:e.text})}):e.status===`streaming`?(0,I.jsxs)(`span`,{className:`inline-flex gap-1 py-1.5 px-0.5`,"aria-label":`응답 대기 중`,children:[(0,I.jsx)(`span`,{className:`chat-typing-dot`}),(0,I.jsx)(`span`,{className:`chat-typing-dot [animation-delay:150ms]`}),(0,I.jsx)(`span`,{className:`chat-typing-dot [animation-delay:300ms]`})]}):null,e.status===`aborted`&&(0,I.jsx)(`p`,{className:`mt-1 text-[10px] text-sand-400`,children:`중단됨`}),e.status===`error`&&(0,I.jsx)(`p`,{className:`mt-1 text-[12px] text-danger-500 break-words`,children:e.error})]}),e.meta&&(0,I.jsxs)(M,{to:e.meta.requestLogId===void 0?`/logs`:`/requests/show`,search:e.meta.requestLogId===void 0?{project:nT,page:1}:{id:e.meta.requestLogId},className:`mt-1 ml-1.5 inline-block text-[10px] tabular-nums text-sand-400 hover:text-sienna-500 transition-colors duration-150`,title:`request log 보기`,children:[e.meta.model,e.meta.fallback&&` (폴백)`,e.meta.tokenName?` · ${e.meta.tokenName}`:``,` · ${(e.meta.durationMs/1e3).toFixed(1)}s · ${cT(e.meta.costUsd)}`]})]},t))})}),ae&&(0,I.jsxs)(`div`,{className:`px-4 py-1.5 border-t border-caution-400/30 bg-caution-400/10 text-[11px] text-caution-500 shrink-0`,children:[oT.get(j)??j,` 토큰이 등록되어 있지 않습니다.`,` `,(0,I.jsx)(M,{to:`/tokens`,className:`font-medium underline hover:text-caution-400`,children:`Tokens 페이지`}),`에서 추가해주세요.`]}),(0,I.jsxs)(`div`,{className:`px-3 py-2.5 border-t border-sand-100 shrink-0`,children:[S.length>0&&(0,I.jsx)(`div`,{className:`flex gap-1.5 pb-2`,children:S.map((e,t)=>(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>T(e),"aria-label":`첨부할 이미지 ${t+1} 크게 보기`,className:`cursor-zoom-in rounded-xl`,children:(0,I.jsx)(`img`,{src:e,alt:``,className:`size-12 rounded-xl object-cover`})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>C(e=>e.filter((e,n)=>n!==t)),title:`첨부 제거`,className:`absolute -top-1.5 -right-1.5 size-4.5 grid place-items-center rounded-full bg-sand-800 text-white hover:bg-sand-700`,children:(0,I.jsx)(su,{className:`size-2.5`})})]},t))}),(0,I.jsxs)(`div`,{className:`flex items-end gap-1.5`,children:[te&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`input`,{ref:ee,type:`file`,accept:`image/*`,multiple:!0,hidden:!0,onChange:e=>{oe(e.target.files),e.target.value=``}}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>ee.current?.click(),disabled:b||S.length>=lT,title:`이미지 첨부`,className:`size-9 shrink-0 grid place-items-center rounded-full text-sand-500 hover:text-sand-700 hover:bg-sand-100 disabled:opacity-40 transition-colors duration-150`,children:(0,I.jsx)(ru,{className:`size-4.5`})})]}),(0,I.jsx)(`textarea`,{ref:A,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),le())},placeholder:`메시지 입력...`,rows:1,className:`min-w-0 flex-1 resize-none [field-sizing:content] max-h-28 rounded-[20px] border border-sand-200/80 bg-sand-50/60 px-4 py-2 text-[13px] leading-relaxed text-sand-800 placeholder:text-sand-400 focus:outline-none focus:border-sienna-300 focus:bg-white transition-colors duration-150`}),b?(0,I.jsx)(`button`,{type:`button`,onClick:ue,title:`응답 중단`,className:`size-9 shrink-0 grid place-items-center rounded-full border border-sand-200/80 text-sand-600 hover:bg-sand-100 active:scale-[0.96] transition-all duration-150`,children:(0,I.jsx)(ou,{className:`size-3.5`})}):(0,I.jsx)(`button`,{type:`button`,onClick:()=>void le(),disabled:!o.trim(),title:`전송`,className:`size-9 shrink-0 grid place-items-center rounded-full bg-sienna-600 text-white hover:bg-sienna-700 disabled:opacity-40 active:scale-[0.96] transition-all duration-150`,children:(0,I.jsx)(nu,{className:`size-4.5`})})]})]})]}):(0,I.jsx)(`button`,{type:`button`,onClick:()=>t(!0),title:`채팅 열기`,"aria-label":`채팅 열기`,className:`block size-15 rounded-[35%] overflow-hidden shadow-[0_6px_20px_rgba(44,36,24,0.25)] hover:scale-105 active:scale-[0.96] transition-transform duration-150`,children:(0,I.jsx)(`img`,{src:cu,alt:``,className:`size-full object-cover`})})]})}var pT=`2.19.1`;function mT({className:e}){let t=A({select:e=>e.location.pathname});return(0,I.jsxs)(`aside`,{className:`hidden md:flex w-[200px] bg-sand-50 flex-col shrink-0 border-r border-sand-200/40 ${e??``}`,children:[(0,I.jsx)(`div`,{className:`h-11 flex items-center px-4 border-b border-sand-200/30`,children:(0,I.jsx)(`span`,{className:`text-[13px] font-semibold text-sand-800 tracking-tight`,children:`Qgrid`})}),(0,I.jsx)(`nav`,{className:`flex-1 px-2.5 py-3 space-y-4 overflow-y-auto`,children:ge.map(e=>(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`px-2 pb-1.5`,children:(0,I.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.08em] text-sand-400 font-medium`,children:e.label})}),(0,I.jsx)(`div`,{className:`space-y-0.5`,children:e.items.map(e=>{let n=ve(e.path,t);return(0,I.jsxs)(M,{to:e.path,className:`flex items-center gap-2 px-2 py-[6px] rounded-[7px] text-[13px] no-underline transition-all duration-150 ${n?`bg-sand-200/60 text-sand-900 font-medium`:`text-sand-500 hover:bg-sand-100 hover:text-sand-700`}`,style:n?{boxShadow:`0 0.5px 1px rgba(0,0,0,0.04), inset 0 0.5px 0 rgba(255,255,255,0.6)`}:void 0,children:[(0,I.jsx)(e.icon,{className:`size-[15px] shrink-0 ${n?`text-sienna-500`:`text-sand-400`}`}),(0,I.jsx)(`span`,{children:e.title})]},e.path)})})]},e.label))}),(0,I.jsx)(`div`,{className:`px-4 py-3 border-t border-sand-200/30`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`div`,{className:`size-1.5 rounded-full bg-sage-400`}),(0,I.jsxs)(`span`,{className:`text-[10px] text-sand-400`,children:[`v`,pT]})]})})]})}var hT=new Map(Object.entries({"/":`Dashboard`,"/tokens":`Tokens`,"/logs":`Request Logs`,"/monit":`Server Logs`,"/voice":`Voice`}));function gT(e){return e.startsWith(`/requests/show`)?{parent:`Request Logs`,parentPath:`/logs`,current:`Detail`}:{current:hT.get(e)??e}}function _T(){let e=gT(A({select:e=>e.location.pathname}));return(0,I.jsx)(`div`,{className:`toolbar-glass h-11 shrink-0 flex items-center px-5`,children:(0,I.jsxs)(`nav`,{className:`flex items-center gap-1.5 text-[13px]`,children:[e.parent&&e.parentPath&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(M,{to:e.parentPath,className:`text-sand-400 hover:text-sand-600 transition-colors no-underline`,children:e.parent}),(0,I.jsx)(`span`,{className:`text-sand-300 select-none`,children:`/`})]}),(0,I.jsx)(`span`,{className:`font-medium text-sand-800`,children:e.current})]})})}var vT=[`/login`,`/signup`];function yT({children:e}){(0,F.useEffect)(()=>{let e=navigator.language.split(`-`)[0],t=yw.find(t=>t===e);t!==void 0&&xw(t)},[]);let t=A({select:e=>e.location.pathname}),n=!vT.includes(t);return(0,I.jsxs)(`div`,{className:`flex h-screen w-full bg-sand-100 overflow-hidden font-sans`,children:[n&&(0,I.jsx)(mT,{}),(0,I.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden min-w-0`,children:[n&&(0,I.jsx)(_T,{}),(0,I.jsx)(`main`,{className:`flex-1 overflow-y-auto main-scroll content-inset`,children:(0,I.jsx)(`div`,{className:`px-3 py-4 sm:px-6 sm:py-5 md:px-8`,children:(0,I.jsx)(F.Suspense,{fallback:(0,I.jsx)(`div`,{className:`text-sand-400 text-center py-8 text-sm`,children:`로딩 중...`}),children:e})})}),n&&(0,I.jsx)(ye,{})]}),n&&(0,I.jsx)(fT,{})]})}var bT={"rc.asyncSelect.loading":`Loading...`,"rc.asyncSelect.noOptions":`No options`,"rc.asyncSelect.noResults":`No results`,"rc.asyncSelect.selectPlaceholder":`Select...`,"rc.combobox.noResults":`No results`,"rc.combobox.selectPlaceholder":`Select...`,"rc.datePicker.pickDate":`Pick date`,"rc.datePicker.placeholder":`Pick date`,"rc.datePicker.selectDate":`Select date`,"rc.dateSelectorMultiple.addDate":`Add date`,"rc.dateSelectorMultiple.dateRange":`Range`,"rc.dateSelectorMultiple.placeholder":`Pick date`,"rc.dateSelectorMultiple.singleDate":`Single`,"rc.fileInput.browseFiles":`Browse files`,"rc.fileInput.dropZone":`Drag files here or click to upload`,"rc.fileInput.filePlaceholder":`File`,"rc.fileInput.imagePlaceholder":`Image`,"rc.fileInput.maxFilesExceeded":e=>`Maximum ${e} files allowed`,"rc.fileInput.pending":`Pending`,"rc.fileInput.remove":`Remove`,"rc.fileInput.uploadFailed":`Upload failed`,"rc.fileInput.uploading":`Uploading...`,"rc.monthPickerMultiple.addMonth":`Add month`,"rc.monthPickerMultiple.dateRange":`Range`,"rc.monthPickerMultiple.endDate":`End date`,"rc.monthPickerMultiple.placeholder":`Pick month`,"rc.monthPickerMultiple.singleDate":`Single`,"rc.monthPickerMultiple.startDate":`Start date`,"rc.multiSelect.clear":`Clear all`,"rc.multiSelect.close":`Close`,"rc.multiSelect.moreItems":e=>`+${e} more`,"rc.multiSelect.noOptions":`No options`,"rc.multiSelect.noOptionsSelected":`No options selected`,"rc.multiSelect.noResults":`No results`,"rc.multiSelect.optionsCount":e=>`${e} options`,"rc.multiSelect.selectAll":`Select all`,"rc.multiSelect.selectPlaceholder":`Select...`,"rc.pagination.next":`Next`,"rc.pagination.previous":`Previous`,"rc.pagination.showing":(e,t,n)=>`Showing ${e}-${t} of ${n}`,"rc.calendar.month.0":`January`,"rc.calendar.month.1":`February`,"rc.calendar.month.2":`March`,"rc.calendar.month.3":`April`,"rc.calendar.month.4":`May`,"rc.calendar.month.5":`June`,"rc.calendar.month.6":`July`,"rc.calendar.month.7":`August`,"rc.calendar.month.8":`September`,"rc.calendar.month.9":`October`,"rc.calendar.month.10":`November`,"rc.calendar.month.11":`December`,"rc.sonamuFilter.title":`Sonamu Filter`,"rc.sonamuFilter.apply":`Apply`,"rc.sonamuFilter.reset":`Reset`,"rc.sonamuFilter.addRule":`Add Rule`,"rc.sonamuFilter.noRulesYet":`No rules yet. Click "+ Add Rule" to start.`,"rc.sonamuFilter.selectField":`Select field`,"rc.sonamuFilter.selectOperator":`Operator`,"rc.sonamuFilter.selectOperatorFirst":`Select operator first`,"rc.sonamuFilter.enterValue":`Enter value`,"rc.sonamuFilter.enterNumber":`Enter number`,"rc.sonamuFilter.notSupported":`Not supported`,"rc.sonamuFilter.startDate":`Start date`,"rc.sonamuFilter.endDate":`End date`,"rc.sonamuFilter.appliedFilters":`🌲 Applied SonamuFilters`,"rc.common.cancel":`Cancel`,"rc.common.save":`Save`},xT=Object.create(null),ST=e=>({}),CT=new Proxy(xT,{get(e,t){return ST()[t]??xT[t]},has(e,t){return t in ST()||t in xT},set(e,t,n){let r=ST(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=ST(!0);return delete n[t],!0},ownKeys(){let e=ST(!0);return Object.keys(e)}});CT.NODE_ENV;function wT(e,t){return typeof process<`u`?{}[e]??t:typeof Deno<`u`?Deno.env.get(e)??t:typeof Bun<`u`?Bun.env[e]??t:t}Object.freeze({get BETTER_AUTH_SECRET(){return wT(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return wT(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return wT(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return wT(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return wT(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return wT(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return wT(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});function TT(){let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,`writable`)?e.writable:e.set!==void 0}function ET(e){let t=e.split(`
|
|
103
103
|
at `);return t.length<=1?e:(t.splice(1,1),t.join(`
|
|
104
|
-
at `))}function DT(e,t){class n extends e{#e;constructor(...e){if(TT()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=ET(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t},enumerable:!1,configurable:!0}),n}var OT={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};DT(class extends Error{status;body;headers;statusCode;constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:OT[e]){if(super(t?.message,t&&`cause`in t?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,t&&`cause`in t){let{cause:e,...n}=t;this.body=Object.defineProperty(n,"cause",{value:e,writable:!0,configurable:!0})}else this.body=t}},Error);var kT=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}},AT=47;function jT(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===AT;)t--;return t===e.length?e:e.slice(0,t)}function MT(e){try{return(jT(new URL(e).pathname)||`/`)!==`/`}catch{throw new kT(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function NT(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new kT(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof kT?t:new kT(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function PT(e,t=`/api/auth`){if(NT(e),MT(e))return e;let n=jT(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function FT(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function IT(e,t,n,r,i){if(e)return PT(e,t);if(r!==!1){let e=CT.BETTER_AUTH_URL||CT.NEXT_PUBLIC_BETTER_AUTH_URL||CT.PUBLIC_BETTER_AUTH_URL||CT.NUXT_PUBLIC_BETTER_AUTH_URL||CT.NUXT_PUBLIC_AUTH_URL||(CT.BASE_URL===`/`?void 0:CT.BASE_URL);if(e)return PT(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&FT(o,`proto`)&&FT(a,`host`))try{return PT(`${o}://${a}`,t)}catch{}if(n){let e=LT(n.url);if(!e)throw new kT(`Could not get origin from request. Please provide a valid base URL.`);return PT(e,t)}if(typeof window<`u`&&window.location)return PT(window.location.origin,t)}function LT(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var RT={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},zT=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,BT={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},VT=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function HT(e){return e instanceof Date&&!isNaN(e.getTime())}function UT(e){let t=VT.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return HT(f)?f:null}function WT(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim(),s=o.toLowerCase();if(s.length<=9&&s in BT)return BT[s];if(!zT.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(RT).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t)r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);else{if(a&&typeof t==`string`){let e=UT(t);if(e)return e}return i?i(e,t):t}})}catch(t){if(n)throw t;return e}}function GT(e,t={strict:!0}){return WT(e,t)}var KT=[`javascript:`,`data:`,`vbscript:`];function qT(e){let t;try{t=new URL(e)}catch{return!0}return!KT.includes(t.protocol)}var JT={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&qT(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},YT=[],XT=0,ZT=null,QT=4,$T=globalThis.nanostoresGlobal||={epoch:0},eE=()=>{let e,t;for(;XT<YT.length;){t=XT,XT+=QT;let n=ZT?.get(YT[t]);if(n){if(!n.has(YT[t+1]))continue;n.clear()}try{YT[t](YT[t+1].value,YT[t+2],YT[t+3])}catch(t){e=t}}if(YT.length=XT=0,e)throw e},tE=e=>{let t=[],n={eq:Object.is,get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{ZT?.get(e)?.delete(n);for(let t=XT;t<YT.length;)YT[t]===e&&YT[t+1]===n?YT.splice(t,QT):t+=QT;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){$T.epoch++;let i=!YT.length&&!0;for(let i of t)YT.push(i,n,e,r);i&&eE()},off(){},set(e){let t=n.value;n.eq(t,e)||(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},nE=2,rE=5,iE=6,aE=10,oE=(e,t,n,r)=>(e.events=e.events||{},e.events[n+aE]||(e.events[n+aE]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);~i&&(r.splice(i,1),r.length||(e.events[n+aE](),delete e.events[n+aE]))}),sE=(e,t)=>oE(e,t,nE,t=>{let n=e.set,r=e.setKey;return e.setKey&&=(n,i)=>{let a;if(t({abort:()=>{a=!0},changed:n,newValue:{...e.value,[n]:i}}),!a)return r(n,i)},e.set=e=>{let r;if(t({abort:()=>{r=!0},newValue:e}),!r)return n(e)},()=>{e.set=n,e.setKey=r}}),cE=1e3,lE=(e,t)=>oE(e,n=>{let r=t(n);r&&e.events[iE].push(r)},rE,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[iE]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[iE])t();e.events[iE]=[]}},cE)},()=>{e.listen=n,e.off=r}});function uE(e,t){let n=fE(t),r=e;for(let e of n){if(r==null)return;r=r[e]}return r}var dE=/(.*)\[(\d+)\]/;function fE(e){return e.split(`.`).flatMap(e=>pE(e))}function pE(e){if(dE.test(e)){let[,t,n]=e.match(dE);return[...pE(t),n]}return[e]}function mE(e,t,n){let r=new Set(t);return e.listen((i,a,o)=>{let s=e=>!Object.is(uE(i,e),uE(a,e));(o===void 0?t.some(t=>a===void 0||(e.eqKey?!e.eqKey(a[t],i[t],t):s(t))):r.has(o)||typeof o==`string`&&(r.has(o.split(/\.|\[/)[0])||!e.eqKey&&a!==void 0&&t.some(s)))&&n(i,a,o)})}function hE(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function gE(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!gE(e[n],t[n]))return!1;return!0}if(hE(e)&&hE(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!(r in t)||!gE(e[r],t[r]))return!1;return!0}return!1}function _E(e,t){return sE(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}var vE=Symbol.for(`better-auth:auth-query`);function yE(e){return vE in e&&e[vE]===!0}function bE(e){let t=tE(e);return Object.defineProperty(t,vE,{value:!0}),t}var xE=Symbol.for(`better-auth:broadcast-channel`),SE=()=>Math.floor(Date.now()/1e3),CE=class{listeners=new Set;name;constructor(e=`better-auth.message`){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(typeof window<`u`)try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:SE()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??`{}`);t?.event===`session`&&t?.data&&this.listeners.forEach(e=>e(t))};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}}};function wE(e=`better-auth.message`){return globalThis[xE]||(globalThis[xE]=new CE(e)),globalThis[xE]}var TE=Symbol.for(`better-auth:focus-manager`),EE=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function DE(){return globalThis[TE]||(globalThis[TE]=new EE),globalThis[TE]}var OE=Symbol.for(`better-auth:online-manager`),kE=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,t,!1),()=>{window.removeEventListener(`online`,e,!1),window.removeEventListener(`offline`,t,!1)}}};function AE(){return globalThis[OE]||(globalThis[OE]=new kE),globalThis[OE]}var jE=()=>Math.floor(Date.now()/1e3),ME=5;function NE(e){let{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},l=()=>s||AE().isOnline,u=e=>{if(l()){if(e?.event===`storage`)t();else if(e?.event===`poll`)c.lastSessionRequest=jE(),t();else if(e?.event===`visibilitychange`){if(jE()-c.lastSessionRequest<ME)return;c.lastSessionRequest=jE(),t()}else t()}},d=e=>{wE().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{n()&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=wE().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=DE().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=AE().subscribe(e=>{e&&u({event:`visibilitychange`})})},g=()=>{c.unsubscribeSignal=r.listen(()=>{t()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,f(),p(),m(),h(),g(),c.cleanupBroadcastSetup=wE().setup(),c.cleanupFocusSetup=DE().setup(),c.cleanupOnlineSetup=AE().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.unsubscribeSignal&&=(c.unsubscribeSignal(),void 0),c.cleanupBroadcastSetup&&=(c.cleanupBroadcastSetup(),void 0),c.cleanupFocusSetup&&=(c.cleanupFocusSetup(),void 0),c.cleanupOnlineSetup&&=(c.cleanupOnlineSetup(),void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:d}}var PE=()=>typeof window>`u`,FE=cE;function IE(e,t){if(typeof window>`u`)return;let n=e.get();n.data===null&&t!==null&&e.set({...n,data:t,error:null,isPending:!1})}function LE(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function RE(e){return!e||e.session===null&&e.user===null?null:e}function zE(e,t){return gE(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function BE(e,t){let n=tE(!1),r,i=0,a=0;n.listen(()=>{a++,i=0});let o=e=>u(e),s=bE({data:null,error:null,isPending:!0,isRefetching:!1,refetch:o});_E(s,zE);let c=async(t,n)=>{let r=s.value;if(s.set({...r,isPending:r.data===null,isRefetching:!0,error:null,refetch:o}),t.aborted)return`aborted`;try{let r=await e(`/get-session`,{method:`GET`,query:n?.query,signal:t});if(t.aborted)return`aborted`;let{data:i,error:a}=LE(r),c=`fresh`;if(i?.needsRefresh)try{let n=await e(`/get-session`,{method:`POST`,signal:t});if(t.aborted)return`aborted`;({data:i,error:a}=LE(n))}catch{if(t.aborted)return`aborted`;c=`stale`}if(a){let e=s.value,t=a?.status===401;return s.set({data:t?null:e.data,error:a,isPending:!1,isRefetching:!1,refetch:o}),`failed`}let l=RE(i),u=s.value,d=u.data!=null&&l!=null&&gE(u.data,l)?u.data:l;return s.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:o}),c}catch(e){if(t.aborted)return`aborted`;let n=s.value;return s.set({data:n.data,error:e,isPending:!1,isRefetching:!1,refetch:o}),`failed`}},l=()=>{let e=s.value.data?.session?.expiresAt,t=e instanceof Date?e.getTime():1/0;return Math.min(Date.now()+FE,t)},u=e=>{i=0,r?.cancel();let t=new AbortController,n={cancel:()=>t.abort(),promise:Promise.resolve().then(()=>t.signal.aborted?`aborted`:c(t.signal,e)),revision:a};r=n;let o=e=>{r===n&&(r=void 0,e===`fresh`&&n.revision===a&&(i=l()))};return n.promise.then(o,()=>o(`failed`)),n.promise.then(()=>void 0)},d=()=>r?.revision===a?r.promise.then(()=>void 0):Date.now()<i?Promise.resolve():u(),f=()=>{};return lE(s,()=>{let e;PE()||(e=setTimeout(()=>{d()},0));let r=NE({fetchSession:u,shouldPollSession:()=>s.value.data!=null,sessionSignal:n,options:t});return r.init(),f=r.broadcastSessionUpdate,()=>{e&&clearTimeout(e),r.cleanup()}}),{session:s,$sessionSignal:n,broadcastSessionUpdate:e=>f(e)}}function VE(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function HE(e,t,n=`.`,r){if(!VE(t))return HE(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(i[t]=Array.isArray(a)&&Array.isArray(i[t])?[...a,...i[t]]:VE(a)&&VE(i[t])?HE(a,i[t],(n?`${n}.`:``)+t.toString(),r):a))}return i}function UE(e){return(...t)=>t.reduce((t,n)=>HE(t,n,``,e),{})}var WE=UE(),GE=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},KE=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let t=await i.init?.call(i,e.toString(),n);n=t.options||n,e=t.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},qE=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},JE=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function YE(e){if(typeof e==`number`)return new qE({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new qE(e);case`exponential`:return new JE(e);default:throw Error(`Invalid retry strategy`)}}var XE=[`get`,`post`,`put`,`patch`,`delete`];function ZE(e){if(!e.startsWith(`@`))return{method:void 0,path:e};let t=e.indexOf(`/`),n=e.slice(1,t===-1?void 0:t);return XE.includes(n)?{method:n,path:t===-1?e:e.slice(t+1)}:{method:void 0,path:e}}var QE=e=>e===`.`||e===`..`,$E=e=>e.split(`:`).map(e=>encodeURIComponent(e)).join(`:`);function eD(e,t){let n=t.get(e);if(n===void 0)return $E(e);if(QE(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function tD(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``,{path:o}=ZE(e);o!==e&&(e=`/${o}`),a.endsWith(`/`)||(a+=`/`);let[s,c]=e.replace(a,``).split(`?`),l=new URLSearchParams(c);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)l.append(e,n);continue}else n=JSON.stringify(t);l.set(e,n)}let u=new Map;if(r){if(Array.isArray(r)){let e=s.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];u.set(n,String(e))}}else for(let[e,t]of Object.entries(r))u.set(`:${e}`,String(t))}s=s.split(`/`).map(e=>eD(e,u)).join(`/`),s=s.replace(/^\/+/,``);let d=l.toString();return d=d.length>0?`?${d}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${s}${d}`,a):`${a}${s}${d}`}var nD=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},rD=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function iD(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return rD.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function aD(e){try{return JSON.parse(e),!0}catch{return!1}}function oD(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function sD(e){try{return JSON.parse(e)}catch{return e}}function cD(e){return typeof e==`function`}function lD(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&cD(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&cD(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function uD(...e){let t={};for(let n of e)if(n){if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else{let e=Array.isArray(n)?n:Object.entries(n);for(let[n,r]of e)r!=null&&(t[n]=r)}}return t}async function dD(e){let t=new Headers(uD(e?.headers,await nD(e)));if(!t.has(`content-type`)){let n=fD(e?.body);n&&t.set(`content-type`,n)}return t}function fD(e){return oD(e)?`application/json`:null}function pD(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function mD(e,t){let{body:n}=e;return n?!oD(n)||typeof n==`string`?n:pD(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function hD(e,t){if(t?.method)return t.method.toUpperCase();let{method:n}=ZE(e);return n?n.toUpperCase():t?.body?`POST`:`GET`}function gD(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var _D=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function vD(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new _D(n.issues);return n.value}function yD(e){"@babel/helpers - typeof";return yD=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},yD(e)}function bD(e,t){if(yD(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(yD(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function xD(e){var t=bD(e,`string`);return yD(t)==`symbol`?t:t+``}function SD(e,t,n){return(t=xD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?CD(Object(n),!0).forEach(function(t){SD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var wD=async(e,t)=>{var n;let{hooks:r,url:i,options:a}=await KE(e,t),o=lD(a),s=new AbortController,c=a.signal??s.signal,l=tD(i,a),u=await dD(a),d=mD(a,u),f=hD(i,a),p=$($({},a),{},{url:l,headers:u,body:d,method:f,signal:c});for(let e of r.onRequest)if(e){let t=await e(p);typeof t==`object`&&t&&Object.assign(p,t)}(`pipeTo`in p&&typeof p.pipeTo==`function`||typeof(t==null||(n=t.body)==null?void 0:n.pipe)==`function`)&&(`duplex`in p||(p.duplex=`half`));let{clearTimeout:m}=gD(a,s),h=await o(p.url,p);m();let g={response:h,request:p};for(let e of r.onResponse)if(e){var _;let n=await e($($({},g),{},{response:t!=null&&(_=t.hookOptions)!=null&&_.cloneResponse?h.clone():h}));n instanceof Response?h=n:typeof n==`object`&&n&&(h=n.response)}if(h.ok){if(p.method===`HEAD`)return{data:``,error:null};let e=iD(h),n={data:null,response:h,request:p};if(e===`json`||e===`text`){let e=await h.text();n.data=await(p.jsonParser??sD)(e)}else n.data=await h[e]();p?.output&&p.output&&!p.disableValidation&&(n.data=await vD(p.output,n.data));for(let e of r.onSuccess)if(e){var v;await e($($({},n),{},{response:t!=null&&(v=t.hookOptions)!=null&&v.cloneResponse?h.clone():h}))}return t?.throw?n.data:{data:n.data,error:null}}let y=t?.jsonParser??sD,b=await h.text(),x=aD(b),S=x?await y(b):null,C={response:h,responseText:b,request:p,error:$($({},S),{},{status:h.status,statusText:h.statusText})};for(let e of r.onError)if(e){var w;await e($($({},C),{},{response:t!=null&&(w=t.hookOptions)!=null&&w.cloneResponse?h.clone():h}))}if(t?.retry){let n=YE(t.retry),i=t.retryAttempt??0;if(await n.shouldAttemptRetry(i,h)){for(let e of r.onRetry)e&&await e(g);let a=n.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await wD(e,$($({},t),{},{retryAttempt:i+1}))}}if(t?.throw)throw new GE(h.status,h.statusText,x?S:b);return{data:null,error:$($({},S),{},{status:h.status,statusText:h.statusText})}},TD=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){var r;let i=$($({},n),e.query!==void 0&&{query:$($({},e.query),n?.query)}),a=((r=e.plugins)==null||(r=r.find(e=>e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1))==null?void 0:r.schema)||e.schema;if(a){let r=t;a.config?.prefix&&r.startsWith(a.config.prefix)&&(r=r.replace(a.config.prefix,``),a.config.baseURL&&(t=t.replace(a.config.prefix,a.config.baseURL))),a.config?.baseURL&&r.startsWith(a.config.baseURL)&&(r=r.replace(a.config.baseURL,``)),r.startsWith(`/`)&&r.charAt(1)===`@`&&(r=r.substring(1));let o=a.schema[r];if(o){let{method:a,path:s}=ZE(r);a&&(t=t.slice(0,t.length-r.length)+s);let c=n?.headers;if(o.headers&&!n?.disableValidation){let e={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((t,n)=>{e[n.toLowerCase()]=t});else if(typeof n.headers==`object`)for(let[t,r]of Object.entries(n.headers))r!=null&&(e[t.toLowerCase()]=r)}let t=await vD(o.headers,e),r={};for(let[e,n]of Object.entries(t))r[e.toLowerCase()]=n;c=r}let l=o.method??a;if(i=$($($($({},i),l!==void 0&&{method:l}),o.output!==void 0&&{output:o.output}),c!==void 0&&{headers:c}),!n?.disableValidation){if(o.query&&(i.query=await vD(o.query,n?.query),i.query!==null&&typeof i.query==`object`)){let t=$({},e.query);for(let e of Object.keys(t))n?.query&&Object.prototype.hasOwnProperty.call(n.query,e)&&(t[e]=n.query[e]);i.query=$($({},t),i.query)}i=$($({},i),{},{body:o.input?await vD(o.input,n?.body):n?.body,params:o.params?await vD(o.params,n?.params):n?.params})}return{url:t,options:i}}}return $({url:t},(n!==void 0||e.query!==void 0)&&{options:i})}}),ED=e=>{async function t(t,n){let r=$($($({},e),n),{},{headers:uD(e?.headers,n?.headers),plugins:[...e?.plugins||[],TD(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await wD(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await wD(t,r)}return t},DD=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},OD=e=>e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/revoke-other-sessions`||e===`/change-email`||e===`/change-password`,kD=(e,t)=>{let n=`credentials`in Request.prototype,r=IT(e?.baseURL,e?.basePath,void 0,t)??DD(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=ED({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?GT(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[JT],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=BE(d,e),h=!1,g=e=>{h||e===null||(h=!0,IE(p,e))},_=e?.plugins||[],v={},y={$sessionSignal:f,session:p},b={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},x=[{signal:`$sessionSignal`,matcher:OD,callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of _)e.getAtoms&&Object.assign(y,e.getAtoms?.(d)),e.pathMethods&&Object.assign(b,e.pathMethods),e.atomListeners&&x.push(...e.atomListeners);let S={notify:e=>{y[e].set(!y[e].get())},listen:(e,t)=>{y[e].subscribe(t)},atoms:y};for(let t of _)t.getActions&&(v=WE(t.getActions?.(d,S,e)??{},v));return{get baseURL(){return r},pluginsActions:v,pluginsAtoms:y,pluginPathMethods:b,atomListeners:x,hydrateSession:g,$sessionSignal:f,$fetch:d,$store:S}};function AD(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function jD(e){return e.charAt(0).toUpperCase()+e.slice(1)}var MD=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,ND=/['\u2019]/g;function PD(e){return e.replace(ND,``).match(MD)??[]}function FD(e){return PD(e).map(e=>e.toLowerCase()).join(`-`)}function ID(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function LD(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||AD(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(FD).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=ID(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function RD(e,t={}){let n=(0,F.useRef)(e.get()),{keys:r,deps:i=[e,r]}=t,a=(0,F.useCallback)(t=>{let i=e=>{n.current!==e&&(n.current=e,t())};return i(e.value),r?.length?mE(e,r,i):e.listen(i)},i),o=()=>n.current;return(0,F.useSyncExternalStore)(a,o,yE(e)?()=>e.init:o)}function zD(e){return`use${jD(e)}`}function BD(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,hydrateSession:i,$fetch:a,$store:o,atomListeners:s}=kD(e),c={};for(let[e,t]of Object.entries(r))c[zD(e)]=()=>RD(t);return LD({...n,...c,hydrateSession:i,$fetch:a,$store:o},a,t,r,s)}var VD=e=>`[SonamuProvider] ${e} is not configured. Please provide ${e} configuration to SonamuProvider.`,HD=()=>()=>{throw Error(VD(`uploader`))};function UD(){let e=new Map(Object.entries(bT));return t=>e.get(t)??t}var WD=(0,F.createContext)({uploader:HD(),SD:UD()});function GD({children:e,auth:t,...n}){let r={uploader:n.uploader??HD(),auth:t,SD:n.SD??UD()};return(0,I.jsx)(WD.Provider,{value:r,children:e})}function KD({children:e,authOptions:t,...n}){let[r]=(0,F.useState)(()=>BD(t));return(0,I.jsx)(GD,{...n,auth:n.auth??r,children:e})}function qD({children:e,authOptions:t,...n}){return t===void 0?(0,I.jsx)(GD,{...n,children:e}):(0,I.jsx)(KD,{...n,authOptions:t,children:e})}var JD=e=>Ow(e);function YD({children:e}){return(0,I.jsx)(qD,{SD:JD,children:e})}var XD=T()({head:()=>({meta:[{charSet:`utf-8`},{name:`viewport`,content:`width=device-width, initial-scale=1.0`},{title:`Qgrid`}]}),component:ZD});function ZD(){let{queryClient:e}=XD.useRouteContext();return(0,I.jsxs)(`html`,{lang:`en`,children:[(0,I.jsxs)(`head`,{children:[(0,I.jsx)(`link`,{rel:`icon`,type:`image/svg+xml`,href:`/sonamu.svg`}),(0,I.jsx)(`link`,{rel:`preconnect`,href:`https://fonts.googleapis.com`}),(0,I.jsx)(`link`,{rel:`preconnect`,href:`https://fonts.gstatic.com`,crossOrigin:``}),(0,I.jsx)(`link`,{href:`https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300..700;1,9..40,300..700&family=DM+Mono:wght@400;500&display=swap`,rel:`stylesheet`}),(0,I.jsx)(D,{})]}),(0,I.jsxs)(`body`,{children:[(0,I.jsx)(`div`,{id:`root`,children:(0,I.jsx)(d,{client:e,children:(0,I.jsx)(YD,{children:(0,I.jsx)(yT,{children:(0,I.jsx)(O,{})})})})}),(0,I.jsx)(j,{})]})]})}var QD=`modulepreload`,$D=function(e){return`/`+e},eO={},tO=function(e){return e.pathname.endsWith(`.css`)},nO=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},rO=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=$D(t,n);let r=s(t),i=tO(r);return nO(eO,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:QD,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},iO=v(`/`)({component:ee(()=>rO(()=>import(`./routes-Dw227enb.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])),`component`)}),aO=kC(Z({type:Y(),role:Y().optional(),content:CC().optional(),name:Y().optional(),arguments:Y().optional(),call_id:Y().optional(),output:Y().optional()})),oO=kC(Z({mediaType:Y().optional(),data:Y().optional(),url:Y().optional(),byteSize:gC().optional()})),sO=NC([Z({accessToken:Y(),refreshToken:Y(),expiresAt:gC(),accountUuid:Y()}),Z({accessToken:Y(),refreshToken:Y(),idToken:Y().optional(),accessTokenExpiresAt:gC(),idTokenExpiresAt:gC().optional(),accountId:Y(),planType:Y().optional()}),Z({authMode:VC(`oauth`),accessToken:Y(),refreshToken:Y(),expiresAt:Y(),issuer:VC(`https://auth.x.ai`),clientId:Y(),scopes:kC(Y()),userId:Y(),sessionId:Y(),agentId:Y(),subscriptionTier:Y().optional()})]),cO=kC(Z({name:Y(),description:Y().optional(),inputSchema:CC()})),lO=zC([`id-desc`,`id-asc`,`created_at-desc`,`created_at-asc`,`ttft_ms-desc`,`ttft_ms-asc`,`duration_ms-desc`,`duration_ms-asc`,`input_tokens-desc`,`input_tokens-asc`,`output_tokens-desc`,`output_tokens-asc`,`cache_read_tokens-desc`,`cache_read_tokens-asc`,`cache_creation_tokens-desc`,`cache_creation_tokens-asc`,`cost_usd-desc`,`cost_usd-asc`]).describe(`RequestLogOrderBy`),uO=zC([`id`,`token_name`,`user_prompt`]).describe(`RequestLogSearchField`),dO=zC([`running`,`succeeded`,`error`,`aborted`]).describe(`RequestLogStatus`),fO=zC([`image`,`video`,`stt`,`tts`]).describe(`RequestLogMediaKind`),pO=zC([`generate`,`tool_call`]).describe(`RequestLogStepType`),mO=zC([`id-asc`]).describe(`RequestLogStepOrderBy`),hO=zC([`id`]).describe(`RequestLogStepSearchField`),gO=zC([`key-asc`]).describe(`SettingOrderBy`),_O=zC([`key`]).describe(`SettingSearchField`),vO=zC([`id-desc`,`ord-asc`]).describe(`TokenOrderBy`),yO=zC([`id`,`name`]).describe(`TokenSearchField`);Z({id:X(),created_at:DC(),token_name:Y().max(100).nullable(),project_name:Y().max(50).nullable(),model_name:Y().max(255).nullable(),requested_model_name:Y().max(255).nullable(),fallback_count:X().nullable(),user_prompt:Y().nullable(),system_prompt:Y().nullable(),response:Y(),input_tokens:X(),output_tokens:X(),cache_read_tokens:X(),cache_creation_tokens:X(),cache_creation_5m_tokens:X().nullable(),cache_creation_1h_tokens:X().nullable(),duration_ms:X(),ttft_ms:X(),cost_usd:X().nullable(),cost_source:Y().max(20).nullable(),image_cost_usd:X().nullable(),image_cost_method:Y().max(100).nullable(),service_tier:Y().max(20).nullable(),effort:Y().max(10).nullable(),history:aO.nullable(),input_images:oO.nullable(),tools:cO.nullable(),json_schema:Y().nullable(),status:dO,error_message:Y().nullable(),response_json_ok:yC().nullable(),tool_call_count:X(),is_image_generation:yC(),is_structured:yC(),media_kind:fO.nullable()}),Z({id:X(),created_at:DC(),request_log_id:X(),step_index:X(),type:pO,model_name:Y().max(255).nullable(),requested_model_name:Y().max(255).nullable(),fallback_count:X().nullable(),input_tokens:X().nullable(),output_tokens:X().nullable(),cache_read_tokens:X().nullable(),cache_creation_tokens:X().nullable(),cache_creation_5m_tokens:X().nullable(),cache_creation_1h_tokens:X().nullable(),cost_usd:X().nullable(),cost_source:Y().max(20).nullable(),duration_ms:X().nullable(),ttft_ms:X().nullable(),finish_reason:Y().max(20).nullable(),reasoning_text:Y().nullable(),reasoning_tokens:X().nullable(),tool_call_index:X().nullable(),tool_call_id:Y().max(100).nullable(),tool_name:Y().max(100).nullable(),tool_args:Y().nullable(),tool_result:Y().nullable(),tool_duration_ms:X().nullable(),error:Y().nullable()}),Z({id:X(),created_at:DC(),key:Y().max(100),value:Y(),updated_at:DC().nullable()}),Z({id:X(),created_at:DC(),provider:Y().max(20),credentials:sO,name:Y(),active:yC(),reauth_required:yC(),ord:X(),quota_threshold:X().nullable(),weight:X(),keepalive_enabled:yC()});var bO=Z({num:gC().int().nonnegative(),page:gC().int().min(1),search:uO,keyword:Y(),orderBy:lO,queryMode:Mw,id:Nw(gC().int().positive()),sonamuFilter:dw(),token_name:Y().max(100).nullable(),project_name:Y().max(50).nullable(),model_name:Y().max(255).nullable()}).partial();Z({num:gC().int().nonnegative(),page:gC().int().min(1),search:hO,keyword:Y(),orderBy:mO,queryMode:Mw,id:Nw(gC().int().positive()),sonamuFilter:dw(),request_log_id:X()}).partial(),Z({num:gC().int().nonnegative(),page:gC().int().min(1),search:_O,keyword:Y(),orderBy:gO,queryMode:Mw,id:Nw(gC().int().positive()),sonamuFilter:dw(),key:Y().max(100)}).partial(),Z({num:gC().int().nonnegative(),page:gC().int().min(1),search:yO,keyword:Y(),orderBy:vO,queryMode:Mw,id:Nw(gC().int().positive()),sonamuFilter:dw()}).partial(),Z({id:X(),created_at:DC(),token_name:Y().max(100).nullable(),project_name:Y().max(50).nullable(),model_name:Y().max(255).nullable(),requested_model_name:Y().max(255).nullable(),fallback_count:X().nullable(),user_prompt:Y().nullable(),system_prompt:Y().nullable(),response:Y(),input_tokens:X(),output_tokens:X(),cache_read_tokens:X(),cache_creation_tokens:X(),cache_creation_5m_tokens:X().nullable(),cache_creation_1h_tokens:X().nullable(),duration_ms:X(),ttft_ms:X(),cost_usd:X().nullable(),cost_source:Y().max(20).nullable(),image_cost_usd:X().nullable(),image_cost_method:Y().max(100).nullable(),effort:Y().max(10).nullable(),service_tier:Y().max(20).nullable(),history:aO.nullable(),input_images:oO.nullable(),tools:cO.nullable(),status:dO,response_json_ok:yC().nullable(),error_message:Y().nullable(),tool_call_count:X(),is_image_generation:yC(),is_structured:yC(),media_kind:fO.nullable()}),Z({id:X(),created_at:DC(),token_name:Y().max(100).nullable(),project_name:Y().max(50).nullable(),model_name:Y().max(255).nullable(),requested_model_name:Y().max(255).nullable(),fallback_count:X().nullable(),input_tokens:X(),output_tokens:X(),cache_read_tokens:X(),cache_creation_tokens:X(),cache_creation_5m_tokens:X().nullable(),cache_creation_1h_tokens:X().nullable(),duration_ms:X(),ttft_ms:X(),cost_usd:X().nullable(),cost_source:Y().max(20).nullable(),image_cost_usd:X().nullable(),image_cost_method:Y().max(100).nullable(),effort:Y().max(10).nullable(),service_tier:Y().max(20).nullable(),status:dO,response_json_ok:yC().nullable(),tool_call_count:X(),is_image_generation:yC(),is_structured:yC(),media_kind:fO.nullable()}),Z({id:X(),token_name:Y().max(100).nullable(),model_name:Y().max(255).nullable(),input_tokens:X(),output_tokens:X(),cache_read_tokens:X(),cache_creation_tokens:X(),cache_creation_5m_tokens:X().nullable(),cache_creation_1h_tokens:X().nullable(),cost_usd:X().nullable(),cost_source:Y().max(20).nullable()}),zC([`A`,`P`,`C`]),Z({id:X(),created_at:DC(),step_index:X(),type:pO,model_name:Y().max(255).nullable(),requested_model_name:Y().max(255).nullable(),fallback_count:X().nullable(),input_tokens:X().nullable(),output_tokens:X().nullable(),cache_read_tokens:X().nullable(),cache_creation_tokens:X().nullable(),cache_creation_5m_tokens:X().nullable(),cache_creation_1h_tokens:X().nullable(),cost_usd:X().nullable(),cost_source:Y().max(20).nullable(),duration_ms:X().nullable(),ttft_ms:X().nullable(),finish_reason:Y().max(20).nullable(),reasoning_text:Y().nullable(),reasoning_tokens:X().nullable(),tool_call_index:X().nullable(),tool_call_id:Y().max(100).nullable(),tool_name:Y().max(100).nullable(),tool_args:Y().nullable(),tool_result:Y().nullable(),tool_duration_ms:X().nullable(),error:Y().nullable()}),Z({id:X(),created_at:DC(),step_index:X(),type:pO,model_name:Y().max(255).nullable(),requested_model_name:Y().max(255).nullable(),fallback_count:X().nullable(),input_tokens:X().nullable(),output_tokens:X().nullable(),cache_read_tokens:X().nullable(),cache_creation_tokens:X().nullable(),cache_creation_5m_tokens:X().nullable(),cache_creation_1h_tokens:X().nullable(),cost_usd:X().nullable(),cost_source:Y().max(20).nullable(),duration_ms:X().nullable(),ttft_ms:X().nullable(),finish_reason:Y().max(20).nullable(),reasoning_tokens:X().nullable(),tool_call_index:X().nullable(),tool_call_id:Y().max(100).nullable(),tool_name:Y().max(100).nullable(),tool_duration_ms:X().nullable(),error:Y().nullable()}),Z({id:X(),tool_args:Y().nullable()}),zC([`A`,`T`,`I`]),Z({id:X(),created_at:DC(),key:Y().max(100),value:Y(),updated_at:DC().nullable()}),zC([`A`]),Z({id:X(),created_at:DC(),provider:Y().max(20),credentials:sO,name:Y(),active:yC(),reauth_required:yC(),ord:X(),quota_threshold:X().nullable(),weight:X(),keepalive_enabled:yC()}),zC([`A`]);var xO=()=>rO(()=>import(`./logs-CbDtQif1.js`),__vite__mapDeps([8,1,2,3,6,9,10])),SO=Z({token:Y().optional(),project:Y().optional(),model:Y().optional(),sort:lO.optional(),page:bO.shape.page.default(1)}),CO=v(`/logs`)({validateSearch:SO,component:ee(xO,`component`)}),wO=()=>rO(()=>import(`./monit-DtW8o_yF.js`),__vite__mapDeps([11,1,2,3,5,6,9])),TO=Z({level:zC([`all`,`warn`,`error`]).optional().default(`all`).catch(()=>`all`)}),EO=v(`/monit`)({validateSearch:TO,component:ee(wO,`component`)}),DO=v(`/settings`)({component:ee(()=>rO(()=>import(`./settings-BXmAToY1.js`),__vite__mapDeps([12,1,2,3,7,13])),`component`)}),OO=v(`/tokens`)({component:ee(()=>rO(()=>import(`./tokens-D8L8AC4v.js`),__vite__mapDeps([14,1,2,3,4,5,7,13])),`component`)}),kO=v(`/voice`)({component:ee(()=>rO(()=>import(`./voice-D-c1Eyp3.js`),__vite__mapDeps([15,1,2,3,16])),`component`)}),AO=()=>rO(()=>import(`./show-5qj6wFgp.js`),__vite__mapDeps([17,1,2,3,6,10,16])),jO=Z({id:gC()}),MO=v(`/requests/show`)({validateSearch:jO,component:ee(AO,`component`)}),NO=mw();Z({mediaType:Y().optional(),data:Y().optional(),url:Y().optional(),byteSize:gC().optional()});var PO=jC({text:Y()});NC([Y(),kC(NC([PO,NO])),NO]);var FO={IndexRoute:iO.update({id:`/`,path:`/`,getParentRoute:()=>XD}),LogsRoute:CO.update({id:`/logs`,path:`/logs`,getParentRoute:()=>XD}),MonitRoute:EO.update({id:`/monit`,path:`/monit`,getParentRoute:()=>XD}),SettingsRoute:DO.update({id:`/settings`,path:`/settings`,getParentRoute:()=>XD}),TokensRoute:OO.update({id:`/tokens`,path:`/tokens`,getParentRoute:()=>XD}),VoiceRoute:kO.update({id:`/voice`,path:`/voice`,getParentRoute:()=>XD}),RequestsShowRoute:MO.update({id:`/requests/show`,path:`/requests/show`,getParentRoute:()=>XD})},IO=XD._addFileChildren(FO)._addFileTypes(),LO=new ce({defaultOptions:{queries:{staleTime:5e3,retry:!1,refetchOnMount:!0}}}),RO=window.__SONAMU_SSR__?JSON.parse(JSON.stringify(window.__SONAMU_SSR__),kw):void 0;RO&&ae(LO,RO);var zO=window.__SONAMU_SSR_CONFIG__,BO=g({routeTree:IO,context:{queryClient:LO},defaultPreload:`intent`});(async()=>{await BO.load(),document.documentElement.innerHTML&&RO?zO?.disableHydrate?(console.log(`[Sonamu] Hydration disabled, rendering as CSR`),le.createRoot(document).render((0,I.jsx)(S,{router:BO}))):le.hydrateRoot(document,(0,I.jsx)(S,{router:BO})):le.createRoot(document).render((0,I.jsx)(S,{router:BO}))})(),window.__TANSTACK_QUERY_CLIENT__=LO;export{Zo as C,tu as S,Y as _,Ww as a,ou as b,Vw as c,jw as d,kC as f,Z as g,gC as h,lO as i,Bw as l,jC as m,EO as n,Uw as o,mw as p,CO as r,Hw as s,MO as t,zw as u,NC as v,pe as w,iu as x,su as y};
|
|
104
|
+
at `))}function DT(e,t){class n extends e{#e;constructor(...e){if(TT()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=ET(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t},enumerable:!1,configurable:!0}),n}var OT={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};DT(class extends Error{status;body;headers;statusCode;constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:OT[e]){if(super(t?.message,t&&`cause`in t?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,t&&`cause`in t){let{cause:e,...n}=t;this.body=Object.defineProperty(n,"cause",{value:e,writable:!0,configurable:!0})}else this.body=t}},Error);var kT=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}},AT=47;function jT(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===AT;)t--;return t===e.length?e:e.slice(0,t)}function MT(e){try{return(jT(new URL(e).pathname)||`/`)!==`/`}catch{throw new kT(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function NT(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new kT(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof kT?t:new kT(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function PT(e,t=`/api/auth`){if(NT(e),MT(e))return e;let n=jT(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function FT(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function IT(e,t,n,r,i){if(e)return PT(e,t);if(r!==!1){let e=CT.BETTER_AUTH_URL||CT.NEXT_PUBLIC_BETTER_AUTH_URL||CT.PUBLIC_BETTER_AUTH_URL||CT.NUXT_PUBLIC_BETTER_AUTH_URL||CT.NUXT_PUBLIC_AUTH_URL||(CT.BASE_URL===`/`?void 0:CT.BASE_URL);if(e)return PT(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&FT(o,`proto`)&&FT(a,`host`))try{return PT(`${o}://${a}`,t)}catch{}if(n){let e=LT(n.url);if(!e)throw new kT(`Could not get origin from request. Please provide a valid base URL.`);return PT(e,t)}if(typeof window<`u`&&window.location)return PT(window.location.origin,t)}function LT(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var RT={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},zT=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,BT={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},VT=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function HT(e){return e instanceof Date&&!isNaN(e.getTime())}function UT(e){let t=VT.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return HT(f)?f:null}function WT(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim(),s=o.toLowerCase();if(s.length<=9&&s in BT)return BT[s];if(!zT.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(RT).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t)r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);else{if(a&&typeof t==`string`){let e=UT(t);if(e)return e}return i?i(e,t):t}})}catch(t){if(n)throw t;return e}}function GT(e,t={strict:!0}){return WT(e,t)}var KT=[`javascript:`,`data:`,`vbscript:`];function qT(e){let t;try{t=new URL(e)}catch{return!0}return!KT.includes(t.protocol)}var JT={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&qT(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},YT=[],XT=0,ZT=null,QT=4,$T=globalThis.nanostoresGlobal||={epoch:0},eE=()=>{let e,t;for(;XT<YT.length;){t=XT,XT+=QT;let n=ZT?.get(YT[t]);if(n){if(!n.has(YT[t+1]))continue;n.clear()}try{YT[t](YT[t+1].value,YT[t+2],YT[t+3])}catch(t){e=t}}if(YT.length=XT=0,e)throw e},tE=e=>{let t=[],n={eq:Object.is,get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{ZT?.get(e)?.delete(n);for(let t=XT;t<YT.length;)YT[t]===e&&YT[t+1]===n?YT.splice(t,QT):t+=QT;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){$T.epoch++;let i=!YT.length&&!0;for(let i of t)YT.push(i,n,e,r);i&&eE()},off(){},set(e){let t=n.value;n.eq(t,e)||(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},nE=2,rE=5,iE=6,aE=10,oE=(e,t,n,r)=>(e.events=e.events||{},e.events[n+aE]||(e.events[n+aE]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);~i&&(r.splice(i,1),r.length||(e.events[n+aE](),delete e.events[n+aE]))}),sE=(e,t)=>oE(e,t,nE,t=>{let n=e.set,r=e.setKey;return e.setKey&&=(n,i)=>{let a;if(t({abort:()=>{a=!0},changed:n,newValue:{...e.value,[n]:i}}),!a)return r(n,i)},e.set=e=>{let r;if(t({abort:()=>{r=!0},newValue:e}),!r)return n(e)},()=>{e.set=n,e.setKey=r}}),cE=1e3,lE=(e,t)=>oE(e,n=>{let r=t(n);r&&e.events[iE].push(r)},rE,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[iE]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[iE])t();e.events[iE]=[]}},cE)},()=>{e.listen=n,e.off=r}});function uE(e,t){let n=fE(t),r=e;for(let e of n){if(r==null)return;r=r[e]}return r}var dE=/(.*)\[(\d+)\]/;function fE(e){return e.split(`.`).flatMap(e=>pE(e))}function pE(e){if(dE.test(e)){let[,t,n]=e.match(dE);return[...pE(t),n]}return[e]}function mE(e,t,n){let r=new Set(t);return e.listen((i,a,o)=>{let s=e=>!Object.is(uE(i,e),uE(a,e));(o===void 0?t.some(t=>a===void 0||(e.eqKey?!e.eqKey(a[t],i[t],t):s(t))):r.has(o)||typeof o==`string`&&(r.has(o.split(/\.|\[/)[0])||!e.eqKey&&a!==void 0&&t.some(s)))&&n(i,a,o)})}function hE(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function gE(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!gE(e[n],t[n]))return!1;return!0}if(hE(e)&&hE(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!(r in t)||!gE(e[r],t[r]))return!1;return!0}return!1}function _E(e,t){return sE(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}var vE=Symbol.for(`better-auth:auth-query`);function yE(e){return vE in e&&e[vE]===!0}function bE(e){let t=tE(e);return Object.defineProperty(t,vE,{value:!0}),t}var xE=Symbol.for(`better-auth:broadcast-channel`),SE=()=>Math.floor(Date.now()/1e3),CE=class{listeners=new Set;name;constructor(e=`better-auth.message`){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(typeof window<`u`)try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:SE()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??`{}`);t?.event===`session`&&t?.data&&this.listeners.forEach(e=>e(t))};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}}};function wE(e=`better-auth.message`){return globalThis[xE]||(globalThis[xE]=new CE(e)),globalThis[xE]}var TE=Symbol.for(`better-auth:focus-manager`),EE=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function DE(){return globalThis[TE]||(globalThis[TE]=new EE),globalThis[TE]}var OE=Symbol.for(`better-auth:online-manager`),kE=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,t,!1),()=>{window.removeEventListener(`online`,e,!1),window.removeEventListener(`offline`,t,!1)}}};function AE(){return globalThis[OE]||(globalThis[OE]=new kE),globalThis[OE]}var jE=()=>Math.floor(Date.now()/1e3),ME=5;function NE(e){let{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},l=()=>s||AE().isOnline,u=e=>{if(l()){if(e?.event===`storage`)t();else if(e?.event===`poll`)c.lastSessionRequest=jE(),t();else if(e?.event===`visibilitychange`){if(jE()-c.lastSessionRequest<ME)return;c.lastSessionRequest=jE(),t()}else t()}},d=e=>{wE().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{n()&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=wE().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=DE().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=AE().subscribe(e=>{e&&u({event:`visibilitychange`})})},g=()=>{c.unsubscribeSignal=r.listen(()=>{t()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,f(),p(),m(),h(),g(),c.cleanupBroadcastSetup=wE().setup(),c.cleanupFocusSetup=DE().setup(),c.cleanupOnlineSetup=AE().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.unsubscribeSignal&&=(c.unsubscribeSignal(),void 0),c.cleanupBroadcastSetup&&=(c.cleanupBroadcastSetup(),void 0),c.cleanupFocusSetup&&=(c.cleanupFocusSetup(),void 0),c.cleanupOnlineSetup&&=(c.cleanupOnlineSetup(),void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:d}}var PE=()=>typeof window>`u`,FE=cE;function IE(e,t){if(typeof window>`u`)return;let n=e.get();n.data===null&&t!==null&&e.set({...n,data:t,error:null,isPending:!1})}function LE(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function RE(e){return!e||e.session===null&&e.user===null?null:e}function zE(e,t){return gE(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function BE(e,t){let n=tE(!1),r,i=0,a=0;n.listen(()=>{a++,i=0});let o=e=>u(e),s=bE({data:null,error:null,isPending:!0,isRefetching:!1,refetch:o});_E(s,zE);let c=async(t,n)=>{let r=s.value;if(s.set({...r,isPending:r.data===null,isRefetching:!0,error:null,refetch:o}),t.aborted)return`aborted`;try{let r=await e(`/get-session`,{method:`GET`,query:n?.query,signal:t});if(t.aborted)return`aborted`;let{data:i,error:a}=LE(r),c=`fresh`;if(i?.needsRefresh)try{let n=await e(`/get-session`,{method:`POST`,signal:t});if(t.aborted)return`aborted`;({data:i,error:a}=LE(n))}catch{if(t.aborted)return`aborted`;c=`stale`}if(a){let e=s.value,t=a?.status===401;return s.set({data:t?null:e.data,error:a,isPending:!1,isRefetching:!1,refetch:o}),`failed`}let l=RE(i),u=s.value,d=u.data!=null&&l!=null&&gE(u.data,l)?u.data:l;return s.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:o}),c}catch(e){if(t.aborted)return`aborted`;let n=s.value;return s.set({data:n.data,error:e,isPending:!1,isRefetching:!1,refetch:o}),`failed`}},l=()=>{let e=s.value.data?.session?.expiresAt,t=e instanceof Date?e.getTime():1/0;return Math.min(Date.now()+FE,t)},u=e=>{i=0,r?.cancel();let t=new AbortController,n={cancel:()=>t.abort(),promise:Promise.resolve().then(()=>t.signal.aborted?`aborted`:c(t.signal,e)),revision:a};r=n;let o=e=>{r===n&&(r=void 0,e===`fresh`&&n.revision===a&&(i=l()))};return n.promise.then(o,()=>o(`failed`)),n.promise.then(()=>void 0)},d=()=>r?.revision===a?r.promise.then(()=>void 0):Date.now()<i?Promise.resolve():u(),f=()=>{};return lE(s,()=>{let e;PE()||(e=setTimeout(()=>{d()},0));let r=NE({fetchSession:u,shouldPollSession:()=>s.value.data!=null,sessionSignal:n,options:t});return r.init(),f=r.broadcastSessionUpdate,()=>{e&&clearTimeout(e),r.cleanup()}}),{session:s,$sessionSignal:n,broadcastSessionUpdate:e=>f(e)}}function VE(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function HE(e,t,n=`.`,r){if(!VE(t))return HE(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(i[t]=Array.isArray(a)&&Array.isArray(i[t])?[...a,...i[t]]:VE(a)&&VE(i[t])?HE(a,i[t],(n?`${n}.`:``)+t.toString(),r):a))}return i}function UE(e){return(...t)=>t.reduce((t,n)=>HE(t,n,``,e),{})}var WE=UE(),GE=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},KE=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let t=await i.init?.call(i,e.toString(),n);n=t.options||n,e=t.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},qE=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},JE=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function YE(e){if(typeof e==`number`)return new qE({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new qE(e);case`exponential`:return new JE(e);default:throw Error(`Invalid retry strategy`)}}var XE=[`get`,`post`,`put`,`patch`,`delete`];function ZE(e){if(!e.startsWith(`@`))return{method:void 0,path:e};let t=e.indexOf(`/`),n=e.slice(1,t===-1?void 0:t);return XE.includes(n)?{method:n,path:t===-1?e:e.slice(t+1)}:{method:void 0,path:e}}var QE=e=>e===`.`||e===`..`,$E=e=>e.split(`:`).map(e=>encodeURIComponent(e)).join(`:`);function eD(e,t){let n=t.get(e);if(n===void 0)return $E(e);if(QE(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function tD(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``,{path:o}=ZE(e);o!==e&&(e=`/${o}`),a.endsWith(`/`)||(a+=`/`);let[s,c]=e.replace(a,``).split(`?`),l=new URLSearchParams(c);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)l.append(e,n);continue}else n=JSON.stringify(t);l.set(e,n)}let u=new Map;if(r){if(Array.isArray(r)){let e=s.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];u.set(n,String(e))}}else for(let[e,t]of Object.entries(r))u.set(`:${e}`,String(t))}s=s.split(`/`).map(e=>eD(e,u)).join(`/`),s=s.replace(/^\/+/,``);let d=l.toString();return d=d.length>0?`?${d}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${s}${d}`,a):`${a}${s}${d}`}var nD=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},rD=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function iD(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return rD.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function aD(e){try{return JSON.parse(e),!0}catch{return!1}}function oD(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function sD(e){try{return JSON.parse(e)}catch{return e}}function cD(e){return typeof e==`function`}function lD(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&cD(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&cD(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function uD(...e){let t={};for(let n of e)if(n){if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else{let e=Array.isArray(n)?n:Object.entries(n);for(let[n,r]of e)r!=null&&(t[n]=r)}}return t}async function dD(e){let t=new Headers(uD(e?.headers,await nD(e)));if(!t.has(`content-type`)){let n=fD(e?.body);n&&t.set(`content-type`,n)}return t}function fD(e){return oD(e)?`application/json`:null}function pD(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function mD(e,t){let{body:n}=e;return n?!oD(n)||typeof n==`string`?n:pD(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function hD(e,t){if(t?.method)return t.method.toUpperCase();let{method:n}=ZE(e);return n?n.toUpperCase():t?.body?`POST`:`GET`}function gD(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var _D=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function vD(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new _D(n.issues);return n.value}function yD(e){"@babel/helpers - typeof";return yD=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},yD(e)}function bD(e,t){if(yD(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(yD(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function xD(e){var t=bD(e,`string`);return yD(t)==`symbol`?t:t+``}function SD(e,t,n){return(t=xD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?CD(Object(n),!0).forEach(function(t){SD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var wD=async(e,t)=>{var n;let{hooks:r,url:i,options:a}=await KE(e,t),o=lD(a),s=new AbortController,c=a.signal??s.signal,l=tD(i,a),u=await dD(a),d=mD(a,u),f=hD(i,a),p=$($({},a),{},{url:l,headers:u,body:d,method:f,signal:c});for(let e of r.onRequest)if(e){let t=await e(p);typeof t==`object`&&t&&Object.assign(p,t)}(`pipeTo`in p&&typeof p.pipeTo==`function`||typeof(t==null||(n=t.body)==null?void 0:n.pipe)==`function`)&&(`duplex`in p||(p.duplex=`half`));let{clearTimeout:m}=gD(a,s),h=await o(p.url,p);m();let g={response:h,request:p};for(let e of r.onResponse)if(e){var _;let n=await e($($({},g),{},{response:t!=null&&(_=t.hookOptions)!=null&&_.cloneResponse?h.clone():h}));n instanceof Response?h=n:typeof n==`object`&&n&&(h=n.response)}if(h.ok){if(p.method===`HEAD`)return{data:``,error:null};let e=iD(h),n={data:null,response:h,request:p};if(e===`json`||e===`text`){let e=await h.text();n.data=await(p.jsonParser??sD)(e)}else n.data=await h[e]();p?.output&&p.output&&!p.disableValidation&&(n.data=await vD(p.output,n.data));for(let e of r.onSuccess)if(e){var v;await e($($({},n),{},{response:t!=null&&(v=t.hookOptions)!=null&&v.cloneResponse?h.clone():h}))}return t?.throw?n.data:{data:n.data,error:null}}let y=t?.jsonParser??sD,b=await h.text(),x=aD(b),S=x?await y(b):null,C={response:h,responseText:b,request:p,error:$($({},S),{},{status:h.status,statusText:h.statusText})};for(let e of r.onError)if(e){var w;await e($($({},C),{},{response:t!=null&&(w=t.hookOptions)!=null&&w.cloneResponse?h.clone():h}))}if(t?.retry){let n=YE(t.retry),i=t.retryAttempt??0;if(await n.shouldAttemptRetry(i,h)){for(let e of r.onRetry)e&&await e(g);let a=n.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await wD(e,$($({},t),{},{retryAttempt:i+1}))}}if(t?.throw)throw new GE(h.status,h.statusText,x?S:b);return{data:null,error:$($({},S),{},{status:h.status,statusText:h.statusText})}},TD=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){var r;let i=$($({},n),e.query!==void 0&&{query:$($({},e.query),n?.query)}),a=((r=e.plugins)==null||(r=r.find(e=>e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1))==null?void 0:r.schema)||e.schema;if(a){let r=t;a.config?.prefix&&r.startsWith(a.config.prefix)&&(r=r.replace(a.config.prefix,``),a.config.baseURL&&(t=t.replace(a.config.prefix,a.config.baseURL))),a.config?.baseURL&&r.startsWith(a.config.baseURL)&&(r=r.replace(a.config.baseURL,``)),r.startsWith(`/`)&&r.charAt(1)===`@`&&(r=r.substring(1));let o=a.schema[r];if(o){let{method:a,path:s}=ZE(r);a&&(t=t.slice(0,t.length-r.length)+s);let c=n?.headers;if(o.headers&&!n?.disableValidation){let e={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((t,n)=>{e[n.toLowerCase()]=t});else if(typeof n.headers==`object`)for(let[t,r]of Object.entries(n.headers))r!=null&&(e[t.toLowerCase()]=r)}let t=await vD(o.headers,e),r={};for(let[e,n]of Object.entries(t))r[e.toLowerCase()]=n;c=r}let l=o.method??a;if(i=$($($($({},i),l!==void 0&&{method:l}),o.output!==void 0&&{output:o.output}),c!==void 0&&{headers:c}),!n?.disableValidation){if(o.query&&(i.query=await vD(o.query,n?.query),i.query!==null&&typeof i.query==`object`)){let t=$({},e.query);for(let e of Object.keys(t))n?.query&&Object.prototype.hasOwnProperty.call(n.query,e)&&(t[e]=n.query[e]);i.query=$($({},t),i.query)}i=$($({},i),{},{body:o.input?await vD(o.input,n?.body):n?.body,params:o.params?await vD(o.params,n?.params):n?.params})}return{url:t,options:i}}}return $({url:t},(n!==void 0||e.query!==void 0)&&{options:i})}}),ED=e=>{async function t(t,n){let r=$($($({},e),n),{},{headers:uD(e?.headers,n?.headers),plugins:[...e?.plugins||[],TD(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await wD(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await wD(t,r)}return t},DD=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},OD=e=>e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/revoke-other-sessions`||e===`/change-email`||e===`/change-password`,kD=(e,t)=>{let n=`credentials`in Request.prototype,r=IT(e?.baseURL,e?.basePath,void 0,t)??DD(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=ED({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?GT(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[JT],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=BE(d,e),h=!1,g=e=>{h||e===null||(h=!0,IE(p,e))},_=e?.plugins||[],v={},y={$sessionSignal:f,session:p},b={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},x=[{signal:`$sessionSignal`,matcher:OD,callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of _)e.getAtoms&&Object.assign(y,e.getAtoms?.(d)),e.pathMethods&&Object.assign(b,e.pathMethods),e.atomListeners&&x.push(...e.atomListeners);let S={notify:e=>{y[e].set(!y[e].get())},listen:(e,t)=>{y[e].subscribe(t)},atoms:y};for(let t of _)t.getActions&&(v=WE(t.getActions?.(d,S,e)??{},v));return{get baseURL(){return r},pluginsActions:v,pluginsAtoms:y,pluginPathMethods:b,atomListeners:x,hydrateSession:g,$sessionSignal:f,$fetch:d,$store:S}};function AD(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function jD(e){return e.charAt(0).toUpperCase()+e.slice(1)}var MD=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,ND=/['\u2019]/g;function PD(e){return e.replace(ND,``).match(MD)??[]}function FD(e){return PD(e).map(e=>e.toLowerCase()).join(`-`)}function ID(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function LD(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||AD(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(FD).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=ID(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function RD(e,t={}){let n=(0,F.useRef)(e.get()),{keys:r,deps:i=[e,r]}=t,a=(0,F.useCallback)(t=>{let i=e=>{n.current!==e&&(n.current=e,t())};return i(e.value),r?.length?mE(e,r,i):e.listen(i)},i),o=()=>n.current;return(0,F.useSyncExternalStore)(a,o,yE(e)?()=>e.init:o)}function zD(e){return`use${jD(e)}`}function BD(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,hydrateSession:i,$fetch:a,$store:o,atomListeners:s}=kD(e),c={};for(let[e,t]of Object.entries(r))c[zD(e)]=()=>RD(t);return LD({...n,...c,hydrateSession:i,$fetch:a,$store:o},a,t,r,s)}var VD=e=>`[SonamuProvider] ${e} is not configured. Please provide ${e} configuration to SonamuProvider.`,HD=()=>()=>{throw Error(VD(`uploader`))};function UD(){let e=new Map(Object.entries(bT));return t=>e.get(t)??t}var WD=(0,F.createContext)({uploader:HD(),SD:UD()});function GD({children:e,auth:t,...n}){let r={uploader:n.uploader??HD(),auth:t,SD:n.SD??UD()};return(0,I.jsx)(WD.Provider,{value:r,children:e})}function KD({children:e,authOptions:t,...n}){let[r]=(0,F.useState)(()=>BD(t));return(0,I.jsx)(GD,{...n,auth:n.auth??r,children:e})}function qD({children:e,authOptions:t,...n}){return t===void 0?(0,I.jsx)(GD,{...n,children:e}):(0,I.jsx)(KD,{...n,authOptions:t,children:e})}var JD=e=>Ow(e);function YD({children:e}){return(0,I.jsx)(qD,{SD:JD,children:e})}var XD=T()({head:()=>({meta:[{charSet:`utf-8`},{name:`viewport`,content:`width=device-width, initial-scale=1.0`},{title:`Qgrid`}]}),component:ZD});function ZD(){let{queryClient:e}=XD.useRouteContext();return(0,I.jsxs)(`html`,{lang:`en`,children:[(0,I.jsxs)(`head`,{children:[(0,I.jsx)(`link`,{rel:`icon`,type:`image/svg+xml`,href:`/sonamu.svg`}),(0,I.jsx)(`link`,{rel:`preconnect`,href:`https://fonts.googleapis.com`}),(0,I.jsx)(`link`,{rel:`preconnect`,href:`https://fonts.gstatic.com`,crossOrigin:``}),(0,I.jsx)(`link`,{href:`https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300..700;1,9..40,300..700&family=DM+Mono:wght@400;500&display=swap`,rel:`stylesheet`}),(0,I.jsx)(D,{})]}),(0,I.jsxs)(`body`,{children:[(0,I.jsx)(`div`,{id:`root`,children:(0,I.jsx)(d,{client:e,children:(0,I.jsx)(YD,{children:(0,I.jsx)(yT,{children:(0,I.jsx)(O,{})})})})}),(0,I.jsx)(j,{})]})]})}var QD=`modulepreload`,$D=function(e){return`/`+e},eO={},tO=function(e){return e.pathname.endsWith(`.css`)},nO=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},rO=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=$D(t,n);let r=s(t),i=tO(r);return nO(eO,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:QD,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},iO=v(`/`)({component:ee(()=>rO(()=>import(`./routes--6kS1pgJ.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])),`component`)}),aO=kC(Z({type:Y(),role:Y().optional(),content:CC().optional(),name:Y().optional(),arguments:Y().optional(),call_id:Y().optional(),output:Y().optional()})),oO=kC(Z({mediaType:Y().optional(),data:Y().optional(),url:Y().optional(),byteSize:gC().optional()})),sO=NC([Z({accessToken:Y(),refreshToken:Y(),expiresAt:gC(),accountUuid:Y()}),Z({accessToken:Y(),refreshToken:Y(),idToken:Y().optional(),accessTokenExpiresAt:gC(),idTokenExpiresAt:gC().optional(),accountId:Y(),planType:Y().optional()}),Z({authMode:VC(`oauth`),accessToken:Y(),refreshToken:Y(),expiresAt:Y(),issuer:VC(`https://auth.x.ai`),clientId:Y(),scopes:kC(Y()),userId:Y(),sessionId:Y(),agentId:Y(),subscriptionTier:Y().optional()})]),cO=kC(Z({name:Y(),description:Y().optional(),inputSchema:CC()})),lO=zC([`id-desc`,`id-asc`,`created_at-desc`,`created_at-asc`,`ttft_ms-desc`,`ttft_ms-asc`,`duration_ms-desc`,`duration_ms-asc`,`input_tokens-desc`,`input_tokens-asc`,`output_tokens-desc`,`output_tokens-asc`,`cache_read_tokens-desc`,`cache_read_tokens-asc`,`cache_creation_tokens-desc`,`cache_creation_tokens-asc`,`cost_usd-desc`,`cost_usd-asc`]).describe(`RequestLogOrderBy`),uO=zC([`id`,`token_name`,`user_prompt`]).describe(`RequestLogSearchField`),dO=zC([`running`,`succeeded`,`error`,`aborted`]).describe(`RequestLogStatus`),fO=zC([`image`,`video`,`stt`,`tts`]).describe(`RequestLogMediaKind`),pO=zC([`generate`,`tool_call`]).describe(`RequestLogStepType`),mO=zC([`id-asc`]).describe(`RequestLogStepOrderBy`),hO=zC([`id`]).describe(`RequestLogStepSearchField`),gO=zC([`key-asc`]).describe(`SettingOrderBy`),_O=zC([`key`]).describe(`SettingSearchField`),vO=zC([`id-desc`,`ord-asc`]).describe(`TokenOrderBy`),yO=zC([`id`,`name`]).describe(`TokenSearchField`);Z({id:X(),created_at:DC(),token_name:Y().max(100).nullable(),project_name:Y().max(50).nullable(),model_name:Y().max(255).nullable(),requested_model_name:Y().max(255).nullable(),fallback_count:X().nullable(),user_prompt:Y().nullable(),system_prompt:Y().nullable(),response:Y(),input_tokens:X(),output_tokens:X(),cache_read_tokens:X(),cache_creation_tokens:X(),cache_creation_5m_tokens:X().nullable(),cache_creation_1h_tokens:X().nullable(),duration_ms:X(),ttft_ms:X(),cost_usd:X().nullable(),cost_source:Y().max(20).nullable(),image_cost_usd:X().nullable(),image_cost_method:Y().max(100).nullable(),service_tier:Y().max(20).nullable(),effort:Y().max(10).nullable(),history:aO.nullable(),input_images:oO.nullable(),tools:cO.nullable(),json_schema:Y().nullable(),status:dO,error_message:Y().nullable(),response_json_ok:yC().nullable(),tool_call_count:X(),is_image_generation:yC(),is_structured:yC(),media_kind:fO.nullable()}),Z({id:X(),created_at:DC(),request_log_id:X(),step_index:X(),type:pO,model_name:Y().max(255).nullable(),requested_model_name:Y().max(255).nullable(),fallback_count:X().nullable(),input_tokens:X().nullable(),output_tokens:X().nullable(),cache_read_tokens:X().nullable(),cache_creation_tokens:X().nullable(),cache_creation_5m_tokens:X().nullable(),cache_creation_1h_tokens:X().nullable(),cost_usd:X().nullable(),cost_source:Y().max(20).nullable(),duration_ms:X().nullable(),ttft_ms:X().nullable(),finish_reason:Y().max(20).nullable(),reasoning_text:Y().nullable(),reasoning_tokens:X().nullable(),tool_call_index:X().nullable(),tool_call_id:Y().max(100).nullable(),tool_name:Y().max(100).nullable(),tool_args:Y().nullable(),tool_result:Y().nullable(),tool_duration_ms:X().nullable(),error:Y().nullable()}),Z({id:X(),created_at:DC(),key:Y().max(100),value:Y(),updated_at:DC().nullable()}),Z({id:X(),created_at:DC(),provider:Y().max(20),credentials:sO,name:Y(),active:yC(),reauth_required:yC(),ord:X(),quota_threshold:X().nullable(),weight:X(),keepalive_enabled:yC()});var bO=Z({num:gC().int().nonnegative(),page:gC().int().min(1),search:uO,keyword:Y(),orderBy:lO,queryMode:Mw,id:Nw(gC().int().positive()),sonamuFilter:dw(),token_name:Y().max(100).nullable(),project_name:Y().max(50).nullable(),model_name:Y().max(255).nullable()}).partial();Z({num:gC().int().nonnegative(),page:gC().int().min(1),search:hO,keyword:Y(),orderBy:mO,queryMode:Mw,id:Nw(gC().int().positive()),sonamuFilter:dw(),request_log_id:X()}).partial(),Z({num:gC().int().nonnegative(),page:gC().int().min(1),search:_O,keyword:Y(),orderBy:gO,queryMode:Mw,id:Nw(gC().int().positive()),sonamuFilter:dw(),key:Y().max(100)}).partial(),Z({num:gC().int().nonnegative(),page:gC().int().min(1),search:yO,keyword:Y(),orderBy:vO,queryMode:Mw,id:Nw(gC().int().positive()),sonamuFilter:dw()}).partial(),Z({id:X(),created_at:DC(),token_name:Y().max(100).nullable(),project_name:Y().max(50).nullable(),model_name:Y().max(255).nullable(),requested_model_name:Y().max(255).nullable(),fallback_count:X().nullable(),user_prompt:Y().nullable(),system_prompt:Y().nullable(),response:Y(),input_tokens:X(),output_tokens:X(),cache_read_tokens:X(),cache_creation_tokens:X(),cache_creation_5m_tokens:X().nullable(),cache_creation_1h_tokens:X().nullable(),duration_ms:X(),ttft_ms:X(),cost_usd:X().nullable(),cost_source:Y().max(20).nullable(),image_cost_usd:X().nullable(),image_cost_method:Y().max(100).nullable(),effort:Y().max(10).nullable(),service_tier:Y().max(20).nullable(),history:aO.nullable(),input_images:oO.nullable(),tools:cO.nullable(),status:dO,response_json_ok:yC().nullable(),error_message:Y().nullable(),tool_call_count:X(),is_image_generation:yC(),is_structured:yC(),media_kind:fO.nullable()}),Z({id:X(),created_at:DC(),token_name:Y().max(100).nullable(),project_name:Y().max(50).nullable(),model_name:Y().max(255).nullable(),requested_model_name:Y().max(255).nullable(),fallback_count:X().nullable(),input_tokens:X(),output_tokens:X(),cache_read_tokens:X(),cache_creation_tokens:X(),cache_creation_5m_tokens:X().nullable(),cache_creation_1h_tokens:X().nullable(),duration_ms:X(),ttft_ms:X(),cost_usd:X().nullable(),cost_source:Y().max(20).nullable(),image_cost_usd:X().nullable(),image_cost_method:Y().max(100).nullable(),effort:Y().max(10).nullable(),service_tier:Y().max(20).nullable(),status:dO,response_json_ok:yC().nullable(),tool_call_count:X(),is_image_generation:yC(),is_structured:yC(),media_kind:fO.nullable()}),Z({id:X(),token_name:Y().max(100).nullable(),model_name:Y().max(255).nullable(),input_tokens:X(),output_tokens:X(),cache_read_tokens:X(),cache_creation_tokens:X(),cache_creation_5m_tokens:X().nullable(),cache_creation_1h_tokens:X().nullable(),cost_usd:X().nullable(),cost_source:Y().max(20).nullable()}),zC([`A`,`P`,`C`]),Z({id:X(),created_at:DC(),step_index:X(),type:pO,model_name:Y().max(255).nullable(),requested_model_name:Y().max(255).nullable(),fallback_count:X().nullable(),input_tokens:X().nullable(),output_tokens:X().nullable(),cache_read_tokens:X().nullable(),cache_creation_tokens:X().nullable(),cache_creation_5m_tokens:X().nullable(),cache_creation_1h_tokens:X().nullable(),cost_usd:X().nullable(),cost_source:Y().max(20).nullable(),duration_ms:X().nullable(),ttft_ms:X().nullable(),finish_reason:Y().max(20).nullable(),reasoning_text:Y().nullable(),reasoning_tokens:X().nullable(),tool_call_index:X().nullable(),tool_call_id:Y().max(100).nullable(),tool_name:Y().max(100).nullable(),tool_args:Y().nullable(),tool_result:Y().nullable(),tool_duration_ms:X().nullable(),error:Y().nullable()}),Z({id:X(),created_at:DC(),step_index:X(),type:pO,model_name:Y().max(255).nullable(),requested_model_name:Y().max(255).nullable(),fallback_count:X().nullable(),input_tokens:X().nullable(),output_tokens:X().nullable(),cache_read_tokens:X().nullable(),cache_creation_tokens:X().nullable(),cache_creation_5m_tokens:X().nullable(),cache_creation_1h_tokens:X().nullable(),cost_usd:X().nullable(),cost_source:Y().max(20).nullable(),duration_ms:X().nullable(),ttft_ms:X().nullable(),finish_reason:Y().max(20).nullable(),reasoning_tokens:X().nullable(),tool_call_index:X().nullable(),tool_call_id:Y().max(100).nullable(),tool_name:Y().max(100).nullable(),tool_duration_ms:X().nullable(),error:Y().nullable()}),Z({id:X(),tool_args:Y().nullable()}),zC([`A`,`T`,`I`]),Z({id:X(),created_at:DC(),key:Y().max(100),value:Y(),updated_at:DC().nullable()}),zC([`A`]),Z({id:X(),created_at:DC(),provider:Y().max(20),credentials:sO,name:Y(),active:yC(),reauth_required:yC(),ord:X(),quota_threshold:X().nullable(),weight:X(),keepalive_enabled:yC()}),zC([`A`]);var xO=()=>rO(()=>import(`./logs-DAif2re1.js`),__vite__mapDeps([8,1,2,3,6,9,10])),SO=Z({token:Y().optional(),project:Y().optional(),model:Y().optional(),sort:lO.optional(),page:bO.shape.page.default(1)}),CO=v(`/logs`)({validateSearch:SO,component:ee(xO,`component`)}),wO=()=>rO(()=>import(`./monit-DYczkiu0.js`),__vite__mapDeps([11,1,2,3,5,6,9])),TO=Z({level:zC([`all`,`warn`,`error`]).optional().default(`all`).catch(()=>`all`)}),EO=v(`/monit`)({validateSearch:TO,component:ee(wO,`component`)}),DO=v(`/settings`)({component:ee(()=>rO(()=>import(`./settings-Dah87LB2.js`),__vite__mapDeps([12,1,2,3,7,13])),`component`)}),OO=v(`/tokens`)({component:ee(()=>rO(()=>import(`./tokens-CIHja806.js`),__vite__mapDeps([14,1,2,3,4,5,7,13])),`component`)}),kO=v(`/voice`)({component:ee(()=>rO(()=>import(`./voice-6i785ieC.js`),__vite__mapDeps([15,1,2,3,16])),`component`)}),AO=()=>rO(()=>import(`./show-DQWFaVDW.js`),__vite__mapDeps([17,1,2,3,6,10,16])),jO=Z({id:gC()}),MO=v(`/requests/show`)({validateSearch:jO,component:ee(AO,`component`)}),NO=mw();Z({mediaType:Y().optional(),data:Y().optional(),url:Y().optional(),byteSize:gC().optional()});var PO=jC({text:Y()});NC([Y(),kC(NC([PO,NO])),NO]);var FO={IndexRoute:iO.update({id:`/`,path:`/`,getParentRoute:()=>XD}),LogsRoute:CO.update({id:`/logs`,path:`/logs`,getParentRoute:()=>XD}),MonitRoute:EO.update({id:`/monit`,path:`/monit`,getParentRoute:()=>XD}),SettingsRoute:DO.update({id:`/settings`,path:`/settings`,getParentRoute:()=>XD}),TokensRoute:OO.update({id:`/tokens`,path:`/tokens`,getParentRoute:()=>XD}),VoiceRoute:kO.update({id:`/voice`,path:`/voice`,getParentRoute:()=>XD}),RequestsShowRoute:MO.update({id:`/requests/show`,path:`/requests/show`,getParentRoute:()=>XD})},IO=XD._addFileChildren(FO)._addFileTypes(),LO=new ce({defaultOptions:{queries:{staleTime:5e3,retry:!1,refetchOnMount:!0}}}),RO=window.__SONAMU_SSR__?JSON.parse(JSON.stringify(window.__SONAMU_SSR__),kw):void 0;RO&&ae(LO,RO);var zO=window.__SONAMU_SSR_CONFIG__,BO=g({routeTree:IO,context:{queryClient:LO},defaultPreload:`intent`});(async()=>{await BO.load(),document.documentElement.innerHTML&&RO?zO?.disableHydrate?(console.log(`[Sonamu] Hydration disabled, rendering as CSR`),le.createRoot(document).render((0,I.jsx)(S,{router:BO}))):le.hydrateRoot(document,(0,I.jsx)(S,{router:BO})):le.createRoot(document).render((0,I.jsx)(S,{router:BO}))})(),window.__TANSTACK_QUERY_CLIENT__=LO;export{Zo as C,tu as S,Y as _,Ww as a,ou as b,Vw as c,jw as d,kC as f,Z as g,gC as h,lO as i,Bw as l,jC as m,EO as n,Uw as o,mw as p,CO as r,Hw as s,MO as t,zw as u,NC as v,pe as w,iu as x,su as y};
|