@shumai-one/shumai 0.2.1 → 0.2.2
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/bin/{chunk-qag3w2dd.js → chunk-0aj303as.js} +1 -1
- package/bin/{chunk-976v5s8y.js → chunk-0qkj838r.js} +1 -1
- package/bin/{chunk-mg6fce5x.js → chunk-0rxhc7ka.js} +1 -1
- package/bin/chunk-0xbf8bcg.js +2 -0
- package/bin/{chunk-t1mxqskx.js → chunk-15sefy5t.js} +1 -1
- package/bin/{chunk-jfjcxyhf.js → chunk-1wm57c6y.js} +3 -3
- package/bin/{chunk-7ktvhtp1.js → chunk-1xpec5r8.js} +1 -1
- package/bin/chunk-23d3968z.js +2 -0
- package/bin/{chunk-y4s3xr4n.js → chunk-262hkppb.js} +2 -2
- package/bin/{chunk-qj2kpkje.js → chunk-29tx9qe2.js} +1 -1
- package/bin/{chunk-a5s5ny4z.js → chunk-2aamsc5v.js} +1 -1
- package/bin/{chunk-gd5xwgp6.js → chunk-2aascrtb.js} +1 -1
- package/bin/chunk-2g12s6mc.js +2 -0
- package/bin/{chunk-pv76qkym.js → chunk-31baz5n0.js} +1 -1
- package/bin/{chunk-hmsb7ehr.js → chunk-46ar48f9.js} +1 -1
- package/bin/chunk-4e3jbp84.js +1 -0
- package/bin/chunk-4jk0y1w1.js +1 -0
- package/bin/{chunk-ga0drqj7.js → chunk-4qpa7b5t.js} +1 -1
- package/bin/{chunk-99db4j0k.js → chunk-54tr7y2x.js} +1 -1
- package/bin/{chunk-9n783gva.js → chunk-5d2q46mx.js} +1 -1
- package/bin/{chunk-qf7n519d.js → chunk-5m9be8an.js} +2 -2
- package/bin/{chunk-1w9dnk5p.js → chunk-5r8858hx.js} +1 -1
- package/bin/{chunk-ydagqpny.js → chunk-5t6c3038.js} +1 -1
- package/bin/chunk-6z65xd0w.js +3 -0
- package/bin/{chunk-qjjr3fff.js → chunk-77r8w95d.js} +1 -1
- package/bin/chunk-7e06b2zb.js +2 -0
- package/bin/{chunk-58aabg1f.js → chunk-7hsgmjpa.js} +2 -2
- package/bin/{chunk-7mnezagc.js → chunk-88fg1sw7.js} +1 -1
- package/bin/{chunk-m11g9hx7.js → chunk-8mkfgcvb.js} +2 -2
- package/bin/chunk-8tf6kgdj.js +2 -0
- package/bin/{chunk-b9hb5jzt.js → chunk-8wqfkm4c.js} +1 -1
- package/bin/{chunk-ag35pxnb.js → chunk-922nnh39.js} +1 -1
- package/bin/{chunk-ymyyap80.js → chunk-925q4paa.js} +1 -1
- package/bin/{chunk-wfex9jw0.js → chunk-92xxys10.js} +6 -6
- package/bin/{chunk-0a5k9avd.js → chunk-97jzve52.js} +1 -1
- package/bin/{chunk-dzm2f82x.js → chunk-9ab6k4rq.js} +1 -1
- package/bin/{chunk-mwh2n8yt.js → chunk-9avkn3x1.js} +1 -1
- package/bin/{chunk-pmx9760x.js → chunk-9h027f50.js} +1 -1
- package/bin/chunk-av71yjaa.js +1 -0
- package/bin/{chunk-mjncyjwf.js → chunk-b8js74jk.js} +1 -1
- package/bin/{chunk-861dz0bf.js → chunk-bd71dp4j.js} +1 -1
- package/bin/{chunk-v3j7acwn.js → chunk-bs0fjz3w.js} +2 -2
- package/bin/chunk-byqc8tzq.js +1 -0
- package/bin/chunk-ccw7mjgq.js +5 -0
- package/bin/{chunk-kj751zje.js → chunk-cxhmr356.js} +1 -1
- package/bin/{chunk-hcz4snm7.js → chunk-d3wmdjze.js} +1 -1
- package/bin/{chunk-82w2419d.js → chunk-de99643r.js} +2 -2
- package/bin/{chunk-dwf5e5g3.js → chunk-dghtwyq1.js} +1 -1
- package/bin/{chunk-5k03xpzq.js → chunk-dqgv5yy1.js} +1 -1
- package/bin/{chunk-q72ax3m8.js → chunk-e3s3rz2e.js} +1 -1
- package/bin/{chunk-79n633wf.js → chunk-e52nga6c.js} +1 -1
- package/bin/{chunk-8abs8d48.js → chunk-e7ndw3hg.js} +2 -2
- package/bin/chunk-f14sqw1d.js +1 -0
- package/bin/chunk-f7sbkfmk.js +2 -0
- package/bin/{chunk-2xnys7v4.js → chunk-fa2g2wge.js} +1 -1
- package/bin/{chunk-044xt1se.js → chunk-fbte2rmd.js} +1 -1
- package/bin/{chunk-k1r17nfa.js → chunk-fcvtgx1y.js} +1 -1
- package/bin/chunk-fd5a3pdd.js +1 -0
- package/bin/{chunk-hqptebzb.js → chunk-fepymbka.js} +1 -1
- package/bin/{chunk-cpr05qng.js → chunk-fz88kkk1.js} +1 -1
- package/bin/chunk-g6zzg6v2.js +1 -0
- package/bin/{chunk-6724dtsx.js → chunk-g8th86na.js} +1 -1
- package/bin/chunk-gswbc6y9.js +2 -0
- package/bin/{chunk-pvy0gccg.js → chunk-gtrc5ka2.js} +1 -1
- package/bin/chunk-h0ytx8zc.js +2 -0
- package/bin/{chunk-mv8c5fky.js → chunk-hkbybhww.js} +1 -1
- package/bin/{chunk-e3c6hyz8.js → chunk-hr97a5j5.js} +1 -1
- package/bin/{chunk-7h75r7ep.js → chunk-j8qtab70.js} +1 -1
- package/bin/{chunk-jyjnt0s9.js → chunk-jf3vn5c3.js} +2 -2
- package/bin/{chunk-azfgjqjx.js → chunk-kfhtk3eh.js} +1 -1
- package/bin/chunk-kr06nrbx.js +2 -0
- package/bin/{chunk-nceqrqey.js → chunk-m4zpf9gg.js} +1 -1
- package/bin/{chunk-1ae8csk6.js → chunk-mqjzmn0e.js} +1 -1
- package/bin/{chunk-sp75qe28.js → chunk-mzg1h07d.js} +1 -1
- package/bin/{chunk-cj5qwc9c.js → chunk-nrwna4ha.js} +1 -1
- package/bin/chunk-nyhqy6q2.js +62 -0
- package/bin/{chunk-4zq8vxcy.css → chunk-pmswtfe3.css} +1 -1
- package/bin/chunk-pq18zenh.js +2 -0
- package/bin/{chunk-p3emandj.js → chunk-q24epdh8.js} +2 -2
- package/bin/{chunk-2djd6pq1.js → chunk-qksb0v3c.js} +2 -2
- package/bin/chunk-qqk51620.js +2 -0
- package/bin/chunk-r0w920zb.js +1 -0
- package/bin/{chunk-2dz8nn9v.js → chunk-re0b7sj7.js} +1 -1
- package/bin/{chunk-x9q2vzn8.js → chunk-rtngbgpk.js} +1 -1
- package/bin/{chunk-zn9jbc6t.js → chunk-ry33f2qk.js} +1 -1
- package/bin/{chunk-k5bekrrp.js → chunk-s46zwr4p.js} +1 -1
- package/bin/chunk-s8t74q9m.js +1 -0
- package/bin/chunk-sd86v1e6.js +1 -0
- package/bin/{chunk-v98yavtp.js → chunk-srn8t0v7.js} +1 -1
- package/bin/chunk-szzff7gd.js +1 -0
- package/bin/{chunk-46c5xkmn.js → chunk-t3t6021k.js} +1 -1
- package/bin/{chunk-jbde7evp.js → chunk-thsbcbay.js} +1 -1
- package/bin/chunk-tspps87j.js +1 -0
- package/bin/{chunk-v05d1aeq.js → chunk-w7dn1m95.js} +1 -1
- package/bin/{chunk-w1d5vmtc.js → chunk-wc8sc9r9.js} +1 -1
- package/bin/chunk-wg98cacx.js +2 -0
- package/bin/chunk-wsyg4rwg.js +2 -0
- package/bin/{chunk-ga3mh3cd.js → chunk-xcwbg4w9.js} +1 -1
- package/bin/{chunk-9bpjfkjf.js → chunk-xyjw8w3r.js} +1 -1
- package/bin/chunk-y2qp11v9.js +1 -0
- package/bin/{chunk-ngd23mtc.js → chunk-ybhgmvxa.js} +1 -1
- package/bin/{chunk-phw4ne8b.js → chunk-ygz6pawn.js} +1 -1
- package/bin/{chunk-hy50c4pw.js → chunk-ymeycphq.js} +2 -2
- package/bin/{chunk-c1v946wb.js → chunk-zemrvz79.js} +2 -2
- package/bin/{chunk-29pkpmvy.js → chunk-zzx99j8t.js} +1 -1
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +248 -224
- package/package.json +7 -7
- package/prisma/migrations/20260723025234_add_ai_usage_table/migration.sql +28 -0
- package/prisma/migrations/20260723032755_add_ai_usage_unique_constraint/migration.sql +8 -0
- package/prisma/schema.prisma +25 -0
- package/bin/chunk-211y81mp.js +0 -1
- package/bin/chunk-25d1g086.js +0 -2
- package/bin/chunk-4fnak2zn.js +0 -2
- package/bin/chunk-50ebjdkv.js +0 -2
- package/bin/chunk-5j7axztv.js +0 -2
- package/bin/chunk-6h4ay2p8.js +0 -2
- package/bin/chunk-6w5cn6p3.js +0 -3
- package/bin/chunk-75jka5v9.js +0 -5
- package/bin/chunk-9evm8x70.js +0 -1
- package/bin/chunk-bepnbw1g.js +0 -2
- package/bin/chunk-bg24g9kk.js +0 -1
- package/bin/chunk-dqtq9t8e.js +0 -1
- package/bin/chunk-fgnxtqtk.js +0 -1
- package/bin/chunk-fxvb6g2r.js +0 -1
- package/bin/chunk-kjkmh26f.js +0 -1
- package/bin/chunk-m3dwydr3.js +0 -2
- package/bin/chunk-mk1jewvw.js +0 -2
- package/bin/chunk-q9sgjs4d.js +0 -1
- package/bin/chunk-s2725w64.js +0 -1
- package/bin/chunk-saq5797j.js +0 -1
- package/bin/chunk-sy8rqacm.js +0 -2
- package/bin/chunk-t84t3v6q.js +0 -1
- package/bin/chunk-ttsqdsxr.js +0 -2
- package/bin/chunk-vreq89j6.js +0 -1
- package/bin/chunk-wbhsmhgp.js +0 -2
- package/bin/chunk-wf4d1anc.js +0 -62
- package/bin/chunk-xv4mfppt.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Rb as $Q}from"./chunk-891h8br6.js";import{Ub as c,Vb as XQ,Wb as l}from"./chunk-q72ax3m8.js";import"./chunk-3rmc8nz6.js";import{Yb as VQ}from"./chunk-s1n39qte.js";import{Zb as g}from"./chunk-mwh2n8yt.js";import{ec as GQ,fc as FQ}from"./chunk-w88219ex.js";import{hc as YQ}from"./chunk-2dsmsa6a.js";import"./chunk-ta7bfdrn.js";import{lc as u}from"./chunk-pxw97qbq.js";import{ke as NQ}from"./chunk-8qg47kj6.js";import{le as x,me as JQ,ne as zQ}from"./chunk-c45rh4hk.js";import"./chunk-ngd23mtc.js";import{af as ZQ}from"./chunk-q09dfja5.js";import{bf as QQ}from"./chunk-d2vxmn9v.js";import"./chunk-v3j7acwn.js";import"./chunk-976v5s8y.js";function i(Q){let $=Q.filter((G)=>G!==void 0);if($.length===0)return{cleanup:()=>{}};if($.length===1)return{signal:$[0],cleanup:()=>{}};let Z=new AbortController,Y=[],F=(G)=>{if(!Z.signal.aborted)Z.abort(G.reason)};for(let G of $){if(G.aborted){F(G);break}let V=()=>F(G);G.addEventListener("abort",V,{once:!0}),Y.push({signal:G,listener:V})}return{signal:Z.signal,cleanup:()=>{for(let{signal:G,listener:V}of Y)G.removeEventListener("abort",V)}}}var PQ={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function v(Q,$){let Z=Q.toLowerCase(),Y=Q.toUpperCase();return $?.[Z]||$?.[Y]||g(Z)||g(Y)||""}function AQ(Q){if(Q instanceof URL)return Q;try{return new URL(Q)}catch{return}}function UQ(Q,$,Z){let Y=v("no_proxy",Z).toLowerCase();if(!Y)return!0;if(Y==="*")return!1;return Y.split(/[,\s]/).every((F)=>{if(!F)return!0;let G=F.match(/^(.+):(\d+)$/),V=G?G[1]:F,j=G?Number.parseInt(G[2],10):0;if(j&&j!==$)return!0;if(!/^[.*]/.test(V))return Q!==V;if(V.startsWith("*"))V=V.slice(1);return!Q.endsWith(V)})}function wQ(Q,$){let Z=AQ(Q);if(!Z?.protocol||!Z.host)return"";let Y=Z.protocol.split(":",1)[0],F=Z.host.replace(/:\d*$/,""),G=Number.parseInt(Z.port,10)||PQ[Y]||0;if(!UQ(F,G,$))return"";let V=v(`${Y}_proxy`,$)||v("all_proxy",$);if(V&&!V.includes("://"))V=`${Y}://${V}`;return V}var CQ="Unsupported proxy protocol. SOCKS and PAC proxy URLs are not supported; use an HTTP or HTTPS proxy URL.";function a(Q,$){let Z=wQ(Q,$);if(!Z)return;let Y;try{Y=new URL(Z)}catch(F){throw Error(`Invalid proxy URL ${JSON.stringify(Z)}: ${F instanceof Error?F.message:String(F)}`)}if(Y.protocol!=="http:"&&Y.protocol!=="https:")throw Error(`${CQ} Got ${Y.protocol}`);return Y}function EQ(){if(typeof process>"u"||!(process.versions?.node||process.versions?.bun))return null;return process.getBuiltinModule?.("node:os")??null}var T=EQ(),fQ="https://chatgpt.com/backend-api",MQ="https://api.openai.com/auth",SQ=0,n=1000,TQ=60000,hQ=15000,IQ=3,jQ=new Set(["openai","openai-codex","opencode"]),xQ=1009,kQ="websocket_connection_limit_reached",bQ=new Set(["completed","incomplete","failed","cancelled","queued","in_progress"]);function gQ(Q){return/GoUsageLimitError|FreeUsageLimitError|Monthly usage limit reached|available balance|insufficient_quota|out of budget|quota exceeded|billing/i.test(Q)}function vQ(Q,$){if(Q===429&&gQ($))return!1;if(Q===429||Q===500||Q===502||Q===503||Q===504)return!0;return/rate.?limit|overloaded|service.?unavailable|upstream.?connect|connection.?refused/i.test($)}function yQ(Q){let $=Q.get("retry-after-ms");if($!==null){let G=Number($);if(Number.isFinite(G))return Math.max(0,G)}let Z=Q.get("retry-after");if(!Z)return;let Y=Number(Z);if(Number.isFinite(Y))return Math.max(0,Y*1000);let F=Date.parse(Z);if(!Number.isNaN(F))return Math.max(0,F-Date.now());return}function mQ(Q,$){let Z=$?.maxRetryDelayMs??TQ;return Z>0?Math.min(Q,Z):Q}function r(Q,$){return new Promise((Z,Y)=>{if($?.aborted){Y(Error("Request was aborted"));return}let F=setTimeout(Z,Q);$?.addEventListener("abort",()=>{clearTimeout(F),Y(Error("Request was aborted"))})})}function t(Q){if(Q===void 0)return;if(!Number.isFinite(Q)||Q<0)throw Error(`Invalid timeoutMs: ${String(Q)}`);return Math.floor(Q)}function uQ(){if(typeof process>"u"||!(process.versions?.node||process.versions?.bun))return null;return process.getBuiltinModule?.("node:zlib")??null}function cQ(Q){let $=uQ();if(!$||typeof $.zstdCompressSync!=="function")return null;try{let Z=$.zstdCompressSync(Q,{params:{[$.constants.ZSTD_c_compressionLevel]:IQ}});return new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength)}catch{return null}}var lQ=(Q,$,Z)=>{let Y=new QQ;return(async()=>{let F={role:"assistant",content:[],api:"openai-codex-responses",provider:Q.provider,model:Q.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let G=Z?.apiKey;if(!G)throw Error(`No API key for provider: ${Q.provider}`);let V=qZ(G),j=pQ(Q,$,Z),N=await Z?.onPayload?.(j,Q);if(N!==void 0)j=N;let X=Z?.sessionId||_Z(),W=OZ(Q.headers,Z?.headers,V,G,Z?.sessionId),J=RZ(Q.headers,Z?.headers,V,G,X),_=JSON.stringify(j),z=t(Z?.timeoutMs),q=t(Z?.websocketConnectTimeoutMs),D=Z?.transport||"auto",B=D!=="sse"&&BQ(Z?.sessionId);if(B)s(Z?.sessionId);if(D!=="sse"&&!B){let O=!1,H=!1;while(!0){O=!1;try{if(await WZ(iQ(Q.baseUrl),j,J,F,Y,Q,()=>{O=!0},z,q,Z),Z?.signal?.aborted)throw Error("Request was aborted");Y.push({type:"done",reason:F.stopReason,message:F}),Y.end();return}catch(A){let C=Z?.signal?.aborted,S=!O&&rQ(A);if(!C&&S&&!H){H=!0;continue}if(C||nQ(A)&&!S)throw A;if(zQ(F,JQ("provider_transport_failure",A,{configuredTransport:D,fallbackTransport:O?void 0:"sse",eventsEmitted:O,phase:O?"after_message_stream_start":"before_message_stream_start",requestBytes:new TextEncoder().encode(_).byteLength})),YZ(Z?.sessionId,A),O)throw A;s(Z?.sessionId);break}}}let R=cQ(_);if(R)W.set("content-encoding","zstd");let K=R??_,L,w,b=Z?.maxRetries??SQ;for(let O=0;O<=b;O++){if(Z?.signal?.aborted)throw Error("Request was aborted");try{let H=z!==void 0&&z>0?AbortSignal.timeout(z):void 0,A=i([Z?.signal,H]);try{L=await fetch(DQ(Q.baseUrl),{method:"POST",headers:W,body:K,signal:A.signal})}catch(E){if(H?.aborted&&!Z?.signal?.aborted)throw Error(`Codex SSE response headers timed out after ${z}ms`);throw E}finally{A.cleanup()}if(await Z?.onResponse?.({status:L.status,headers:u(L.headers)},Q),L.ok)break;let C=await L.text();if(O<b&&vQ(L.status,C)){let E=yQ(L.headers),HQ=E===void 0?n*2**O:L.status===429?mQ(E,Z):E;await r(HQ,Z?.signal);continue}let S=new Response(C,{status:L.status,statusText:L.statusText}),d=await BZ(S);throw Error(d.friendlyMessage||d.message)}catch(H){if(H instanceof Error){if(H.name==="AbortError"||H.message==="Request was aborted")throw Error("Request was aborted")}if(w=H instanceof Error?H:Error(String(H)),O<b&&!w.message.includes("usage limit")){let A=n*2**O;await r(A,Z?.signal);continue}throw w}}if(!L?.ok)throw w??Error("Failed after retries");if(!L.body)throw Error("No response body");if(Y.push({type:"start",partial:F}),await aQ(L,F,Y,Q,Z),Z?.signal?.aborted)throw Error("Request was aborted");Y.push({type:"done",reason:F.stopReason,message:F}),Y.end()}catch(G){for(let V of F.content)delete V.partialJson;F.stopReason=Z?.signal?.aborted?"aborted":"error",F.errorMessage=FQ(GQ(G)),Y.push({type:"error",reason:F.stopReason,error:F}),Y.end()}})(),Y},bZ=(Q,$,Z)=>{let Y=Z?.apiKey;if(!Y)throw Error(`No API key for provider: ${Q.provider}`);let F=YQ(Q,$,Z,Y),G=Z?.reasoning?ZQ(Q,Z.reasoning):void 0;return lQ(Q,$,{...F,reasoningEffort:G==="off"?void 0:G})};function pQ(Q,$,Z){let Y=$Q($,Q.compat?.supportsToolSearch??!1),F=c(Q,$,jQ,{includeSystemPrompt:!1,deferredTools:Y.deferred}),G={model:Q.id,store:!1,stream:!0,instructions:$.systemPrompt||"You are a helpful assistant.",input:F,text:{verbosity:Z?.textVerbosity||"low"},include:["reasoning.encrypted_content"],prompt_cache_key:VQ(Z?.sessionId),tool_choice:Z?.toolChoice??"auto",parallel_tool_calls:!0};if(Z?.temperature!==void 0)G.temperature=Z.temperature;if(Z?.serviceTier!==void 0)G.service_tier=Z.serviceTier;if(Y.immediate.length>0)G.tools=XQ(Y.immediate,{strict:null});if(Z?.reasoningEffort!==void 0){let V=Z.reasoningEffort==="none"?Q.thinkingLevelMap?.off??"none":Q.thinkingLevelMap?.[Z.reasoningEffort]??Z.reasoningEffort;if(V!==null)G.reasoning={effort:V,summary:Z.reasoningSummary??"auto"}}return G}function dQ(Q,$){switch($){case"flex":return 0.5;case"priority":return Q.id==="gpt-5.5"?2.5:2;default:return 1}}function KQ(Q,$,Z){let Y=dQ(Z,$);if(Y===1)return;Q.cost.input*=Y,Q.cost.output*=Y,Q.cost.cacheRead*=Y,Q.cost.cacheWrite*=Y,Q.cost.total=Q.cost.input+Q.cost.output+Q.cost.cacheRead+Q.cost.cacheWrite}function LQ(Q,$){if(Q==="default"&&($==="flex"||$==="priority"))return $;return Q??$}function DQ(Q){let Z=(Q&&Q.trim().length>0?Q:fQ).replace(/\/+$/,"");if(Z.endsWith("/codex/responses"))return Z;if(Z.endsWith("/codex"))return`${Z}/responses`;return`${Z}/codex/responses`}function iQ(Q){let $=new URL(DQ(Q));if($.protocol==="https:")$.protocol="wss:";if($.protocol==="http:")$.protocol="ws:";return $.toString()}async function aQ(Q,$,Z,Y,F){await l(WQ(oQ(Q,F?.signal)),$,Z,Y,{serviceTier:F?.serviceTier,resolveServiceTier:LQ,applyServiceTierPricing:(G,V)=>KQ(G,V,Y)})}class f extends Error{code;payload;constructor(Q,$){super(Q);this.name="CodexApiError",this.code=$?.code,this.payload=$?.payload,this.cause=$?.cause}}class k extends Error{payload;constructor(Q,$){super(Q);this.name="CodexProtocolError",this.payload=$?.payload,this.cause=$?.cause}}function nQ(Q){return Q instanceof f||Q instanceof k}function rQ(Q){return Q instanceof f&&Q.code===kQ}function tQ(Q){let $=Q.error&&typeof Q.error==="object"?Q.error:void 0;return{code:typeof Q.code==="string"?Q.code:typeof $?.code==="string"?$.code:void 0,message:typeof Q.message==="string"?Q.message:typeof $?.message==="string"?$.message:void 0}}async function*WQ(Q){for await(let $ of Q){let Z=typeof $.type==="string"?$.type:void 0;if(!Z)continue;if(Z==="error"){let{code:Y,message:F}=tQ($);throw new f(`Codex error: ${F||Y||JSON.stringify($)}`,{code:Y,payload:$})}if(Z==="response.failed"){let Y=$.response,F=Y?.error?.code,G=Y?.error?.message;throw new f(G||"Codex response failed",{code:F,payload:$})}if(Z==="response.done"||Z==="response.completed"||Z==="response.incomplete"){let Y=$.response,F=Y?{...Y,status:sQ(Y.status)}:Y;yield{...$,type:"response.completed",response:F};return}yield $}}function sQ(Q){if(typeof Q!=="string")return;return bQ.has(Q)?Q:void 0}async function*oQ(Q,$){if(!Q.body)return;let Z=Q.body.getReader(),Y=new TextDecoder,F="",G=()=>{Z.cancel().catch(()=>{})};$?.addEventListener("abort",G,{once:!0});try{while(!0){if($?.aborted)throw Error("Request was aborted");let{done:V,value:j}=await Z.read();if($?.aborted)throw Error("Request was aborted");if(V)break;F+=Y.decode(j,{stream:!0});let N=F.indexOf(`
|
|
2
|
+
import{Rb as $Q}from"./chunk-891h8br6.js";import{Ub as c,Vb as XQ,Wb as l}from"./chunk-e3s3rz2e.js";import"./chunk-3rmc8nz6.js";import{Yb as VQ}from"./chunk-s1n39qte.js";import{Zb as g}from"./chunk-9avkn3x1.js";import{ec as GQ,fc as FQ}from"./chunk-w88219ex.js";import{hc as YQ}from"./chunk-2dsmsa6a.js";import"./chunk-ta7bfdrn.js";import{lc as u}from"./chunk-pxw97qbq.js";import{ke as NQ}from"./chunk-8qg47kj6.js";import{le as x,me as JQ,ne as zQ}from"./chunk-c45rh4hk.js";import"./chunk-ybhgmvxa.js";import{af as ZQ}from"./chunk-q09dfja5.js";import{bf as QQ}from"./chunk-d2vxmn9v.js";import"./chunk-bs0fjz3w.js";import"./chunk-0qkj838r.js";function i(Q){let $=Q.filter((G)=>G!==void 0);if($.length===0)return{cleanup:()=>{}};if($.length===1)return{signal:$[0],cleanup:()=>{}};let Z=new AbortController,Y=[],F=(G)=>{if(!Z.signal.aborted)Z.abort(G.reason)};for(let G of $){if(G.aborted){F(G);break}let V=()=>F(G);G.addEventListener("abort",V,{once:!0}),Y.push({signal:G,listener:V})}return{signal:Z.signal,cleanup:()=>{for(let{signal:G,listener:V}of Y)G.removeEventListener("abort",V)}}}var PQ={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function v(Q,$){let Z=Q.toLowerCase(),Y=Q.toUpperCase();return $?.[Z]||$?.[Y]||g(Z)||g(Y)||""}function AQ(Q){if(Q instanceof URL)return Q;try{return new URL(Q)}catch{return}}function UQ(Q,$,Z){let Y=v("no_proxy",Z).toLowerCase();if(!Y)return!0;if(Y==="*")return!1;return Y.split(/[,\s]/).every((F)=>{if(!F)return!0;let G=F.match(/^(.+):(\d+)$/),V=G?G[1]:F,j=G?Number.parseInt(G[2],10):0;if(j&&j!==$)return!0;if(!/^[.*]/.test(V))return Q!==V;if(V.startsWith("*"))V=V.slice(1);return!Q.endsWith(V)})}function wQ(Q,$){let Z=AQ(Q);if(!Z?.protocol||!Z.host)return"";let Y=Z.protocol.split(":",1)[0],F=Z.host.replace(/:\d*$/,""),G=Number.parseInt(Z.port,10)||PQ[Y]||0;if(!UQ(F,G,$))return"";let V=v(`${Y}_proxy`,$)||v("all_proxy",$);if(V&&!V.includes("://"))V=`${Y}://${V}`;return V}var CQ="Unsupported proxy protocol. SOCKS and PAC proxy URLs are not supported; use an HTTP or HTTPS proxy URL.";function a(Q,$){let Z=wQ(Q,$);if(!Z)return;let Y;try{Y=new URL(Z)}catch(F){throw Error(`Invalid proxy URL ${JSON.stringify(Z)}: ${F instanceof Error?F.message:String(F)}`)}if(Y.protocol!=="http:"&&Y.protocol!=="https:")throw Error(`${CQ} Got ${Y.protocol}`);return Y}function EQ(){if(typeof process>"u"||!(process.versions?.node||process.versions?.bun))return null;return process.getBuiltinModule?.("node:os")??null}var T=EQ(),fQ="https://chatgpt.com/backend-api",MQ="https://api.openai.com/auth",SQ=0,n=1000,TQ=60000,hQ=15000,IQ=3,jQ=new Set(["openai","openai-codex","opencode"]),xQ=1009,kQ="websocket_connection_limit_reached",bQ=new Set(["completed","incomplete","failed","cancelled","queued","in_progress"]);function gQ(Q){return/GoUsageLimitError|FreeUsageLimitError|Monthly usage limit reached|available balance|insufficient_quota|out of budget|quota exceeded|billing/i.test(Q)}function vQ(Q,$){if(Q===429&&gQ($))return!1;if(Q===429||Q===500||Q===502||Q===503||Q===504)return!0;return/rate.?limit|overloaded|service.?unavailable|upstream.?connect|connection.?refused/i.test($)}function yQ(Q){let $=Q.get("retry-after-ms");if($!==null){let G=Number($);if(Number.isFinite(G))return Math.max(0,G)}let Z=Q.get("retry-after");if(!Z)return;let Y=Number(Z);if(Number.isFinite(Y))return Math.max(0,Y*1000);let F=Date.parse(Z);if(!Number.isNaN(F))return Math.max(0,F-Date.now());return}function mQ(Q,$){let Z=$?.maxRetryDelayMs??TQ;return Z>0?Math.min(Q,Z):Q}function r(Q,$){return new Promise((Z,Y)=>{if($?.aborted){Y(Error("Request was aborted"));return}let F=setTimeout(Z,Q);$?.addEventListener("abort",()=>{clearTimeout(F),Y(Error("Request was aborted"))})})}function t(Q){if(Q===void 0)return;if(!Number.isFinite(Q)||Q<0)throw Error(`Invalid timeoutMs: ${String(Q)}`);return Math.floor(Q)}function uQ(){if(typeof process>"u"||!(process.versions?.node||process.versions?.bun))return null;return process.getBuiltinModule?.("node:zlib")??null}function cQ(Q){let $=uQ();if(!$||typeof $.zstdCompressSync!=="function")return null;try{let Z=$.zstdCompressSync(Q,{params:{[$.constants.ZSTD_c_compressionLevel]:IQ}});return new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength)}catch{return null}}var lQ=(Q,$,Z)=>{let Y=new QQ;return(async()=>{let F={role:"assistant",content:[],api:"openai-codex-responses",provider:Q.provider,model:Q.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let G=Z?.apiKey;if(!G)throw Error(`No API key for provider: ${Q.provider}`);let V=qZ(G),j=pQ(Q,$,Z),N=await Z?.onPayload?.(j,Q);if(N!==void 0)j=N;let X=Z?.sessionId||_Z(),W=OZ(Q.headers,Z?.headers,V,G,Z?.sessionId),J=RZ(Q.headers,Z?.headers,V,G,X),_=JSON.stringify(j),z=t(Z?.timeoutMs),q=t(Z?.websocketConnectTimeoutMs),D=Z?.transport||"auto",B=D!=="sse"&&BQ(Z?.sessionId);if(B)s(Z?.sessionId);if(D!=="sse"&&!B){let O=!1,H=!1;while(!0){O=!1;try{if(await WZ(iQ(Q.baseUrl),j,J,F,Y,Q,()=>{O=!0},z,q,Z),Z?.signal?.aborted)throw Error("Request was aborted");Y.push({type:"done",reason:F.stopReason,message:F}),Y.end();return}catch(A){let C=Z?.signal?.aborted,S=!O&&rQ(A);if(!C&&S&&!H){H=!0;continue}if(C||nQ(A)&&!S)throw A;if(zQ(F,JQ("provider_transport_failure",A,{configuredTransport:D,fallbackTransport:O?void 0:"sse",eventsEmitted:O,phase:O?"after_message_stream_start":"before_message_stream_start",requestBytes:new TextEncoder().encode(_).byteLength})),YZ(Z?.sessionId,A),O)throw A;s(Z?.sessionId);break}}}let R=cQ(_);if(R)W.set("content-encoding","zstd");let K=R??_,L,w,b=Z?.maxRetries??SQ;for(let O=0;O<=b;O++){if(Z?.signal?.aborted)throw Error("Request was aborted");try{let H=z!==void 0&&z>0?AbortSignal.timeout(z):void 0,A=i([Z?.signal,H]);try{L=await fetch(DQ(Q.baseUrl),{method:"POST",headers:W,body:K,signal:A.signal})}catch(E){if(H?.aborted&&!Z?.signal?.aborted)throw Error(`Codex SSE response headers timed out after ${z}ms`);throw E}finally{A.cleanup()}if(await Z?.onResponse?.({status:L.status,headers:u(L.headers)},Q),L.ok)break;let C=await L.text();if(O<b&&vQ(L.status,C)){let E=yQ(L.headers),HQ=E===void 0?n*2**O:L.status===429?mQ(E,Z):E;await r(HQ,Z?.signal);continue}let S=new Response(C,{status:L.status,statusText:L.statusText}),d=await BZ(S);throw Error(d.friendlyMessage||d.message)}catch(H){if(H instanceof Error){if(H.name==="AbortError"||H.message==="Request was aborted")throw Error("Request was aborted")}if(w=H instanceof Error?H:Error(String(H)),O<b&&!w.message.includes("usage limit")){let A=n*2**O;await r(A,Z?.signal);continue}throw w}}if(!L?.ok)throw w??Error("Failed after retries");if(!L.body)throw Error("No response body");if(Y.push({type:"start",partial:F}),await aQ(L,F,Y,Q,Z),Z?.signal?.aborted)throw Error("Request was aborted");Y.push({type:"done",reason:F.stopReason,message:F}),Y.end()}catch(G){for(let V of F.content)delete V.partialJson;F.stopReason=Z?.signal?.aborted?"aborted":"error",F.errorMessage=FQ(GQ(G)),Y.push({type:"error",reason:F.stopReason,error:F}),Y.end()}})(),Y},bZ=(Q,$,Z)=>{let Y=Z?.apiKey;if(!Y)throw Error(`No API key for provider: ${Q.provider}`);let F=YQ(Q,$,Z,Y),G=Z?.reasoning?ZQ(Q,Z.reasoning):void 0;return lQ(Q,$,{...F,reasoningEffort:G==="off"?void 0:G})};function pQ(Q,$,Z){let Y=$Q($,Q.compat?.supportsToolSearch??!1),F=c(Q,$,jQ,{includeSystemPrompt:!1,deferredTools:Y.deferred}),G={model:Q.id,store:!1,stream:!0,instructions:$.systemPrompt||"You are a helpful assistant.",input:F,text:{verbosity:Z?.textVerbosity||"low"},include:["reasoning.encrypted_content"],prompt_cache_key:VQ(Z?.sessionId),tool_choice:Z?.toolChoice??"auto",parallel_tool_calls:!0};if(Z?.temperature!==void 0)G.temperature=Z.temperature;if(Z?.serviceTier!==void 0)G.service_tier=Z.serviceTier;if(Y.immediate.length>0)G.tools=XQ(Y.immediate,{strict:null});if(Z?.reasoningEffort!==void 0){let V=Z.reasoningEffort==="none"?Q.thinkingLevelMap?.off??"none":Q.thinkingLevelMap?.[Z.reasoningEffort]??Z.reasoningEffort;if(V!==null)G.reasoning={effort:V,summary:Z.reasoningSummary??"auto"}}return G}function dQ(Q,$){switch($){case"flex":return 0.5;case"priority":return Q.id==="gpt-5.5"?2.5:2;default:return 1}}function KQ(Q,$,Z){let Y=dQ(Z,$);if(Y===1)return;Q.cost.input*=Y,Q.cost.output*=Y,Q.cost.cacheRead*=Y,Q.cost.cacheWrite*=Y,Q.cost.total=Q.cost.input+Q.cost.output+Q.cost.cacheRead+Q.cost.cacheWrite}function LQ(Q,$){if(Q==="default"&&($==="flex"||$==="priority"))return $;return Q??$}function DQ(Q){let Z=(Q&&Q.trim().length>0?Q:fQ).replace(/\/+$/,"");if(Z.endsWith("/codex/responses"))return Z;if(Z.endsWith("/codex"))return`${Z}/responses`;return`${Z}/codex/responses`}function iQ(Q){let $=new URL(DQ(Q));if($.protocol==="https:")$.protocol="wss:";if($.protocol==="http:")$.protocol="ws:";return $.toString()}async function aQ(Q,$,Z,Y,F){await l(WQ(oQ(Q,F?.signal)),$,Z,Y,{serviceTier:F?.serviceTier,resolveServiceTier:LQ,applyServiceTierPricing:(G,V)=>KQ(G,V,Y)})}class f extends Error{code;payload;constructor(Q,$){super(Q);this.name="CodexApiError",this.code=$?.code,this.payload=$?.payload,this.cause=$?.cause}}class k extends Error{payload;constructor(Q,$){super(Q);this.name="CodexProtocolError",this.payload=$?.payload,this.cause=$?.cause}}function nQ(Q){return Q instanceof f||Q instanceof k}function rQ(Q){return Q instanceof f&&Q.code===kQ}function tQ(Q){let $=Q.error&&typeof Q.error==="object"?Q.error:void 0;return{code:typeof Q.code==="string"?Q.code:typeof $?.code==="string"?$.code:void 0,message:typeof Q.message==="string"?Q.message:typeof $?.message==="string"?$.message:void 0}}async function*WQ(Q){for await(let $ of Q){let Z=typeof $.type==="string"?$.type:void 0;if(!Z)continue;if(Z==="error"){let{code:Y,message:F}=tQ($);throw new f(`Codex error: ${F||Y||JSON.stringify($)}`,{code:Y,payload:$})}if(Z==="response.failed"){let Y=$.response,F=Y?.error?.code,G=Y?.error?.message;throw new f(G||"Codex response failed",{code:F,payload:$})}if(Z==="response.done"||Z==="response.completed"||Z==="response.incomplete"){let Y=$.response,F=Y?{...Y,status:sQ(Y.status)}:Y;yield{...$,type:"response.completed",response:F};return}yield $}}function sQ(Q){if(typeof Q!=="string")return;return bQ.has(Q)?Q:void 0}async function*oQ(Q,$){if(!Q.body)return;let Z=Q.body.getReader(),Y=new TextDecoder,F="",G=()=>{Z.cancel().catch(()=>{})};$?.addEventListener("abort",G,{once:!0});try{while(!0){if($?.aborted)throw Error("Request was aborted");let{done:V,value:j}=await Z.read();if($?.aborted)throw Error("Request was aborted");if(V)break;F+=Y.decode(j,{stream:!0});let N=F.indexOf(`
|
|
3
3
|
|
|
4
4
|
`);while(N!==-1){let X=F.slice(0,N);F=F.slice(N+2);let W=X.split(`
|
|
5
5
|
`).filter((J)=>J.startsWith("data:")).map((J)=>J.slice(5).trim());if(W.length>0){let J=W.join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as U}from"./chunk-2g12s6mc.js";import"./chunk-f7sbkfmk.js";import"./chunk-fepymbka.js";import"./chunk-xyjw8w3r.js";import"./chunk-ccw7mjgq.js";import"./chunk-pq18zenh.js";import"./chunk-wsyg4rwg.js";import"./chunk-7e06b2zb.js";import"./chunk-srn8t0v7.js";import"./chunk-kfhtk3eh.js";import"./chunk-kr06nrbx.js";import"./chunk-b8js74jk.js";import"./chunk-0xbf8bcg.js";import{cf as N}from"./chunk-jf3vn5c3.js";import"./chunk-88fg1sw7.js";import{zf as K}from"./chunk-ry33f2qk.js";import"./chunk-77r8w95d.js";import"./chunk-t3t6021k.js";import"./chunk-54tr7y2x.js";import"./chunk-1xpec5r8.js";import"./chunk-0rxhc7ka.js";import"./chunk-fa2g2wge.js";import"./chunk-fz88kkk1.js";import"./chunk-dghtwyq1.js";import{bh as J}from"./chunk-gswbc6y9.js";import{Gh as G,Sh as H,mh as Z,oh as q,th as B,uh as D}from"./chunk-nyhqy6q2.js";import{Vk as Y}from"./chunk-0qkj838r.js";var V=Y(Z(),1);function _(){let{projectId:h,folderId:W}=z.useParams(),{teamId:v,ensureTeamIdForProject:w}=J();V.useEffect(()=>{w(h)},[h,w]);let{data:A}=D(N(h)),b=A?.rootFolder,{data:X}=B({queryKey:["folders",b],queryFn:()=>(async()=>{return await(await H.api.folders[":folderId"].$get({param:{folderId:b}})).json()})(),enabled:!!b});if(!v||!b||!X)return q(K,{});return q(U,{teamId:v,projectId:h,projectName:A.name??"",assetId:W,rootFolderId:b})}var z=G("/projects/$projectId/folders/$folderId")({component:_});export{z as Route};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-xg9xscqz.js";import{Ac as I,Sc as w}from"./chunk-
|
|
2
|
+
import"./chunk-xg9xscqz.js";import{Ac as I,Sc as w}from"./chunk-e7ndw3hg.js";import"./chunk-0aj303as.js";import"./chunk-0qkj838r.js";function R(q,$){if(typeof q==="string"&&typeof $==="string")return q.toLowerCase()===$.toLowerCase();return q===$}function y(q,$){if(typeof q!=="string")return $.includes(q);return $.some((E)=>typeof E==="string"&&q.toLowerCase()===E.toLowerCase())}function j(q,$){return!y(q,$)}function g(q,$){if(typeof q!=="string"||typeof $!=="string")return!1;return q.toLowerCase().includes($.toLowerCase())}function f(q,$){if(typeof q!=="string"||typeof $!=="string")return!1;return q.toLowerCase().startsWith($.toLowerCase())}function V(q,$){if(typeof q!=="string"||typeof $!=="string")return!1;return q.toLowerCase().endsWith($.toLowerCase())}var v=(q,$)=>{let E=null,M=w({config:{adapterId:"memory",adapterName:"Memory Adapter",usePlural:!1,debugLogs:$?.debugLogs||!1,supportsArrays:!0,customTransformInput(P){if(P.options.advanced?.database?.generateId==="serial"&&P.field==="id"&&P.action==="create")return q[P.model].length+1;return P.data},transaction:async(P)=>{let A=structuredClone(q);try{return await P(M(E))}catch(_){throw Object.keys(q).forEach((S)=>{q[S]=A[S]}),_}}},adapter:({getFieldName:P,getDefaultFieldName:A,options:_,getModelName:S})=>{let N=(x,K,Y)=>{if(!K)return x;return x.sort((L,Z)=>{let z=P({model:Y,field:K.field}),D=L[z],X=Z[z],Q=0;if(D==null&&X==null)Q=0;else if(D==null)Q=-1;else if(X==null)Q=1;else if(typeof D==="string"&&typeof X==="string")Q=D.localeCompare(X);else if(D instanceof Date&&X instanceof Date)Q=D.getTime()-X.getTime();else if(typeof D==="number"&&typeof X==="number")Q=D-X;else if(typeof D==="boolean"&&typeof X==="boolean")Q=D===X?0:D?1:-1;else Q=String(D).localeCompare(String(X));return K.direction==="asc"?Q:-Q})};function F(x,K,Y,L){let Z=(()=>{let X=q[K];if(!X)throw I.error(`[MemoryAdapter] Model ${K} not found in the DB`,Object.keys(q)),Error(`Model ${K} not found`);let Q=(G,O)=>{let{field:J,value:H,operator:B,mode:k="sensitive"}=O,U=k==="insensitive"&&(typeof H==="string"||Array.isArray(H)&&H.every((W)=>typeof W==="string"));switch(B){case"in":if(!Array.isArray(H))throw Error("Value must be an array");if(U)return y(G[J],H);return H.includes(G[J]);case"not_in":if(!Array.isArray(H))throw Error("Value must be an array");if(U)return j(G[J],H);return!H.includes(G[J]);case"contains":if(U)return g(G[J],H);return G[J]?.includes(H);case"starts_with":if(U)return f(G[J],H);return G[J].startsWith(H);case"ends_with":if(U)return V(G[J],H);return G[J].endsWith(H);case"ne":return U?!R(G[J],H):G[J]!==H;case"gt":return H!=null&&Boolean(G[J]>H);case"gte":return H!=null&&Boolean(G[J]>=H);case"lt":return H!=null&&Boolean(G[J]<H);case"lte":return H!=null&&Boolean(G[J]<=H);default:if(U)return R(G[J],H);if(H===null)return G[J]==null;return G[J]===H}},T=X.filter((G)=>{if(!x.length||x.length===0)return!0;let O=Q(G,x[0]);for(let J of x){let H=Q(G,J);if(J.connector==="OR")O=O||H;else O=O&&H}return O});if(L?.length&&L.length>0)T=T.map((G)=>Object.fromEntries(Object.entries(G).filter(([O])=>L.includes(A({model:K,field:O})))));return T})();if(!Y)return Z;let z=new Map,D=new Map;for(let X of Z){let Q=String(X.id);if(!z.has(Q)){let G={...X};for(let[O,J]of Object.entries(Y)){let H=S(O);if(J.relation==="one-to-one")G[H]=null;else G[H]=[],D.set(`${Q}-${O}`,new Set)}z.set(Q,G)}let T=z.get(Q);for(let[G,O]of Object.entries(Y)){let J=S(G),H=q[J];if(!H)throw I.error(`[MemoryAdapter] JoinOption model ${J} not found in the DB`,Object.keys(q)),Error(`JoinOption model ${J} not found`);let B=H.filter((k)=>k[O.on.to]===X[O.on.from]);if(O.relation==="one-to-one")T[J]=B[0]||null;else{let k=D.get(`${Q}-${G}`),U=O.limit??100,W=0;for(let C of B){if(W>=U)break;if(!k.has(C.id))T[J].push(C),k.add(C.id),W++}}}}return Array.from(z.values())}return{create:async({model:x,data:K})=>{if(_.advanced?.database?.generateId==="serial")K.id=q[S(x)].length+1;if(!q[x])q[x]=[];return q[x].push(K),K},findOne:async({model:x,where:K,select:Y,join:L})=>{let Z=F(K,x,L,Y);if(L){let z=Z;if(!z.length)return null;return z[0]}return Z[0]||null},findMany:async({model:x,where:K,sortBy:Y,limit:L,select:Z,offset:z,join:D})=>{let X=F(K||[],x,D,Z);if(D){let T=X;if(!T.length)return[];N(T,Y,x);let G=T;if(z!==void 0)G=G.slice(z);if(L!==void 0)G=G.slice(0,L);return G}let Q=N(X,Y,x);if(z!==void 0)Q=Q.slice(z);if(L!==void 0)Q=Q.slice(0,L);return Q||[]},count:async({model:x,where:K})=>{if(K)return F(K,x).length;return q[x].length},update:async({model:x,where:K,update:Y})=>{let L=F(K,x);return L.forEach((Z)=>{Object.assign(Z,Y)}),L[0]||null},delete:async({model:x,where:K})=>{let Y=q[x],L=F(K,x);q[x]=Y.filter((Z)=>!L.includes(Z))},deleteMany:async({model:x,where:K})=>{let Y=q[x],L=F(K,x),Z=0;return q[x]=Y.filter((z)=>{if(L.includes(z))return Z++,!1;return!L.includes(z)}),Z},consumeOne:async({model:x,where:K})=>{let Y=q[x],L=F(K,x)[0];if(!L)return null;return q[x]=Y.filter((Z)=>Z!==L),L},updateMany({model:x,where:K,update:Y}){let L=F(K,x);return L.forEach((Z)=>{Object.assign(Z,Y)}),L[0]||null}}}});return(P)=>{return E=P,M(P)}};export{v as memoryAdapter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{gk as o,oh as a}from"./chunk-nyhqy6q2.js";function l({className:t,...e}){return a("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:a("table",{"data-slot":"table",className:o("w-full caption-bottom text-sm",t),...e})})}function n({className:t,...e}){return a("thead",{"data-slot":"table-header",className:o("[&_tr]:border-b",t),...e})}function c({className:t,...e}){return a("tbody",{"data-slot":"table-body",className:o("[&_tr:last-child]:border-0",t),...e})}function d({className:t,...e}){return a("tr",{"data-slot":"table-row",className:o("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",t),...e})}function s({className:t,...e}){return a("th",{"data-slot":"table-head",className:o("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e})}function b({className:t,...e}){return a("td",{"data-slot":"table-cell",className:o("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e})}
|
|
2
2
|
export{l as a,n as b,c,d,s as e,b as f};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Of as Rf,Pf as Lf,Qf as Vf,Rf as Cf,Wf as Hf,Xf as Jf,Yf as Kf,Zf as Qf,_f as Wf,bg as _f}from"./chunk-77r8w95d.js";import{hg as Zf,ig as Gf}from"./chunk-54tr7y2x.js";import{jg as zf}from"./chunk-1xpec5r8.js";import{pg as $f}from"./chunk-fa2g2wge.js";import{$g as l,Rg as Sf,Sg as a,Tg as Nf,Ug as Uf,Vg as W,Yg as qf,Zg as g,_g as p,ah as c,ch as Xf}from"./chunk-gswbc6y9.js";import{Bh as u,Dh as d,Mi as n,Sh as i,Ti as o,Wi as s,Zh as x,_i as ff,gk as D,mk as X,nh as O,oh as f,ph as V,qi as e,vi as j,wi as r}from"./chunk-nyhqy6q2.js";function Yf({teamId:K,projectId:L,projectName:_,ancestorFolders:B,currentAsset:U,isRootFolder:Y,displayStyle:E,onDisplayStyleChange:h,isLeftSidebarCollapsed:P,onLeftSidebarToggle:T,isRightSidebarCollapsed:$,onRightSidebarToggle:v,isChatbotOpen:Z=!1,onChatbotToggle:N,isPublic:Q=!1,onFolderClick:w,fileId:q,shareId:G,downloadInfo:z,versions:S,compareMode:J=!1,canCompareVersions:b=!1,onCompareVersions:A}){let k=u(),{canEdit:y}=Xf(L),I=!1,m=(R)=>{if(!q)return;if(Q&&G){k({to:"/share/$shareId/files/$fileId",params:{shareId:G,fileId:q},search:(C)=>({...C,version:R})});return}if(!L)return;k({to:"/projects/$projectId/files/$fileId",params:{projectId:L,fileId:q},search:(C)=>({...C,version:R})})},M=async(R)=>{if(!q)return;try{let C=G?await i.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:G,fileId:q},json:{key:R}}):await i.api.files["download-url"].$post({json:{key:R,assetId:q}});if(!C.ok)return;let{url:H}=await C.json(),F=document.createElement("a");F.href=H,F.download="",document.body.appendChild(F),F.click(),document.body.removeChild(F)}catch{}},Bf=U.proxyType!=="audio"&&z?.videoTranscodes&&z.videoTranscodes.filter((R)=>!R.isRaw).length>0,Ef=Q?[{name:_,id:"root"},...B.slice().reverse().map((R)=>({name:R.name||"",id:R.id}))]:[{name:X.all_projects(),path:`/teams/${K}`,isMuted:!0},{name:_,path:`/projects/${L}`},...B.slice().reverse().map((R)=>({name:R.name||"",path:`/projects/${L}/folders/${R.id}`}))];return V("div",{className:"flex h-14 flex-wrap items-center justify-between gap-2 border-b border-border bg-card px-4 py-2",children:[V("div",{className:"flex min-w-0 flex-shrink items-center gap-1",children:[Ef.map((R,C)=>V("div",{className:"flex items-center gap-1",children:[C>0&&f("span",{className:"text-muted-foreground",children:"/"}),R.path?f(d,{to:R.path,className:D("truncate rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground",R.isMuted?"text-muted-foreground":"text-foreground"),children:R.name}):f("button",{onClick:()=>R.id&&w?.(R.id),className:"truncate rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground text-foreground",children:R.name})]},C)),!Y&&!J&&V("div",{className:"flex items-center gap-1",children:[f("span",{className:"text-muted-foreground",children:"/"}),U.type==="folder"?f("span",{className:"truncate rounded px-2 py-1 text-sm font-medium text-foreground",children:U.name}):V(Sf,{children:[V(Nf,{className:"flex items-center gap-1 truncate rounded px-2 py-1 text-sm font-medium text-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:[f("span",{children:U.name}),U.version!==void 0&&V(zf,{variant:"outline",className:"px-1 py-0 text-xs",children:["v",U.version]}),f(r,{className:"h-4 w-4"})]}),V(Uf,{className:"w-56",children:[Bf?V(p,{children:[f(l,{className:"flex items-center gap-2",children:f("span",{children:X.download()})}),f(a,{children:V(c,{className:"w-48",children:[f(qf,{children:X.download()}),z?.videoTranscodes?.filter((R)=>!R.isRaw).map((R)=>{let C=Math.max(R.width,R.height),H=`${R.height}p`;if(C>=3840)H="2160p";else if(C>=1920)H="1080p";else if(C>=1280)H="720p";else if(C>=960)H="540p";else if(C>=640)H="360p";else if(C>=320)H="180p";return V(W,{onClick:()=>M(R.key),className:"flex items-center justify-between",children:[f("span",{children:H}),f("span",{className:"text-xs text-muted-foreground",children:"MP4"})]},H)}),z?.originalKey&&V(O,{children:[f(g,{}),V(W,{onClick:()=>M(z.originalKey),className:"flex items-center justify-between",children:[f("span",{children:"Original"}),f("span",{className:"text-xs text-muted-foreground",children:U.name?.split(".").pop()?.toUpperCase()||"RAW"})]})]})]})})]}):f(W,{onClick:()=>z?.originalKey&&M(z.originalKey),disabled:!z?.originalKey,children:X.download()}),y&&f(W,{onClick:()=>console.log("Rename"),children:"Rename"}),y&&f(W,{onClick:()=>console.log("Delete"),children:"Delete"}),b&&A&&V(O,{children:[f(g,{}),V(W,{onClick:()=>A(),children:[f(x,{className:"h-4 w-4"}),f("span",{children:X.compare_versions()})]})]}),S&&S.length>0&&V(O,{children:[f(g,{}),V(p,{children:[V(l,{className:"flex items-center gap-2",children:[f(o,{className:"h-4 w-4"}),f("span",{children:"Versions"})]}),f(a,{children:V(c,{className:"w-80 p-1",children:[f("div",{className:"flex flex-col gap-1 max-h-96 overflow-y-auto",children:S.map((R)=>{let C=U.version===R.version;return V(W,{onClick:()=>m(R.id),className:"flex items-center gap-3 py-2 px-3 rounded-md cursor-pointer focus:bg-accent focus:text-accent-foreground",children:[V("div",{className:"flex-shrink-0 flex items-center justify-center bg-muted dark:bg-muted-foreground/20 text-muted-foreground dark:text-muted-foreground rounded-full px-2 py-0.5 text-xs font-semibold select-none min-w-[2rem]",children:["v",R.version]}),f("div",{className:"h-10 w-16 flex-shrink-0 overflow-hidden rounded-md border border-border bg-muted flex items-center justify-center",children:R.previewUrl?f("img",{src:R.previewUrl,alt:R.name||void 0,className:"h-full w-full object-cover"}):f(n,{className:"h-4 w-4 text-muted-foreground"})}),V("div",{className:"flex flex-col flex-1 min-w-0 text-left",children:[f("span",{className:"truncate text-sm font-semibold text-foreground",children:R.name}),f("span",{className:"truncate text-xs text-muted-foreground",children:R.creator?.name||"Unknown"})]}),C&&f(j,{className:"h-4 w-4 text-primary ml-auto flex-shrink-0"})]},R.id)})}),f(g,{}),f("div",{className:"p-1",children:f("button",{className:"w-full text-center text-xs font-medium py-2 px-3 rounded-md bg-muted/80 hover:bg-muted text-foreground transition-colors",onClick:()=>console.log("Manage versions"),children:"Manage versions..."})})]})})]})]})]})]})]})]}),V("div",{className:"flex items-center gap-2",children:[V("div",{className:"flex flex-shrink-0 items-center gap-1 rounded-md border border-border bg-background p-1",children:[!q&&!Q&&T&&f("button",{onClick:T,className:"rounded p-1.5 text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",title:P?"Show Left Sidebar":"Hide Left Sidebar",children:P?f(Hf,{className:"h-4 w-4"}):f(Kf,{className:"h-4 w-4 fill-primary stroke-0"})}),!q&&!Q&&E&&h&&V(O,{children:[f("button",{onClick:()=>h("card"),className:`rounded p-1.5 transition-colors ${E==="card"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:"Card View",children:f(s,{className:"h-4 w-4"})}),f("button",{onClick:()=>h("list"),className:`rounded p-1.5 transition-colors ${E==="list"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:"List View",children:f(ff,{className:"h-4 w-4"})})]}),f("button",{onClick:v,className:`rounded p-1.5 transition-colors ${!$&&!Z?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:$?"Show Right Sidebar":"Hide Right Sidebar",children:!$&&!Z?f(Qf,{className:"h-4 w-4 fill-primary stroke-0"}):f(Jf,{className:"h-4 w-4"})})]}),!Q&&N&&f(Rf,{children:V(Lf,{children:[f(Vf,{asChild:!0,children:f("span",{children:f("button",{disabled:!1,onClick:N,className:D("h-9 w-9 flex items-center justify-center rounded-full border border-border bg-background transition-colors",Z?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground",!1),children:Z?f(Wf,{className:"h-6 w-6 text-primary transition-colors"}):f(e,{className:"h-6 w-6 text-muted-foreground transition-colors"})})})}),f(Cf,{children:f("p",{children:Z?X.hide_chatbot():X.show_chatbot()})})]})})]})]})}function cf(){let{projectState:K}=Zf(),L=$f(),{isChatbotOpen:_,setIsChatbotOpen:B}=Gf();if(!K)return f(hf,{});let{teamId:U,projectId:Y,projectName:E,ancestorFolders:h,currentAsset:P,isRootFolder:T,fileId:$,downloadInfo:v,versions:Z,isPublic:N,shareId:Q,onFolderClick:w,compareMode:q,canCompareVersions:G,onCompareVersions:z}=K,S=!!$,J=!!Q&&!S,b=S?L.fileViewLeftSidebarCollapsed:J?L.shareConfigLeftSidebarCollapsed:L.fileListLeftSidebarCollapsed,A=N?void 0:()=>S?L.setFileViewLeftSidebarCollapsed(!L.fileViewLeftSidebarCollapsed):J?L.setShareConfigLeftSidebarCollapsed(!L.shareConfigLeftSidebarCollapsed):L.setFileListLeftSidebarCollapsed(!L.fileListLeftSidebarCollapsed),k=N&&K.isRightSidebarCollapsed!==void 0?K.isRightSidebarCollapsed:S?L.fileViewRightSidebarCollapsed:J?L.shareConfigRightSidebarCollapsed:L.fileListRightSidebarCollapsed,y=N&&K.onRightSidebarToggle?K.onRightSidebarToggle:()=>{if(!N&&_)if(B(!1),S)L.setFileViewRightSidebarCollapsed(!1);else if(J)L.setShareConfigRightSidebarCollapsed(!1);else L.setFileListRightSidebarCollapsed(!1);else if(S)L.setFileViewRightSidebarCollapsed(!L.fileViewRightSidebarCollapsed);else if(J)L.setShareConfigRightSidebarCollapsed(!L.shareConfigRightSidebarCollapsed);else L.setFileListRightSidebarCollapsed(!L.fileListRightSidebarCollapsed)},I=N?void 0:()=>{B(!_)},m=Y?L.viewModes[Y]??"card":"card";return f(Yf,{teamId:U,projectId:Y,projectName:E,ancestorFolders:h,currentAsset:P,isRootFolder:T,displayStyle:S||J?void 0:m,onDisplayStyleChange:S||J?void 0:N?void 0:(t)=>{if(Y)L.setViewMode(Y,t)},isLeftSidebarCollapsed:b,onLeftSidebarToggle:A,isRightSidebarCollapsed:k,onRightSidebarToggle:y,isChatbotOpen:!N&&_,onChatbotToggle:I,isPublic:N,shareId:Q,fileId:$,downloadInfo:v,versions:Z,onFolderClick:w,compareMode:q,canCompareVersions:G,onCompareVersions:z})}function hf(){return f("div",{className:"flex h-14 flex-wrap items-center justify-center gap-2 border-b border-border bg-card px-4 py-2 flex-shrink-0",children:f(_f,{className:"w-10 h-10 text-orange-600"})})}
|
|
2
|
+
export{cf as pf};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ng as e}from"./chunk-0rxhc7ka.js";import{$j as n,ak as C,gk as s,oh as r,ph as l,vi as x,wi as f,zi as b}from"./chunk-nyhqy6q2.js";function se({...t}){return r(n.Root,{"data-slot":"select",...t})}function pe({...t}){return r(n.Value,{"data-slot":"select-value",...t})}function ce({className:t,size:o="default",children:i,...p}){return l(n.Trigger,{"data-slot":"select-trigger","data-size":o,className:s("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",t),...p,children:[i,r(n.Icon,{asChild:!0,children:r(f,{className:"size-4 opacity-50"})})]})}function le({className:t,children:o,position:i="item-aligned",align:p="center",...d}){return r(n.Portal,{children:l(n.Content,{"data-slot":"select-content",className:s("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",i==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:i,align:p,...d,children:[r(T,{}),r(n.Viewport,{className:s("p-1",i==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:o}),r(w,{})]})})}function me({className:t,children:o,...i}){return l(n.Item,{"data-slot":"select-item",className:s("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...i,children:[r("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:r(n.ItemIndicator,{children:r(x,{className:"size-4"})})}),r(n.ItemText,{children:o})]})}function T({className:t,...o}){return r(n.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:s("flex cursor-default items-center justify-center py-1",t),...o,children:r(b,{className:"size-4"})})}function w({className:t,...o}){return r(n.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:s("flex cursor-default items-center justify-center py-1",t),...o,children:r(f,{className:"size-4"})})}var c=e.object({cursor:e.string().optional(),total:e.number().optional(),totalSize:e.number().optional()}),a=e.object({first:e.coerce.number().optional(),after:e.string().optional()});var he=e.object({name:e.string()}),A=e.object({id:e.string(),name:e.string(),rootFolder:e.string().optional(),updatedAt:e.union([e.string(),e.date()])});var xe=e.object({data:e.array(A),pageInfo:c}),be=e.object({teamId:e.string(),userId:e.string()}),Re=e.object({id:e.string(),name:e.string(),email:e.string().optional(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),image:e.string().optional(),unreadNotificationCount:e.number().optional()}),Ie=e.object({name:e.string().optional(),imageKey:e.string().nullable().optional()}),ve=e.object({id:e.string(),name:e.string(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),email:e.string().optional(),type:e.enum(["human","agent"]).optional(),image:e.string().optional(),scope:e.enum(["team","project"]).optional()}),qe=e.object({includeAgents:e.string().optional().transform((t)=>t==="true")}),N={best_match:"best_match",all:"all"},je=e.union([e.object({key:e.literal("transcode.videoStrategy"),value:e.nativeEnum(N)})]),Pe=e.object({allowedDomains:e.array(e.string()),pendingDomains:e.array(e.string()).default([])});var ke=e.object({role:e.enum(["editor","reviewer"])});var R=e.enum(["chat","autofill","embedding"]),I=e.enum(["off","minimal","low","medium","high","xhigh"]),F=e.object({id:e.string().optional(),skillId:e.string(),skill:e.object({id:e.string(),name:e.string()}).optional()}),Te=e.object({id:e.string(),name:e.string(),type:R,enabled:e.boolean(),avatar:e.string().optional(),providerId:e.string().optional(),modelId:e.string().optional(),thinkingLevel:I.optional().default("off"),systemPrompt:e.string().optional(),soul:e.string().optional(),skills:e.array(F).optional(),deniedTools:e.array(e.string()).optional()}),v=e.object({name:e.string().min(1),type:R,enabled:e.boolean().optional().default(!0),avatar:e.string().optional(),providerId:e.string().optional(),modelId:e.string().optional(),thinkingLevel:I.optional().default("off"),systemPrompt:e.string().optional(),soul:e.string().optional(),skills:e.array(e.string()).optional(),deniedTools:e.array(e.string()).optional()}),we=v.superRefine((t,o)=>{if(t.type==="chat"||t.type==="autofill"){if(!t.providerId)o.addIssue({code:e.ZodIssueCode.custom,message:"providerId is required for chat/autofill agents",path:["providerId"]});if(!t.modelId)o.addIssue({code:e.ZodIssueCode.custom,message:"modelId is required for chat/autofill agents",path:["modelId"]})}}),Ae=v.superRefine((t,o)=>{if(t.type==="chat"||t.type==="autofill"){if(!t.providerId)o.addIssue({code:e.ZodIssueCode.custom,message:"providerId is required for chat/autofill agents",path:["providerId"]});if(!t.modelId)o.addIssue({code:e.ZodIssueCode.custom,message:"modelId is required for chat/autofill agents",path:["modelId"]})}}),Ne=e.object({id:e.string(),sessionId:e.string(),entry:e.unknown()});var Le=e.object({apiKey:e.string().optional(),baseUrl:e.string().optional(),chatModels:e.array(e.string()).optional()}),M=e.enum(["1h","24h","7d","30d"]),Ve=e.object({timeframe:M.default("30d"),userId:e.string().optional()});var Ee=e.object({data:e.array(e.lazy(()=>D)),pageInfo:c}),q=e.object({proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional(),thumbnailUrl:e.string().optional(),originalHeight:e.number().optional(),originalWidth:e.number().optional(),spriteUrl:e.string().optional(),duration:e.number().optional(),pageCount:e.number().optional()}),L=e.object({type:e.string().nullable(),preview:q.nullable()}),m=e.object({id:e.string(),name:e.string(),image:e.string().optional()}),V=e.object({fieldId:e.string(),value:e.any()}),B=e.object({id:e.string(),name:e.string()}),O=e.object({duration:e.number().optional(),originalWidth:e.number().optional(),originalHeight:e.number().optional(),frameRate:e.number().optional(),totalFrames:e.number().optional(),startTimecode:e.string().optional()}),D=e.object({id:e.string(),name:e.string(),sizeByte:e.number(),fileCount:e.number(),type:e.string(),targetType:e.string().optional().nullable(),status:e.string(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional(),latestChildren:e.array(L).optional(),preview:q.nullable().optional(),createdAt:e.string(),updatedAt:e.string(),deletedAt:e.string().nullable().optional(),projectId:e.string().optional().nullable(),creator:m.nullable().optional(),fieldValues:e.array(V).optional(),sortIndex:e.string().optional().nullable(),startTime:e.number().optional().nullable(),endTime:e.number().optional().nullable(),media:e.object({original:e.object({downloadUrl:e.string(),key:e.string().optional()}).optional(),videoTranscodes:e.array(e.object({id:e.string(),url:e.string(),key:e.string(),width:e.number(),height:e.number(),size:e.number(),isRaw:e.boolean()})).optional(),imageTranscodes:e.array(e.object({id:e.string(),url:e.string(),key:e.string(),width:e.number(),height:e.number(),size:e.number(),isRaw:e.boolean()})).optional(),videoPreview:e.object({url:e.string(),key:e.string().optional()}).optional(),pdfTranscode:e.object({url:e.string(),key:e.string().optional()}).optional(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional(),metadata:O.optional()}).optional(),ancestorFolders:e.array(B).optional(),versionStack:e.object({id:e.string(),versions:e.array(e.object({version:e.number(),current:e.boolean(),id:e.string(),name:e.string().optional().nullable(),previewUrl:e.string().optional().nullable(),creator:e.object({id:e.string(),name:e.string().nullable()}).nullable().optional()}))}).optional().nullable()}),Ge=e.object({name:e.string(),type:e.string(),projectId:e.string().optional(),parentId:e.string().optional(),key:e.string().optional(),sizeByte:e.number().optional(),contentType:e.string().optional(),creatorId:e.string().optional()}),Qe=e.object({assetId:e.string()}),_e=e.object({id:e.string(),name:e.string()}),Ze=e.object({assetId:e.string().optional(),assetType:e.string(),projectId:e.string().optional(),showDeleted:e.boolean().optional(),prefix:e.string().optional(),sort:e.string().optional(),order:e.string().optional(),...a.shape}),Ke=e.object({assetId:e.string(),userId:e.string(),replyToId:e.string().optional(),message:e.string(),annotations:e.any().optional(),second:e.number().optional(),attachmentIds:e.array(e.string())}),E=e.object({id:e.string(),assetId:e.string(),url:e.string(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional()}),G=e.object({id:e.string(),assetId:e.string(),message:e.string().nullable(),annotations:e.any(),second:e.number().nullable(),creator:m,replies:e.array(e.lazy(()=>G)),attachments:e.array(E),mentions:e.array(m),createdAt:e.string(),updatedAt:e.string(),sessionId:e.string().nullable(),isCompleted:e.boolean(),completionLastChangedBy:m.nullable()}),He=e.object({isCompleted:e.boolean()}),Je=e.object({newParentId:e.string(),assetIds:e.array(e.string()),creatorId:e.string().optional()}),We=e.object({newParentId:e.string(),assetIds:e.array(e.string()),withComments:e.boolean().default(!1),creatorId:e.string().optional()}),Xe=e.object({name:e.string()}),Ye=e.object({beforeIndex:e.string().optional(),afterIndex:e.string().optional()}),$e=e.object({ids:e.array(e.string())}),ze=e.object({ids:e.array(e.string())}),et=e.object({file:e.instanceof(File)}),tt=e.object({key:e.string()}),ot=e.object({fileName:e.string(),contentType:e.string(),size:e.number()}),rt=e.object({id:e.string(),uploadUrl:e.string()}),nt=e.object({ids:e.array(e.string())}),Q=e.object({id:e.string(),name:e.string(),url:e.string()}),it=e.object({files:e.array(Q)});var pt=e.object({userCount:e.number()}),ct=e.object({name:e.string().min(1,"Name is required").max(100,"Name is too long")}),lt=e.object({id:e.string(),token:e.string(),name:e.string(),createdAt:e.string()});var _=e.enum(["is","eq","neq","gt","gte","lt","lte","contains","notContains","isEmpty","isNotEmpty","in","notIn","hasAny","hasAll","hasNone","isWithin"]),Z=e.object({field:e.string(),operator:_,value:e.any()}),K=e.enum(["asc","desc"]),H=e.object({field:e.string(),order:K}),J=e.enum(["AND","OR"]),W=e.enum(["file","folder"]),u=e.object({operator:J.optional().default("AND"),conditions:e.array(Z).optional().default([]),sort:H.optional(),assetType:W.optional(),showSymlink:e.boolean().optional(),recursively:e.boolean().optional().default(!0),query:e.string().optional(),isSemantic:e.boolean().optional().default(!1)}),ut=u.extend(a.shape);var g=e.object({sourceFolderId:e.string(),searchFilter:u}),X=e.object({id:e.string(),name:e.string(),filter:g,projectId:e.string(),createdAt:e.string(),updatedAt:e.string(),creator:e.object({id:e.string(),name:e.string(),image:e.string().optional().nullable()}).optional().nullable()}),xt=e.object({name:e.string(),filter:g}),bt=e.object({name:e.string().optional(),filter:g.optional()});var Rt=e.object({data:e.array(X),pageInfo:e.object({cursor:e.string().optional(),total:e.number().optional()})});var qt=e.object({name:e.string(),parentId:e.string()}),jt=e.object({name:e.string()}),Pt=e.object({ids:e.array(e.string())}),kt=e.object({ids:e.array(e.string())});var Tt=e.object({code:e.string(),role:e.enum(["editor","reviewer","owner"]),teamId:e.string(),teamName:e.string(),projectId:e.string().optional(),projectName:e.string().optional(),inviterName:e.string(),isUsed:e.boolean()}),wt=e.object({role:e.enum(["editor","reviewer"])}),At=e.object({role:e.enum(["editor","reviewer"])}),Nt=e.object({code:e.string()});var Lt={text:"text",longText:"longText",select:"select",selectMulti:"selectMulti",rating:"rating",number:"number",toggle:"toggle",date:"date",user:"user",userMulti:"userMulti"},Vt=e.object({id:e.string(),displayName:e.string(),color:e.string().optional()}),y=e.object({name:e.string(),type:e.enum(["text","longText","select","selectMulti","rating","number","toggle","date","user","userMulti"]),text:e.any().optional(),longText:e.any().optional(),select:e.any().optional(),selectMulti:e.any().optional(),rating:e.any().optional(),number:e.any().optional(),toggle:e.any().optional(),date:e.any().optional(),user:e.any().optional(),userMulti:e.any().optional()}),Bt=e.object({key:e.string().optional(),label:e.string().optional(),scope:e.string().optional(),config:y,aiAutofill:e.boolean().default(!1),description:e.string().default("")}),Ot=e.object({label:e.string().optional(),config:y,aiAutofill:e.boolean().optional(),description:e.string().optional()}),Y=e.object({fieldId:e.string(),visible:e.boolean()}),Dt=e.array(Y),$=e.object({key:e.string(),value:e.any()}),Et=e.array($),Gt=e.object({id:e.string(),config:y,scope:e.string(),readOnly:e.boolean(),visible:e.boolean(),description:e.string(),aiAutofill:e.boolean()});var j=e.object({id:e.string().optional(),name:e.string().optional(),role:e.string().optional()}),P=e.object({id:e.string().optional(),name:e.string().optional()}),z=e.object({id:e.string().optional(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional(),name:e.string().optional(),preview:e.string().optional(),thumbnailUrl:e.string().optional(),originalWidth:e.number().optional(),originalHeight:e.number().optional()}),Zt=e.object({id:e.string().optional(),creator:j.optional(),type:e.string().optional(),team:P.optional(),project:P.optional(),asset:z.optional(),user:j.optional(),createdAt:e.string().optional(),isRead:e.boolean().optional()}),Kt=e.object({unreadOnly:e.union([e.boolean(),e.string()]).transform((t)=>t===!0||t==="true").optional(),after:e.string().optional(),pageSize:e.coerce.number().optional()}),Ht=e.object({notificationId:e.string().min(1)}),Jt=e.object({comments:e.boolean().default(!0),replies:e.boolean().default(!0),mentions:e.boolean().default(!0),yourUploads:e.boolean().default(!1),otherUploads:e.boolean().default(!0),statusUpdates:e.boolean().default(!0)});var $t=e.object({name:e.string(),coverImageKey:e.string().optional(),enableNotification:e.boolean().default(!0)}),zt=e.object({name:e.string().optional(),coverImageKey:e.string().optional(),enableNotification:e.boolean().optional()}),ee=e.object({id:e.string(),name:e.string(),teamId:e.string(),rootFolder:e.string().optional(),coverImage:e.string().optional(),coverImageKey:e.string().optional(),enableNotification:e.boolean(),updatedAt:e.union([e.string(),e.date()])}),eo=e.object({sortBy:e.string().optional(),sortDirection:e.enum(["asc","desc"]).optional()}).merge(a),to=e.object({data:e.array(ee),pageInfo:c}),oo=e.object({teamId:e.string()}),ro=e.object({id:e.string(),name:e.string(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),image:e.string().optional(),scope:e.enum(["team","project"]).optional()}),no=e.object({id:e.string(),name:e.string()}),io=e.object({assetType:e.string(),sort:e.enum(["createdAt","name","size"]).optional(),order:e.enum(["asc","desc"]).optional()}).merge(a),ao=e.object({role:e.enum(["editor","reviewer"])}),so=e.object({userId:e.string(),role:e.enum(["owner","editor","reviewer"])}),po=e.object({id:e.string(),name:e.string(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),image:e.string().optional()});var k=["openai-completions","mistral-conversations","openai-responses","azure-openai-responses","openai-codex-responses","anthropic-messages","bedrock-converse-stream","google-generative-ai","google-vertex"],te=e.object({api:e.enum(k).optional(),reasoning:e.boolean().default(!1),input:e.array(e.enum(["text","image"])).default(["text"]),contextWindow:e.number().int().positive().default(128000),maxTokens:e.number().int().positive().default(4096),cost:e.object({input:e.number().nonnegative().default(0),output:e.number().nonnegative().default(0),cacheRead:e.number().nonnegative().default(0),cacheWrite:e.number().nonnegative().default(0)})}),S=e.object({id:e.string().optional(),modelId:e.string().min(1,"Model ID is required"),name:e.string().min(0).default(""),config:te}),h=e.object({baseUrl:e.string().url("Must be a valid URL").optional().or(e.literal("")),apiKey:e.string().optional().or(e.literal("")),api:e.enum(k),headers:e.record(e.string(),e.string()).optional(),authHeader:e.boolean().optional()}),mo=e.object({name:e.string().min(1,"Provider name is required"),config:h,models:e.array(S).min(1,"At least one model is required")}),fo=e.object({config:h,models:e.array(S).min(1,"At least one model is required")}),uo=e.object({id:e.string(),name:e.string(),isBuiltin:e.boolean(),config:h,models:e.array(S).optional(),modelsCount:e.number().optional(),createdAt:e.date(),updatedAt:e.date()});var ho=e.object({name:e.string().min(1),expireAt:e.string().datetime().optional(),password:e.string().optional(),isDisabled:e.boolean().optional(),defaultSortOrder:e.string().optional(),viewMode:e.string().optional()}),xo=e.object({name:e.string().min(1).optional(),expireAt:e.string().datetime().optional().nullable(),password:e.string().optional().nullable(),isDisabled:e.boolean().optional(),defaultSortOrder:e.string().optional().nullable(),viewMode:e.string().optional().nullable(),fieldVisibility:e.record(e.string(),e.boolean()).optional().nullable()}),bo=a.extend({projectId:e.string().optional()}),Ro=e.object({assetIds:e.array(e.string().min(1)).min(1)});var qo=e.object({assetId:e.string().optional(),githubUrl:e.string().optional(),override:e.boolean().optional()}),jo=e.object({config:e.object({environmentVariables:e.array(e.object({name:e.string(),default:e.string().optional()}))})}),Po=e.object({permission:e.enum(["owner","editor","reviewer"])});var U=e.lazy(()=>e.object({name:e.string(),id:e.string(),size:e.number(),children:e.array(U),type:e.string(),mediaType:e.string().optional()})),Co=e.object({parentId:e.string(),files:e.array(U)}),oe=e.object({id:e.string(),fileId:e.string(),url:e.string()}),To=e.object({taskId:e.string(),presignedUrls:e.array(oe),createdAssets:e.array(e.object({tempId:e.string(),assetId:e.string()})).optional()}),wo=e.object({fileId:e.string(),errorMessage:e.string().optional()}),Ao=e.object({id:e.string(),name:e.string(),total:e.number(),uploaded:e.number(),createdAt:e.string()}),No=e.object({bucket:e.string(),key:e.string(),Signature:e.string()}),Fo=e.object({file:e.instanceof(File)});var re=e.object({key:e.string(),value:e.unknown()}),Vo=e.object({value:e.unknown()}),Bo=e.array(re);var Eo=e.object({fileIds:e.array(e.string())}),Go=e.object({fileId:e.string(),beforeId:e.string()});var Zo=e.object({agentId:e.string(),textPrompt:e.string().optional(),attachedFiles:e.array(e.string()).optional(),assetIds:e.array(e.string()).optional(),sessionId:e.string().optional(),contextAssetId:e.string().optional(),projectId:e.string().optional()}).superRefine((t,o)=>{let i=t.textPrompt&&t.textPrompt.trim().length>0,p=t.attachedFiles&&t.attachedFiles.length>0,d=t.assetIds&&t.assetIds.length>0;if(!i&&!p&&!d)o.addIssue({code:e.ZodIssueCode.custom,message:"At least one of textPrompt, attachedFiles, or assetIds must be provided.",path:["textPrompt"]})}),Ko=e.object({id:e.string(),agentId:e.string(),userId:e.string().nullable(),assetId:e.string().nullable(),userCommentId:e.string().nullable(),name:e.string().nullable().optional(),createdAt:e.string(),updatedAt:e.string()}),Ho=e.intersection(e.object({id:e.string()}),e.unknown());function xr({className:t,orientation:o="horizontal",decorative:i=!0,...p}){return r(C.Root,{"data-slot":"separator",decorative:i,orientation:o,className:s("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...p})}
|
|
2
|
+
export{se as V,pe as W,ce as X,le as Y,me as Z,I as _,Lt as $,k as aa,S as ba,h as ca,N as da,xr as ea};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Rk as s}from"./chunk-976v5s8y.js";var zn={};s(zn,{xor:()=>Zl,xid:()=>kl,void:()=>Bl,uuidv7:()=>$l,uuidv6:()=>ul,uuidv4:()=>el,uuid:()=>vl,url:()=>gl,unknown:()=>mr,union:()=>gt,undefined:()=>Tl,ulid:()=>Ul,uint64:()=>Ql,uint32:()=>ql,tuple:()=>Q$,transform:()=>ct,templateLiteral:()=>uc,symbol:()=>Fl,superRefine:()=>cg,success:()=>tc,stringbool:()=>Uc,stringFormat:()=>Ll,string:()=>On,strictObject:()=>Rl,set:()=>pl,refine:()=>lg,record:()=>F$,readonly:()=>og,promise:()=>$c,preprocess:()=>Dc,prefault:()=>y$,pipe:()=>di,partialRecord:()=>hl,optional:()=>Pn,object:()=>xl,number:()=>N$,nullish:()=>ic,nullable:()=>Jn,null:()=>J$,nonoptional:()=>a$,never:()=>$t,nativeEnum:()=>sl,nanoid:()=>Il,nan:()=>oc,meta:()=>bc,map:()=>al,mac:()=>Sl,looseRecord:()=>yl,looseObject:()=>fl,literal:()=>rc,lazy:()=>ug,ksuid:()=>Dl,keyof:()=>dl,jwt:()=>Jl,json:()=>kc,ipv6:()=>ml,ipv4:()=>wl,invertCodec:()=>ec,intersection:()=>K$,int64:()=>Yl,int32:()=>Xl,int:()=>Mi,instanceof:()=>_c,httpUrl:()=>ll,hostname:()=>El,hex:()=>Gl,hash:()=>Wl,guid:()=>ol,function:()=>gc,float64:()=>Vl,float32:()=>Al,file:()=>nc,exactOptional:()=>R$,enum:()=>lt,emoji:()=>cl,email:()=>tl,e164:()=>Pl,discriminatedUnion:()=>Cl,describe:()=>Ic,date:()=>Ml,custom:()=>cc,cuid2:()=>_l,cuid:()=>bl,codec:()=>vc,cidrv6:()=>zl,cidrv4:()=>Nl,check:()=>lc,catch:()=>rg,boolean:()=>z$,bigint:()=>Kl,base64url:()=>jl,base64:()=>Ol,array:()=>Wn,any:()=>Hl,_function:()=>gc,_default:()=>C$,_ZodString:()=>xi,ZodXor:()=>V$,ZodXID:()=>ai,ZodVoid:()=>W$,ZodUnknown:()=>E$,ZodUnion:()=>Vn,ZodUndefined:()=>j$,ZodUUID:()=>p,ZodURL:()=>En,ZodULID:()=>yi,ZodType:()=>O,ZodTuple:()=>Y$,ZodTransform:()=>d$,ZodTemplateLiteral:()=>vg,ZodSymbol:()=>O$,ZodSuccess:()=>p$,ZodStringFormat:()=>L,ZodString:()=>Cr,ZodSet:()=>H$,ZodRecord:()=>fr,ZodReadonly:()=>tg,ZodPromise:()=>$g,ZodPreprocess:()=>ig,ZodPrefault:()=>h$,ZodPipe:()=>Xn,ZodOptional:()=>It,ZodObject:()=>An,ZodNumberFormat:()=>Nr,ZodNumber:()=>yr,ZodNullable:()=>f$,ZodNull:()=>P$,ZodNonOptional:()=>bt,ZodNever:()=>G$,ZodNanoID:()=>Zi,ZodNaN:()=>ng,ZodMap:()=>T$,ZodMAC:()=>m$,ZodLiteral:()=>B$,ZodLazy:()=>eg,ZodKSUID:()=>pi,ZodJWT:()=>et,ZodIntersection:()=>q$,ZodIPv6:()=>rt,ZodIPv4:()=>si,ZodGUID:()=>jn,ZodFunction:()=>gg,ZodFile:()=>M$,ZodExactOptional:()=>x$,ZodEnum:()=>Zr,ZodEmoji:()=>fi,ZodEmail:()=>Ri,ZodE164:()=>vt,ZodDiscriminatedUnion:()=>X$,ZodDefault:()=>Z$,ZodDate:()=>Gn,ZodCustomStringFormat:()=>hr,ZodCustom:()=>Kn,ZodCodec:()=>qn,ZodCatch:()=>s$,ZodCUID2:()=>hi,ZodCUID:()=>Ci,ZodCIDRv6:()=>it,ZodCIDRv4:()=>nt,ZodBoolean:()=>ar,ZodBigIntFormat:()=>ut,ZodBigInt:()=>pr,ZodBase64URL:()=>ot,ZodBase64:()=>tt,ZodArray:()=>A$,ZodAny:()=>L$});var ir={};s(ir,{version:()=>jo,util:()=>k,treeifyError:()=>Lt,toJSONSchema:()=>Yi,toDotPath:()=>zg,safeParseAsync:()=>Wt,safeParse:()=>Gt,safeEncodeAsync:()=>rI,safeEncode:()=>pc,safeDecodeAsync:()=>nI,safeDecode:()=>sc,registry:()=>ui,regexes:()=>d,process:()=>P,prettifyError:()=>Et,parseAsync:()=>Tn,parse:()=>Fn,meta:()=>Du,locales:()=>Sn,isValidJWT:()=>xg,isValidBase64URL:()=>dg,isValidBase64:()=>Zo,initializeContext:()=>gr,globalRegistry:()=>X,globalConfig:()=>Ir,formatError:()=>$n,flattenError:()=>un,finalize:()=>cr,extractDefs:()=>lr,encodeAsync:()=>yc,encode:()=>Cc,describe:()=>ku,decodeAsync:()=>ac,decode:()=>hc,createToJSONSchemaMethod:()=>Su,createStandardJSONSchemaMethod:()=>xr,config:()=>W,clone:()=>K,_xor:()=>Eb,_xid:()=>wi,_void:()=>uu,_uuidv7:()=>Ii,_uuidv6:()=>ci,_uuidv4:()=>li,_uuid:()=>gi,_url:()=>Nn,_uppercase:()=>Xr,_unknown:()=>vu,_union:()=>Lb,_undefined:()=>iu,_ulid:()=>Di,_uint64:()=>ru,_uint32:()=>Ce,_tuple:()=>Ab,_trim:()=>Tr,_transform:()=>Fb,_toUpperCase:()=>Br,_toLowerCase:()=>Hr,_templateLiteral:()=>Zb,_symbol:()=>nu,_superRefine:()=>Uu,_success:()=>db,_stringbool:()=>wu,_stringFormat:()=>dr,_string:()=>qe,_startsWith:()=>Kr,_slugify:()=>Mr,_size:()=>Dr,_set:()=>qb,_safeParseAsync:()=>Er,_safeParse:()=>Lr,_safeEncodeAsync:()=>fn,_safeEncode:()=>xn,_safeDecodeAsync:()=>Zn,_safeDecode:()=>Rn,_regex:()=>Ar,_refine:()=>_u,_record:()=>Vb,_readonly:()=>fb,_property:()=>Vi,_promise:()=>hb,_positive:()=>Ei,_pipe:()=>Rb,_parseAsync:()=>Jr,_parse:()=>Pr,_overwrite:()=>f,_optional:()=>Tb,_number:()=>Me,_nullable:()=>Hb,_null:()=>tu,_normalize:()=>Fr,_nonpositive:()=>Wi,_nonoptional:()=>Mb,_nonnegative:()=>Ai,_never:()=>eu,_negative:()=>Gi,_nativeEnum:()=>Yb,_nanoid:()=>_i,_nan:()=>lu,_multipleOf:()=>ur,_minSize:()=>a,_minLength:()=>nr,_min:()=>Q,_mime:()=>Qr,_maxSize:()=>$r,_maxLength:()=>wr,_max:()=>x,_map:()=>Xb,_mac:()=>Ye,_lte:()=>x,_lt:()=>h,_lowercase:()=>Vr,_literal:()=>Qb,_length:()=>Sr,_lazy:()=>Cb,_ksuid:()=>Si,_jwt:()=>Li,_isoTime:()=>He,_isoDuration:()=>Be,_isoDateTime:()=>Fe,_isoDate:()=>Te,_ipv6:()=>Ni,_ipv4:()=>mi,_intersection:()=>Wb,_int64:()=>se,_int32:()=>Ze,_int:()=>xe,_includes:()=>qr,_guid:()=>mn,_gte:()=>Q,_gt:()=>y,_float64:()=>fe,_float32:()=>Re,_file:()=>Iu,_enum:()=>Kb,_endsWith:()=>Yr,_encodeAsync:()=>Mn,_encode:()=>Hn,_emoji:()=>bi,_email:()=>$i,_e164:()=>Ji,_discriminatedUnion:()=>Gb,_default:()=>Bb,_decodeAsync:()=>dn,_decode:()=>Bn,_date:()=>$u,_custom:()=>bu,_cuid2:()=>ki,_cuid:()=>Ui,_coercedString:()=>Ke,_coercedNumber:()=>de,_coercedDate:()=>gu,_coercedBoolean:()=>ye,_coercedBigint:()=>pe,_cidrv6:()=>Oi,_cidrv4:()=>zi,_check:()=>sg,_catch:()=>xb,_boolean:()=>he,_bigint:()=>ae,_base64url:()=>Pi,_base64:()=>ji,_array:()=>cu,_any:()=>ou,TimePrecision:()=>Qe,NEVER:()=>Ut,JSONSchemaGenerator:()=>t$,JSONSchema:()=>rl,Doc:()=>an,$output:()=>Ae,$input:()=>Ve,$constructor:()=>l,$brand:()=>kt,$ZodXor:()=>cv,$ZodXID:()=>Ko,$ZodVoid:()=>uv,$ZodUnknown:()=>vv,$ZodUnion:()=>bn,$ZodUndefined:()=>iv,$ZodUUID:()=>Lo,$ZodURL:()=>Go,$ZodULID:()=>qo,$ZodType:()=>z,$ZodTuple:()=>oi,$ZodTransform:()=>mv,$ZodTemplateLiteral:()=>Av,$ZodSymbol:()=>nv,$ZodSuccess:()=>Jv,$ZodStringFormat:()=>J,$ZodString:()=>kr,$ZodSet:()=>kv,$ZodRegistry:()=>Xe,$ZodRecord:()=>_v,$ZodRealError:()=>B,$ZodReadonly:()=>Wv,$ZodPromise:()=>Xv,$ZodPreprocess:()=>Gv,$ZodPrefault:()=>jv,$ZodPipe:()=>ei,$ZodOptional:()=>vi,$ZodObjectJIT:()=>lv,$ZodObject:()=>Zg,$ZodNumberFormat:()=>so,$ZodNumber:()=>ii,$ZodNullable:()=>zv,$ZodNull:()=>tv,$ZodNonOptional:()=>Pv,$ZodNever:()=>ev,$ZodNanoID:()=>Ao,$ZodNaN:()=>Ev,$ZodMap:()=>Uv,$ZodMAC:()=>xo,$ZodLiteral:()=>wv,$ZodLazy:()=>qv,$ZodKSUID:()=>Yo,$ZodJWT:()=>ao,$ZodIntersection:()=>bv,$ZodISOTime:()=>To,$ZodISODuration:()=>Ho,$ZodISODateTime:()=>Qo,$ZodISODate:()=>Fo,$ZodIPv6:()=>Mo,$ZodIPv4:()=>Bo,$ZodGUID:()=>Jo,$ZodFunction:()=>Vv,$ZodFile:()=>Sv,$ZodExactOptional:()=>Nv,$ZodError:()=>en,$ZodEnum:()=>Dv,$ZodEncodeError:()=>br,$ZodEmoji:()=>Wo,$ZodEmail:()=>Eo,$ZodE164:()=>yo,$ZodDiscriminatedUnion:()=>Iv,$ZodDefault:()=>Ov,$ZodDate:()=>$v,$ZodCustomStringFormat:()=>po,$ZodCustom:()=>Kv,$ZodCodec:()=>_n,$ZodCheckUpperCase:()=>Do,$ZodCheckStringFormat:()=>Gr,$ZodCheckStartsWith:()=>So,$ZodCheckSizeEquals:()=>co,$ZodCheckRegex:()=>Uo,$ZodCheckProperty:()=>No,$ZodCheckOverwrite:()=>Oo,$ZodCheckNumberFormat:()=>uo,$ZodCheckMultipleOf:()=>eo,$ZodCheckMinSize:()=>lo,$ZodCheckMinLength:()=>bo,$ZodCheckMimeType:()=>zo,$ZodCheckMaxSize:()=>go,$ZodCheckMaxLength:()=>Io,$ZodCheckLowerCase:()=>ko,$ZodCheckLessThan:()=>hn,$ZodCheckLengthEquals:()=>_o,$ZodCheckIncludes:()=>wo,$ZodCheckGreaterThan:()=>yn,$ZodCheckEndsWith:()=>mo,$ZodCheckBigIntFormat:()=>$o,$ZodCheck:()=>E,$ZodCatch:()=>Lv,$ZodCUID2:()=>Xo,$ZodCUID:()=>Vo,$ZodCIDRv6:()=>fo,$ZodCIDRv4:()=>Ro,$ZodBoolean:()=>In,$ZodBigIntFormat:()=>rv,$ZodBigInt:()=>ti,$ZodBase64URL:()=>ho,$ZodBase64:()=>Co,$ZodAsyncError:()=>C,$ZodArray:()=>gv,$ZodAny:()=>ov});var kg,Ut=Object.freeze({status:"aborted"});function l(n,i,o){function v(u,g){if(!u._zod)Object.defineProperty(u,"_zod",{value:{def:g,constr:e,traits:new Set},enumerable:!1});if(u._zod.traits.has(n))return;u._zod.traits.add(n),i(u,g);let $=e.prototype,c=Object.keys($);for(let b=0;b<c.length;b++){let S=c[b];if(!(S in u))u[S]=$[S].bind(u)}}let r=o?.Parent??Object;class t extends r{}Object.defineProperty(t,"name",{value:n});function e(u){var g;let $=o?.Parent?new t:this;v($,u),(g=$._zod).deferred??(g.deferred=[]);for(let c of $._zod.deferred)c();return $}return Object.defineProperty(e,"init",{value:v}),Object.defineProperty(e,Symbol.hasInstance,{value:(u)=>{if(o?.Parent&&u instanceof o.Parent)return!0;return u?._zod?.traits?.has(n)}}),Object.defineProperty(e,"name",{value:n}),e}var kt=Symbol("zod_brand");class C extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class br extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`);this.name="ZodEncodeError"}}(kg=globalThis).__zod_globalConfig??(kg.__zod_globalConfig={});var Ir=globalThis.__zod_globalConfig;function W(n){if(n)Object.assign(Ir,n);return Ir}var k={};s(k,{unwrapMessage:()=>sr,uint8ArrayToHex:()=>fc,uint8ArrayToBase64url:()=>xc,uint8ArrayToBase64:()=>Sg,stringifyPrimitive:()=>_,slugify:()=>St,shallowClone:()=>Nt,safeExtend:()=>Fc,required:()=>Bc,randomString:()=>Ac,propertyKeyTypes:()=>tn,promiseAllObject:()=>Wc,primitiveTypes:()=>zt,prefixIssues:()=>H,pick:()=>Kc,partial:()=>Hc,parsedType:()=>U,optionalKeys:()=>Ot,omit:()=>Yc,objectClone:()=>Lc,numKeys:()=>Vc,nullish:()=>tr,normalizeParams:()=>w,mergeDefs:()=>rr,merge:()=>Tc,jsonStringifyReplacer:()=>zr,joinValues:()=>I,issue:()=>jr,isPlainObject:()=>vr,isObject:()=>_r,hexToUint8Array:()=>Rc,getSizableOrigin:()=>on,getParsedType:()=>Xc,getLengthableOrigin:()=>vn,getEnumValues:()=>rn,getElementAtPath:()=>Gc,floatSafeRemainder:()=>wt,finalizeIssue:()=>Y,extend:()=>Qc,explicitlyAborted:()=>Jt,escapeRegex:()=>R,esc:()=>Yn,defineLazy:()=>j,createTransparentProxy:()=>qc,cloneDef:()=>Ec,clone:()=>K,cleanRegex:()=>nn,cleanEnum:()=>Mc,captureStackTrace:()=>Qn,cached:()=>Or,base64urlToUint8Array:()=>dc,base64ToUint8Array:()=>wg,assignProp:()=>or,assertNotEqual:()=>Oc,assertNever:()=>Pc,assertIs:()=>jc,assertEqual:()=>zc,assert:()=>Jc,allowsEval:()=>mt,aborted:()=>er,NUMBER_FORMAT_RANGES:()=>jt,Class:()=>mg,BIGINT_FORMAT_RANGES:()=>Pt});function zc(n){return n}function Oc(n){return n}function jc(n){}function Pc(n){throw Error("Unexpected value in exhaustive check")}function Jc(n){}function rn(n){let i=Object.values(n).filter((v)=>typeof v==="number");return Object.entries(n).filter(([v,r])=>i.indexOf(+v)===-1).map(([v,r])=>r)}function I(n,i="|"){return n.map((o)=>_(o)).join(i)}function zr(n,i){if(typeof i==="bigint")return i.toString();return i}function Or(n){return{get value(){{let o=n();return Object.defineProperty(this,"value",{value:o}),o}throw Error("cached value already set")}}}function tr(n){return n===null||n===void 0}function nn(n){let i=n.startsWith("^")?1:0,o=n.endsWith("$")?n.length-1:n.length;return n.slice(i,o)}function wt(n,i){let o=n/i,v=Math.round(o),r=Number.EPSILON*Math.max(Math.abs(o),1);if(Math.abs(o-v)<r)return 0;return o-v}var Dg=Symbol("evaluating");function j(n,i,o){let v=void 0;Object.defineProperty(n,i,{get(){if(v===Dg)return;if(v===void 0)v=Dg,v=o();return v},set(r){Object.defineProperty(n,i,{value:r})},configurable:!0})}function Lc(n){return Object.create(Object.getPrototypeOf(n),Object.getOwnPropertyDescriptors(n))}function or(n,i,o){Object.defineProperty(n,i,{value:o,writable:!0,enumerable:!0,configurable:!0})}function rr(...n){let i={};for(let o of n){let v=Object.getOwnPropertyDescriptors(o);Object.assign(i,v)}return Object.defineProperties({},i)}function Ec(n){return rr(n._zod.def)}function Gc(n,i){if(!i)return n;return i.reduce((o,v)=>o?.[v],n)}function Wc(n){let i=Object.keys(n),o=i.map((v)=>n[v]);return Promise.all(o).then((v)=>{let r={};for(let t=0;t<i.length;t++)r[i[t]]=v[t];return r})}function Ac(n=10){let o="";for(let v=0;v<n;v++)o+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return o}function Yn(n){return JSON.stringify(n)}function St(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Qn="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function _r(n){return typeof n==="object"&&n!==null&&!Array.isArray(n)}var mt=Or(()=>{if(Ir.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(n){return!1}});function vr(n){if(_r(n)===!1)return!1;let i=n.constructor;if(i===void 0)return!0;if(typeof i!=="function")return!0;let o=i.prototype;if(_r(o)===!1)return!1;if(Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)return!1;return!0}function Nt(n){if(vr(n))return{...n};if(Array.isArray(n))return[...n];if(n instanceof Map)return new Map(n);if(n instanceof Set)return new Set(n);return n}function Vc(n){let i=0;for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o))i++;return i}var Xc=(n)=>{let i=typeof n;switch(i){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(n)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(n))return"array";if(n===null)return"null";if(n.then&&typeof n.then==="function"&&n.catch&&typeof n.catch==="function")return"promise";if(typeof Map<"u"&&n instanceof Map)return"map";if(typeof Set<"u"&&n instanceof Set)return"set";if(typeof Date<"u"&&n instanceof Date)return"date";if(typeof File<"u"&&n instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${i}`)}},tn=new Set(["string","number","symbol"]),zt=new Set(["string","number","bigint","boolean","symbol","undefined"]);function R(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function K(n,i,o){let v=new n._zod.constr(i??n._zod.def);if(!i||o?.parent)v._zod.parent=n;return v}function w(n){let i=n;if(!i)return{};if(typeof i==="string")return{error:()=>i};if(i?.message!==void 0){if(i?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");i.error=i.message}if(delete i.message,typeof i.error==="string")return{...i,error:()=>i.error};return i}function qc(n){let i;return new Proxy({},{get(o,v,r){return i??(i=n()),Reflect.get(i,v,r)},set(o,v,r,t){return i??(i=n()),Reflect.set(i,v,r,t)},has(o,v){return i??(i=n()),Reflect.has(i,v)},deleteProperty(o,v){return i??(i=n()),Reflect.deleteProperty(i,v)},ownKeys(o){return i??(i=n()),Reflect.ownKeys(i)},getOwnPropertyDescriptor(o,v){return i??(i=n()),Reflect.getOwnPropertyDescriptor(i,v)},defineProperty(o,v,r){return i??(i=n()),Reflect.defineProperty(i,v,r)}})}function _(n){if(typeof n==="bigint")return n.toString()+"n";if(typeof n==="string")return`"${n}"`;return`${n}`}function Ot(n){return Object.keys(n).filter((i)=>{return n[i]._zod.optin==="optional"&&n[i]._zod.optout==="optional"})}var jt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Pt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Kc(n,i){let o=n._zod.def,v=o.checks;if(v&&v.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let t=rr(n._zod.def,{get shape(){let e={};for(let u in i){if(!(u in o.shape))throw Error(`Unrecognized key: "${u}"`);if(!i[u])continue;e[u]=o.shape[u]}return or(this,"shape",e),e},checks:[]});return K(n,t)}function Yc(n,i){let o=n._zod.def,v=o.checks;if(v&&v.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let t=rr(n._zod.def,{get shape(){let e={...n._zod.def.shape};for(let u in i){if(!(u in o.shape))throw Error(`Unrecognized key: "${u}"`);if(!i[u])continue;delete e[u]}return or(this,"shape",e),e},checks:[]});return K(n,t)}function Qc(n,i){if(!vr(i))throw Error("Invalid input to extend: expected a plain object");let o=n._zod.def.checks;if(o&&o.length>0){let t=n._zod.def.shape;for(let e in i)if(Object.getOwnPropertyDescriptor(t,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=rr(n._zod.def,{get shape(){let t={...n._zod.def.shape,...i};return or(this,"shape",t),t}});return K(n,r)}function Fc(n,i){if(!vr(i))throw Error("Invalid input to safeExtend: expected a plain object");let o=rr(n._zod.def,{get shape(){let v={...n._zod.def.shape,...i};return or(this,"shape",v),v}});return K(n,o)}function Tc(n,i){if(n._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let o=rr(n._zod.def,{get shape(){let v={...n._zod.def.shape,...i._zod.def.shape};return or(this,"shape",v),v},get catchall(){return i._zod.def.catchall},checks:i._zod.def.checks??[]});return K(n,o)}function Hc(n,i,o){let r=i._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let e=rr(i._zod.def,{get shape(){let u=i._zod.def.shape,g={...u};if(o)for(let $ in o){if(!($ in u))throw Error(`Unrecognized key: "${$}"`);if(!o[$])continue;g[$]=n?new n({type:"optional",innerType:u[$]}):u[$]}else for(let $ in u)g[$]=n?new n({type:"optional",innerType:u[$]}):u[$];return or(this,"shape",g),g},checks:[]});return K(i,e)}function Bc(n,i,o){let v=rr(i._zod.def,{get shape(){let r=i._zod.def.shape,t={...r};if(o)for(let e in o){if(!(e in t))throw Error(`Unrecognized key: "${e}"`);if(!o[e])continue;t[e]=new n({type:"nonoptional",innerType:r[e]})}else for(let e in r)t[e]=new n({type:"nonoptional",innerType:r[e]});return or(this,"shape",t),t}});return K(i,v)}function er(n,i=0){if(n.aborted===!0)return!0;for(let o=i;o<n.issues.length;o++)if(n.issues[o]?.continue!==!0)return!0;return!1}function Jt(n,i=0){if(n.aborted===!0)return!0;for(let o=i;o<n.issues.length;o++)if(n.issues[o]?.continue===!1)return!0;return!1}function H(n,i){return i.map((o)=>{var v;return(v=o).path??(v.path=[]),o.path.unshift(n),o})}function sr(n){return typeof n==="string"?n:n?.message}function Y(n,i,o){let v=n.message?n.message:sr(n.inst?._zod.def?.error?.(n))??sr(i?.error?.(n))??sr(o.customError?.(n))??sr(o.localeError?.(n))??"Invalid input",{inst:r,continue:t,input:e,...u}=n;if(u.path??(u.path=[]),u.message=v,i?.reportInput)u.input=e;return u}function on(n){if(n instanceof Set)return"set";if(n instanceof Map)return"map";if(n instanceof File)return"file";return"unknown"}function vn(n){if(Array.isArray(n))return"array";if(typeof n==="string")return"string";return"unknown"}function U(n){let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"nan":"number";case"object":{if(n===null)return"null";if(Array.isArray(n))return"array";let o=n;if(o&&Object.getPrototypeOf(o)!==Object.prototype&&"constructor"in o&&o.constructor)return o.constructor.name}}return i}function jr(...n){let[i,o,v]=n;if(typeof i==="string")return{message:i,code:"custom",input:o,inst:v};return{...i}}function Mc(n){return Object.entries(n).filter(([i,o])=>{return Number.isNaN(Number.parseInt(i,10))}).map((i)=>i[1])}function wg(n){let i=atob(n),o=new Uint8Array(i.length);for(let v=0;v<i.length;v++)o[v]=i.charCodeAt(v);return o}function Sg(n){let i="";for(let o=0;o<n.length;o++)i+=String.fromCharCode(n[o]);return btoa(i)}function dc(n){let i=n.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-i.length%4)%4);return wg(i+o)}function xc(n){return Sg(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Rc(n){let i=n.replace(/^0x/,"");if(i.length%2!==0)throw Error("Invalid hex string length");let o=new Uint8Array(i.length/2);for(let v=0;v<i.length;v+=2)o[v/2]=Number.parseInt(i.slice(v,v+2),16);return o}function fc(n){return Array.from(n).map((i)=>i.toString(16).padStart(2,"0")).join("")}class mg{constructor(...n){}}var Ng=(n,i)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:i,enumerable:!1}),n.message=JSON.stringify(i,zr,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},en=l("$ZodError",Ng),B=l("$ZodError",Ng,{Parent:Error});function un(n,i=(o)=>o.message){let o={},v=[];for(let r of n.issues)if(r.path.length>0)o[r.path[0]]=o[r.path[0]]||[],o[r.path[0]].push(i(r));else v.push(i(r));return{formErrors:v,fieldErrors:o}}function $n(n,i=(o)=>o.message){let o={_errors:[]},v=(r,t=[])=>{for(let e of r.issues)if(e.code==="invalid_union"&&e.errors.length)e.errors.map((u)=>v({issues:u},[...t,...e.path]));else if(e.code==="invalid_key")v({issues:e.issues},[...t,...e.path]);else if(e.code==="invalid_element")v({issues:e.issues},[...t,...e.path]);else{let u=[...t,...e.path];if(u.length===0)o._errors.push(i(e));else{let g=o,$=0;while($<u.length){let c=u[$];if($!==u.length-1)g[c]=g[c]||{_errors:[]};else g[c]=g[c]||{_errors:[]},g[c]._errors.push(i(e));g=g[c],$++}}}};return v(n),o}function Lt(n,i=(o)=>o.message){let o={errors:[]},v=(r,t=[])=>{var e,u;for(let g of r.issues)if(g.code==="invalid_union"&&g.errors.length)g.errors.map(($)=>v({issues:$},[...t,...g.path]));else if(g.code==="invalid_key")v({issues:g.issues},[...t,...g.path]);else if(g.code==="invalid_element")v({issues:g.issues},[...t,...g.path]);else{let $=[...t,...g.path];if($.length===0){o.errors.push(i(g));continue}let c=o,b=0;while(b<$.length){let S=$[b],D=b===$.length-1;if(typeof S==="string")c.properties??(c.properties={}),(e=c.properties)[S]??(e[S]={errors:[]}),c=c.properties[S];else c.items??(c.items=[]),(u=c.items)[S]??(u[S]={errors:[]}),c=c.items[S];if(D)c.errors.push(i(g));b++}}};return v(n),o}function zg(n){let i=[],o=n.map((v)=>typeof v==="object"?v.key:v);for(let v of o)if(typeof v==="number")i.push(`[${v}]`);else if(typeof v==="symbol")i.push(`[${JSON.stringify(String(v))}]`);else if(/[^\w$]/.test(v))i.push(`[${JSON.stringify(v)}]`);else{if(i.length)i.push(".");i.push(v)}return i.join("")}function Et(n){let i=[],o=[...n.issues].sort((v,r)=>(v.path??[]).length-(r.path??[]).length);for(let v of o)if(i.push(`\u2716 ${v.message}`),v.path?.length)i.push(` \u2192 at ${zg(v.path)}`);return i.join(`
|
|
2
|
+
import{Xk as s}from"./chunk-0qkj838r.js";var zn={};s(zn,{xor:()=>Zl,xid:()=>kl,void:()=>Bl,uuidv7:()=>$l,uuidv6:()=>ul,uuidv4:()=>el,uuid:()=>vl,url:()=>gl,unknown:()=>mr,union:()=>gt,undefined:()=>Tl,ulid:()=>Ul,uint64:()=>Ql,uint32:()=>ql,tuple:()=>Q$,transform:()=>ct,templateLiteral:()=>uc,symbol:()=>Fl,superRefine:()=>cg,success:()=>tc,stringbool:()=>Uc,stringFormat:()=>Ll,string:()=>On,strictObject:()=>Rl,set:()=>pl,refine:()=>lg,record:()=>F$,readonly:()=>og,promise:()=>$c,preprocess:()=>Dc,prefault:()=>y$,pipe:()=>di,partialRecord:()=>hl,optional:()=>Pn,object:()=>xl,number:()=>N$,nullish:()=>ic,nullable:()=>Jn,null:()=>J$,nonoptional:()=>a$,never:()=>$t,nativeEnum:()=>sl,nanoid:()=>Il,nan:()=>oc,meta:()=>bc,map:()=>al,mac:()=>Sl,looseRecord:()=>yl,looseObject:()=>fl,literal:()=>rc,lazy:()=>ug,ksuid:()=>Dl,keyof:()=>dl,jwt:()=>Jl,json:()=>kc,ipv6:()=>ml,ipv4:()=>wl,invertCodec:()=>ec,intersection:()=>K$,int64:()=>Yl,int32:()=>Xl,int:()=>Mi,instanceof:()=>_c,httpUrl:()=>ll,hostname:()=>El,hex:()=>Gl,hash:()=>Wl,guid:()=>ol,function:()=>gc,float64:()=>Vl,float32:()=>Al,file:()=>nc,exactOptional:()=>R$,enum:()=>lt,emoji:()=>cl,email:()=>tl,e164:()=>Pl,discriminatedUnion:()=>Cl,describe:()=>Ic,date:()=>Ml,custom:()=>cc,cuid2:()=>_l,cuid:()=>bl,codec:()=>vc,cidrv6:()=>zl,cidrv4:()=>Nl,check:()=>lc,catch:()=>rg,boolean:()=>z$,bigint:()=>Kl,base64url:()=>jl,base64:()=>Ol,array:()=>Wn,any:()=>Hl,_function:()=>gc,_default:()=>C$,_ZodString:()=>xi,ZodXor:()=>V$,ZodXID:()=>ai,ZodVoid:()=>W$,ZodUnknown:()=>E$,ZodUnion:()=>Vn,ZodUndefined:()=>j$,ZodUUID:()=>p,ZodURL:()=>En,ZodULID:()=>yi,ZodType:()=>O,ZodTuple:()=>Y$,ZodTransform:()=>d$,ZodTemplateLiteral:()=>vg,ZodSymbol:()=>O$,ZodSuccess:()=>p$,ZodStringFormat:()=>L,ZodString:()=>Cr,ZodSet:()=>H$,ZodRecord:()=>fr,ZodReadonly:()=>tg,ZodPromise:()=>$g,ZodPreprocess:()=>ig,ZodPrefault:()=>h$,ZodPipe:()=>Xn,ZodOptional:()=>It,ZodObject:()=>An,ZodNumberFormat:()=>Nr,ZodNumber:()=>yr,ZodNullable:()=>f$,ZodNull:()=>P$,ZodNonOptional:()=>bt,ZodNever:()=>G$,ZodNanoID:()=>Zi,ZodNaN:()=>ng,ZodMap:()=>T$,ZodMAC:()=>m$,ZodLiteral:()=>B$,ZodLazy:()=>eg,ZodKSUID:()=>pi,ZodJWT:()=>et,ZodIntersection:()=>q$,ZodIPv6:()=>rt,ZodIPv4:()=>si,ZodGUID:()=>jn,ZodFunction:()=>gg,ZodFile:()=>M$,ZodExactOptional:()=>x$,ZodEnum:()=>Zr,ZodEmoji:()=>fi,ZodEmail:()=>Ri,ZodE164:()=>vt,ZodDiscriminatedUnion:()=>X$,ZodDefault:()=>Z$,ZodDate:()=>Gn,ZodCustomStringFormat:()=>hr,ZodCustom:()=>Kn,ZodCodec:()=>qn,ZodCatch:()=>s$,ZodCUID2:()=>hi,ZodCUID:()=>Ci,ZodCIDRv6:()=>it,ZodCIDRv4:()=>nt,ZodBoolean:()=>ar,ZodBigIntFormat:()=>ut,ZodBigInt:()=>pr,ZodBase64URL:()=>ot,ZodBase64:()=>tt,ZodArray:()=>A$,ZodAny:()=>L$});var ir={};s(ir,{version:()=>jo,util:()=>k,treeifyError:()=>Lt,toJSONSchema:()=>Yi,toDotPath:()=>zg,safeParseAsync:()=>Wt,safeParse:()=>Gt,safeEncodeAsync:()=>rI,safeEncode:()=>pc,safeDecodeAsync:()=>nI,safeDecode:()=>sc,registry:()=>ui,regexes:()=>d,process:()=>P,prettifyError:()=>Et,parseAsync:()=>Tn,parse:()=>Fn,meta:()=>Du,locales:()=>Sn,isValidJWT:()=>xg,isValidBase64URL:()=>dg,isValidBase64:()=>Zo,initializeContext:()=>gr,globalRegistry:()=>X,globalConfig:()=>Ir,formatError:()=>$n,flattenError:()=>un,finalize:()=>cr,extractDefs:()=>lr,encodeAsync:()=>yc,encode:()=>Cc,describe:()=>ku,decodeAsync:()=>ac,decode:()=>hc,createToJSONSchemaMethod:()=>Su,createStandardJSONSchemaMethod:()=>xr,config:()=>W,clone:()=>K,_xor:()=>Eb,_xid:()=>wi,_void:()=>uu,_uuidv7:()=>Ii,_uuidv6:()=>ci,_uuidv4:()=>li,_uuid:()=>gi,_url:()=>Nn,_uppercase:()=>Xr,_unknown:()=>vu,_union:()=>Lb,_undefined:()=>iu,_ulid:()=>Di,_uint64:()=>ru,_uint32:()=>Ce,_tuple:()=>Ab,_trim:()=>Tr,_transform:()=>Fb,_toUpperCase:()=>Br,_toLowerCase:()=>Hr,_templateLiteral:()=>Zb,_symbol:()=>nu,_superRefine:()=>Uu,_success:()=>db,_stringbool:()=>wu,_stringFormat:()=>dr,_string:()=>qe,_startsWith:()=>Kr,_slugify:()=>Mr,_size:()=>Dr,_set:()=>qb,_safeParseAsync:()=>Er,_safeParse:()=>Lr,_safeEncodeAsync:()=>fn,_safeEncode:()=>xn,_safeDecodeAsync:()=>Zn,_safeDecode:()=>Rn,_regex:()=>Ar,_refine:()=>_u,_record:()=>Vb,_readonly:()=>fb,_property:()=>Vi,_promise:()=>hb,_positive:()=>Ei,_pipe:()=>Rb,_parseAsync:()=>Jr,_parse:()=>Pr,_overwrite:()=>f,_optional:()=>Tb,_number:()=>Me,_nullable:()=>Hb,_null:()=>tu,_normalize:()=>Fr,_nonpositive:()=>Wi,_nonoptional:()=>Mb,_nonnegative:()=>Ai,_never:()=>eu,_negative:()=>Gi,_nativeEnum:()=>Yb,_nanoid:()=>_i,_nan:()=>lu,_multipleOf:()=>ur,_minSize:()=>a,_minLength:()=>nr,_min:()=>Q,_mime:()=>Qr,_maxSize:()=>$r,_maxLength:()=>wr,_max:()=>x,_map:()=>Xb,_mac:()=>Ye,_lte:()=>x,_lt:()=>h,_lowercase:()=>Vr,_literal:()=>Qb,_length:()=>Sr,_lazy:()=>Cb,_ksuid:()=>Si,_jwt:()=>Li,_isoTime:()=>He,_isoDuration:()=>Be,_isoDateTime:()=>Fe,_isoDate:()=>Te,_ipv6:()=>Ni,_ipv4:()=>mi,_intersection:()=>Wb,_int64:()=>se,_int32:()=>Ze,_int:()=>xe,_includes:()=>qr,_guid:()=>mn,_gte:()=>Q,_gt:()=>y,_float64:()=>fe,_float32:()=>Re,_file:()=>Iu,_enum:()=>Kb,_endsWith:()=>Yr,_encodeAsync:()=>Mn,_encode:()=>Hn,_emoji:()=>bi,_email:()=>$i,_e164:()=>Ji,_discriminatedUnion:()=>Gb,_default:()=>Bb,_decodeAsync:()=>dn,_decode:()=>Bn,_date:()=>$u,_custom:()=>bu,_cuid2:()=>ki,_cuid:()=>Ui,_coercedString:()=>Ke,_coercedNumber:()=>de,_coercedDate:()=>gu,_coercedBoolean:()=>ye,_coercedBigint:()=>pe,_cidrv6:()=>Oi,_cidrv4:()=>zi,_check:()=>sg,_catch:()=>xb,_boolean:()=>he,_bigint:()=>ae,_base64url:()=>Pi,_base64:()=>ji,_array:()=>cu,_any:()=>ou,TimePrecision:()=>Qe,NEVER:()=>Ut,JSONSchemaGenerator:()=>t$,JSONSchema:()=>rl,Doc:()=>an,$output:()=>Ae,$input:()=>Ve,$constructor:()=>l,$brand:()=>kt,$ZodXor:()=>cv,$ZodXID:()=>Ko,$ZodVoid:()=>uv,$ZodUnknown:()=>vv,$ZodUnion:()=>bn,$ZodUndefined:()=>iv,$ZodUUID:()=>Lo,$ZodURL:()=>Go,$ZodULID:()=>qo,$ZodType:()=>z,$ZodTuple:()=>oi,$ZodTransform:()=>mv,$ZodTemplateLiteral:()=>Av,$ZodSymbol:()=>nv,$ZodSuccess:()=>Jv,$ZodStringFormat:()=>J,$ZodString:()=>kr,$ZodSet:()=>kv,$ZodRegistry:()=>Xe,$ZodRecord:()=>_v,$ZodRealError:()=>B,$ZodReadonly:()=>Wv,$ZodPromise:()=>Xv,$ZodPreprocess:()=>Gv,$ZodPrefault:()=>jv,$ZodPipe:()=>ei,$ZodOptional:()=>vi,$ZodObjectJIT:()=>lv,$ZodObject:()=>Zg,$ZodNumberFormat:()=>so,$ZodNumber:()=>ii,$ZodNullable:()=>zv,$ZodNull:()=>tv,$ZodNonOptional:()=>Pv,$ZodNever:()=>ev,$ZodNanoID:()=>Ao,$ZodNaN:()=>Ev,$ZodMap:()=>Uv,$ZodMAC:()=>xo,$ZodLiteral:()=>wv,$ZodLazy:()=>qv,$ZodKSUID:()=>Yo,$ZodJWT:()=>ao,$ZodIntersection:()=>bv,$ZodISOTime:()=>To,$ZodISODuration:()=>Ho,$ZodISODateTime:()=>Qo,$ZodISODate:()=>Fo,$ZodIPv6:()=>Mo,$ZodIPv4:()=>Bo,$ZodGUID:()=>Jo,$ZodFunction:()=>Vv,$ZodFile:()=>Sv,$ZodExactOptional:()=>Nv,$ZodError:()=>en,$ZodEnum:()=>Dv,$ZodEncodeError:()=>br,$ZodEmoji:()=>Wo,$ZodEmail:()=>Eo,$ZodE164:()=>yo,$ZodDiscriminatedUnion:()=>Iv,$ZodDefault:()=>Ov,$ZodDate:()=>$v,$ZodCustomStringFormat:()=>po,$ZodCustom:()=>Kv,$ZodCodec:()=>_n,$ZodCheckUpperCase:()=>Do,$ZodCheckStringFormat:()=>Gr,$ZodCheckStartsWith:()=>So,$ZodCheckSizeEquals:()=>co,$ZodCheckRegex:()=>Uo,$ZodCheckProperty:()=>No,$ZodCheckOverwrite:()=>Oo,$ZodCheckNumberFormat:()=>uo,$ZodCheckMultipleOf:()=>eo,$ZodCheckMinSize:()=>lo,$ZodCheckMinLength:()=>bo,$ZodCheckMimeType:()=>zo,$ZodCheckMaxSize:()=>go,$ZodCheckMaxLength:()=>Io,$ZodCheckLowerCase:()=>ko,$ZodCheckLessThan:()=>hn,$ZodCheckLengthEquals:()=>_o,$ZodCheckIncludes:()=>wo,$ZodCheckGreaterThan:()=>yn,$ZodCheckEndsWith:()=>mo,$ZodCheckBigIntFormat:()=>$o,$ZodCheck:()=>E,$ZodCatch:()=>Lv,$ZodCUID2:()=>Xo,$ZodCUID:()=>Vo,$ZodCIDRv6:()=>fo,$ZodCIDRv4:()=>Ro,$ZodBoolean:()=>In,$ZodBigIntFormat:()=>rv,$ZodBigInt:()=>ti,$ZodBase64URL:()=>ho,$ZodBase64:()=>Co,$ZodAsyncError:()=>C,$ZodArray:()=>gv,$ZodAny:()=>ov});var kg,Ut=Object.freeze({status:"aborted"});function l(n,i,o){function v(u,g){if(!u._zod)Object.defineProperty(u,"_zod",{value:{def:g,constr:e,traits:new Set},enumerable:!1});if(u._zod.traits.has(n))return;u._zod.traits.add(n),i(u,g);let $=e.prototype,c=Object.keys($);for(let b=0;b<c.length;b++){let S=c[b];if(!(S in u))u[S]=$[S].bind(u)}}let r=o?.Parent??Object;class t extends r{}Object.defineProperty(t,"name",{value:n});function e(u){var g;let $=o?.Parent?new t:this;v($,u),(g=$._zod).deferred??(g.deferred=[]);for(let c of $._zod.deferred)c();return $}return Object.defineProperty(e,"init",{value:v}),Object.defineProperty(e,Symbol.hasInstance,{value:(u)=>{if(o?.Parent&&u instanceof o.Parent)return!0;return u?._zod?.traits?.has(n)}}),Object.defineProperty(e,"name",{value:n}),e}var kt=Symbol("zod_brand");class C extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class br extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`);this.name="ZodEncodeError"}}(kg=globalThis).__zod_globalConfig??(kg.__zod_globalConfig={});var Ir=globalThis.__zod_globalConfig;function W(n){if(n)Object.assign(Ir,n);return Ir}var k={};s(k,{unwrapMessage:()=>sr,uint8ArrayToHex:()=>fc,uint8ArrayToBase64url:()=>xc,uint8ArrayToBase64:()=>Sg,stringifyPrimitive:()=>_,slugify:()=>St,shallowClone:()=>Nt,safeExtend:()=>Fc,required:()=>Bc,randomString:()=>Ac,propertyKeyTypes:()=>tn,promiseAllObject:()=>Wc,primitiveTypes:()=>zt,prefixIssues:()=>H,pick:()=>Kc,partial:()=>Hc,parsedType:()=>U,optionalKeys:()=>Ot,omit:()=>Yc,objectClone:()=>Lc,numKeys:()=>Vc,nullish:()=>tr,normalizeParams:()=>w,mergeDefs:()=>rr,merge:()=>Tc,jsonStringifyReplacer:()=>zr,joinValues:()=>I,issue:()=>jr,isPlainObject:()=>vr,isObject:()=>_r,hexToUint8Array:()=>Rc,getSizableOrigin:()=>on,getParsedType:()=>Xc,getLengthableOrigin:()=>vn,getEnumValues:()=>rn,getElementAtPath:()=>Gc,floatSafeRemainder:()=>wt,finalizeIssue:()=>Y,extend:()=>Qc,explicitlyAborted:()=>Jt,escapeRegex:()=>R,esc:()=>Yn,defineLazy:()=>j,createTransparentProxy:()=>qc,cloneDef:()=>Ec,clone:()=>K,cleanRegex:()=>nn,cleanEnum:()=>Mc,captureStackTrace:()=>Qn,cached:()=>Or,base64urlToUint8Array:()=>dc,base64ToUint8Array:()=>wg,assignProp:()=>or,assertNotEqual:()=>Oc,assertNever:()=>Pc,assertIs:()=>jc,assertEqual:()=>zc,assert:()=>Jc,allowsEval:()=>mt,aborted:()=>er,NUMBER_FORMAT_RANGES:()=>jt,Class:()=>mg,BIGINT_FORMAT_RANGES:()=>Pt});function zc(n){return n}function Oc(n){return n}function jc(n){}function Pc(n){throw Error("Unexpected value in exhaustive check")}function Jc(n){}function rn(n){let i=Object.values(n).filter((v)=>typeof v==="number");return Object.entries(n).filter(([v,r])=>i.indexOf(+v)===-1).map(([v,r])=>r)}function I(n,i="|"){return n.map((o)=>_(o)).join(i)}function zr(n,i){if(typeof i==="bigint")return i.toString();return i}function Or(n){return{get value(){{let o=n();return Object.defineProperty(this,"value",{value:o}),o}throw Error("cached value already set")}}}function tr(n){return n===null||n===void 0}function nn(n){let i=n.startsWith("^")?1:0,o=n.endsWith("$")?n.length-1:n.length;return n.slice(i,o)}function wt(n,i){let o=n/i,v=Math.round(o),r=Number.EPSILON*Math.max(Math.abs(o),1);if(Math.abs(o-v)<r)return 0;return o-v}var Dg=Symbol("evaluating");function j(n,i,o){let v=void 0;Object.defineProperty(n,i,{get(){if(v===Dg)return;if(v===void 0)v=Dg,v=o();return v},set(r){Object.defineProperty(n,i,{value:r})},configurable:!0})}function Lc(n){return Object.create(Object.getPrototypeOf(n),Object.getOwnPropertyDescriptors(n))}function or(n,i,o){Object.defineProperty(n,i,{value:o,writable:!0,enumerable:!0,configurable:!0})}function rr(...n){let i={};for(let o of n){let v=Object.getOwnPropertyDescriptors(o);Object.assign(i,v)}return Object.defineProperties({},i)}function Ec(n){return rr(n._zod.def)}function Gc(n,i){if(!i)return n;return i.reduce((o,v)=>o?.[v],n)}function Wc(n){let i=Object.keys(n),o=i.map((v)=>n[v]);return Promise.all(o).then((v)=>{let r={};for(let t=0;t<i.length;t++)r[i[t]]=v[t];return r})}function Ac(n=10){let o="";for(let v=0;v<n;v++)o+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return o}function Yn(n){return JSON.stringify(n)}function St(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Qn="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function _r(n){return typeof n==="object"&&n!==null&&!Array.isArray(n)}var mt=Or(()=>{if(Ir.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(n){return!1}});function vr(n){if(_r(n)===!1)return!1;let i=n.constructor;if(i===void 0)return!0;if(typeof i!=="function")return!0;let o=i.prototype;if(_r(o)===!1)return!1;if(Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)return!1;return!0}function Nt(n){if(vr(n))return{...n};if(Array.isArray(n))return[...n];if(n instanceof Map)return new Map(n);if(n instanceof Set)return new Set(n);return n}function Vc(n){let i=0;for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o))i++;return i}var Xc=(n)=>{let i=typeof n;switch(i){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(n)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(n))return"array";if(n===null)return"null";if(n.then&&typeof n.then==="function"&&n.catch&&typeof n.catch==="function")return"promise";if(typeof Map<"u"&&n instanceof Map)return"map";if(typeof Set<"u"&&n instanceof Set)return"set";if(typeof Date<"u"&&n instanceof Date)return"date";if(typeof File<"u"&&n instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${i}`)}},tn=new Set(["string","number","symbol"]),zt=new Set(["string","number","bigint","boolean","symbol","undefined"]);function R(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function K(n,i,o){let v=new n._zod.constr(i??n._zod.def);if(!i||o?.parent)v._zod.parent=n;return v}function w(n){let i=n;if(!i)return{};if(typeof i==="string")return{error:()=>i};if(i?.message!==void 0){if(i?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");i.error=i.message}if(delete i.message,typeof i.error==="string")return{...i,error:()=>i.error};return i}function qc(n){let i;return new Proxy({},{get(o,v,r){return i??(i=n()),Reflect.get(i,v,r)},set(o,v,r,t){return i??(i=n()),Reflect.set(i,v,r,t)},has(o,v){return i??(i=n()),Reflect.has(i,v)},deleteProperty(o,v){return i??(i=n()),Reflect.deleteProperty(i,v)},ownKeys(o){return i??(i=n()),Reflect.ownKeys(i)},getOwnPropertyDescriptor(o,v){return i??(i=n()),Reflect.getOwnPropertyDescriptor(i,v)},defineProperty(o,v,r){return i??(i=n()),Reflect.defineProperty(i,v,r)}})}function _(n){if(typeof n==="bigint")return n.toString()+"n";if(typeof n==="string")return`"${n}"`;return`${n}`}function Ot(n){return Object.keys(n).filter((i)=>{return n[i]._zod.optin==="optional"&&n[i]._zod.optout==="optional"})}var jt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Pt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Kc(n,i){let o=n._zod.def,v=o.checks;if(v&&v.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let t=rr(n._zod.def,{get shape(){let e={};for(let u in i){if(!(u in o.shape))throw Error(`Unrecognized key: "${u}"`);if(!i[u])continue;e[u]=o.shape[u]}return or(this,"shape",e),e},checks:[]});return K(n,t)}function Yc(n,i){let o=n._zod.def,v=o.checks;if(v&&v.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let t=rr(n._zod.def,{get shape(){let e={...n._zod.def.shape};for(let u in i){if(!(u in o.shape))throw Error(`Unrecognized key: "${u}"`);if(!i[u])continue;delete e[u]}return or(this,"shape",e),e},checks:[]});return K(n,t)}function Qc(n,i){if(!vr(i))throw Error("Invalid input to extend: expected a plain object");let o=n._zod.def.checks;if(o&&o.length>0){let t=n._zod.def.shape;for(let e in i)if(Object.getOwnPropertyDescriptor(t,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=rr(n._zod.def,{get shape(){let t={...n._zod.def.shape,...i};return or(this,"shape",t),t}});return K(n,r)}function Fc(n,i){if(!vr(i))throw Error("Invalid input to safeExtend: expected a plain object");let o=rr(n._zod.def,{get shape(){let v={...n._zod.def.shape,...i};return or(this,"shape",v),v}});return K(n,o)}function Tc(n,i){if(n._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let o=rr(n._zod.def,{get shape(){let v={...n._zod.def.shape,...i._zod.def.shape};return or(this,"shape",v),v},get catchall(){return i._zod.def.catchall},checks:i._zod.def.checks??[]});return K(n,o)}function Hc(n,i,o){let r=i._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let e=rr(i._zod.def,{get shape(){let u=i._zod.def.shape,g={...u};if(o)for(let $ in o){if(!($ in u))throw Error(`Unrecognized key: "${$}"`);if(!o[$])continue;g[$]=n?new n({type:"optional",innerType:u[$]}):u[$]}else for(let $ in u)g[$]=n?new n({type:"optional",innerType:u[$]}):u[$];return or(this,"shape",g),g},checks:[]});return K(i,e)}function Bc(n,i,o){let v=rr(i._zod.def,{get shape(){let r=i._zod.def.shape,t={...r};if(o)for(let e in o){if(!(e in t))throw Error(`Unrecognized key: "${e}"`);if(!o[e])continue;t[e]=new n({type:"nonoptional",innerType:r[e]})}else for(let e in r)t[e]=new n({type:"nonoptional",innerType:r[e]});return or(this,"shape",t),t}});return K(i,v)}function er(n,i=0){if(n.aborted===!0)return!0;for(let o=i;o<n.issues.length;o++)if(n.issues[o]?.continue!==!0)return!0;return!1}function Jt(n,i=0){if(n.aborted===!0)return!0;for(let o=i;o<n.issues.length;o++)if(n.issues[o]?.continue===!1)return!0;return!1}function H(n,i){return i.map((o)=>{var v;return(v=o).path??(v.path=[]),o.path.unshift(n),o})}function sr(n){return typeof n==="string"?n:n?.message}function Y(n,i,o){let v=n.message?n.message:sr(n.inst?._zod.def?.error?.(n))??sr(i?.error?.(n))??sr(o.customError?.(n))??sr(o.localeError?.(n))??"Invalid input",{inst:r,continue:t,input:e,...u}=n;if(u.path??(u.path=[]),u.message=v,i?.reportInput)u.input=e;return u}function on(n){if(n instanceof Set)return"set";if(n instanceof Map)return"map";if(n instanceof File)return"file";return"unknown"}function vn(n){if(Array.isArray(n))return"array";if(typeof n==="string")return"string";return"unknown"}function U(n){let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"nan":"number";case"object":{if(n===null)return"null";if(Array.isArray(n))return"array";let o=n;if(o&&Object.getPrototypeOf(o)!==Object.prototype&&"constructor"in o&&o.constructor)return o.constructor.name}}return i}function jr(...n){let[i,o,v]=n;if(typeof i==="string")return{message:i,code:"custom",input:o,inst:v};return{...i}}function Mc(n){return Object.entries(n).filter(([i,o])=>{return Number.isNaN(Number.parseInt(i,10))}).map((i)=>i[1])}function wg(n){let i=atob(n),o=new Uint8Array(i.length);for(let v=0;v<i.length;v++)o[v]=i.charCodeAt(v);return o}function Sg(n){let i="";for(let o=0;o<n.length;o++)i+=String.fromCharCode(n[o]);return btoa(i)}function dc(n){let i=n.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-i.length%4)%4);return wg(i+o)}function xc(n){return Sg(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Rc(n){let i=n.replace(/^0x/,"");if(i.length%2!==0)throw Error("Invalid hex string length");let o=new Uint8Array(i.length/2);for(let v=0;v<i.length;v+=2)o[v/2]=Number.parseInt(i.slice(v,v+2),16);return o}function fc(n){return Array.from(n).map((i)=>i.toString(16).padStart(2,"0")).join("")}class mg{constructor(...n){}}var Ng=(n,i)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:i,enumerable:!1}),n.message=JSON.stringify(i,zr,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},en=l("$ZodError",Ng),B=l("$ZodError",Ng,{Parent:Error});function un(n,i=(o)=>o.message){let o={},v=[];for(let r of n.issues)if(r.path.length>0)o[r.path[0]]=o[r.path[0]]||[],o[r.path[0]].push(i(r));else v.push(i(r));return{formErrors:v,fieldErrors:o}}function $n(n,i=(o)=>o.message){let o={_errors:[]},v=(r,t=[])=>{for(let e of r.issues)if(e.code==="invalid_union"&&e.errors.length)e.errors.map((u)=>v({issues:u},[...t,...e.path]));else if(e.code==="invalid_key")v({issues:e.issues},[...t,...e.path]);else if(e.code==="invalid_element")v({issues:e.issues},[...t,...e.path]);else{let u=[...t,...e.path];if(u.length===0)o._errors.push(i(e));else{let g=o,$=0;while($<u.length){let c=u[$];if($!==u.length-1)g[c]=g[c]||{_errors:[]};else g[c]=g[c]||{_errors:[]},g[c]._errors.push(i(e));g=g[c],$++}}}};return v(n),o}function Lt(n,i=(o)=>o.message){let o={errors:[]},v=(r,t=[])=>{var e,u;for(let g of r.issues)if(g.code==="invalid_union"&&g.errors.length)g.errors.map(($)=>v({issues:$},[...t,...g.path]));else if(g.code==="invalid_key")v({issues:g.issues},[...t,...g.path]);else if(g.code==="invalid_element")v({issues:g.issues},[...t,...g.path]);else{let $=[...t,...g.path];if($.length===0){o.errors.push(i(g));continue}let c=o,b=0;while(b<$.length){let S=$[b],D=b===$.length-1;if(typeof S==="string")c.properties??(c.properties={}),(e=c.properties)[S]??(e[S]={errors:[]}),c=c.properties[S];else c.items??(c.items=[]),(u=c.items)[S]??(u[S]={errors:[]}),c=c.items[S];if(D)c.errors.push(i(g));b++}}};return v(n),o}function zg(n){let i=[],o=n.map((v)=>typeof v==="object"?v.key:v);for(let v of o)if(typeof v==="number")i.push(`[${v}]`);else if(typeof v==="symbol")i.push(`[${JSON.stringify(String(v))}]`);else if(/[^\w$]/.test(v))i.push(`[${JSON.stringify(v)}]`);else{if(i.length)i.push(".");i.push(v)}return i.join("")}function Et(n){let i=[],o=[...n.issues].sort((v,r)=>(v.path??[]).length-(r.path??[]).length);for(let v of o)if(i.push(`\u2716 ${v.message}`),v.path?.length)i.push(` \u2192 at ${zg(v.path)}`);return i.join(`
|
|
3
3
|
`)}var Pr=(n)=>(i,o,v,r)=>{let t=v?{...v,async:!1}:{async:!1},e=i._zod.run({value:o,issues:[]},t);if(e instanceof Promise)throw new C;if(e.issues.length){let u=new(r?.Err??n)(e.issues.map((g)=>Y(g,t,W())));throw Qn(u,r?.callee),u}return e.value},Fn=Pr(B),Jr=(n)=>async(i,o,v,r)=>{let t=v?{...v,async:!0}:{async:!0},e=i._zod.run({value:o,issues:[]},t);if(e instanceof Promise)e=await e;if(e.issues.length){let u=new(r?.Err??n)(e.issues.map((g)=>Y(g,t,W())));throw Qn(u,r?.callee),u}return e.value},Tn=Jr(B),Lr=(n)=>(i,o,v)=>{let r=v?{...v,async:!1}:{async:!1},t=i._zod.run({value:o,issues:[]},r);if(t instanceof Promise)throw new C;return t.issues.length?{success:!1,error:new(n??en)(t.issues.map((e)=>Y(e,r,W())))}:{success:!0,data:t.value}},Gt=Lr(B),Er=(n)=>async(i,o,v)=>{let r=v?{...v,async:!0}:{async:!0},t=i._zod.run({value:o,issues:[]},r);if(t instanceof Promise)t=await t;return t.issues.length?{success:!1,error:new n(t.issues.map((e)=>Y(e,r,W())))}:{success:!0,data:t.value}},Wt=Er(B),Hn=(n)=>(i,o,v)=>{let r=v?{...v,direction:"backward"}:{direction:"backward"};return Pr(n)(i,o,r)},Cc=Hn(B),Bn=(n)=>(i,o,v)=>{return Pr(n)(i,o,v)},hc=Bn(B),Mn=(n)=>async(i,o,v)=>{let r=v?{...v,direction:"backward"}:{direction:"backward"};return Jr(n)(i,o,r)},yc=Mn(B),dn=(n)=>async(i,o,v)=>{return Jr(n)(i,o,v)},ac=dn(B),xn=(n)=>(i,o,v)=>{let r=v?{...v,direction:"backward"}:{direction:"backward"};return Lr(n)(i,o,r)},pc=xn(B),Rn=(n)=>(i,o,v)=>{return Lr(n)(i,o,v)},sc=Rn(B),fn=(n)=>async(i,o,v)=>{let r=v?{...v,direction:"backward"}:{direction:"backward"};return Er(n)(i,o,r)},rI=fn(B),Zn=(n)=>async(i,o,v)=>{return Er(n)(i,o,v)},nI=Zn(B);var d={};s(d,{xid:()=>qt,uuid7:()=>vI,uuid6:()=>oI,uuid4:()=>tI,uuid:()=>Ur,uppercase:()=>vo,unicodeEmail:()=>Og,undefined:()=>to,ulid:()=>Xt,time:()=>yt,string:()=>pt,sha512_hex:()=>JI,sha512_base64url:()=>EI,sha512_base64:()=>LI,sha384_hex:()=>OI,sha384_base64url:()=>PI,sha384_base64:()=>jI,sha256_hex:()=>mI,sha256_base64url:()=>zI,sha256_base64:()=>NI,sha1_hex:()=>DI,sha1_base64url:()=>SI,sha1_base64:()=>wI,rfc5322Email:()=>uI,number:()=>gn,null:()=>io,nanoid:()=>Yt,md5_hex:()=>_I,md5_base64url:()=>kI,md5_base64:()=>UI,mac:()=>dt,lowercase:()=>oo,ksuid:()=>Kt,ipv6:()=>Mt,ipv4:()=>Bt,integer:()=>ro,idnEmail:()=>$I,httpProtocol:()=>Zt,html5Email:()=>eI,hostname:()=>cI,hex:()=>bI,guid:()=>Ft,extendedDuration:()=>iI,emoji:()=>Ht,email:()=>Tt,e164:()=>Ct,duration:()=>Qt,domain:()=>II,datetime:()=>at,date:()=>ht,cuid2:()=>Vt,cuid:()=>At,cidrv6:()=>Rt,cidrv4:()=>xt,browserEmail:()=>gI,boolean:()=>no,bigint:()=>st,base64url:()=>Cn,base64:()=>ft});var At=/^[cC][0-9a-z]{6,}$/,Vt=/^[0-9a-z]+$/,Xt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qt=/^[0-9a-vA-V]{20}$/,Kt=/^[A-Za-z0-9]{27}$/,Yt=/^[a-zA-Z0-9_-]{21}$/,Qt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,iI=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ft=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ur=(n)=>{if(!n)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},tI=Ur(4),oI=Ur(6),vI=Ur(7),Tt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,eI=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,uI=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Og=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,$I=Og,gI=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,lI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ht(){return new RegExp(lI,"u")}var Bt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Mt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,dt=(n)=>{let i=R(n??":");return new RegExp(`^(?:[0-9A-F]{2}${i}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${i}){5}[0-9a-f]{2}$`)},xt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Rt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ft=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Cn=/^[A-Za-z0-9_-]*$/,cI=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,II=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Zt=/^https?$/,Ct=/^\+[1-9]\d{6,14}$/,jg="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",ht=new RegExp(`^${jg}$`);function Pg(n){return typeof n.precision==="number"?n.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":n.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${n.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function yt(n){return new RegExp(`^${Pg(n)}$`)}function at(n){let i=Pg({precision:n.precision}),o=["Z"];if(n.local)o.push("");if(n.offset)o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let v=`${i}(?:${o.join("|")})`;return new RegExp(`^${jg}T(?:${v})$`)}var pt=(n)=>{let i=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${i}$`)},st=/^-?\d+n?$/,ro=/^-?\d+$/,gn=/^-?\d+(?:\.\d+)?$/,no=/^(?:true|false)$/i,io=/^null$/i;var to=/^undefined$/i;var oo=/^[^A-Z]*$/,vo=/^[^a-z]*$/,bI=/^[0-9a-fA-F]*$/;function ln(n,i){return new RegExp(`^[A-Za-z0-9+/]{${n}}${i}$`)}function cn(n){return new RegExp(`^[A-Za-z0-9_-]{${n}}$`)}var _I=/^[0-9a-fA-F]{32}$/,UI=ln(22,"=="),kI=cn(22),DI=/^[0-9a-fA-F]{40}$/,wI=ln(27,"="),SI=cn(27),mI=/^[0-9a-fA-F]{64}$/,NI=ln(43,"="),zI=cn(43),OI=/^[0-9a-fA-F]{96}$/,jI=ln(64,""),PI=cn(64),JI=/^[0-9a-fA-F]{128}$/,LI=ln(86,"=="),EI=cn(86);var E=l("$ZodCheck",(n,i)=>{var o;n._zod??(n._zod={}),n._zod.def=i,(o=n._zod).onattach??(o.onattach=[])}),Lg={number:"number",bigint:"bigint",object:"date"},hn=l("$ZodCheckLessThan",(n,i)=>{E.init(n,i);let o=Lg[typeof i.value];n._zod.onattach.push((v)=>{let r=v._zod.bag,t=(i.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(i.value<t)if(i.inclusive)r.maximum=i.value;else r.exclusiveMaximum=i.value}),n._zod.check=(v)=>{if(i.inclusive?v.value<=i.value:v.value<i.value)return;v.issues.push({origin:o,code:"too_big",maximum:typeof i.value==="object"?i.value.getTime():i.value,input:v.value,inclusive:i.inclusive,inst:n,continue:!i.abort})}}),yn=l("$ZodCheckGreaterThan",(n,i)=>{E.init(n,i);let o=Lg[typeof i.value];n._zod.onattach.push((v)=>{let r=v._zod.bag,t=(i.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(i.value>t)if(i.inclusive)r.minimum=i.value;else r.exclusiveMinimum=i.value}),n._zod.check=(v)=>{if(i.inclusive?v.value>=i.value:v.value>i.value)return;v.issues.push({origin:o,code:"too_small",minimum:typeof i.value==="object"?i.value.getTime():i.value,input:v.value,inclusive:i.inclusive,inst:n,continue:!i.abort})}}),eo=l("$ZodCheckMultipleOf",(n,i)=>{E.init(n,i),n._zod.onattach.push((o)=>{var v;(v=o._zod.bag).multipleOf??(v.multipleOf=i.value)}),n._zod.check=(o)=>{if(typeof o.value!==typeof i.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof o.value==="bigint"?o.value%i.value===BigInt(0):wt(o.value,i.value)===0)return;o.issues.push({origin:typeof o.value,code:"not_multiple_of",divisor:i.value,input:o.value,inst:n,continue:!i.abort})}}),uo=l("$ZodCheckNumberFormat",(n,i)=>{E.init(n,i),i.format=i.format||"float64";let o=i.format?.includes("int"),v=o?"int":"number",[r,t]=jt[i.format];n._zod.onattach.push((e)=>{let u=e._zod.bag;if(u.format=i.format,u.minimum=r,u.maximum=t,o)u.pattern=ro}),n._zod.check=(e)=>{let u=e.value;if(o){if(!Number.isInteger(u)){e.issues.push({expected:v,format:i.format,code:"invalid_type",continue:!1,input:u,inst:n});return}if(!Number.isSafeInteger(u)){if(u>0)e.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:v,inclusive:!0,continue:!i.abort});else e.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:v,inclusive:!0,continue:!i.abort});return}}if(u<r)e.issues.push({origin:"number",input:u,code:"too_small",minimum:r,inclusive:!0,inst:n,continue:!i.abort});if(u>t)e.issues.push({origin:"number",input:u,code:"too_big",maximum:t,inclusive:!0,inst:n,continue:!i.abort})}}),$o=l("$ZodCheckBigIntFormat",(n,i)=>{E.init(n,i);let[o,v]=Pt[i.format];n._zod.onattach.push((r)=>{let t=r._zod.bag;t.format=i.format,t.minimum=o,t.maximum=v}),n._zod.check=(r)=>{let t=r.value;if(t<o)r.issues.push({origin:"bigint",input:t,code:"too_small",minimum:o,inclusive:!0,inst:n,continue:!i.abort});if(t>v)r.issues.push({origin:"bigint",input:t,code:"too_big",maximum:v,inclusive:!0,inst:n,continue:!i.abort})}}),go=l("$ZodCheckMaxSize",(n,i)=>{var o;E.init(n,i),(o=n._zod.def).when??(o.when=(v)=>{let r=v.value;return!tr(r)&&r.size!==void 0}),n._zod.onattach.push((v)=>{let r=v._zod.bag.maximum??Number.POSITIVE_INFINITY;if(i.maximum<r)v._zod.bag.maximum=i.maximum}),n._zod.check=(v)=>{let r=v.value;if(r.size<=i.maximum)return;v.issues.push({origin:on(r),code:"too_big",maximum:i.maximum,inclusive:!0,input:r,inst:n,continue:!i.abort})}}),lo=l("$ZodCheckMinSize",(n,i)=>{var o;E.init(n,i),(o=n._zod.def).when??(o.when=(v)=>{let r=v.value;return!tr(r)&&r.size!==void 0}),n._zod.onattach.push((v)=>{let r=v._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(i.minimum>r)v._zod.bag.minimum=i.minimum}),n._zod.check=(v)=>{let r=v.value;if(r.size>=i.minimum)return;v.issues.push({origin:on(r),code:"too_small",minimum:i.minimum,inclusive:!0,input:r,inst:n,continue:!i.abort})}}),co=l("$ZodCheckSizeEquals",(n,i)=>{var o;E.init(n,i),(o=n._zod.def).when??(o.when=(v)=>{let r=v.value;return!tr(r)&&r.size!==void 0}),n._zod.onattach.push((v)=>{let r=v._zod.bag;r.minimum=i.size,r.maximum=i.size,r.size=i.size}),n._zod.check=(v)=>{let r=v.value,t=r.size;if(t===i.size)return;let e=t>i.size;v.issues.push({origin:on(r),...e?{code:"too_big",maximum:i.size}:{code:"too_small",minimum:i.size},inclusive:!0,exact:!0,input:v.value,inst:n,continue:!i.abort})}}),Io=l("$ZodCheckMaxLength",(n,i)=>{var o;E.init(n,i),(o=n._zod.def).when??(o.when=(v)=>{let r=v.value;return!tr(r)&&r.length!==void 0}),n._zod.onattach.push((v)=>{let r=v._zod.bag.maximum??Number.POSITIVE_INFINITY;if(i.maximum<r)v._zod.bag.maximum=i.maximum}),n._zod.check=(v)=>{let r=v.value;if(r.length<=i.maximum)return;let e=vn(r);v.issues.push({origin:e,code:"too_big",maximum:i.maximum,inclusive:!0,input:r,inst:n,continue:!i.abort})}}),bo=l("$ZodCheckMinLength",(n,i)=>{var o;E.init(n,i),(o=n._zod.def).when??(o.when=(v)=>{let r=v.value;return!tr(r)&&r.length!==void 0}),n._zod.onattach.push((v)=>{let r=v._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(i.minimum>r)v._zod.bag.minimum=i.minimum}),n._zod.check=(v)=>{let r=v.value;if(r.length>=i.minimum)return;let e=vn(r);v.issues.push({origin:e,code:"too_small",minimum:i.minimum,inclusive:!0,input:r,inst:n,continue:!i.abort})}}),_o=l("$ZodCheckLengthEquals",(n,i)=>{var o;E.init(n,i),(o=n._zod.def).when??(o.when=(v)=>{let r=v.value;return!tr(r)&&r.length!==void 0}),n._zod.onattach.push((v)=>{let r=v._zod.bag;r.minimum=i.length,r.maximum=i.length,r.length=i.length}),n._zod.check=(v)=>{let r=v.value,t=r.length;if(t===i.length)return;let e=vn(r),u=t>i.length;v.issues.push({origin:e,...u?{code:"too_big",maximum:i.length}:{code:"too_small",minimum:i.length},inclusive:!0,exact:!0,input:v.value,inst:n,continue:!i.abort})}}),Gr=l("$ZodCheckStringFormat",(n,i)=>{var o,v;if(E.init(n,i),n._zod.onattach.push((r)=>{let t=r._zod.bag;if(t.format=i.format,i.pattern)t.patterns??(t.patterns=new Set),t.patterns.add(i.pattern)}),i.pattern)(o=n._zod).check??(o.check=(r)=>{if(i.pattern.lastIndex=0,i.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:i.format,input:r.value,...i.pattern?{pattern:i.pattern.toString()}:{},inst:n,continue:!i.abort})});else(v=n._zod).check??(v.check=()=>{})}),Uo=l("$ZodCheckRegex",(n,i)=>{Gr.init(n,i),n._zod.check=(o)=>{if(i.pattern.lastIndex=0,i.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:i.pattern.toString(),inst:n,continue:!i.abort})}}),ko=l("$ZodCheckLowerCase",(n,i)=>{i.pattern??(i.pattern=oo),Gr.init(n,i)}),Do=l("$ZodCheckUpperCase",(n,i)=>{i.pattern??(i.pattern=vo),Gr.init(n,i)}),wo=l("$ZodCheckIncludes",(n,i)=>{E.init(n,i);let o=R(i.includes),v=new RegExp(typeof i.position==="number"?`^.{${i.position}}${o}`:o);i.pattern=v,n._zod.onattach.push((r)=>{let t=r._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(v)}),n._zod.check=(r)=>{if(r.value.includes(i.includes,i.position))return;r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:i.includes,input:r.value,inst:n,continue:!i.abort})}}),So=l("$ZodCheckStartsWith",(n,i)=>{E.init(n,i);let o=new RegExp(`^${R(i.prefix)}.*`);i.pattern??(i.pattern=o),n._zod.onattach.push((v)=>{let r=v._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),n._zod.check=(v)=>{if(v.value.startsWith(i.prefix))return;v.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:i.prefix,input:v.value,inst:n,continue:!i.abort})}}),mo=l("$ZodCheckEndsWith",(n,i)=>{E.init(n,i);let o=new RegExp(`.*${R(i.suffix)}$`);i.pattern??(i.pattern=o),n._zod.onattach.push((v)=>{let r=v._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),n._zod.check=(v)=>{if(v.value.endsWith(i.suffix))return;v.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:i.suffix,input:v.value,inst:n,continue:!i.abort})}});function Jg(n,i,o){if(n.issues.length)i.issues.push(...H(o,n.issues))}var No=l("$ZodCheckProperty",(n,i)=>{E.init(n,i),n._zod.check=(o)=>{let v=i.schema._zod.run({value:o.value[i.property],issues:[]},{});if(v instanceof Promise)return v.then((r)=>Jg(r,o,i.property));Jg(v,o,i.property);return}}),zo=l("$ZodCheckMimeType",(n,i)=>{E.init(n,i);let o=new Set(i.mime);n._zod.onattach.push((v)=>{v._zod.bag.mime=i.mime}),n._zod.check=(v)=>{if(o.has(v.value.type))return;v.issues.push({code:"invalid_value",values:i.mime,input:v.value.type,inst:n,continue:!i.abort})}}),Oo=l("$ZodCheckOverwrite",(n,i)=>{E.init(n,i),n._zod.check=(o)=>{o.value=i.tx(o.value)}});class an{constructor(n=[]){if(this.content=[],this.indent=0,this)this.args=n}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n==="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}let o=n.split(`
|
|
4
4
|
`).filter((t)=>t),v=Math.min(...o.map((t)=>t.length-t.trimStart().length)),r=o.map((t)=>t.slice(v)).map((t)=>" ".repeat(this.indent*2)+t);for(let t of r)this.content.push(t)}compile(){let n=Function,i=this?.args,v=[...(this?.content??[""]).map((r)=>` ${r}`)];return new n(...i,v.join(`
|
|
5
5
|
`))}}var jo={major:4,minor:4,patch:3};var z=l("$ZodType",(n,i)=>{var o;n??(n={}),n._zod.def=i,n._zod.bag=n._zod.bag||{},n._zod.version=jo;let v=[...n._zod.def.checks??[]];if(n._zod.traits.has("$ZodCheck"))v.unshift(n);for(let r of v)for(let t of r._zod.onattach)t(n);if(v.length===0)(o=n._zod).deferred??(o.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{let r=(e,u,g)=>{let $=er(e),c;for(let b of u){if(b._zod.def.when){if(Jt(e))continue;if(!b._zod.def.when(e))continue}else if($)continue;let S=e.issues.length,D=b._zod.check(e);if(D instanceof Promise&&g?.async===!1)throw new C;if(c||D instanceof Promise)c=(c??Promise.resolve()).then(async()=>{if(await D,e.issues.length===S)return;if(!$)$=er(e,S)});else{if(e.issues.length===S)continue;if(!$)$=er(e,S)}}if(c)return c.then(()=>{return e});return e},t=(e,u,g)=>{if(er(e))return e.aborted=!0,e;let $=r(u,v,g);if($ instanceof Promise){if(g.async===!1)throw new C;return $.then((c)=>n._zod.parse(c,g))}return n._zod.parse($,g)};n._zod.run=(e,u)=>{if(u.skipChecks)return n._zod.parse(e,u);if(u.direction==="backward"){let $=n._zod.parse({value:e.value,issues:[]},{...u,skipChecks:!0});if($ instanceof Promise)return $.then((c)=>{return t(c,e,u)});return t($,e,u)}let g=n._zod.parse(e,u);if(g instanceof Promise){if(u.async===!1)throw new C;return g.then(($)=>r($,v,u))}return r(g,v,u)}}j(n,"~standard",()=>({validate:(r)=>{try{let t=Gt(n,r);return t.success?{value:t.data}:{issues:t.error?.issues}}catch(t){return Wt(n,r).then((e)=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),kr=l("$ZodString",(n,i)=>{z.init(n,i),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??pt(n._zod.bag),n._zod.parse=(o,v)=>{if(i.coerce)try{o.value=String(o.value)}catch(r){}if(typeof o.value==="string")return o;return o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:n}),o}}),J=l("$ZodStringFormat",(n,i)=>{Gr.init(n,i),kr.init(n,i)}),Jo=l("$ZodGUID",(n,i)=>{i.pattern??(i.pattern=Ft),J.init(n,i)}),Lo=l("$ZodUUID",(n,i)=>{if(i.version){let v={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[i.version];if(v===void 0)throw Error(`Invalid UUID version: "${i.version}"`);i.pattern??(i.pattern=Ur(v))}else i.pattern??(i.pattern=Ur());J.init(n,i)}),Eo=l("$ZodEmail",(n,i)=>{i.pattern??(i.pattern=Tt),J.init(n,i)}),Go=l("$ZodURL",(n,i)=>{J.init(n,i),n._zod.check=(o)=>{try{let v=o.value.trim();if(!i.normalize&&i.protocol?.source===Zt.source){if(!/^https?:\/\//i.test(v)){o.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:o.value,inst:n,continue:!i.abort});return}}let r=new URL(v);if(i.hostname){if(i.hostname.lastIndex=0,!i.hostname.test(r.hostname))o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:i.hostname.source,input:o.value,inst:n,continue:!i.abort})}if(i.protocol){if(i.protocol.lastIndex=0,!i.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol))o.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:i.protocol.source,input:o.value,inst:n,continue:!i.abort})}if(i.normalize)o.value=r.href;else o.value=v;return}catch(v){o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:n,continue:!i.abort})}}}),Wo=l("$ZodEmoji",(n,i)=>{i.pattern??(i.pattern=Ht()),J.init(n,i)}),Ao=l("$ZodNanoID",(n,i)=>{i.pattern??(i.pattern=Yt),J.init(n,i)}),Vo=l("$ZodCUID",(n,i)=>{i.pattern??(i.pattern=At),J.init(n,i)}),Xo=l("$ZodCUID2",(n,i)=>{i.pattern??(i.pattern=Vt),J.init(n,i)}),qo=l("$ZodULID",(n,i)=>{i.pattern??(i.pattern=Xt),J.init(n,i)}),Ko=l("$ZodXID",(n,i)=>{i.pattern??(i.pattern=qt),J.init(n,i)}),Yo=l("$ZodKSUID",(n,i)=>{i.pattern??(i.pattern=Kt),J.init(n,i)}),Qo=l("$ZodISODateTime",(n,i)=>{i.pattern??(i.pattern=at(i)),J.init(n,i)}),Fo=l("$ZodISODate",(n,i)=>{i.pattern??(i.pattern=ht),J.init(n,i)}),To=l("$ZodISOTime",(n,i)=>{i.pattern??(i.pattern=yt(i)),J.init(n,i)}),Ho=l("$ZodISODuration",(n,i)=>{i.pattern??(i.pattern=Qt),J.init(n,i)}),Bo=l("$ZodIPv4",(n,i)=>{i.pattern??(i.pattern=Bt),J.init(n,i),n._zod.bag.format="ipv4"}),Mo=l("$ZodIPv6",(n,i)=>{i.pattern??(i.pattern=Mt),J.init(n,i),n._zod.bag.format="ipv6",n._zod.check=(o)=>{try{new URL(`http://[${o.value}]`)}catch{o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:n,continue:!i.abort})}}}),xo=l("$ZodMAC",(n,i)=>{i.pattern??(i.pattern=dt(i.delimiter)),J.init(n,i),n._zod.bag.format="mac"}),Ro=l("$ZodCIDRv4",(n,i)=>{i.pattern??(i.pattern=xt),J.init(n,i)}),fo=l("$ZodCIDRv6",(n,i)=>{i.pattern??(i.pattern=Rt),J.init(n,i),n._zod.check=(o)=>{let v=o.value.split("/");try{if(v.length!==2)throw Error();let[r,t]=v;if(!t)throw Error();let e=Number(t);if(`${e}`!==t)throw Error();if(e<0||e>128)throw Error();new URL(`http://[${r}]`)}catch{o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:n,continue:!i.abort})}}});function Zo(n){if(n==="")return!0;if(/\s/.test(n))return!1;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}var Co=l("$ZodBase64",(n,i)=>{i.pattern??(i.pattern=ft),J.init(n,i),n._zod.bag.contentEncoding="base64",n._zod.check=(o)=>{if(Zo(o.value))return;o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:n,continue:!i.abort})}});function dg(n){if(!Cn.test(n))return!1;let i=n.replace(/[-_]/g,(v)=>v==="-"?"+":"/"),o=i.padEnd(Math.ceil(i.length/4)*4,"=");return Zo(o)}var ho=l("$ZodBase64URL",(n,i)=>{i.pattern??(i.pattern=Cn),J.init(n,i),n._zod.bag.contentEncoding="base64url",n._zod.check=(o)=>{if(dg(o.value))return;o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:n,continue:!i.abort})}}),yo=l("$ZodE164",(n,i)=>{i.pattern??(i.pattern=Ct),J.init(n,i)});function xg(n,i=null){try{let o=n.split(".");if(o.length!==3)return!1;let[v]=o;if(!v)return!1;let r=JSON.parse(atob(v));if("typ"in r&&r?.typ!=="JWT")return!1;if(!r.alg)return!1;if(i&&(!("alg"in r)||r.alg!==i))return!1;return!0}catch{return!1}}var ao=l("$ZodJWT",(n,i)=>{J.init(n,i),n._zod.check=(o)=>{if(xg(o.value,i.alg))return;o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:n,continue:!i.abort})}}),po=l("$ZodCustomStringFormat",(n,i)=>{J.init(n,i),n._zod.check=(o)=>{if(i.fn(o.value))return;o.issues.push({code:"invalid_format",format:i.format,input:o.value,inst:n,continue:!i.abort})}}),ii=l("$ZodNumber",(n,i)=>{z.init(n,i),n._zod.pattern=n._zod.bag.pattern??gn,n._zod.parse=(o,v)=>{if(i.coerce)try{o.value=Number(o.value)}catch(e){}let r=o.value;if(typeof r==="number"&&!Number.isNaN(r)&&Number.isFinite(r))return o;let t=typeof r==="number"?Number.isNaN(r)?"NaN":!Number.isFinite(r)?"Infinity":void 0:void 0;return o.issues.push({expected:"number",code:"invalid_type",input:r,inst:n,...t?{received:t}:{}}),o}}),so=l("$ZodNumberFormat",(n,i)=>{uo.init(n,i),ii.init(n,i)}),In=l("$ZodBoolean",(n,i)=>{z.init(n,i),n._zod.pattern=no,n._zod.parse=(o,v)=>{if(i.coerce)try{o.value=Boolean(o.value)}catch(t){}let r=o.value;if(typeof r==="boolean")return o;return o.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:n}),o}}),ti=l("$ZodBigInt",(n,i)=>{z.init(n,i),n._zod.pattern=st,n._zod.parse=(o,v)=>{if(i.coerce)try{o.value=BigInt(o.value)}catch(r){}if(typeof o.value==="bigint")return o;return o.issues.push({expected:"bigint",code:"invalid_type",input:o.value,inst:n}),o}}),rv=l("$ZodBigIntFormat",(n,i)=>{$o.init(n,i),ti.init(n,i)}),nv=l("$ZodSymbol",(n,i)=>{z.init(n,i),n._zod.parse=(o,v)=>{let r=o.value;if(typeof r==="symbol")return o;return o.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:n}),o}}),iv=l("$ZodUndefined",(n,i)=>{z.init(n,i),n._zod.pattern=to,n._zod.values=new Set([void 0]),n._zod.parse=(o,v)=>{let r=o.value;if(typeof r>"u")return o;return o.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:n}),o}}),tv=l("$ZodNull",(n,i)=>{z.init(n,i),n._zod.pattern=io,n._zod.values=new Set([null]),n._zod.parse=(o,v)=>{let r=o.value;if(r===null)return o;return o.issues.push({expected:"null",code:"invalid_type",input:r,inst:n}),o}}),ov=l("$ZodAny",(n,i)=>{z.init(n,i),n._zod.parse=(o)=>o}),vv=l("$ZodUnknown",(n,i)=>{z.init(n,i),n._zod.parse=(o)=>o}),ev=l("$ZodNever",(n,i)=>{z.init(n,i),n._zod.parse=(o,v)=>{return o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:n}),o}}),uv=l("$ZodVoid",(n,i)=>{z.init(n,i),n._zod.parse=(o,v)=>{let r=o.value;if(typeof r>"u")return o;return o.issues.push({expected:"void",code:"invalid_type",input:r,inst:n}),o}}),$v=l("$ZodDate",(n,i)=>{z.init(n,i),n._zod.parse=(o,v)=>{if(i.coerce)try{o.value=new Date(o.value)}catch(u){}let r=o.value,t=r instanceof Date;if(t&&!Number.isNaN(r.getTime()))return o;return o.issues.push({expected:"date",code:"invalid_type",input:r,...t?{received:"Invalid Date"}:{},inst:n}),o}});function Gg(n,i,o){if(n.issues.length)i.issues.push(...H(o,n.issues));i.value[o]=n.value}var gv=l("$ZodArray",(n,i)=>{z.init(n,i),n._zod.parse=(o,v)=>{let r=o.value;if(!Array.isArray(r))return o.issues.push({expected:"array",code:"invalid_type",input:r,inst:n}),o;o.value=Array(r.length);let t=[];for(let e=0;e<r.length;e++){let u=r[e],g=i.element._zod.run({value:u,issues:[]},v);if(g instanceof Promise)t.push(g.then(($)=>Gg($,o,e)));else Gg(g,o,e)}if(t.length)return Promise.all(t).then(()=>o);return o}});function ni(n,i,o,v,r,t){let e=o in v;if(n.issues.length){if(r&&t&&!e)return;i.issues.push(...H(o,n.issues))}if(!e&&!r){if(!n.issues.length)i.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[o]});return}if(n.value===void 0){if(e)i.value[o]=void 0}else i.value[o]=n.value}function Rg(n){let i=Object.keys(n.shape);for(let v of i)if(!n.shape?.[v]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${v}": expected a Zod schema`);let o=Ot(n.shape);return{...n,keys:i,keySet:new Set(i),numKeys:i.length,optionalKeys:new Set(o)}}function fg(n,i,o,v,r,t){let e=[],u=r.keySet,g=r.catchall._zod,$=g.def.type,c=g.optin==="optional",b=g.optout==="optional";for(let S in i){if(S==="__proto__")continue;if(u.has(S))continue;if($==="never"){e.push(S);continue}let D=g.run({value:i[S],issues:[]},v);if(D instanceof Promise)n.push(D.then((N)=>ni(N,o,S,i,c,b)));else ni(D,o,S,i,c,b)}if(e.length)o.issues.push({code:"unrecognized_keys",keys:e,input:i,inst:t});if(!n.length)return o;return Promise.all(n).then(()=>{return o})}var Zg=l("$ZodObject",(n,i)=>{if(z.init(n,i),!Object.getOwnPropertyDescriptor(i,"shape")?.get){let u=i.shape;Object.defineProperty(i,"shape",{get:()=>{let g={...u};return Object.defineProperty(i,"shape",{value:g}),g}})}let v=Or(()=>Rg(i));j(n._zod,"propValues",()=>{let u=i.shape,g={};for(let $ in u){let c=u[$]._zod;if(c.values){g[$]??(g[$]=new Set);for(let b of c.values)g[$].add(b)}}return g});let r=_r,t=i.catchall,e;n._zod.parse=(u,g)=>{e??(e=v.value);let $=u.value;if(!r($))return u.issues.push({expected:"object",code:"invalid_type",input:$,inst:n}),u;u.value={};let c=[],b=e.shape;for(let S of e.keys){let D=b[S],N=D._zod.optin==="optional",T=D._zod.optout==="optional",A=D._zod.run({value:$[S],issues:[]},g);if(A instanceof Promise)c.push(A.then((_t)=>ni(_t,u,S,$,N,T)));else ni(A,u,S,$,N,T)}if(!t)return c.length?Promise.all(c).then(()=>u):u;return fg(c,$,u,g,v.value,n)}}),lv=l("$ZodObjectJIT",(n,i)=>{Zg.init(n,i);let o=n._zod.parse,v=Or(()=>Rg(i)),r=(S)=>{let D=new an(["shape","payload","ctx"]),N=v.value,T=(Z)=>{let G=Yn(Z);return`shape[${G}]._zod.run({ value: input[${G}], issues: [] }, ctx)`};D.write("const input = payload.value;");let A=Object.create(null),_t=0;for(let Z of N.keys)A[Z]=`key_${_t++}`;D.write("const newResult = {};");for(let Z of N.keys){let G=A[Z],V=Yn(Z),_g=S[Z],Ug=_g?._zod?.optin==="optional",Nc=_g?._zod?.optout==="optional";if(D.write(`const ${G} = ${T(Z)};`),Ug&&Nc)D.write(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{B as gO,D as Jd,F as F5,G as B5,H as O5,O as Qd,P as bO,Q as $k,R as cl,S as i3,T as P7,U as H3}from"./chunk-
|
|
1
|
+
import{B as gO,D as Jd,F as F5,G as B5,H as O5,O as Qd,P as bO,Q as $k,R as cl,S as i3,T as P7,U as H3}from"./chunk-pq18zenh.js";import{ea as Ed}from"./chunk-wsyg4rwg.js";import{Wa as _p}from"./chunk-kfhtk3eh.js";import{$a as Hd,_a as Od,ab as Md,bb as Dd,cb as Td,db as Rd,eb as Nd,fb as zd}from"./chunk-0xbf8bcg.js";import{Bf as C3,Cf as _3,Df as v_,Ff as kb,Gf as S_,Hf as y_,Jf as k_,Kf as M_,Lf as Cb,Mf as C_,Nf as __,Of as wd,Pf as jd,Qf as dd,Rf as qd,Sf as hO,Tf as cO,Uf as kp,Vf as Cp,ag as _5}from"./chunk-77r8w95d.js";import{og as uO,pg as wo,qg as hi}from"./chunk-fa2g2wge.js";import{Mg as yd}from"./chunk-fz88kkk1.js";import{Og as c8}from"./chunk-dghtwyq1.js";import{Qg as Ln,Rg as Mf,Tg as Df,Ug as Tf,Vg as l1,Yg as n3,bh as Yd,ch as mO,dh as h8,eh as kd,fh as Cd,gh as _d,ih as Fd,jh as Bd}from"./chunk-gswbc6y9.js";import{$h as bd,Aj as l8,Cj as pd,Ei as Gd,Ej as Vd,Gi as $_,Ji as Vn,Jj as Qk,Kj as Zk,Lh as xd,Mi as C5,Mj as qo,Sh as Le,ai as Zd,bk as E2,dj as l3,gk as Mi,hj as f3,hk as Ad,ij as ul,ik as vd,ji as Ud,jk as Sd,li as r8,lj as Xd,mh as Pa,mj as Vk,mk as It,nh as mo,ni as O3,nj as hh,oh as x,oj as ch,ph as rt,qh as k5,qj as Kd,rj as Yk,si as Id,th as po,tj as Jk,vh as Hf,vi as oh,wh as oO,wi as jo,xi as aO,xj as Ld,yi as iO}from"./chunk-nyhqy6q2.js";import{Vk as Ie,Wk as Me,Xk as o4}from"./chunk-0qkj838r.js";var kw=Me((lJ,yw)=>{var qw=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,wM=/\n/g,jM=/^\s*/,dM=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,qM=/^:\s*/,AM=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,vM=/^[;\s]*/,SM=/^\s+|\s+$/g,yM=`
|
|
2
2
|
`,Aw="/",vw="*",Cf="",kM="comment",CM="declaration";function _M(t,e){if(typeof t!=="string")throw TypeError("First argument must be a string");if(!t)return[];e=e||{};var a=1,i=1;function s(d){var v=d.match(wM);if(v)a+=v.length;var k=d.lastIndexOf(yM);i=~k?d.length-k:i+d.length}function n(){var d={line:a,column:i};return function(v){return v.position=new l(d),c(),v}}function l(d){this.start=d,this.end={line:a,column:i},this.source=e.source}l.prototype.content=t;function f(d){var v=Error(e.source+":"+a+":"+i+": "+d);if(v.reason=d,v.filename=e.source,v.line=a,v.column=i,v.source=t,e.silent);else throw v}function o(d){var v=d.exec(t);if(!v)return;var k=v[0];return s(k),t=t.slice(k.length),v}function c(){o(jM)}function u(d){var v;d=d||[];while(v=m())if(v!==!1)d.push(v);return d}function m(){var d=n();if(Aw!=t.charAt(0)||vw!=t.charAt(1))return;var v=2;while(Cf!=t.charAt(v)&&(vw!=t.charAt(v)||Aw!=t.charAt(v+1)))++v;if(v+=2,Cf===t.charAt(v-1))return f("End of comment missing");var k=t.slice(2,v-2);return i+=2,s(k),t=t.slice(v),i+=2,d({type:kM,comment:k})}function p(){var d=n(),v=o(dM);if(!v)return;if(m(),!o(qM))return f("property missing ':'");var k=o(AM),y=d({type:CM,property:Sw(v[0].replace(qw,Cf)),value:k?Sw(k[0].replace(qw,Cf)):Cf});return o(vM),y}function w(){var d=[];u(d);var v;while(v=p())if(v!==!1)d.push(v),u(d);return d}return c(),w()}function Sw(t){return t?t.replace(SM,Cf):Cf}yw.exports=_M});var Cw=Me((Dc)=>{var FM=Dc&&Dc.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dc,"__esModule",{value:!0});Dc.default=OM;var BM=FM(kw());function OM(t,e){let a=null;if(!t||typeof t!=="string")return a;let i=(0,BM.default)(t),s=typeof e==="function";return i.forEach((n)=>{if(n.type!=="declaration")return;let{property:l,value:f}=n;if(s)e(l,f,n);else if(f)a=a||{},a[l]=f}),a}});var Ow=Me((Fw)=>{Object.defineProperty(Fw,"__esModule",{value:!0});Fw.camelCase=void 0;var HM=/^--[a-zA-Z0-9_-]+$/,MM=/-([a-z])/g,DM=/^[^-]+$/,TM=/^-(webkit|moz|ms|o|khtml)-/,RM=/^-(ms)-/,NM=function(t){return!t||DM.test(t)||HM.test(t)},zM=function(t,e){return e.toUpperCase()},_w=function(t,e){return"".concat(e,"-")},EM=function(t,e){if(e===void 0)e={};if(NM(t))return t;if(t=t.toLowerCase(),e.reactCompat)t=t.replace(RM,_w);else t=t.replace(TM,_w);return t.replace(MM,zM)};Fw.camelCase=EM});var Mw=Me((j4,Hw)=>{var xM=j4&&j4.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},UM=xM(Cw()),IM=Ow();function w4(t,e){var a={};if(!t||typeof t!=="string")return a;return(0,UM.default)(t,function(i,s){if(i&&s)a[(0,IM.camelCase)(i,e)]=s}),a}w4.default=w4;Hw.exports=w4});var ad=Me((ZP,ed)=>{var v5=Object.prototype.hasOwnProperty,td=Object.prototype.toString,Jj=Object.defineProperty,Qj=Object.getOwnPropertyDescriptor,Zj=function(e){if(typeof Array.isArray==="function")return Array.isArray(e);return td.call(e)==="[object Array]"},$j=function(e){if(!e||td.call(e)!=="[object Object]")return!1;var a=v5.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&v5.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!a&&!i)return!1;var s;for(s in e);return typeof s>"u"||v5.call(e,s)},Wj=function(e,a){if(Jj&&a.name==="__proto__")Jj(e,a.name,{enumerable:!0,configurable:!0,value:a.newValue,writable:!0});else e[a.name]=a.newValue},Pj=function(e,a){if(a==="__proto__"){if(!v5.call(e,a))return;else if(Qj)return Qj(e,a).value}return e[a]};ed.exports=function t(){var e,a,i,s,n,l,f=arguments[0],o=1,c=arguments.length,u=!1;if(typeof f==="boolean")u=f,f=arguments[1]||{},o=2;if(f==null||typeof f!=="object"&&typeof f!=="function")f={};for(;o<c;++o)if(e=arguments[o],e!=null){for(a in e)if(i=Pj(f,a),s=Pj(e,a),f!==s){if(u&&s&&($j(s)||(n=Zj(s)))){if(n)n=!1,l=i&&Zj(i)?i:[];else l=i&&$j(i)?i:{};Wj(f,{name:a,newValue:t(u,l,s)})}else if(typeof s<"u")Wj(f,{name:a,newValue:s})}}return f}});var h0=Me((Met,Wd)=>{var $c;if(typeof window<"u")$c=window;else if(typeof global<"u")$c=global;else if(typeof self<"u")$c=self;else $c={};Wd.exports=$c});var u8=Me((Det,tq)=>{var Pd=Array.prototype.slice;tq.exports=AR;function AR(t,e){if(!("length"in t))t=[t];t=Pd.call(t);while(t.length){var a=t.shift(),i=e(a);if(i)return i;if(a.childNodes&&a.childNodes.length)t=Pd.call(a.childNodes).concat(t)}}});var aq=Me((Tet,eq)=>{eq.exports=Ao;function Ao(t,e){if(!(this instanceof Ao))return new Ao(t,e);this.data=t,this.nodeValue=t,this.length=t.length,this.ownerDocument=e||null}Ao.prototype.nodeType=8;Ao.prototype.nodeName="#comment";Ao.prototype.toString=function(){return"[object Comment]"}});var sq=Me((Ret,iq)=>{iq.exports=ml;function ml(t,e){if(!(this instanceof ml))return new ml(t);this.data=t||"",this.length=this.data.length,this.ownerDocument=e||null}ml.prototype.type="DOMTextNode";ml.prototype.nodeType=3;ml.prototype.nodeName="#text";ml.prototype.toString=function(){return this.data};ml.prototype.replaceData=function(e,a,i){var s=this.data,n=s.substring(0,e),l=s.substring(e+a,s.length);this.data=n+i+l,this.length=this.data.length}});var m8=Me((Net,nq)=>{nq.exports=vR;function vR(t){var e=this,a=t.type;if(!t.target)t.target=e;if(!e.listeners)e.listeners={};var i=e.listeners[a];if(i)return i.forEach(function(s){if(t.currentTarget=e,typeof s==="function")s(t);else s.handleEvent(t)});if(e.parentNode)e.parentNode.dispatchEvent(t)}});var g8=Me((zet,lq)=>{lq.exports=SR;function SR(t,e){var a=this;if(!a.listeners)a.listeners={};if(!a.listeners[t])a.listeners[t]=[];if(a.listeners[t].indexOf(e)===-1)a.listeners[t].push(e)}});var b8=Me((Eet,fq)=>{fq.exports=yR;function yR(t,e){var a=this;if(!a.listeners)return;if(!a.listeners[t])return;var i=a.listeners[t],s=i.indexOf(e);if(s!==-1)i.splice(s,1)}});var cq=Me((xet,hq)=>{hq.exports=rq;var kR=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function rq(t){switch(t.nodeType){case 3:return p8(t.data);case 8:return"<!--"+t.data+"-->";default:return CR(t)}}function CR(t){var e=[],a=t.tagName;if(t.namespaceURI==="http://www.w3.org/1999/xhtml")a=a.toLowerCase();if(e.push("<"+a+OR(t)+BR(t)),kR.indexOf(a)>-1)e.push(" />");else{if(e.push(">"),t.childNodes.length)e.push.apply(e,t.childNodes.map(rq));else if(t.textContent||t.innerText)e.push(p8(t.textContent||t.innerText));else if(t.innerHTML)e.push(t.innerHTML);e.push("</"+a+">")}return e.join("")}function _R(t,e){var a=typeof t[e];if(e==="style"&&Object.keys(t.style).length>0)return!0;return t.hasOwnProperty(e)&&(a==="string"||a==="boolean"||a==="number")&&e!=="nodeName"&&e!=="className"&&e!=="tagName"&&e!=="textContent"&&e!=="innerText"&&e!=="namespaceURI"&&e!=="innerHTML"}function FR(t){if(typeof t==="string")return t;var e="";return Object.keys(t).forEach(function(a){var i=t[a];a=a.replace(/[A-Z]/g,function(s){return"-"+s.toLowerCase()}),e+=a+":"+i+";"}),e}function BR(t){var e=t.dataset,a=[];for(var i in e)a.push({name:"data-"+i,value:e[i]});return a.length?oq(a):""}function oq(t){var e=[];return t.forEach(function(a){var{name:i,value:s}=a;if(i==="style")s=FR(s);e.push(i+'="'+HR(s)+'"')}),e.length?" "+e.join(" "):""}function OR(t){var e=[];for(var a in t)if(_R(t,a))e.push({name:a,value:t[a]});for(var i in t._attributes)for(var s in t._attributes[i]){var n=t._attributes[i][s],l=(n.prefix?n.prefix+":":"")+s;e.push({name:l,value:n.value})}if(t.className)e.push({name:"class",value:t.className});return e.length?oq(e):""}function p8(t){var e="";if(typeof t==="string")e=t;else if(t)e=t.toString();return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function HR(t){return p8(t).replace(/"/g,""")}});var j8=Me((Uet,mq)=>{var w8=u8(),MR=m8(),DR=g8(),TR=b8(),RR=cq(),uq="http://www.w3.org/1999/xhtml";mq.exports=Ca;function Ca(t,e,a){if(!(this instanceof Ca))return new Ca(t);var i=a===void 0?uq:a||null;if(this.tagName=i===uq?String(t).toUpperCase():t,this.nodeName=this.tagName,this.className="",this.dataset={},this.childNodes=[],this.parentNode=null,this.style={},this.ownerDocument=e||null,this.namespaceURI=i,this._attributes={},this.tagName==="INPUT")this.type="text"}Ca.prototype.type="DOMElement";Ca.prototype.nodeType=1;Ca.prototype.appendChild=function(e){if(e.parentNode)e.parentNode.removeChild(e);return this.childNodes.push(e),e.parentNode=this,e};Ca.prototype.replaceChild=function(e,a){if(e.parentNode)e.parentNode.removeChild(e);var i=this.childNodes.indexOf(a);return a.parentNode=null,this.childNodes[i]=e,e.parentNode=this,a};Ca.prototype.removeChild=function(e){var a=this.childNodes.indexOf(e);return this.childNodes.splice(a,1),e.parentNode=null,e};Ca.prototype.insertBefore=function(e,a){if(e.parentNode)e.parentNode.removeChild(e);var i=a===null||a===void 0?-1:this.childNodes.indexOf(a);if(i>-1)this.childNodes.splice(i,0,e);else this.childNodes.push(e);return e.parentNode=this,e};Ca.prototype.setAttributeNS=function(e,a,i){var s=null,n=a,l=a.indexOf(":");if(l>-1)s=a.substr(0,l),n=a.substr(l+1);if(this.tagName==="INPUT"&&a==="type")this.type=i;else{var f=this._attributes[e]||(this._attributes[e]={});f[n]={value:i,prefix:s}}};Ca.prototype.getAttributeNS=function(e,a){var i=this._attributes[e],s=i&&i[a]&&i[a].value;if(this.tagName==="INPUT"&&a==="type")return this.type;if(typeof s!=="string")return null;return s};Ca.prototype.removeAttributeNS=function(e,a){if(!Object.prototype.hasOwnProperty.call(this._attributes,e))return;var i=this._attributes[e];if(i&&Object.prototype.hasOwnProperty.call(i,a))delete i[a]};Ca.prototype.hasAttributeNS=function(e,a){var i=this._attributes[e];return!!i&&a in i};Ca.prototype.setAttribute=function(e,a){return this.setAttributeNS(null,e,a)};Ca.prototype.getAttribute=function(e){return this.getAttributeNS(null,e)};Ca.prototype.removeAttribute=function(e){return this.removeAttributeNS(null,e)};Ca.prototype.hasAttribute=function(e){return this.hasAttributeNS(null,e)};Ca.prototype.removeEventListener=TR;Ca.prototype.addEventListener=DR;Ca.prototype.dispatchEvent=MR;Ca.prototype.focus=function(){return};Ca.prototype.toString=function(){return RR(this)};Ca.prototype.getElementsByClassName=function(e){var a=e.split(" "),i=[];return w8(this,function(s){if(s.nodeType===1){var n=s.className||"",l=n.split(" ");if(a.every(function(f){return l.indexOf(f)!==-1}))i.push(s)}}),i};Ca.prototype.getElementsByTagName=function(e){e=e.toLowerCase();var a=[];return w8(this.childNodes,function(i){if(i.nodeType===1&&(e==="*"||i.tagName.toLowerCase()===e))a.push(i)}),a};Ca.prototype.contains=function(e){return w8(this,function(a){return e===a})||!1}});var bq=Me((Iet,gq)=>{var d8=j8();gq.exports=c0;function c0(t){if(!(this instanceof c0))return new c0;this.childNodes=[],this.parentNode=null,this.ownerDocument=t||null}c0.prototype.type="DocumentFragment";c0.prototype.nodeType=11;c0.prototype.nodeName="#document-fragment";c0.prototype.appendChild=d8.prototype.appendChild;c0.prototype.replaceChild=d8.prototype.replaceChild;c0.prototype.removeChild=d8.prototype.removeChild;c0.prototype.toString=function(){return this.childNodes.map(function(e){return String(e)}).join("")}});var wq=Me((Get,pq)=>{pq.exports=q8;function q8(t){}q8.prototype.initEvent=function(e,a,i){this.type=e,this.bubbles=a,this.cancelable=i};q8.prototype.preventDefault=function(){}});var dq=Me((Xet,jq)=>{var NR=u8(),zR=aq(),ER=sq(),Wc=j8(),xR=bq(),UR=wq(),IR=m8(),GR=g8(),XR=b8();jq.exports=H5;function H5(){if(!(this instanceof H5))return new H5;this.head=this.createElement("head"),this.body=this.createElement("body"),this.documentElement=this.createElement("html"),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body),this.childNodes=[this.documentElement],this.nodeType=9}var Ws=H5.prototype;Ws.createTextNode=function(e){return new ER(e,this)};Ws.createElementNS=function(e,a){var i=e===null?null:String(e);return new Wc(a,this,i)};Ws.createElement=function(e){return new Wc(e,this)};Ws.createDocumentFragment=function(){return new xR(this)};Ws.createEvent=function(e){return new UR(e)};Ws.createComment=function(e){return new zR(e,this)};Ws.getElementById=function(e){e=String(e);var a=NR(this.childNodes,function(i){if(String(i.id)===e)return i});return a||null};Ws.getElementsByClassName=Wc.prototype.getElementsByClassName;Ws.getElementsByTagName=Wc.prototype.getElementsByTagName;Ws.contains=Wc.prototype.contains;Ws.removeEventListener=XR;Ws.addEventListener=GR;Ws.dispatchEvent=IR});var Aq=Me((Ket,qq)=>{var KR=dq();qq.exports=new KR});var A8=Me((Let,Sq)=>{var vq=typeof global<"u"?global:typeof window<"u"?window:{},LR=Aq(),Pc;if(typeof document<"u")Pc=document;else if(Pc=vq["__GLOBAL_DOCUMENT_CACHE@4"],!Pc)Pc=vq["__GLOBAL_DOCUMENT_CACHE@4"]=LR;Sq.exports=Pc});var yq=Me((Vet,f1)=>{function v8(){return f1.exports=v8=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var i in a)({}).hasOwnProperty.call(a,i)&&(t[i]=a[i])}return t},f1.exports.__esModule=!0,f1.exports.default=f1.exports,v8.apply(null,arguments)}f1.exports=v8,f1.exports.__esModule=!0,f1.exports.default=f1.exports});var Cq=Me((Yet,kq)=>{kq.exports=YR;var VR=Object.prototype.toString;function YR(t){if(!t)return!1;var e=VR.call(t);return e==="[object Function]"||typeof t==="function"&&e!=="[object RegExp]"||typeof window<"u"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}});var Bq=Me((Jet,Fq)=>{function JR(t,e){var a=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(a)return(a=a.call(t)).next.bind(a);if(Array.isArray(t)||(a=QR(t))||e&&t&&typeof t.length==="number"){if(a)t=a;var i=0;return function(){if(i>=t.length)return{done:!0};return{done:!1,value:t[i++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QR(t,e){if(!t)return;if(typeof t==="string")return _q(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);if(a==="Object"&&t.constructor)a=t.constructor.name;if(a==="Map"||a==="Set")return Array.from(t);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _q(t,e)}function _q(t,e){if(e==null||e>t.length)e=t.length;for(var a=0,i=Array(e);a<e;a++)i[a]=t[a];return i}var ZR=function(){function t(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var e=t.prototype;return e.getIsEnabled=function(){return this.enabled_},e.enable=function(){this.enabled_=!0},e.disable=function(){this.enabled_=!1},e.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},e.addInterceptor=function(i,s){if(!this.typeToInterceptorsMap_.has(i))this.typeToInterceptorsMap_.set(i,new Set);var n=this.typeToInterceptorsMap_.get(i);if(n.has(s))return!1;return n.add(s),!0},e.removeInterceptor=function(i,s){var n=this.typeToInterceptorsMap_.get(i);if(n&&n.has(s))return n.delete(s),!0;return!1},e.clearInterceptorsByType=function(i){var s=this.typeToInterceptorsMap_.get(i);if(!s)return!1;return this.typeToInterceptorsMap_.delete(i),this.typeToInterceptorsMap_.set(i,new Set),!0},e.clear=function(){if(!this.typeToInterceptorsMap_.size)return!1;return this.typeToInterceptorsMap_=new Map,!0},e.getForType=function(i){return this.typeToInterceptorsMap_.get(i)||new Set},e.execute=function(i,s){var n=this.getForType(i);for(var l=JR(n),f;!(f=l()).done;){var o=f.value;try{s=o(s)}catch(c){}}return s},t}();Fq.exports=ZR});var Hq=Me((Qet,Oq)=>{var $R=function(){function t(){this.maxAttempts_=1,this.delayFactor_=0.1,this.fuzzFactor_=0.1,this.initialDelay_=1000,this.enabled_=!1}var e=t.prototype;return e.getIsEnabled=function(){return this.enabled_},e.enable=function(){this.enabled_=!0},e.disable=function(){this.enabled_=!1},e.reset=function(){this.maxAttempts_=1,this.delayFactor_=0.1,this.fuzzFactor_=0.1,this.initialDelay_=1000,this.enabled_=!1},e.getMaxAttempts=function(){return this.maxAttempts_},e.setMaxAttempts=function(i){this.maxAttempts_=i},e.getDelayFactor=function(){return this.delayFactor_},e.setDelayFactor=function(i){this.delayFactor_=i},e.getFuzzFactor=function(){return this.fuzzFactor_},e.setFuzzFactor=function(i){this.fuzzFactor_=i},e.getInitialDelay=function(){return this.initialDelay_},e.setInitialDelay=function(i){this.initialDelay_=i},e.createRetry=function(i){var s=i===void 0?{}:i,n=s.maxAttempts,l=s.delayFactor,f=s.fuzzFactor,o=s.initialDelay;return new WR({maxAttempts:n||this.maxAttempts_,delayFactor:l||this.delayFactor_,fuzzFactor:f||this.fuzzFactor_,initialDelay:o||this.initialDelay_})},t}(),WR=function(){function t(a){this.maxAttempts_=a.maxAttempts,this.delayFactor_=a.delayFactor,this.fuzzFactor_=a.fuzzFactor,this.currentDelay_=a.initialDelay,this.currentAttempt_=1}var e=t.prototype;return e.moveToNextAttempt=function(){this.currentAttempt_++;var i=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+i},e.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},e.getCurrentDelay=function(){return this.currentDelay_},e.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},e.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},e.getCurrentFuzzedDelay=function(){var i=this.getCurrentMinPossibleDelay(),s=this.getCurrentMaxPossibleDelay();return i+Math.random()*(s-i)},t}();Oq.exports=$R});var Dq=Me((Zet,Mq)=>{var PR=h0(),tN=function(e,a){if(a===void 0)a=!1;return function(i,s,n){if(i){e(i);return}if(s.statusCode>=400&&s.statusCode<=599){var l=n;if(a)if(PR.TextDecoder){var f=eN(s.headers&&s.headers["content-type"]);try{l=new TextDecoder(f).decode(n)}catch(o){}}else l=String.fromCharCode.apply(null,new Uint8Array(n));e({cause:l});return}e(null,n)}};function eN(t){if(t===void 0)t="";return t.toLowerCase().split(";").reduce(function(e,a){var i=a.split("="),s=i[0],n=i[1];if(s.trim()==="charset")return n.trim();return e},"utf-8")}Mq.exports=tN});var zq=Me(($et,y8)=>{var Tq=h0(),aN=yq(),iN=Cq(),Rq=Bq(),sN=Hq();ti.httpHandler=Dq();ti.requestInterceptorsStorage=new Rq;ti.responseInterceptorsStorage=new Rq;ti.retryManager=new sN;var nN=function(e){var a={};if(!e)return a;return e.trim().split(`
|
|
4
4
|
`).forEach(function(i){var s=i.indexOf(":"),n=i.slice(0,s).trim().toLowerCase(),l=i.slice(s+1).trim();if(typeof a[n]>"u")a[n]=l;else if(Array.isArray(a[n]))a[n].push(l);else a[n]=[a[n],l]}),a};y8.exports=ti;y8.exports.default=ti;ti.XMLHttpRequest=Tq.XMLHttpRequest||oN;ti.XDomainRequest="withCredentials"in new ti.XMLHttpRequest?ti.XMLHttpRequest:Tq.XDomainRequest;lN(["get","put","post","patch","head","delete"],function(t){ti[t==="delete"?"del":t]=function(e,a,i){return a=Nq(e,a,i),a.method=t.toUpperCase(),S8(a)}});function lN(t,e){for(var a=0;a<t.length;a++)e(t[a])}function fN(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}function Nq(t,e,a){var i=t;if(iN(e)){if(a=e,typeof t==="string")i={uri:t}}else i=aN({},e,{uri:t});return i.callback=a,i}function ti(t,e,a){return e=Nq(t,e,a),S8(e)}function S8(t){if(typeof t.callback>"u")throw Error("callback argument missing");if(t.requestType&&ti.requestInterceptorsStorage.getIsEnabled()){var e={uri:t.uri||t.url,headers:t.headers||{},body:t.body,metadata:t.metadata||{},retry:t.retry,timeout:t.timeout},a=ti.requestInterceptorsStorage.execute(t.requestType,e);t.uri=a.uri,t.headers=a.headers,t.body=a.body,t.metadata=a.metadata,t.retry=a.retry,t.timeout=a.timeout}var i=!1,s=function(D,T,z){if(!i)i=!0,t.callback(D,T,z)};function n(){if(c.readyState===4&&!ti.responseInterceptorsStorage.getIsEnabled())setTimeout(o,0)}function l(){var M=void 0;if(c.response)M=c.response;else M=c.responseText||rN(c);if(y)try{M=JSON.parse(M)}catch(D){}return M}function f(M){if(clearTimeout(B),clearTimeout(t.retryTimeout),!(M instanceof Error))M=Error(""+(M||"Unknown XMLHttpRequest Error"));if(M.statusCode=0,!m&&ti.retryManager.getIsEnabled()&&t.retry&&t.retry.shouldRetry()){t.retryTimeout=setTimeout(function(){t.retry.moveToNextAttempt(),t.xhr=c,S8(t)},t.retry.getCurrentFuzzedDelay());return}if(t.requestType&&ti.responseInterceptorsStorage.getIsEnabled()){var D={headers:H.headers||{},body:H.body,responseUrl:c.responseURL,responseType:c.responseType},T=ti.responseInterceptorsStorage.execute(t.requestType,D);H.body=T.body,H.headers=T.headers}return s(M,H)}function o(){if(m)return;var M;if(clearTimeout(B),clearTimeout(t.retryTimeout),t.useXDR&&c.status===void 0)M=200;else M=c.status===1223?204:c.status;var D=H,T=null;if(M!==0){if(D={body:l(),statusCode:M,method:w,headers:{},url:p,rawRequest:c},c.getAllResponseHeaders)D.headers=nN(c.getAllResponseHeaders())}else T=Error("Internal XMLHttpRequest Error");if(t.requestType&&ti.responseInterceptorsStorage.getIsEnabled()){var z={headers:D.headers||{},body:D.body,responseUrl:c.responseURL,responseType:c.responseType},E=ti.responseInterceptorsStorage.execute(t.requestType,z);D.body=E.body,D.headers=E.headers}return s(T,D,D.body)}var c=t.xhr||null;if(!c)if(t.cors||t.useXDR)c=new ti.XDomainRequest;else c=new ti.XMLHttpRequest;var u,m,p=c.url=t.uri||t.url,w=c.method=t.method||"GET",d=t.body||t.data,v=c.headers=t.headers||{},k=!!t.sync,y=!1,B,H={body:void 0,headers:{},statusCode:0,method:w,url:p,rawRequest:c};if("json"in t&&t.json!==!1){if(y=!0,v.accept||v.Accept||(v.Accept="application/json"),w!=="GET"&&w!=="HEAD")v["content-type"]||v["Content-Type"]||(v["Content-Type"]="application/json"),d=JSON.stringify(t.json===!0?d:t.json)}if(c.onreadystatechange=n,c.onload=o,c.onerror=f,c.onprogress=function(){},c.onabort=function(){m=!0,clearTimeout(t.retryTimeout)},c.ontimeout=f,c.open(w,p,!k,t.username,t.password),!k)c.withCredentials=!!t.withCredentials;if(!k&&t.timeout>0)B=setTimeout(function(){if(m)return;m=!0,c.abort("timeout");var M=Error("XMLHttpRequest timeout");M.code="ETIMEDOUT",f(M)},t.timeout);if(c.setRequestHeader){for(u in v)if(v.hasOwnProperty(u))c.setRequestHeader(u,v[u])}else if(t.headers&&!fN(t.headers))throw Error("Headers cannot be set on an XDomainRequest object");if("responseType"in t)c.responseType=t.responseType;if("beforeSend"in t&&typeof t.beforeSend==="function")t.beforeSend(c);return c.send(d||null),c}function rN(t){try{if(t.responseType==="document")return t.responseXML;var e=t.responseXML&&t.responseXML.documentElement.nodeName==="parsererror";if(t.responseType===""&&!e)return t.responseXML}catch(a){}return null}function oN(){}});var Kq=Me((Wet,Xq)=>{var Eq=A8(),C8=Object.create||function(){function t(){}return function(e){if(arguments.length!==1)throw Error("Object.create shim only accepts one parameter.");return t.prototype=e,new t}}();function Ps(t,e){this.name="ParsingError",this.code=t.code,this.message=e||t.message}Ps.prototype=C8(Error.prototype);Ps.prototype.constructor=Ps;Ps.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function _8(t){function e(i,s,n,l){return(i|0)*3600+(s|0)*60+(n|0)+(l|0)/1000}var a=t.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);if(!a)return null;if(a[3])return e(a[1],a[2],a[3].replace(":",""),a[4]);else if(a[1]>59)return e(a[1],a[2],0,a[4]);else return e(0,a[1],a[2],a[4])}function e2(){this.values=C8(null)}e2.prototype={set:function(t,e){if(!this.get(t)&&e!=="")this.values[t]=e},get:function(t,e,a){if(a)return this.has(t)?this.values[t]:e[a];return this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,a){for(var i=0;i<a.length;++i)if(e===a[i]){this.set(t,e);break}},integer:function(t,e){if(/^-?\d+$/.test(e))this.set(t,parseInt(e,10))},percent:function(t,e){var a;if(a=e.match(/^([\d]{1,3})(\.[\d]*)?%$/)){if(e=parseFloat(e),e>=0&&e<=100)return this.set(t,e),!0}return!1}};function t2(t,e,a,i){var s=i?t.split(i):[t];for(var n in s){if(typeof s[n]!=="string")continue;var l=s[n].split(a);if(l.length!==2)continue;var f=l[0].trim(),o=l[1].trim();e(f,o)}}function hN(t,e,a){var i=t;function s(){var f=_8(t);if(f===null)throw new Ps(Ps.Errors.BadTimeStamp,"Malformed timestamp: "+i);return t=t.replace(/^[^\sa-zA-Z-]+/,""),f}function n(f,o){var c=new e2;t2(f,function(u,m){switch(u){case"region":for(var p=a.length-1;p>=0;p--)if(a[p].id===m){c.set(u,a[p].region);break}break;case"vertical":c.alt(u,m,["rl","lr"]);break;case"line":var w=m.split(","),d=w[0];if(c.integer(u,d),c.percent(u,d)&&c.set("snapToLines",!1),c.alt(u,d,["auto"]),w.length===2)c.alt("lineAlign",w[1],["start","center","end"]);break;case"position":if(w=m.split(","),c.percent(u,w[0]),w.length===2)c.alt("positionAlign",w[1],["start","center","end"]);break;case"size":c.percent(u,m);break;case"align":c.alt(u,m,["start","center","end","left","right"]);break}},/:/,/\s/),o.region=c.get("region",null),o.vertical=c.get("vertical","");try{o.line=c.get("line","auto")}catch(u){}o.lineAlign=c.get("lineAlign","start"),o.snapToLines=c.get("snapToLines",!0),o.size=c.get("size",100);try{o.align=c.get("align","center")}catch(u){o.align=c.get("align","middle")}try{o.position=c.get("position","auto")}catch(u){o.position=c.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},o.align)}o.positionAlign=c.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},o.align)}function l(){t=t.replace(/^\s+/,"")}if(l(),e.startTime=s(),l(),t.substr(0,3)!=="-->")throw new Ps(Ps.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+i);t=t.substr(3),l(),e.endTime=s(),l(),n(t,e)}var k8=Eq.createElement&&Eq.createElement("textarea"),cN={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},xq={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},uN={v:"title",lang:"lang"},Uq={rt:"ruby"};function Gq(t,e){function a(){if(!e)return null;function d(k){return e=e.substr(k.length),k}var v=e.match(/^([^<]*)(<[^>]*>?)?/);return d(v[1]?v[1]:v[2])}function i(d){return k8.innerHTML=d,d=k8.textContent,k8.textContent="",d}function s(d,v){return!Uq[v.localName]||Uq[v.localName]===d.localName}function n(d,v){var k=cN[d];if(!k)return null;var y=t.document.createElement(k),B=uN[d];if(B&&v)y[B]=v.trim();return y}var l=t.document.createElement("div"),f=l,o,c=[];while((o=a())!==null){if(o[0]==="<"){if(o[1]==="/"){if(c.length&&c[c.length-1]===o.substr(2).replace(">",""))c.pop(),f=f.parentNode;continue}var u=_8(o.substr(1,o.length-2)),m;if(u){m=t.document.createProcessingInstruction("timestamp",u),f.appendChild(m);continue}var p=o.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!p)continue;if(m=n(p[1],p[3]),!m)continue;if(!s(f,m))continue;if(p[2]){var w=p[2].split(".");w.forEach(function(d){var v=/^bg_/.test(d),k=v?d.slice(3):d;if(xq.hasOwnProperty(k)){var y=v?"background-color":"color",B=xq[k];m.style[y]=B}}),m.className=w.join(" ")}c.push(p[1]),f.appendChild(m),f=m;continue}f.appendChild(t.document.createTextNode(i(o)))}return l}var Iq=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function mN(t){for(var e=0;e<Iq.length;e++){var a=Iq[e];if(t>=a[0]&&t<=a[1])return!0}return!1}function gN(t){var e=[],a="",i;if(!t||!t.childNodes)return"ltr";function s(f,o){for(var c=o.childNodes.length-1;c>=0;c--)f.push(o.childNodes[c])}function n(f){if(!f||!f.length)return null;var o=f.pop(),c=o.textContent||o.innerText;if(c){var u=c.match(/^.*(\n|\r)/);if(u)return f.length=0,u[0];return c}if(o.tagName==="ruby")return n(f);if(o.childNodes)return s(f,o),n(f)}s(e,t);while(a=n(e))for(var l=0;l<a.length;l++)if(i=a.charCodeAt(l),mN(i))return"rtl";return"ltr"}function bN(t){if(typeof t.line==="number"&&(t.snapToLines||t.line>=0&&t.line<=100))return t.line;if(!t.track||!t.track.textTrackList||!t.track.textTrackList.mediaElement)return-1;var e=t.track,a=e.textTrackList,i=0;for(var s=0;s<a.length&&a[s]!==e;s++)if(a[s].mode==="showing")i++;return++i*-1}function D5(){}D5.prototype.applyStyles=function(t,e){e=e||this.div;for(var a in t)if(t.hasOwnProperty(a))e.style[a]=t[a]};D5.prototype.formatStyle=function(t,e){return t===0?0:t+e};function M5(t,e,a){D5.call(this),this.cue=e,this.cueDiv=Gq(t,e.text);var i={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(i,this.cueDiv),this.div=t.document.createElement("div"),i={direction:gN(this.cueDiv),writingMode:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:e.align==="middle"?"center":e.align,font:a.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(i),this.div.appendChild(this.cueDiv);var s=0;switch(e.positionAlign){case"start":case"line-left":s=e.position;break;case"center":s=e.position-e.size/2;break;case"end":case"line-right":s=e.position-e.size;break}if(e.vertical==="")this.applyStyles({left:this.formatStyle(s,"%"),width:this.formatStyle(e.size,"%")});else this.applyStyles({top:this.formatStyle(s,"%"),height:this.formatStyle(e.size,"%")});this.move=function(n){this.applyStyles({top:this.formatStyle(n.top,"px"),bottom:this.formatStyle(n.bottom,"px"),left:this.formatStyle(n.left,"px"),right:this.formatStyle(n.right,"px"),height:this.formatStyle(n.height,"px"),width:this.formatStyle(n.width,"px")})}}M5.prototype=C8(D5.prototype);M5.prototype.constructor=M5;function hs(t){var e,a,i,s;if(t.div){a=t.div.offsetHeight,i=t.div.offsetWidth,s=t.div.offsetTop;var n=(n=t.div.childNodes)&&(n=n[0])&&n.getClientRects&&n.getClientRects();t=t.div.getBoundingClientRect(),e=n?Math.max(n[0]&&n[0].height||0,t.height/n.length):0}this.left=t.left,this.right=t.right,this.top=t.top||s,this.height=t.height||a,this.bottom=t.bottom||s+(t.height||a),this.width=t.width||i,this.lineHeight=e!==void 0?e:t.lineHeight}hs.prototype.move=function(t,e){switch(e=e!==void 0?e:this.lineHeight,t){case"+x":this.left+=e,this.right+=e;break;case"-x":this.left-=e,this.right-=e;break;case"+y":this.top+=e,this.bottom+=e;break;case"-y":this.top-=e,this.bottom-=e;break}};hs.prototype.overlaps=function(t){return this.left<t.right&&this.right>t.left&&this.top<t.bottom&&this.bottom>t.top};hs.prototype.overlapsAny=function(t){for(var e=0;e<t.length;e++)if(this.overlaps(t[e]))return!0;return!1};hs.prototype.within=function(t){return this.top>=t.top&&this.bottom<=t.bottom&&this.left>=t.left&&this.right<=t.right};hs.prototype.overlapsOppositeAxis=function(t,e){switch(e){case"+x":return this.left<t.left;case"-x":return this.right>t.right;case"+y":return this.top<t.top;case"-y":return this.bottom>t.bottom}};hs.prototype.intersectPercentage=function(t){var e=Math.max(0,Math.min(this.right,t.right)-Math.max(this.left,t.left)),a=Math.max(0,Math.min(this.bottom,t.bottom)-Math.max(this.top,t.top)),i=e*a;return i/(this.height*this.width)};hs.prototype.toCSSCompatValues=function(t){return{top:this.top-t.top,bottom:t.bottom-this.bottom,left:this.left-t.left,right:t.right-this.right,height:this.height,width:this.width}};hs.getSimpleBoxPosition=function(t){var e=t.div?t.div.offsetHeight:t.tagName?t.offsetHeight:0,a=t.div?t.div.offsetWidth:t.tagName?t.offsetWidth:0,i=t.div?t.div.offsetTop:t.tagName?t.offsetTop:0;t=t.div?t.div.getBoundingClientRect():t.tagName?t.getBoundingClientRect():t;var s={left:t.left,right:t.right,top:t.top||i,height:t.height||e,bottom:t.bottom||i+(t.height||e),width:t.width||a};return s};function pN(t,e,a,i){function s(k,y){var B,H=new hs(k),M=1;for(var D=0;D<y.length;D++){while(k.overlapsOppositeAxis(a,y[D])||k.within(a)&&k.overlapsAny(i))k.move(y[D]);if(k.within(a))return k;var T=k.intersectPercentage(a);if(M>T)B=new hs(k),M=T;k=new hs(H)}return B||H}var n=new hs(e),l=e.cue,f=bN(l),o=[];if(l.snapToLines){var c;switch(l.vertical){case"":o=["+y","-y"],c="height";break;case"rl":o=["+x","-x"],c="width";break;case"lr":o=["-x","+x"],c="width";break}var u=n.lineHeight,m=u*Math.round(f),p=a[c]+u,w=o[0];if(Math.abs(m)>p)m=m<0?-1:1,m*=Math.ceil(p/u)*u;if(f<0)m+=l.vertical===""?a.height:a.width,o=o.reverse();n.move(w,m)}else{var d=n.lineHeight/a.height*100;switch(l.lineAlign){case"center":f-=d/2;break;case"end":f-=d;break}switch(l.vertical){case"":e.applyStyles({top:e.formatStyle(f,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(f,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(f,"%")});break}o=["+y","-x","+x","-y"],n=new hs(e)}var v=s(n,o);e.move(v.toCSSCompatValues(a))}function vo(){}vo.StringDecoder=function(){return{decode:function(t){if(!t)return"";if(typeof t!=="string")throw Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}};vo.convertCueToDOMTree=function(t,e){if(!t||!e)return null;return Gq(t,e)};var wN=0.05,jN="sans-serif",dN="1.5%";vo.processCues=function(t,e,a){if(!t||!e||!a)return null;while(a.firstChild)a.removeChild(a.firstChild);var i=t.document.createElement("div");i.style.position="absolute",i.style.left="0",i.style.right="0",i.style.top="0",i.style.bottom="0",i.style.margin=dN,a.appendChild(i);function s(u){for(var m=0;m<u.length;m++)if(u[m].hasBeenReset||!u[m].displayState)return!0;return!1}if(!s(e)){for(var n=0;n<e.length;n++)i.appendChild(e[n].displayState);return}var l=[],f=hs.getSimpleBoxPosition(i),o=Math.round(f.height*wN*100)/100,c={font:o+"px "+jN};(function(){var u,m;for(var p=0;p<e.length;p++)m=e[p],u=new M5(t,m,c),i.appendChild(u.div),pN(t,u,f,l),m.displayState=u.div,l.push(hs.getSimpleBoxPosition(u))})()};vo.Parser=function(t,e,a){if(!a)a=e,e={};if(!e)e={};this.window=t,this.vttjs=e,this.state="INITIAL",this.buffer="",this.decoder=a||new TextDecoder("utf8"),this.regionList=[]};vo.Parser.prototype={reportOrThrowError:function(t){if(t instanceof Ps)this.onparsingerror&&this.onparsingerror(t);else throw t},parse:function(t){var e=this;if(t)e.buffer+=e.decoder.decode(t,{stream:!0});function a(){var u=e.buffer,m=0;while(m<u.length&&u[m]!=="\r"&&u[m]!==`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as B}from"./chunk-qqk51620.js";import"./chunk-h0ytx8zc.js";import"./chunk-xyjw8w3r.js";import"./chunk-ccw7mjgq.js";import"./chunk-pq18zenh.js";import"./chunk-wsyg4rwg.js";import"./chunk-7e06b2zb.js";import"./chunk-srn8t0v7.js";import"./chunk-kfhtk3eh.js";import"./chunk-kr06nrbx.js";import"./chunk-b8js74jk.js";import"./chunk-0xbf8bcg.js";import"./chunk-wg98cacx.js";import"./chunk-15sefy5t.js";import"./chunk-77r8w95d.js";import"./chunk-t3t6021k.js";import"./chunk-54tr7y2x.js";import"./chunk-1xpec5r8.js";import"./chunk-0rxhc7ka.js";import"./chunk-fa2g2wge.js";import"./chunk-fz88kkk1.js";import"./chunk-dghtwyq1.js";import"./chunk-gswbc6y9.js";import{Gh as w,oh as q}from"./chunk-nyhqy6q2.js";import"./chunk-0qkj838r.js";function O(){let{shareId:C,fileId:D}=k.useParams(),{start:E,version:G,compare:H,cmpLeft:J,cmpRight:K,cmpActive:N}=k.useSearch();return q(B,{shareId:C,initialFileId:D,startTime:E,versionId:G,compare:H,compareLeftId:J,compareRightId:K,compareActiveSide:N})}var k=w("/share/$shareId/files/$fileId")({component:O});export{k as Route};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Bk as G}from"./chunk-bs0fjz3w.js";import{Vk as F}from"./chunk-0qkj838r.js";var y=F(G(),1),H=new Set(['"',"\\","/","b","f","n","r","t","u"]);function K(b){let f=b.codePointAt(0);return f!==void 0&&f>=0&&f<=31}function Q(b){switch(b){case"\b":return"\\b";case"\f":return"\\f";case`
|
|
3
3
|
`:return"\\n";case"\r":return"\\r";case"\t":return"\\t";default:return`\\u${b.codePointAt(0)?.toString(16).padStart(4,"0")??"0000"}`}}function B(b){let f="",v=!1;for(let k=0;k<b.length;k++){let q=b[k];if(!v){if(f+=q,q==='"')v=!0;continue}if(q==='"'){f+=q,v=!1;continue}if(q==="\\"){let w=b[k+1];if(w===void 0){f+="\\\\";continue}if(w==="u"){let z=b.slice(k+2,k+6);if(/^[0-9a-fA-F]{4}$/.test(z)){f+=`\\u${z}`,k+=5;continue}}if(H.has(w)){f+=`\\${w}`,k+=1;continue}f+="\\\\";continue}f+=K(q)?Q(q):q}return f}function T(b){try{return JSON.parse(b)}catch(f){let v=B(b);if(v!==b)return JSON.parse(v);throw f}}function X(b){if(!b||b.trim()==="")return{};try{return T(b)}catch{try{return y.parse(b)??{}}catch{try{return y.parse(B(b))??{}}catch{return{}}}}}
|
|
4
4
|
export{T as We,X as Xe};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{sk as S,tk as T,uk as C}from"./chunk-7hsgmjpa.js";import"./chunk-j8qtab70.js";import{wk as D}from"./chunk-5t6c3038.js";import{yk as Z}from"./chunk-9ab6k4rq.js";import"./chunk-zemrvz79.js";import"./chunk-bs0fjz3w.js";import{Ck as k}from"./chunk-4qpa7b5t.js";import{Ok as f}from"./chunk-re0b7sj7.js";import{Sk as M,Tk as V}from"./chunk-922nnh39.js";import"./chunk-9h027f50.js";import"./chunk-0qkj838r.js";var j="v1",E=new Set(["openai","openai-codex","opencode","azure-openai-responses"]);function K(G){let Q=new Map;if(!G)return Q;for(let w of G.split(",")){let W=w.trim();if(!W)continue;let[X,J]=W.split("=",2);if(!X||!J)continue;Q.set(X.trim(),J.trim())}return Q}function g(G,Q){if(Q?.azureDeploymentName)return Q.azureDeploymentName;return K(process.env.AZURE_OPENAI_DEPLOYMENT_NAME_MAP).get(G.id)||G.id}function B(G){if(G instanceof Error){let Q=G.status,w=typeof Q==="number"?Q:void 0;if(w!==void 0)return`Azure OpenAI API error (${w}): ${G.message}`;return G.message}try{return JSON.stringify(G)}catch{return String(G)}}var I=(G,Q,w)=>{let W=new V;return(async()=>{let X=g(G,w),J={role:"assistant",content:[],api:"azure-openai-responses",provider:G.provider,model:G.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let Y=w?.apiKey;if(!Y)throw Error(`No API key for provider: ${G.provider}`);let $=z(G,Y,w),q=b(G,Q,w,X),F=await w?.onPayload?.(q,G);if(F!==void 0)q=F;let L={...w?.signal?{signal:w.signal}:{},...w?.timeoutMs!==void 0?{timeout:w.timeoutMs}:{},maxRetries:w?.maxRetries??0},{data:_,response:H}=await $.responses.create(q,L).withResponse();if(await w?.onResponse?.({status:H.status,headers:k(H.headers)},G),W.push({type:"start",partial:J}),await C(_,J,W,G),w?.signal?.aborted)throw Error("Request was aborted");if(J.stopReason==="aborted"||J.stopReason==="error")throw Error("An unknown error occurred");W.push({type:"done",reason:J.stopReason,message:J}),W.end()}catch(Y){for(let $ of J.content)delete $.index,delete $.partialJson;J.stopReason=w?.signal?.aborted?"aborted":"error",J.errorMessage=B(Y),W.push({type:"error",reason:J.stopReason,error:J}),W.end()}})(),W},c=(G,Q,w)=>{let W=w?.apiKey;if(!W)throw Error(`No API key for provider: ${G.provider}`);let X=f(G,w,W),J=w?.reasoning?M(G,w.reasoning):void 0;return I(G,Q,{...X,reasoningEffort:J==="off"?void 0:J})};function P(G){let Q=G.trim().replace(/\/+$/,""),w;try{w=new URL(Q)}catch{throw Error(`Invalid Azure OpenAI base URL: ${G}`)}let W=w.hostname.endsWith(".openai.azure.com")||w.hostname.endsWith(".cognitiveservices.azure.com"),X=w.pathname.replace(/\/+$/,"");if(W&&(X===""||X==="/"||X==="/openai"))w.pathname="/openai/v1",w.search="";return w.toString().replace(/\/+$/,"")}function O(G){return`https://${G}.openai.azure.com/openai/v1`}function h(G,Q){let w=Q?.azureApiVersion||process.env.AZURE_OPENAI_API_VERSION||j,W=Q?.azureBaseUrl?.trim()||process.env.AZURE_OPENAI_BASE_URL?.trim()||void 0,X=Q?.azureResourceName||process.env.AZURE_OPENAI_RESOURCE_NAME,J=W;if(!J&&X)J=O(X);if(!J&&G.baseUrl)J=G.baseUrl;if(!J)throw Error("Azure OpenAI base URL is required. Set AZURE_OPENAI_BASE_URL or AZURE_OPENAI_RESOURCE_NAME, or pass azureBaseUrl, azureResourceName, or model.baseUrl.");return{baseUrl:P(J),apiVersion:w}}function z(G,Q,w){let W={...G.headers};if(w?.headers)Object.assign(W,w.headers);let{baseUrl:X,apiVersion:J}=h(G,w);return new Z({apiKey:Q,apiVersion:J,dangerouslyAllowBrowser:!0,defaultHeaders:W,baseURL:X})}function b(G,Q,w,W){let X=S(G,Q,E),J={model:W,input:X,stream:!0,prompt_cache_key:D(w?.sessionId)};if(w?.maxTokens)J.max_output_tokens=w?.maxTokens;if(w?.temperature!==void 0)J.temperature=w?.temperature;if(Q.tools&&Q.tools.length>0)J.tools=T(Q.tools);if(G.reasoning){if(w?.reasoningEffort||w?.reasoningSummary){let Y=w?.reasoningEffort?G.thinkingLevelMap?.[w.reasoningEffort]??w.reasoningEffort:"medium";J.reasoning={effort:Y,summary:w?.reasoningSummary||"auto"},J.include=["reasoning.encrypted_content"]}else if(G.thinkingLevelMap?.off!==null)J.reasoning={effort:G.thinkingLevelMap?.off??"none"}}return J}export{c as streamSimpleAzureOpenAIResponses,I as streamAzureOpenAIResponses};
|