sliccy 3.37.1 → 3.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/assets/adobe-6ekJOAbP.js +2 -0
- package/dist/ui/assets/{adobe-Do5FVWEd.js → adobe-Dbtiqx38.js} +1 -1
- package/dist/ui/assets/agent-bridge-BpvRrGtE.js +1 -0
- package/dist/ui/assets/{agent-message-to-chat-gcUd4azi.js → agent-message-to-chat-CirhIhp-.js} +1 -1
- package/dist/ui/assets/{anthropic-CPc6AdUF.js → anthropic-Bc4wRfIs.js} +2 -2
- package/dist/ui/assets/{anthropic-DqX3RKuq.js → anthropic-DeFXFJgQ.js} +1 -1
- package/dist/ui/assets/{apps-BW1k6lF-.js → apps-DO2uOt-9.js} +1 -1
- package/dist/ui/assets/{azure-openai-lQA0OsYZ.js → azure-openai-D7WR5xIn.js} +1 -1
- package/dist/ui/assets/azure-openai-DTYBcMPG.js +1 -0
- package/dist/ui/assets/{azure-openai-responses-D7KfF46t.js → azure-openai-responses-CaON53BQ.js} +1 -1
- package/dist/ui/assets/azure-openai-responses-DNVmx4qz.js +1 -0
- package/dist/ui/assets/{biome_wasm-C15EopD6.js → biome_wasm-CVknj_xD.js} +1 -1
- package/dist/ui/assets/{bsh-watchdog-B4BKDMv9.js → bsh-watchdog-X5_2cHRb.js} +1 -1
- package/dist/ui/assets/{cdp-Ck34I7rp.js → cdp-QAh2Cy7Y.js} +3 -3
- package/dist/ui/assets/{cdp-ws-page-bridge-xODEflym.js → cdp-ws-page-bridge-DchL-saa.js} +1 -1
- package/dist/ui/assets/{common-D_RGfoLs.js → common-D-zb7tFR.js} +1 -1
- package/dist/ui/assets/{connect-surface-DQiJgxmp.js → connect-surface-B08-lROA.js} +1 -1
- package/dist/ui/assets/cost-command-KII6x53b.js +1 -0
- package/dist/ui/assets/{dist-CZleMBgY.js → dist-BUp5ZKTe.js} +1 -1
- package/dist/ui/assets/{dist-BeB4OPFR.js → dist-C3aqBmpl.js} +1 -1
- package/dist/ui/assets/{dist-DFawGJ88.js → dist-DPujqrCp.js} +1 -1
- package/dist/ui/assets/{dist-5eteEdeW.js → dist-X1KlMLP2.js} +1 -1
- package/dist/ui/assets/{es-CFfrd0ul.js → es-9XUoJ8uS.js} +1 -1
- package/dist/ui/assets/esp32-BGhaU4F4.js +1 -0
- package/dist/ui/assets/esp32-CNxr-r6b.js +1 -0
- package/dist/ui/assets/esp32c2-CFWOihPO.js +1 -0
- package/dist/ui/assets/esp32c2-Cig1fvmU.js +1 -0
- package/dist/ui/assets/esp32c3-BCQ4OtJ1.js +1 -0
- package/dist/ui/assets/esp32c3-BKiIoFJ0.js +1 -0
- package/dist/ui/assets/esp32c5-Bd1q0WgP.js +1 -0
- package/dist/ui/assets/esp32c5-BfwIJIeC.js +1 -0
- package/dist/ui/assets/esp32c6-CR8KvzQK.js +1 -0
- package/dist/ui/assets/esp32c6-DIlTUw4d.js +1 -0
- package/dist/ui/assets/esp32c61-BNeMp5wP.js +1 -0
- package/dist/ui/assets/esp32c61-ByuVKC7b.js +1 -0
- package/dist/ui/assets/esp32h2-D2KQ2YCv.js +1 -0
- package/dist/ui/assets/esp32h2-DIXUsh8G.js +1 -0
- package/dist/ui/assets/esp32p4-DPqFNZ5I.js +1 -0
- package/dist/ui/assets/esp32p4-DQAIVsCH.js +1 -0
- package/dist/ui/assets/esp32s2-CL7U2rWs.js +1 -0
- package/dist/ui/assets/esp32s2-IFH9AqZl.js +1 -0
- package/dist/ui/assets/esp32s3-CTm8ijuz.js +1 -0
- package/dist/ui/assets/esp32s3-Dx7X8tO1.js +1 -0
- package/dist/ui/assets/esp8266-BR4D5ppf.js +1 -0
- package/dist/ui/assets/esp8266-DlqfHb7M.js +1 -0
- package/dist/ui/assets/esptool-operations-Dh_CbFQX.js +13 -0
- package/dist/ui/assets/esptool-operations-DpqsEewy.js +12 -0
- package/dist/ui/assets/{follower-sprinkle-bridge-CBj18dVf.js → follower-sprinkle-bridge-9Y9xLvYP.js} +1 -1
- package/dist/ui/assets/{github-C6Ut-Hki.js → github-B8UeFkm8.js} +1 -1
- package/dist/ui/assets/github-CQx2L4YC.js +2 -0
- package/dist/ui/assets/{github-copilot-Dqba68pv.js → github-copilot-DsrDQ00N.js} +1 -1
- package/dist/ui/assets/github-copilot-_sjl5LuA.js +2 -0
- package/dist/ui/assets/google-C55LkvGP.js +1 -0
- package/dist/ui/assets/{google-CCReXHOY.js → google-DfvC3eni.js} +1 -1
- package/dist/ui/assets/{google-shared-CV2aMv2V.js → google-shared-BtXV-l3b.js} +1 -1
- package/dist/ui/assets/{google-shared-Cgd8LKVE.js → google-shared-D7WzcGUZ.js} +3 -3
- package/dist/ui/assets/{google-vertex-DA4qECv8.js → google-vertex-BuAG1U4s.js} +1 -1
- package/dist/ui/assets/google-vertex-hOuEM6_G.js +1 -0
- package/dist/ui/assets/hosted-config-apply-BwFI9A7v.js +1 -0
- package/dist/ui/assets/{intercepted-oauth-Ca2ar2P-.js → intercepted-oauth-COerdsHV.js} +1 -1
- package/dist/ui/assets/js-realm-worker-DFuUhqWh.js +5 -0
- package/dist/ui/assets/{kernel-worker-3dJlBPKw.js → kernel-worker-BN9jVURi.js} +1194 -1065
- package/dist/ui/assets/{lick-ws-bridge-DXWCrUpu.js → lick-ws-bridge-KoiVTblv.js} +1 -1
- package/dist/ui/assets/{local-llm-CvUKDON7.js → local-llm-vFYRcLOw.js} +2 -2
- package/dist/ui/assets/{magick-wasm-DHrcSuej.js → magick-wasm-CidNK8__.js} +1 -1
- package/dist/ui/assets/main-D7z3x3_Y.js +1825 -0
- package/dist/ui/assets/main-cherry-ofRlsW4-.js +1 -0
- package/dist/ui/assets/{migration-run-N0b3mn0V.js → migration-run-7dEwzG6w.js} +1 -1
- package/dist/ui/assets/{mistral-q0AndRb9.js → mistral-4heSdDTJ.js} +1 -1
- package/dist/ui/assets/{mistral-C0BwdjQK.js → mistral-CAgia6M0.js} +2 -2
- package/dist/ui/assets/{nodejs-C9x-6kuN.js → nodejs-DfRdaKQ1.js} +1 -1
- package/dist/ui/assets/{nuke-command-Dyosu0J7.js → nuke-command-Cc30YO9Y.js} +1 -1
- package/dist/ui/assets/{oauth-788GCHZ5.js → oauth-TCqaadpJ.js} +1 -1
- package/dist/ui/assets/oauth-bootstrap-C1BSYDbV.js +2 -0
- package/dist/ui/assets/oauth-service-COeryBep.js +1 -0
- package/dist/ui/assets/{oauth-service-DjGfalyq.js → oauth-service-DW1e-iJS.js} +1 -1
- package/dist/ui/assets/offscreen-client-qrJEELC-.js +1 -0
- package/dist/ui/assets/onboarding-orchestrator-Cfempts7.js +1 -0
- package/dist/ui/assets/openai-codex-CXt4lcoL.js +1 -0
- package/dist/ui/assets/{openai-codex-responses-sPuczYbE.js → openai-codex-responses-D40BqWeW.js} +1 -1
- package/dist/ui/assets/openai-codex-responses-Vw6eXh1d.js +7 -0
- package/dist/ui/assets/{openai-codex-DOHPeNTF.js → openai-codex-x1sc3IM7.js} +1 -1
- package/dist/ui/assets/openai-completions-BMW7FpCv.js +5 -0
- package/dist/ui/assets/openai-responses-B2Bk2mZO.js +1 -0
- package/dist/ui/assets/{openai-responses-Bj4fvlFf.js → openai-responses-DkI_T0MX.js} +1 -1
- package/dist/ui/assets/{openai-responses-shared-BFgL-o3e.js → openai-responses-shared-CE7ueMKJ.js} +3 -3
- package/dist/ui/assets/{openai-responses-shared-BocZ0nJ9.js → openai-responses-shared-D6SdNmJF.js} +1 -1
- package/dist/ui/assets/{openrouter-KSYp3IxY.js → openrouter-DdIDpcn5.js} +1 -1
- package/dist/ui/assets/panel-rpc-handlers-WyKwM5GK.js +2 -0
- package/dist/ui/assets/provider-BD3ViaTO.js +2 -0
- package/dist/ui/assets/{provider-B7jO0hH7.js → provider-DKuH0A_V.js} +1 -1
- package/dist/ui/assets/provider-store-access-CdWFhcVY.js +1 -0
- package/dist/ui/assets/provider-store-access-aoSAXhF0.js +1 -0
- package/dist/ui/assets/proxied-fetch-CNqjEnhB.js +1 -0
- package/dist/ui/assets/{py-realm-worker-DhXHapes.js → py-realm-worker-DvbMqvZQ.js} +1 -1
- package/dist/ui/assets/{pyodide-BMh2S3n1.js → pyodide-Cmbqoy74.js} +2 -2
- package/dist/ui/assets/remote-terminal-view-qkCXZltb.js +6 -0
- package/dist/ui/assets/remote-vfs-client-BMD-xQVk.js +1 -0
- package/dist/ui/assets/rom-eeWiO07Z.js +1 -0
- package/dist/ui/assets/secret-env-BiOTElj9.js +1 -0
- package/dist/ui/assets/{slicc-editor-DawcDX-J.js → slicc-editor-B3sk1bqn.js} +1 -1
- package/dist/ui/assets/{spawn-BWlCnXas.js → spawn-BqzgEouB.js} +1 -1
- package/dist/ui/assets/{sql-wasm-Dm6zQsKx.js → sql-wasm-b-bLcT97.js} +1 -1
- package/dist/ui/assets/{src-l2uxz6Ab.js → src-CtWqiCTj.js} +1 -1
- package/dist/ui/assets/{store-D6FxMGSe.js → store-BwSbpSHY.js} +1 -1
- package/dist/ui/assets/stub_flasher_32-CjtdTvhc.js +1 -0
- package/dist/ui/assets/stub_flasher_32-Dh8hmUXW.js +1 -0
- package/dist/ui/assets/stub_flasher_32c2-CrZruPQ-.js +1 -0
- package/dist/ui/assets/stub_flasher_32c2-DNonOeew.js +1 -0
- package/dist/ui/assets/stub_flasher_32c3-B5aGaWtF.js +1 -0
- package/dist/ui/assets/stub_flasher_32c3-DATkZbTY.js +1 -0
- package/dist/ui/assets/stub_flasher_32c5-B9wT3AwM.js +1 -0
- package/dist/ui/assets/stub_flasher_32c5-BDhwtIo7.js +1 -0
- package/dist/ui/assets/stub_flasher_32c6-DeY1L1JR.js +1 -0
- package/dist/ui/assets/stub_flasher_32c6-SMkhzZkf.js +1 -0
- package/dist/ui/assets/stub_flasher_32c61-B9ViWE_2.js +1 -0
- package/dist/ui/assets/stub_flasher_32c61-r9i57APe.js +1 -0
- package/dist/ui/assets/stub_flasher_32h2-B3NG8cq-.js +1 -0
- package/dist/ui/assets/stub_flasher_32h2-D7VeKsp3.js +1 -0
- package/dist/ui/assets/stub_flasher_32p4-Bb2Wtu69.js +1 -0
- package/dist/ui/assets/stub_flasher_32p4-DfQO64Ur.js +1 -0
- package/dist/ui/assets/stub_flasher_32p4rc1-3WH0f-dF.js +1 -0
- package/dist/ui/assets/stub_flasher_32p4rc1-p7EPUAvY.js +1 -0
- package/dist/ui/assets/stub_flasher_32s2-CBM9sAmm.js +1 -0
- package/dist/ui/assets/stub_flasher_32s2-DJJBwldO.js +1 -0
- package/dist/ui/assets/stub_flasher_32s3-D2W9M8KW.js +1 -0
- package/dist/ui/assets/stub_flasher_32s3-tuCbt8bU.js +1 -0
- package/dist/ui/assets/stub_flasher_8266-C20Md_4f.js +1 -0
- package/dist/ui/assets/stub_flasher_8266-DjoUeugS.js +1 -0
- package/dist/ui/assets/tray-leave-runtime-Di5-PGTL.js +1 -0
- package/dist/ui/assets/{typescript-D6flK270.js → typescript-DAa2uLJ3.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-jCctGGPk.js → upgrade-detection-Ce294jrB.js} +1 -1
- package/dist/ui/assets/{web-CCvcFM5o.js → web-C7m_nZRh.js} +1 -1
- package/dist/ui/assets/writable-vfs-client-CSgAEdDN.js +1 -0
- package/dist/ui/assets/{ws-subscribers-DmE7U-J_.js → ws-subscribers-JU9OidFF.js} +1 -1
- package/dist/ui/assets/{xai-grok-CP5PeYYT.js → xai-grok-B2I1NBMs.js} +1 -1
- package/dist/ui/assets/xai-grok-oPcvt0ZG.js +1 -0
- package/dist/ui/index.html +1 -1
- package/dist/ui/packages/webapp/index.html +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/adobe-CZPBfX_1.js +0 -2
- package/dist/ui/assets/agent-bridge-CTTgpHln.js +0 -1
- package/dist/ui/assets/azure-openai-AsqEbq7P.js +0 -1
- package/dist/ui/assets/azure-openai-responses-BE8XE04k.js +0 -1
- package/dist/ui/assets/cost-command-BPJ3R2wT.js +0 -1
- package/dist/ui/assets/github-C4UQlYfZ.js +0 -2
- package/dist/ui/assets/github-copilot-CjLuHl_d.js +0 -2
- package/dist/ui/assets/google-BlIB0cJA.js +0 -1
- package/dist/ui/assets/google-vertex-BjTDaknH.js +0 -1
- package/dist/ui/assets/hosted-config-apply-DvmOz70_.js +0 -1
- package/dist/ui/assets/js-realm-worker-z70bd_yW.js +0 -5
- package/dist/ui/assets/main-BpRJcmki.js +0 -1755
- package/dist/ui/assets/main-cherry-B46m_kn5.js +0 -1
- package/dist/ui/assets/oauth-bootstrap-DMTToV-t.js +0 -2
- package/dist/ui/assets/oauth-service-ClH1BHMq.js +0 -1
- package/dist/ui/assets/offscreen-client-C_hPHkwJ.js +0 -1
- package/dist/ui/assets/onboarding-orchestrator-8kqMyWPN.js +0 -1
- package/dist/ui/assets/openai-codex-Dx0ZoExa.js +0 -1
- package/dist/ui/assets/openai-codex-responses-BcIl6TvG.js +0 -7
- package/dist/ui/assets/openai-completions-Bx5Afuyz.js +0 -5
- package/dist/ui/assets/openai-responses-QksDIhvO.js +0 -1
- package/dist/ui/assets/panel-rpc-handlers-CJ-H4d6p.js +0 -1
- package/dist/ui/assets/provider-DPhAhKZ2.js +0 -2
- package/dist/ui/assets/provider-store-access-4xBAIgs1.js +0 -1
- package/dist/ui/assets/provider-store-access-sO8BdpI8.js +0 -1
- package/dist/ui/assets/proxied-fetch-CDLv67Nc.js +0 -1
- package/dist/ui/assets/remote-terminal-view-BIZsKmbf.js +0 -6
- package/dist/ui/assets/remote-vfs-client-ByyZAkae.js +0 -1
- package/dist/ui/assets/secret-env-Bje7EF6z.js +0 -1
- package/dist/ui/assets/tray-leave-runtime-B1x3_Arq.js +0 -1
- package/dist/ui/assets/writable-vfs-client-DRD0MgVo.js +0 -1
- package/dist/ui/assets/xai-grok-BeDajuFq.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{St as e}from"./main-D7z3x3_Y.js";import{BrowserAPI as t}from"./cdp-QAh2Cy7Y.js";var n=new Set([`handshake.hello`,`handshake.welcome`,`cdp.request`,`cdp.response`,`cdp.event`,`permission.request`,`permission.response`,`host.event`,`slicc.event`]);function r(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.cherry===1&&typeof t.channelId==`string`&&typeof t.kind==`string`&&n.has(t.kind)}function i(e,t){return!(!t.allowOrigins.includes(e.origin)||t.expectedSource!==null&&e.source!==t.expectedSource||!r(e.data)||t.channelId!==null&&e.data.channelId!==t.channelId)}var a=e(`cherry-transport`),o=`cherry-session`,s=`cherry-target`,c=`cherry-frame`,l=3e4,u=class{opts;channelId=null;nextId=1;_state=`disconnected`;pending=new Map;listeners=new Map;connectResolve=null;connectTimer=null;_joinUrl=null;boundHandler=e=>this.handleMessage(e);onHostEvent=null;constructor(e){this.opts=e}get state(){return this._state}get joinUrl(){return this._joinUrl}async connect(e){if(this._state!==`disconnected`)throw Error(`Cannot connect: state is ${this._state}`);this._state=`connecting`,this.channelId=`cherry-${crypto.randomUUID()}`,typeof window<`u`&&window.addEventListener(`message`,this.boundHandler);let t=e?.timeout??l;return new Promise((e,n)=>{this.connectResolve=e,this.connectTimer=setTimeout(()=>{this.connectTimer=null,typeof window<`u`&&window.removeEventListener(`message`,this.boundHandler),this._state=`disconnected`,this.channelId=null,this.connectResolve=null,n(Error(`Cherry handshake timed out after ${t}ms`))},t),this.post({cherry:1,channelId:this.channelId,kind:`handshake.hello`,capabilities:this.opts.capabilities??{navigate:!0,screenshot:!0,openUrl:!0}})})}disconnect(){this.connectTimer!==null&&(clearTimeout(this.connectTimer),this.connectTimer=null),typeof window<`u`&&window.removeEventListener(`message`,this.boundHandler);for(let[,e]of this.pending)e.reject(Error(`Cherry transport disconnected`));this.pending.clear(),this._state=`disconnected`,this.channelId=null}async send(e,t,n,r=3e4){if(this._state!==`connected`)throw Error(`Cherry transport is not connected`);let i=this.handleSynthetic(e,t);if(i)return i;let a=this.nextId++,o=await new Promise((n,i)=>{let o=setTimeout(()=>{this.pending.delete(a),i(Error(`Cherry CDP timed out after ${r}ms: ${e}`))},r);this.pending.set(a,{resolve:e=>{clearTimeout(o),n(e)},reject:e=>{clearTimeout(o),i(e)}}),this.post({cherry:1,channelId:this.channelId,kind:`cdp.request`,id:a,method:e,params:t})});return e===`Page.navigate`&&this.synthesizeNavigationLifecycle(o,t?.url),o}on(e,t){let n=this.listeners.get(e);n||(n=new Set,this.listeners.set(e,n)),n.add(t)}off(e,t){let n=this.listeners.get(e);n&&(n.delete(t),n.size===0&&this.listeners.delete(e))}once(e,t=3e4){return new Promise((n,r)=>{let i=setTimeout(()=>{this.off(e,a),r(Error(`Timed out waiting for event: ${e}`))},t),a=t=>{clearTimeout(i),this.off(e,a),n(t)};this.on(e,a)})}__test_receive(e){this.handleMessage(e)}emitSliccEventToHost(e,t){if(!this.channelId){a.warn(`Dropping slicc.event before handshake (no channelId yet)`,{name:e});return}this.post({cherry:1,channelId:this.channelId,kind:`slicc.event`,name:e,detail:t})}post(e){this.opts.counterpart.postMessage(e,this.opts.targetOrigin)}emit(e,t){let n=this.listeners.get(e);if(n)for(let e of n)try{e(t)}catch{}}handleSynthetic(e,t){switch(e){case`Target.getTargets`:return Promise.resolve({targetInfos:[{targetId:s,type:`page`,title:`Cherry Host Page`,url:typeof location<`u`?location.href:`about:blank`,attached:!0}]});case`Target.attachToTarget`:return Promise.resolve({sessionId:o});case`Target.detachFromTarget`:case`Target.closeTarget`:return Promise.resolve({success:!0});case`Page.enable`:case`Runtime.enable`:case`DOM.enable`:case`Page.bringToFront`:return Promise.resolve({});case`Page.getFrameTree`:return Promise.resolve({frameTree:{frame:{id:c,loaderId:`cherry-loader`,url:typeof location<`u`?location.href:`about:blank`,securityOrigin:this.opts.targetOrigin,mimeType:`text/html`},childFrames:[]}});case`Runtime.createIsolatedWorld`:return Promise.resolve({executionContextId:1});default:return null}}synthesizeNavigationLifecycle(e,t){let n=e.frameId??c,r=t??(typeof location<`u`?location.href:`about:blank`);this.emit(`Page.frameNavigated`,{frame:{id:n,loaderId:`cherry-loader`,url:r,securityOrigin:this.opts.targetOrigin,mimeType:`text/html`},sessionId:o}),this.emit(`Page.loadEventFired`,{timestamp:Date.now()/1e3,sessionId:o})}handleMessage(e){if(!i(e,{allowOrigins:this.opts.allowOrigins,expectedSource:this.opts.counterpart,channelId:this.channelId})){r(e.data)&&a.warn(`Rejected a cherry envelope (origin/source/channel mismatch)`,{origin:e.origin,allowOrigins:this.opts.allowOrigins});return}let t=e.data;switch(t.kind){case`handshake.welcome`:this.connectTimer!==null&&(clearTimeout(this.connectTimer),this.connectTimer=null),this._state=`connected`,this._joinUrl=t.joinUrl??null,a.info(`Cherry handshake complete`,{channelId:this.channelId}),this.connectResolve?.(),this.connectResolve=null;return;case`cdp.response`:{let e=this.pending.get(t.id);if(!e)return;this.pending.delete(t.id),t.error?e.reject(Error(`Cherry CDP error: ${t.error.message} (${t.error.code})`)):e.resolve(t.result??{});return}case`cdp.event`:this.emit(t.method,{...t.params??{},sessionId:t.sessionId??o});return;case`host.event`:this.onHostEvent?.(t.name,t.detail);return;default:return}}},d=e(`cherry-boot`);async function f(){let e=[document.referrer?new URL(document.referrer).origin:location.origin],n=e[0],r=new u({counterpart:window.parent,allowOrigins:e,targetOrigin:n});await r.connect(),d.info(`Cherry transport connected`);let i=r.joinUrl;if(!i)throw Error(`cherry boot: no joinUrl from handshake`);return{transport:r,browser:new t(r),joinUrl:i}}export{f as setupCherryFollower};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{St as e,gt as t,h as n,m as r}from"./kernel-worker-
|
|
1
|
+
import{St as e,gt as t,h as n,m as r}from"./kernel-worker-BN9jVURi.js";const i=`/.slicc-migrated`;async function a(e){let{manifest:t,source:n,target:r,logger:i}=e,a={fileCount:t.fileCount,totalBytes:t.totalBytes},c=t.entries.filter(e=>e.type===`dir`).sort((e,t)=>o(e.path)-o(t.path)),l=t.entries.filter(e=>e.type===`file`),u=t.entries.filter(e=>e.type===`symlink`);for(let e of c)try{await r.mkdir(e.path)}catch(e){return i?.warn?.(`[migration] mkdir failed during C2 copy`,{copiedFiles:0,stage:`mkdir`,code:s(e)}),{kind:`copy-error`,expected:a,copiedFiles:0,stage:`mkdir`}}let d=0;try{e.onProgress?.({copied:0,total:a.fileCount})}catch{}for(let t of l){if(t.type!==`file`)continue;let o;try{o=await n.readFile(t.path)}catch(e){return i?.warn?.(`[migration] legacy read failed during C2 copy`,{copiedFiles:d,stage:`read`,code:s(e)}),{kind:`copy-error`,expected:a,copiedFiles:d,stage:`read`}}try{await r.writeFile(t.path,o)}catch(e){return i?.warn?.(`[migration] OPFS write failed during C2 copy`,{copiedFiles:d,stage:`writeFile`,code:s(e)}),{kind:`copy-error`,expected:a,copiedFiles:d,stage:`writeFile`}}d++;try{e.onProgress?.({copied:d,total:a.fileCount})}catch{}}let f=0;for(let e of u)if(e.type===`symlink`)try{await r.symlink(e.target,e.path)}catch(e){if(s(e)===`EEXIST`){f++;continue}return i?.warn?.(`[migration] symlink failed during C2 copy`,{copiedFiles:d,stage:`symlink`,code:s(e)}),{kind:`copy-error`,expected:a,copiedFiles:d,stage:`symlink`}}if(f>0&&i?.info?.(`[migration] tolerated pre-existing symlinks during C2 re-run`,{skipped:f,symlinks:t.symlinkCount}),e.flushBeforeSentinel)try{await e.flushBeforeSentinel()}catch(e){return i?.warn?.(`[migration] sidecar flush failed before parity`,{code:s(e)}),{kind:`copy-error`,expected:a,copiedFiles:d,stage:`writeFile`}}let p=await e.countOpfsFiles(),m=p.totalBytes-a.totalBytes;return p.fileCount===a.fileCount?(m!==0&&i?.info?.(`[migration] byte drift tolerated (count parity matched)`,{expectedBytes:a.totalBytes,actualBytes:p.totalBytes,byteDelta:m}),await e.writeSentinel(),i?.info?.(`[migration] C2 copy complete, sentinel written`,{files:p.fileCount,totalBytes:p.totalBytes,expectedBytes:a.totalBytes,byteDelta:m,symlinks:t.symlinkCount,dirs:t.dirCount}),{kind:`success`,fileCount:p.fileCount,totalBytes:p.totalBytes}):(i?.warn?.(`[migration] parity mismatch — sentinel NOT written`,{expectedFiles:a.fileCount,actualFiles:p.fileCount,expectedBytes:a.totalBytes,actualBytes:p.totalBytes,byteDelta:m}),{kind:`parity-mismatch`,expected:a,actual:p})}function o(e){if(e===`/`)return 0;let t=0;for(let n=0;n<e.length;n++)e.charCodeAt(n)===47&&t++;return t}function s(e){let t=e?.code;return typeof t==`string`?t:void 0}const c=t(`migration-guard`);function l(){let e=globalThis;return{hasExtensionRuntime:typeof e.chrome?.runtime?.id==`string`,hasDocument:e.document!==void 0,pathname:e.window?.location?.pathname??``}}function u(e){return!e.hasExtensionRuntime||!e.hasDocument?!1:!/offscreen\.html$/.test(e.pathname)}var d=class extends Error{constructor(e){super(`runLegacyMigrationFromVfs invoked from the chrome extension side panel (pathname='${e.pathname}'). Migration must run only in the offscreen document; the panel should wait on the kernel-ready RPC (OffscreenClient.onReady).`),this.name=`MigrationFromSidePanelError`}};function f(e=l()){if(u(e)){let t=new d(e);throw c.error(t.message),t}}async function p(e,t={}){f(t.callerEnv);let r=t.logger,o=await n({sentinelExists:async()=>{try{return await e.stat(i),!0}catch{return!1}},probeLegacyDbExists:t.probeLegacyDbExists??y,lfsFactory:t.legacyLfsFactory??v,logger:r});if(o.kind===`sentinel-present`)return{kind:`sentinel-present`};if(o.kind===`legacy-absent`)return{kind:`legacy-absent`};let s=await(t.legacyReaderFactory??_)(),c=m(e);return{kind:`copied`,result:await a({manifest:o.manifest,source:s,target:c,countOpfsFiles:()=>g(e,o.manifest),flushBeforeSentinel:()=>e.flush().catch(()=>{}),writeSentinel:async()=>{await e.writeFile(i,``),await e.flush().catch(()=>{})},onProgress:t.onProgress,logger:r})}}function m(e){return{mkdir:async t=>{await e.mkdir(t,{recursive:!0})},writeFile:async(t,n)=>{await e.writeFile(t,n)},symlink:async(t,n)=>{try{await e.symlink(t,n);return}catch(e){if(h(e)!==`EEXIST`)throw e}let r;try{r=await e.readlink(n)}catch{}r!==t&&(await e.rm(n,{recursive:!0}),await e.symlink(t,n))}}}function h(e){let t=e?.code;return typeof t==`string`?t:void 0}async function g(e,t){let n=0,r=0;for(let i of t.entries){if(i.type!==`file`)continue;let t;try{t=await e.lstat(i.path)}catch{continue}t.type===`file`&&(n++,r+=t.size??0)}return{fileCount:n,totalBytes:r}}async function _(){let t=(await import(`./src-CtWqiCTj.js`).then(t=>e(t.default,1))).default,n=new t(r).promises;return{readFile:async e=>{let t=await n.readFile(e);return t instanceof Uint8Array?t:new TextEncoder().encode(String(t))}}}async function v(){let t=(await import(`./src-CtWqiCTj.js`).then(t=>e(t.default,1))).default;return new t(r).promises}async function y(){try{let e=globalThis.indexedDB;if(!e)return!1;let t=e.databases;return typeof t==`function`?(await t.call(e)).some(e=>e.name===r):!0}catch{return!0}}export{p as runLegacyMigrationFromVfs};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{I as e,M as t,P as n,Q as r,Y as i,Z as a,u as o}from"./kernel-worker-3dJlBPKw.js";import{t as s}from"./hash-yQufAZII.js";const c=Object.prototype.hasOwnProperty;function l(e,t){let n=/\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;return function(r={}){return e.replace(n,function(e,n){if(!c.call(r,n))throw Error(`Parameter '${n}' is required`);let i=r[n];if(typeof i!=`string`&&typeof i!=`number`)throw Error(`Parameter '${n}' must be a string or number`);return t?.charEncoding===`percent`?encodeURIComponent(`${i}`):`${i}`}).replace(/^\/+/,``)}}const u={eu:`https://api.mistral.ai`};function d(e){let t=e.serverURL,n={};t||=u[e.server??`eu`]||``;let r=l(t)(n);return new URL(r)}const f={language:`typescript`,openapiDocVersion:`1.0.0`,sdkVersion:`2.2.1`,genVersion:`2.881.4`,userAgent:`speakeasy-sdk/typescript 2.2.1 2.881.4 1.0.0 @mistralai/mistralai`};async function p(e){let t=e.getReader(),n=[],r=0,i=!1;for(;!i;){let{value:e,done:a}=await t.read();a?i=!0:(n.push(e),r+=e.length)}let a=new Uint8Array(r),o=0;for(let e of n)a.set(e,o),o+=e.length;return a.buffer}function m(e){if(!e)return null;let t=e.toLowerCase().split(`.`).pop();return t&&{json:`application/json`,xml:`application/xml`,html:`text/html`,htm:`text/html`,txt:`text/plain`,csv:`text/csv`,pdf:`application/pdf`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,svg:`image/svg+xml`,js:`application/javascript`,css:`text/css`,zip:`application/zip`,tar:`application/x-tar`,gz:`application/gzip`,mp4:`video/mp4`,mp3:`audio/mpeg`,wav:`audio/wav`,webp:`image/webp`,ico:`image/x-icon`,woff:`font/woff`,woff2:`font/woff2`,ttf:`font/ttf`,otf:`font/otf`}[t]||null}function h(e,t){return e instanceof Uint8Array?new Blob([new Uint8Array(e)],{type:t}):new Blob([e],{type:t})}const g=(e,t)=>t==null?fetch(e):fetch(e,t);var _=class e{options;fetcher;requestHooks=[];requestErrorHooks=[];responseHooks=[];constructor(e={}){this.options=e,this.fetcher=e.fetcher||g}async request(e){let t=e;for(let e of this.requestHooks){let n=await e(t);n&&(t=n)}try{let e=await this.fetcher(t);for(let n of this.responseHooks)await n(e,t);return e}catch(e){for(let n of this.requestErrorHooks)await n(e,t);throw e}}addHook(...e){if(e[0]===`beforeRequest`)this.requestHooks.push(e[1]);else if(e[0]===`requestError`)this.requestErrorHooks.push(e[1]);else if(e[0]===`response`)this.responseHooks.push(e[1]);else throw Error(`Invalid hook type: ${e[0]}`);return this}removeHook(...e){let t;if(e[0]===`beforeRequest`)t=this.requestHooks;else if(e[0]===`requestError`)t=this.requestErrorHooks;else if(e[0]===`response`)t=this.responseHooks;else throw Error(`Invalid hook type: ${e[0]}`);let n=t.findIndex(t=>t===e[1]);return n>=0&&t.splice(n,1),this}clone(){let t=new e(this.options);return t.requestHooks=this.requestHooks.slice(),t.requestErrorHooks=this.requestErrorHooks.slice(),t.responseHooks=this.responseHooks.slice(),t}};const v=/\s*;\s*/g;function ee(e,t){if(t===`*`)return!0;let n=e.headers.get(`content-type`)?.trim()||`application/octet-stream`;n=n.toLowerCase();let[r=``,...i]=t.toLowerCase().trim().split(v);if(r.split(`/`).length!==2)return!1;let[a=``,...o]=n.split(v),[s=``,c=``]=a.split(`/`);if(!s||!c||r!==`*/*`&&a!==r&&`${s}/*`!==r&&`*/${c}`!==r||o.length<i.length)return!1;let l=new Set(o);for(let e of i)if(!l.has(e))return!1;return!0}const te=RegExp(`^[0-9]xx$`,`i`);function y(e,t){let n=`${e.status}`,r=Array.isArray(t)?t:[t];return r.length?r.some(e=>{let t=`${e}`;if(t===`default`)return!0;if(!te.test(`${t}`))return t===n;let r=t.charAt(0);if(!r)throw Error(`Invalid status code range`);let i=n.charAt(0);if(!i)throw Error(`Invalid response status code: ${n}`);return i===r}):!1}function ne(e,t,n){return y(e,t)&&ee(e,n)}function re(e){if(typeof e!=`object`||!e)return!1;let t=e instanceof TypeError&&e.message.toLowerCase().startsWith(`failed to fetch`),n=e instanceof TypeError&&e.message.toLowerCase().startsWith(`fetch failed`),r=`name`in e&&e.name===`ConnectionError`,i=`code`in e&&typeof e.code==`string`&&e.code.toLowerCase()===`econnreset`;return t||n||i||r}function ie(e){if(typeof e!=`object`||!e)return!1;let t=`name`in e&&e.name===`TimeoutError`,n=`code`in e&&e.code===23,r=`code`in e&&typeof e.code==`string`&&e.code.toLowerCase()===`econnaborted`;return t||n||r}function ae(e){if(typeof e!=`object`||!e)return!1;let t=`name`in e&&e.name===`AbortError`,n=`code`in e&&e.code===20,r=`code`in e&&typeof e.code==`string`&&e.code.toLowerCase()===`econnaborted`;return t||n||r}var oe=class{beforeRequest(e,t){let n=`mistral-client-typescript/${f.sdkVersion}`;return t.headers.set(`user-agent`,n),t.headers.get(`user-agent`)||t.headers.set(`x-mistral-user-agent`,n),t}};const se=`x-model-deprecation-timestamp`;var ce=class{afterSuccess(e,t){return t.headers.has(se)&&t.clone().json().then(e=>{let n=e.model;console.warn(`WARNING: The model ${n} is deprecated and will be removed on ${t.headers.get(se)}. Please refer to https://docs.mistral.ai/getting-started/models/#api-versioning for more information.`)}),t}};function le(e){let t=new oe;e.registerBeforeRequestHook(t);let n=new ce;e.registerAfterSuccessHook(n)}var ue=class{sdkInitHooks=[];beforeCreateRequestHooks=[];beforeRequestHooks=[];afterSuccessHooks=[];afterErrorHooks=[];constructor(){for(let e of[])`sdkInit`in e&&this.registerSDKInitHook(e),`beforeCreateRequest`in e&&this.registerBeforeCreateRequestHook(e),`beforeRequest`in e&&this.registerBeforeRequestHook(e),`afterSuccess`in e&&this.registerAfterSuccessHook(e),`afterError`in e&&this.registerAfterErrorHook(e);le(this)}registerSDKInitHook(e){this.sdkInitHooks.push(e)}registerBeforeCreateRequestHook(e){this.beforeCreateRequestHooks.push(e)}registerBeforeRequestHook(e){this.beforeRequestHooks.push(e)}registerAfterSuccessHook(e){this.afterSuccessHooks.push(e)}registerAfterErrorHook(e){this.afterErrorHooks.push(e)}sdkInit(e){return this.sdkInitHooks.reduce((e,t)=>t.sdkInit(e),e)}beforeCreateRequest(e,t){let n=t;for(let t of this.beforeCreateRequestHooks)n=t.beforeCreateRequest(e,n);return n}async beforeRequest(e,t){let n=t;for(let t of this.beforeRequestHooks)n=await t.beforeRequest(e,n);return n}async afterSuccess(e,t){let n=t;for(let t of this.afterSuccessHooks)n=await t.afterSuccess(e,n);return n}async afterError(e,t,n){let r=t,i=n;for(let t of this.afterErrorHooks){let n=await t.afterError(e,r,i);r=n.response,i=n.error}return{response:r,error:i}}},de=class extends Error{cause;name=`HTTPClientError`;constructor(e,t){let n=e;t?.cause&&(n+=`: ${t.cause}`),super(n,t),this.cause===void 0&&(this.cause=t?.cause)}},fe=class extends de{name=`UnexpectedClientError`},pe=class extends de{name=`InvalidRequestError`},me=class extends de{name=`RequestAbortedError`},he=class extends de{name=`RequestTimeoutError`},ge=class extends de{name=`ConnectionError`};function _e(e){return{ok:!0,value:e}}function ve(e){return{ok:!1,error:e}}async function b(e){let t=await e;if(!t.ok)throw t.error;return t.value}const ye=Object.freeze({status:`aborted`});function x(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var be=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},xe=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};const Se={};function Ce(e){return e&&Object.assign(Se,e),Se}function we(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Te(e,t){return typeof t==`bigint`?t.toString():t}function Ee(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function De(e){return e==null}function Oe(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ke(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}const Ae=Symbol(`evaluating`);function je(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ae)return r===void 0&&(r=Ae,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Me(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ne(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Pe(e){return JSON.stringify(e)}function Fe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const Ie=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Le(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const Re=Ee(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function ze(e){if(Le(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Le(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Be(e){return ze(e)?{...e}:Array.isArray(e)?[...e]:e}const Ve=new Set([`string`,`number`,`symbol`]);function He(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ue(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function S(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function We(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const Ge={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ke(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Ue(e,Ne(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Me(this,`shape`,e),e},checks:[]}))}function qe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Ue(e,Ne(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Me(this,`shape`,r),r},checks:[]}))}function Je(e,t){if(!ze(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ue(e,Ne(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Me(this,`shape`,n),n}}))}function Ye(e,t){if(!ze(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ue(e,Ne(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Me(this,`shape`,n),n}}))}function Xe(e,t){return Ue(e,Ne(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Me(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function Ze(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Ue(t,Ne(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Me(this,`shape`,i),i},checks:[]}))}function Qe(e,t,n){return Ue(t,Ne(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Me(this,`shape`,i),i}}))}function $e(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function et(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function tt(e){return typeof e==`string`?e:e?.message}function nt(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=tt(e.inst?._zod.def?.error?.(e))??tt(t?.error?.(e))??tt(n.customError?.(e))??tt(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function rt(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function it(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const at=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Te,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ot=x(`$ZodError`,at),st=x(`$ZodError`,at,{Parent:Error});function ct(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function lt(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}function ut(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function dt(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${ut(e.path)}`);return t.join(`
|
|
1
|
+
import{I as e,M as t,P as n,Q as r,Y as i,Z as a,u as o}from"./kernel-worker-BN9jVURi.js";import{t as s}from"./hash-yQufAZII.js";const c=Object.prototype.hasOwnProperty;function l(e,t){let n=/\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;return function(r={}){return e.replace(n,function(e,n){if(!c.call(r,n))throw Error(`Parameter '${n}' is required`);let i=r[n];if(typeof i!=`string`&&typeof i!=`number`)throw Error(`Parameter '${n}' must be a string or number`);return t?.charEncoding===`percent`?encodeURIComponent(`${i}`):`${i}`}).replace(/^\/+/,``)}}const u={eu:`https://api.mistral.ai`};function d(e){let t=e.serverURL,n={};t||=u[e.server??`eu`]||``;let r=l(t)(n);return new URL(r)}const f={language:`typescript`,openapiDocVersion:`1.0.0`,sdkVersion:`2.2.1`,genVersion:`2.881.4`,userAgent:`speakeasy-sdk/typescript 2.2.1 2.881.4 1.0.0 @mistralai/mistralai`};async function p(e){let t=e.getReader(),n=[],r=0,i=!1;for(;!i;){let{value:e,done:a}=await t.read();a?i=!0:(n.push(e),r+=e.length)}let a=new Uint8Array(r),o=0;for(let e of n)a.set(e,o),o+=e.length;return a.buffer}function m(e){if(!e)return null;let t=e.toLowerCase().split(`.`).pop();return t&&{json:`application/json`,xml:`application/xml`,html:`text/html`,htm:`text/html`,txt:`text/plain`,csv:`text/csv`,pdf:`application/pdf`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,svg:`image/svg+xml`,js:`application/javascript`,css:`text/css`,zip:`application/zip`,tar:`application/x-tar`,gz:`application/gzip`,mp4:`video/mp4`,mp3:`audio/mpeg`,wav:`audio/wav`,webp:`image/webp`,ico:`image/x-icon`,woff:`font/woff`,woff2:`font/woff2`,ttf:`font/ttf`,otf:`font/otf`}[t]||null}function h(e,t){return e instanceof Uint8Array?new Blob([new Uint8Array(e)],{type:t}):new Blob([e],{type:t})}const g=(e,t)=>t==null?fetch(e):fetch(e,t);var _=class e{options;fetcher;requestHooks=[];requestErrorHooks=[];responseHooks=[];constructor(e={}){this.options=e,this.fetcher=e.fetcher||g}async request(e){let t=e;for(let e of this.requestHooks){let n=await e(t);n&&(t=n)}try{let e=await this.fetcher(t);for(let n of this.responseHooks)await n(e,t);return e}catch(e){for(let n of this.requestErrorHooks)await n(e,t);throw e}}addHook(...e){if(e[0]===`beforeRequest`)this.requestHooks.push(e[1]);else if(e[0]===`requestError`)this.requestErrorHooks.push(e[1]);else if(e[0]===`response`)this.responseHooks.push(e[1]);else throw Error(`Invalid hook type: ${e[0]}`);return this}removeHook(...e){let t;if(e[0]===`beforeRequest`)t=this.requestHooks;else if(e[0]===`requestError`)t=this.requestErrorHooks;else if(e[0]===`response`)t=this.responseHooks;else throw Error(`Invalid hook type: ${e[0]}`);let n=t.findIndex(t=>t===e[1]);return n>=0&&t.splice(n,1),this}clone(){let t=new e(this.options);return t.requestHooks=this.requestHooks.slice(),t.requestErrorHooks=this.requestErrorHooks.slice(),t.responseHooks=this.responseHooks.slice(),t}};const v=/\s*;\s*/g;function ee(e,t){if(t===`*`)return!0;let n=e.headers.get(`content-type`)?.trim()||`application/octet-stream`;n=n.toLowerCase();let[r=``,...i]=t.toLowerCase().trim().split(v);if(r.split(`/`).length!==2)return!1;let[a=``,...o]=n.split(v),[s=``,c=``]=a.split(`/`);if(!s||!c||r!==`*/*`&&a!==r&&`${s}/*`!==r&&`*/${c}`!==r||o.length<i.length)return!1;let l=new Set(o);for(let e of i)if(!l.has(e))return!1;return!0}const te=RegExp(`^[0-9]xx$`,`i`);function y(e,t){let n=`${e.status}`,r=Array.isArray(t)?t:[t];return r.length?r.some(e=>{let t=`${e}`;if(t===`default`)return!0;if(!te.test(`${t}`))return t===n;let r=t.charAt(0);if(!r)throw Error(`Invalid status code range`);let i=n.charAt(0);if(!i)throw Error(`Invalid response status code: ${n}`);return i===r}):!1}function ne(e,t,n){return y(e,t)&&ee(e,n)}function re(e){if(typeof e!=`object`||!e)return!1;let t=e instanceof TypeError&&e.message.toLowerCase().startsWith(`failed to fetch`),n=e instanceof TypeError&&e.message.toLowerCase().startsWith(`fetch failed`),r=`name`in e&&e.name===`ConnectionError`,i=`code`in e&&typeof e.code==`string`&&e.code.toLowerCase()===`econnreset`;return t||n||i||r}function ie(e){if(typeof e!=`object`||!e)return!1;let t=`name`in e&&e.name===`TimeoutError`,n=`code`in e&&e.code===23,r=`code`in e&&typeof e.code==`string`&&e.code.toLowerCase()===`econnaborted`;return t||n||r}function ae(e){if(typeof e!=`object`||!e)return!1;let t=`name`in e&&e.name===`AbortError`,n=`code`in e&&e.code===20,r=`code`in e&&typeof e.code==`string`&&e.code.toLowerCase()===`econnaborted`;return t||n||r}var oe=class{beforeRequest(e,t){let n=`mistral-client-typescript/${f.sdkVersion}`;return t.headers.set(`user-agent`,n),t.headers.get(`user-agent`)||t.headers.set(`x-mistral-user-agent`,n),t}};const se=`x-model-deprecation-timestamp`;var ce=class{afterSuccess(e,t){return t.headers.has(se)&&t.clone().json().then(e=>{let n=e.model;console.warn(`WARNING: The model ${n} is deprecated and will be removed on ${t.headers.get(se)}. Please refer to https://docs.mistral.ai/getting-started/models/#api-versioning for more information.`)}),t}};function le(e){let t=new oe;e.registerBeforeRequestHook(t);let n=new ce;e.registerAfterSuccessHook(n)}var ue=class{sdkInitHooks=[];beforeCreateRequestHooks=[];beforeRequestHooks=[];afterSuccessHooks=[];afterErrorHooks=[];constructor(){for(let e of[])`sdkInit`in e&&this.registerSDKInitHook(e),`beforeCreateRequest`in e&&this.registerBeforeCreateRequestHook(e),`beforeRequest`in e&&this.registerBeforeRequestHook(e),`afterSuccess`in e&&this.registerAfterSuccessHook(e),`afterError`in e&&this.registerAfterErrorHook(e);le(this)}registerSDKInitHook(e){this.sdkInitHooks.push(e)}registerBeforeCreateRequestHook(e){this.beforeCreateRequestHooks.push(e)}registerBeforeRequestHook(e){this.beforeRequestHooks.push(e)}registerAfterSuccessHook(e){this.afterSuccessHooks.push(e)}registerAfterErrorHook(e){this.afterErrorHooks.push(e)}sdkInit(e){return this.sdkInitHooks.reduce((e,t)=>t.sdkInit(e),e)}beforeCreateRequest(e,t){let n=t;for(let t of this.beforeCreateRequestHooks)n=t.beforeCreateRequest(e,n);return n}async beforeRequest(e,t){let n=t;for(let t of this.beforeRequestHooks)n=await t.beforeRequest(e,n);return n}async afterSuccess(e,t){let n=t;for(let t of this.afterSuccessHooks)n=await t.afterSuccess(e,n);return n}async afterError(e,t,n){let r=t,i=n;for(let t of this.afterErrorHooks){let n=await t.afterError(e,r,i);r=n.response,i=n.error}return{response:r,error:i}}},de=class extends Error{cause;name=`HTTPClientError`;constructor(e,t){let n=e;t?.cause&&(n+=`: ${t.cause}`),super(n,t),this.cause===void 0&&(this.cause=t?.cause)}},fe=class extends de{name=`UnexpectedClientError`},pe=class extends de{name=`InvalidRequestError`},me=class extends de{name=`RequestAbortedError`},he=class extends de{name=`RequestTimeoutError`},ge=class extends de{name=`ConnectionError`};function _e(e){return{ok:!0,value:e}}function ve(e){return{ok:!1,error:e}}async function b(e){let t=await e;if(!t.ok)throw t.error;return t.value}const ye=Object.freeze({status:`aborted`});function x(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var be=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},xe=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};const Se={};function Ce(e){return e&&Object.assign(Se,e),Se}function we(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Te(e,t){return typeof t==`bigint`?t.toString():t}function Ee(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function De(e){return e==null}function Oe(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ke(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}const Ae=Symbol(`evaluating`);function je(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ae)return r===void 0&&(r=Ae,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Me(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ne(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Pe(e){return JSON.stringify(e)}function Fe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const Ie=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Le(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const Re=Ee(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function ze(e){if(Le(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Le(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Be(e){return ze(e)?{...e}:Array.isArray(e)?[...e]:e}const Ve=new Set([`string`,`number`,`symbol`]);function He(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ue(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function S(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function We(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const Ge={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ke(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Ue(e,Ne(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Me(this,`shape`,e),e},checks:[]}))}function qe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Ue(e,Ne(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Me(this,`shape`,r),r},checks:[]}))}function Je(e,t){if(!ze(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ue(e,Ne(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Me(this,`shape`,n),n}}))}function Ye(e,t){if(!ze(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ue(e,Ne(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Me(this,`shape`,n),n}}))}function Xe(e,t){return Ue(e,Ne(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Me(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function Ze(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Ue(t,Ne(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Me(this,`shape`,i),i},checks:[]}))}function Qe(e,t,n){return Ue(t,Ne(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Me(this,`shape`,i),i}}))}function $e(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function et(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function tt(e){return typeof e==`string`?e:e?.message}function nt(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=tt(e.inst?._zod.def?.error?.(e))??tt(t?.error?.(e))??tt(n.customError?.(e))??tt(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function rt(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function it(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const at=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Te,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ot=x(`$ZodError`,at),st=x(`$ZodError`,at,{Parent:Error});function ct(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function lt(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}function ut(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function dt(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${ut(e.path)}`);return t.join(`
|
|
2
2
|
`)}const ft=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new be;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>nt(e,a,Ce())));throw Ie(t,i?.callee),t}return o.value},pt=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>nt(e,a,Ce())));throw Ie(t,i?.callee),t}return o.value},mt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new be;return a.issues.length?{success:!1,error:new(e??ot)(a.issues.map(e=>nt(e,i,Ce())))}:{success:!0,data:a.value}},ht=mt(st),gt=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>nt(e,i,Ce())))}:{success:!0,data:a.value}},_t=gt(st),vt=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return ft(e)(t,n,i)},yt=e=>(t,n,r)=>ft(e)(t,n,r),bt=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return pt(e)(t,n,i)},xt=e=>async(t,n,r)=>pt(e)(t,n,r),St=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return mt(e)(t,n,i)},Ct=e=>(t,n,r)=>mt(e)(t,n,r),wt=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return gt(e)(t,n,i)},Tt=e=>async(t,n,r)=>gt(e)(t,n,r),Et=/^[cC][^\s-]{8,}$/,Dt=/^[0-9a-z]+$/,Ot=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,kt=/^[0-9a-vA-V]{20}$/,At=/^[A-Za-z0-9]{27}$/,jt=/^[a-zA-Z0-9_-]{21}$/,Mt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Nt=/^([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})$/,Pt=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ft=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function It(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const Lt=/^(?:(?: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])$/,Rt=/^(([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}|:))$/,zt=/^((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])$/,Bt=/^(([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])$/,Vt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ht=/^[A-Za-z0-9_-]*$/,Ut=/^\+[1-9]\d{6,14}$/,Wt=`(?:(?:\\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])))`,Gt=RegExp(`^${Wt}$`);function Kt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function qt(e){return RegExp(`^${Kt(e)}$`)}function Jt(e){let t=Kt({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Wt}T(?:${r})$`)}const Yt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Xt=/^-?\d+$/,Zt=/^-?\d+(?:\.\d+)?$/,Qt=/^(?:true|false)$/i,$t=/^[^A-Z]*$/,en=/^[^a-z]*$/,tn=x(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),nn={number:`number`,bigint:`bigint`,object:`date`},rn=x(`$ZodCheckLessThan`,(e,t)=>{tn.init(e,t);let n=nn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),an=x(`$ZodCheckGreaterThan`,(e,t)=>{tn.init(e,t);let n=nn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),on=x(`$ZodCheckMultipleOf`,(e,t)=>{tn.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):ke(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),sn=x(`$ZodCheckNumberFormat`,(e,t)=>{tn.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Ge[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Xt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),cn=x(`$ZodCheckMaxLength`,(e,t)=>{var n;tn.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!De(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=rt(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ln=x(`$ZodCheckMinLength`,(e,t)=>{var n;tn.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!De(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=rt(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),un=x(`$ZodCheckLengthEquals`,(e,t)=>{var n;tn.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!De(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=rt(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),dn=x(`$ZodCheckStringFormat`,(e,t)=>{var n,r;tn.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),fn=x(`$ZodCheckRegex`,(e,t)=>{dn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),pn=x(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=$t,dn.init(e,t)}),mn=x(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=en,dn.init(e,t)}),hn=x(`$ZodCheckIncludes`,(e,t)=>{tn.init(e,t);let n=He(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),gn=x(`$ZodCheckStartsWith`,(e,t)=>{tn.init(e,t);let n=RegExp(`^${He(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),_n=x(`$ZodCheckEndsWith`,(e,t)=>{tn.init(e,t);let n=RegExp(`.*${He(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),vn=x(`$ZodCheckOverwrite`,(e,t)=>{tn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var yn=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
3
3
|
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
4
4
|
`))}};const bn={major:4,minor:3,patch:6},xn=x(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=bn;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=$e(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new be;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=$e(e,t))});else{if(e.issues.length===t)continue;r||=$e(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if($e(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new be;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new be;return o.then(e=>t(e,r,a))}return t(o,r,a)}}je(e,`~standard`,()=>({validate:t=>{try{let n=ht(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return _t(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Sn=x(`$ZodString`,(e,t)=>{xn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Yt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Cn=x(`$ZodStringFormat`,(e,t)=>{dn.init(e,t),Sn.init(e,t)}),wn=x(`$ZodGUID`,(e,t)=>{t.pattern??=Nt,Cn.init(e,t)}),Tn=x(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Pt(e)}else t.pattern??=Pt();Cn.init(e,t)}),En=x(`$ZodEmail`,(e,t)=>{t.pattern??=Ft,Cn.init(e,t)}),Dn=x(`$ZodURL`,(e,t)=>{Cn.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),On=x(`$ZodEmoji`,(e,t)=>{t.pattern??=It(),Cn.init(e,t)}),kn=x(`$ZodNanoID`,(e,t)=>{t.pattern??=jt,Cn.init(e,t)}),An=x(`$ZodCUID`,(e,t)=>{t.pattern??=Et,Cn.init(e,t)}),jn=x(`$ZodCUID2`,(e,t)=>{t.pattern??=Dt,Cn.init(e,t)}),Mn=x(`$ZodULID`,(e,t)=>{t.pattern??=Ot,Cn.init(e,t)}),Nn=x(`$ZodXID`,(e,t)=>{t.pattern??=kt,Cn.init(e,t)}),Pn=x(`$ZodKSUID`,(e,t)=>{t.pattern??=At,Cn.init(e,t)}),Fn=x(`$ZodISODateTime`,(e,t)=>{t.pattern??=Jt(t),Cn.init(e,t)}),In=x(`$ZodISODate`,(e,t)=>{t.pattern??=Gt,Cn.init(e,t)}),Ln=x(`$ZodISOTime`,(e,t)=>{t.pattern??=qt(t),Cn.init(e,t)}),Rn=x(`$ZodISODuration`,(e,t)=>{t.pattern??=Mt,Cn.init(e,t)}),zn=x(`$ZodIPv4`,(e,t)=>{t.pattern??=Lt,Cn.init(e,t),e._zod.bag.format=`ipv4`}),Bn=x(`$ZodIPv6`,(e,t)=>{t.pattern??=Rt,Cn.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Vn=x(`$ZodCIDRv4`,(e,t)=>{t.pattern??=zt,Cn.init(e,t)}),Hn=x(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Bt,Cn.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Un(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Wn=x(`$ZodBase64`,(e,t)=>{t.pattern??=Vt,Cn.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Un(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Gn(e){if(!Ht.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Un(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Kn=x(`$ZodBase64URL`,(e,t)=>{t.pattern??=Ht,Cn.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Gn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),qn=x(`$ZodE164`,(e,t)=>{t.pattern??=Ut,Cn.init(e,t)});function Jn(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const Yn=x(`$ZodJWT`,(e,t)=>{Cn.init(e,t),e._zod.check=n=>{Jn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Xn=x(`$ZodNumber`,(e,t)=>{xn.init(e,t),e._zod.pattern=e._zod.bag.pattern??Zt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Zn=x(`$ZodNumberFormat`,(e,t)=>{sn.init(e,t),Xn.init(e,t)}),Qn=x(`$ZodBoolean`,(e,t)=>{xn.init(e,t),e._zod.pattern=Qt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),$n=x(`$ZodAny`,(e,t)=>{xn.init(e,t),e._zod.parse=e=>e}),er=x(`$ZodUnknown`,(e,t)=>{xn.init(e,t),e._zod.parse=e=>e}),tr=x(`$ZodNever`,(e,t)=>{xn.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),nr=x(`$ZodVoid`,(e,t)=>{xn.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),rr=x(`$ZodDate`,(e,t)=>{xn.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}});function ir(e,t,n){e.issues.length&&t.issues.push(...et(n,e.issues)),t.value[n]=e.value}const ar=x(`$ZodArray`,(e,t)=>{xn.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>ir(t,n,e))):ir(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function or(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...et(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function sr(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=We(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function cr(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>or(e,n,i,t,u))):or(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const lr=x(`$ZodObject`,(e,t)=>{if(xn.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=Ee(()=>sr(t));je(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Le,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>or(n,t,e,s,r))):or(i,t,e,s,r)}return i?cr(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),ur=x(`$ZodObjectJIT`,(e,t)=>{lr.init(e,t);let n=e._zod.parse,r=Ee(()=>sr(t)),i=e=>{let t=new yn([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Pe(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Pe(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
|