@contractspec/example.pocket-family-office 1.44.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.
Files changed (40) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +43 -0
  3. package/dist/blueprint.d.ts +5 -0
  4. package/dist/blueprint.d.ts.map +1 -0
  5. package/dist/connections/samples.d.ts +4 -0
  6. package/dist/connections/samples.d.ts.map +1 -0
  7. package/dist/index.d.ts +9 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +63 -0
  10. package/dist/knowledge/sources.sample.d.ts +3 -0
  11. package/dist/knowledge/sources.sample.d.ts.map +1 -0
  12. package/dist/operations/index.d.ts +492 -0
  13. package/dist/operations/index.d.ts.map +1 -0
  14. package/dist/pocket-family-office.feature.d.ts +12 -0
  15. package/dist/pocket-family-office.feature.d.ts.map +1 -0
  16. package/dist/telemetry.d.ts +4 -0
  17. package/dist/telemetry.d.ts.map +1 -0
  18. package/dist/tenant.sample.d.ts +3 -0
  19. package/dist/tenant.sample.d.ts.map +1 -0
  20. package/dist/tests/pocket-family-office.test.d.ts +2 -0
  21. package/dist/tests/pocket-family-office.test.d.ts.map +1 -0
  22. package/dist/workflows/generate-financial-summary.d.ts +3 -0
  23. package/dist/workflows/generate-financial-summary.d.ts.map +1 -0
  24. package/dist/workflows/generate-openbanking-overview.d.ts +3 -0
  25. package/dist/workflows/generate-openbanking-overview.d.ts.map +1 -0
  26. package/dist/workflows/index.d.ts +9 -0
  27. package/dist/workflows/index.d.ts.map +1 -0
  28. package/dist/workflows/ingest-email-threads.d.ts +3 -0
  29. package/dist/workflows/ingest-email-threads.d.ts.map +1 -0
  30. package/dist/workflows/process-uploaded-document.d.ts +3 -0
  31. package/dist/workflows/process-uploaded-document.d.ts.map +1 -0
  32. package/dist/workflows/refresh-openbanking-balances.d.ts +3 -0
  33. package/dist/workflows/refresh-openbanking-balances.d.ts.map +1 -0
  34. package/dist/workflows/sync-openbanking-accounts.d.ts +3 -0
  35. package/dist/workflows/sync-openbanking-accounts.d.ts.map +1 -0
  36. package/dist/workflows/sync-openbanking-transactions.d.ts +3 -0
  37. package/dist/workflows/sync-openbanking-transactions.d.ts.map +1 -0
  38. package/dist/workflows/upcoming-payments-reminder.d.ts +3 -0
  39. package/dist/workflows/upcoming-payments-reminder.d.ts.map +1 -0
  40. package/package.json +87 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Chaman Ventures, SASU
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # Pocket Family Office Vertical
2
+
3
+ Website: https://contractspec.io/
4
+
5
+
6
+ This vertical demonstrates how a spec-first application orchestrates
7
+ financial document automation, payment reminders, and AI summarisation
8
+ using ContractSpec. It is designed for multi-tenant deployments where
9
+ each household configures its own integrations while reusing a shared
10
+ blueprint.
11
+
12
+ ## Contents
13
+
14
+ - `blueprint.ts` – the global `AppBlueprintSpec` describing required
15
+ capabilities, integration slots, workflows, and telemetry.
16
+ - `tenant.sample.ts` – example `TenantAppConfig` showing per-tenant
17
+ bindings to integrations, knowledge spaces, and locales.
18
+ - `connections/` – sample `IntegrationConnection` descriptors for the
19
+ nine priority providers (Mistral, Qdrant, GCS, Gmail, Google Calendar,
20
+ Postmark, ElevenLabs, Stripe, Twilio).
21
+ - `knowledge/` – example `KnowledgeSourceConfig` entries wiring Gmail
22
+ threads and uploaded documents into canonical knowledge spaces.
23
+ - `contracts/` – command specs powering document ingestion, reminders,
24
+ financial summaries, and Gmail synchronisation.
25
+ - `workflows/` – workflow specs orchestrating end-to-end automation for
26
+ uploads, reminders, financial overviews, and email ingestion.
27
+ - `tests/` – Vitest scenarios covering blueprint validation, config
28
+ composition, and a full end-to-end ingestion/query flow.
29
+
30
+ ## Usage
31
+
32
+ The files are designed for direct consumption inside tests, CLI
33
+ generators, or documentation tooling. They depend exclusively on the
34
+ public APIs exported by `@contractspec/lib.contracts`, making them safe to copy
35
+ into downstream projects or use as a reference implementation during the
36
+ Pocket Family Office hackathon.
37
+
38
+
39
+
40
+
41
+
42
+
43
+
@@ -0,0 +1,5 @@
1
+ import type { AppBlueprintSpec } from '@contractspec/lib.contracts/app-config/spec';
2
+ import type { AppBlueprintRegistry } from '@contractspec/lib.contracts/app-config/spec';
3
+ export declare const pocketFamilyOfficeBlueprint: AppBlueprintSpec;
4
+ export declare function registerPocketFamilyOfficeBlueprint(registry: AppBlueprintRegistry): AppBlueprintRegistry;
5
+ //# sourceMappingURL=blueprint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blueprint.d.ts","sourceRoot":"","sources":["../src/blueprint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAOpF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAIxF,eAAO,MAAM,2BAA2B,EAAE,gBAgMzC,CAAC;AAEF,wBAAgB,mCAAmC,CACjD,QAAQ,EAAE,oBAAoB,GAC7B,oBAAoB,CAEtB"}
@@ -0,0 +1,4 @@
1
+ import type { IntegrationConnection } from '@contractspec/lib.contracts/integrations/connection';
2
+ export declare const pocketFamilyOfficeConnections: IntegrationConnection[];
3
+ export declare function getPocketFamilyOfficeConnection(connectionId: string): IntegrationConnection | undefined;
4
+ //# sourceMappingURL=samples.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"samples.d.ts","sourceRoot":"","sources":["../../src/connections/samples.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAUjG,eAAO,MAAM,6BAA6B,EAAE,qBAAqB,EAgMhE,CAAC;AAEF,wBAAgB,+BAA+B,CAC7C,YAAY,EAAE,MAAM,GACnB,qBAAqB,GAAG,SAAS,CAInC"}
@@ -0,0 +1,9 @@
1
+ export * from './blueprint';
2
+ export * from './tenant.sample';
3
+ export * from './connections/samples';
4
+ export * from './knowledge/sources.sample';
5
+ export * from './operations';
6
+ export * from './workflows';
7
+ export * from './telemetry';
8
+ export * from './pocket-family-office.feature';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gCAAgC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,63 @@
1
+ var k9=Object.defineProperty;var _4=(J,X)=>{for(var H in X)k9(J,H,{get:X[H],enumerable:!0,configurable:!0,set:(W)=>X[H]=()=>W})};var A={Idea:"idea",InCreation:"in_creation",Experimental:"experimental",Beta:"beta",Stable:"stable",Deprecated:"deprecated"},V={PlatformCore:"platform.core",PlatformSigil:"platform.sigil",PlatformMarketplace:"platform.marketplace",PlatformMessaging:"platform.messaging",PlatformContent:"platform.content",PlatformFeatureFlags:"platform.featureflags",PlatformFinance:"platform.finance"};var R={Spots:"spots",Collectivity:"collectivity",Marketplace:"marketplace",Sellers:"sellers",Auth:"auth",Login:"login",Signup:"signup",Guide:"guide",Docs:"docs",I18n:"i18n",Incident:"incident",Automation:"automation",Hygiene:"hygiene"};var Z=(J,X)=>({key:J,version:X}),j9={meta:{key:"pocket-family-office.app",version:1,appId:"pocket-family-office",title:"Pocket Family Office",description:"Household finance automation: ingest documents, track bills, remind payments, and summarise cashflow.",domain:"finance",owners:[V.PlatformFinance],tags:[R.Guide,"finance","automation"],stability:A.Experimental},capabilities:{enabled:[Z("ai.chat",1),Z("ai.embeddings",1),Z("vector-db.search",1),Z("vector-db.storage",1),Z("storage.objects",1),Z("email.inbound",1),Z("email.transactional",1),Z("calendar.events",1),Z("sms.outbound",1),Z("ai.voice.synthesis",1),Z("payments.psp",1),Z("openbanking.accounts.read",1),Z("openbanking.transactions.read",1),Z("openbanking.balances.read",1)]},integrationSlots:[{slotId:"primaryLLM",requiredCategory:"ai-llm",allowedModes:["managed","byok"],requiredCapabilities:[Z("ai.chat",1)],required:!0,description:"Chat completion provider powering summarisation, explanations, and insights."},{slotId:"primaryVectorDb",requiredCategory:"vector-db",allowedModes:["managed","byok"],requiredCapabilities:[Z("vector-db.search",1)],required:!0,description:"Vector database storing embeddings for financial documents and email threads."},{slotId:"primaryStorage",requiredCategory:"storage",allowedModes:["managed","byok"],requiredCapabilities:[Z("storage.objects",1)],required:!0,description:"Object storage used for raw uploads and normalised documents."},{slotId:"primaryOpenBanking",requiredCategory:"open-banking",allowedModes:["byok"],requiredCapabilities:[Z("openbanking.accounts.read",1),Z("openbanking.transactions.read",1),Z("openbanking.balances.read",1)],required:!0,description:"Powens BYOK connection powering bank account, transaction, and balance synchronisation."},{slotId:"emailInbound",requiredCategory:"email",allowedModes:["managed","byok"],requiredCapabilities:[Z("email.inbound",1)],required:!0,description:"Inbound email/thread sync (Gmail) feeding the knowledge corpus."},{slotId:"emailOutbound",requiredCategory:"email",allowedModes:["managed","byok"],requiredCapabilities:[Z("email.transactional",1)],required:!0,description:"Transactional email delivery for reminders and summaries."},{slotId:"calendarScheduling",requiredCategory:"calendar",allowedModes:["managed","byok"],requiredCapabilities:[Z("calendar.events",1)],required:!0,description:"Creates calendar holds for bill reviews and handoff meetings."},{slotId:"voicePlayback",requiredCategory:"ai-voice",allowedModes:["managed","byok"],requiredCapabilities:[Z("ai.voice.synthesis",1)],required:!1,description:"Optional voice synthesis for spoken summaries (ElevenLabs)."},{slotId:"smsNotifications",requiredCategory:"sms",allowedModes:["managed","byok"],requiredCapabilities:[Z("sms.outbound",1)],required:!1,description:"SMS provider used for urgent reminders."},{slotId:"paymentsProcessing",requiredCategory:"payments",allowedModes:["managed","byok"],requiredCapabilities:[Z("payments.psp",1)],required:!1,description:"Optional payments processor enabling bill pay automations."}],workflows:{processUploadedDocument:{key:"pfo.workflow.process-uploaded-document",version:1},upcomingPaymentsReminder:{key:"pfo.workflow.upcoming-payments-reminder",version:1},generateFinancialSummary:{key:"pfo.workflow.generate-financial-summary",version:1},ingestEmailThreads:{key:"pfo.workflow.ingest-email-threads",version:1},syncOpenBankingAccounts:{key:"pfo.workflow.sync-openbanking-accounts",version:1},syncOpenBankingTransactions:{key:"pfo.workflow.sync-openbanking-transactions",version:1},refreshOpenBankingBalances:{key:"pfo.workflow.refresh-openbanking-balances",version:1},generateOpenBankingOverview:{key:"pfo.workflow.generate-openbanking-overview",version:1}},policies:[{key:"pfo.policy.tenancy",version:1},{key:"knowledge.access.financial-docs",version:1}],telemetry:{spec:{key:"pfo.telemetry",version:1}},featureFlags:[{key:"voice-summaries",enabled:!1,description:"Enable ElevenLabs spoken summaries in addition to email distribution."}],routes:[{path:"/dashboard",label:"Overview",workflow:"pfo.workflow.generate-financial-summary"},{path:"/documents/upload",label:"Upload Document",workflow:"pfo.workflow.process-uploaded-document"},{path:"/communications",label:"Inbox",workflow:"pfo.workflow.ingest-email-threads"}],notes:"Pocket Family Office blueprint pulling together finance automations for the hackathon reference implementation."};function kW(J){return J.register(j9)}var TW={meta:{id:"tenant-pfo-sample",tenantId:"tenant.family-office",appId:"pocket-family-office",blueprintName:"pocket-family-office.app",blueprintVersion:1,environment:"production",version:1,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),status:"published"},featureFlags:[{key:"voice-summaries",enabled:!0,description:"Enable spoken ElevenLabs summaries for daily briefings."}],integrations:[{slotId:"primaryLLM",connectionId:"conn-mistral-primary"},{slotId:"primaryVectorDb",connectionId:"conn-qdrant-finance"},{slotId:"primaryStorage",connectionId:"conn-gcs-documents"},{slotId:"primaryOpenBanking",connectionId:"conn-powens-primary"},{slotId:"emailInbound",connectionId:"conn-gmail-threads"},{slotId:"emailOutbound",connectionId:"conn-postmark-outbound"},{slotId:"calendarScheduling",connectionId:"conn-google-calendar"},{slotId:"voicePlayback",connectionId:"conn-elevenlabs-voice"},{slotId:"smsNotifications",connectionId:"conn-twilio-sms"},{slotId:"paymentsProcessing",connectionId:"conn-stripe-recurring"}],knowledge:[{spaceKey:"knowledge.financial-docs",scope:{workflows:["pfo.workflow.process-uploaded-document","pfo.workflow.generate-financial-summary"]}},{spaceKey:"knowledge.email-threads",scope:{workflows:["pfo.workflow.ingest-email-threads"]}},{spaceKey:"knowledge.financial-overview",scope:{workflows:["pfo.workflow.sync-openbanking-transactions","pfo.workflow.refresh-openbanking-balances","pfo.workflow.generate-financial-summary","pfo.workflow.generate-openbanking-overview"]},required:!1}],locales:{defaultLocale:"en",enabledLocales:["en"]},notes:"Sample tenant configuration for hackathon demos. Replace connection IDs with tenant-specific bindings when provisioning."};var l=new Date,s={tenantId:"tenant.family-office",createdAt:l,updatedAt:l},T9=[{meta:{...s,id:"conn-mistral-primary",integrationKey:"ai-llm.mistral",integrationVersion:1,label:"Mistral Primary"},ownershipMode:"managed",config:{model:"mistral-large-latest",embeddingModel:"mistral-embed"},secretProvider:"gcp-secret-manager",secretRef:"gcp://projects/pfo-hackathon/secrets/mistral-api-key/versions/latest",status:"connected",health:{status:"connected",checkedAt:l,latencyMs:180}},{meta:{...s,id:"conn-qdrant-finance",integrationKey:"vectordb.qdrant",integrationVersion:1,label:"Qdrant Finance Cluster"},ownershipMode:"managed",config:{apiUrl:"https://qdrant.pfo.internal",collectionPrefix:"tenant-family-office"},secretProvider:"gcp-secret-manager",secretRef:"gcp://projects/pfo-hackathon/secrets/qdrant-api-key/versions/latest",status:"connected",health:{status:"connected",checkedAt:l,latencyMs:95}},{meta:{...s,id:"conn-gcs-documents",integrationKey:"storage.gcs",integrationVersion:1,label:"GCS Documents Bucket"},ownershipMode:"managed",config:{bucket:"pfo-uploads",prefix:"financial-docs/"},secretProvider:"gcp-secret-manager",secretRef:"gcp://projects/pfo-hackathon/secrets/gcs-service-account/versions/latest",status:"connected",health:{status:"connected",checkedAt:l,latencyMs:60}},{meta:{...s,id:"conn-gmail-threads",integrationKey:"email.gmail",integrationVersion:1,label:"Gmail Household Threads"},ownershipMode:"byok",config:{labelIds:["FINANCE","INBOX"],includeSpamTrash:!1},secretProvider:"gcp-secret-manager",secretRef:"gcp://projects/pfo-hackathon/secrets/gmail-refresh-token/versions/latest",status:"connected",health:{status:"connected",checkedAt:l,latencyMs:320}},{meta:{...s,id:"conn-postmark-outbound",integrationKey:"email.postmark",integrationVersion:1,label:"Postmark Transactional"},ownershipMode:"managed",config:{messageStream:"outbound",fromEmail:"family.office@pfo.dev"},secretProvider:"gcp-secret-manager",secretRef:"gcp://projects/pfo-hackathon/secrets/postmark-server-token/versions/latest",status:"connected",health:{status:"connected",checkedAt:l,latencyMs:210}},{meta:{...s,id:"conn-google-calendar",integrationKey:"calendar.google",integrationVersion:1,label:"Household Calendar"},ownershipMode:"managed",config:{calendarId:"primary"},secretProvider:"gcp-secret-manager",secretRef:"gcp://projects/pfo-hackathon/secrets/google-calendar-service-account/versions/latest",status:"connected",health:{status:"connected",checkedAt:l,latencyMs:140}},{meta:{...s,id:"conn-elevenlabs-voice",integrationKey:"ai-voice.elevenlabs",integrationVersion:1,label:"ElevenLabs Voice"},ownershipMode:"byok",config:{defaultVoiceId:"pNInz6obpgDQGcFmaJgB"},secretProvider:"gcp-secret-manager",secretRef:"gcp://projects/pfo-hackathon/secrets/elevenlabs-api-key/versions/latest",status:"connected",health:{status:"connected",checkedAt:l,latencyMs:250}},{meta:{...s,id:"conn-twilio-sms",integrationKey:"sms.twilio",integrationVersion:1,label:"Twilio SMS"},ownershipMode:"managed",config:{fromNumber:"+15552340000"},secretProvider:"gcp-secret-manager",secretRef:"gcp://projects/pfo-hackathon/secrets/twilio-auth-token/versions/latest",status:"connected",health:{status:"connected",checkedAt:l,latencyMs:180}},{meta:{...s,id:"conn-stripe-recurring",integrationKey:"payments.stripe",integrationVersion:1,label:"Stripe Recurring Billing"},ownershipMode:"managed",config:{accountId:"acct_1PFOHACKATHON",region:"eu-west-1"},secretProvider:"gcp-secret-manager",secretRef:"gcp://projects/pfo-hackathon/secrets/stripe-secret-key/versions/latest",status:"connected",health:{status:"connected",checkedAt:l,latencyMs:220}},{meta:{...s,id:"conn-powens-primary",integrationKey:"openbanking.powens",integrationVersion:1,label:"Powens Open Banking"},ownershipMode:"byok",config:{environment:"sandbox",baseUrl:"https://api-sandbox.powens.com/v2"},secretProvider:"gcp-secret-manager",secretRef:"gcp://projects/pfo-hackathon/secrets/powens-credentials/versions/latest",status:"connected",health:{status:"connected",checkedAt:l,latencyMs:410}}];function vW(J){return T9.find((X)=>X.meta.id===J)}var q1=new Date,gW=[{meta:{id:"source-financial-uploads",tenantId:"tenant.family-office",spaceKey:"knowledge.financial-docs",spaceVersion:1,label:"Uploaded Financial Documents",sourceType:"file_upload",createdAt:q1,updatedAt:q1},config:{bucket:"pfo-uploads",prefix:"financial-docs/"},syncSchedule:{enabled:!0,intervalMs:900000},lastSync:{timestamp:q1,success:!0}},{meta:{id:"source-gmail-threads",tenantId:"tenant.family-office",spaceKey:"knowledge.email-threads",spaceVersion:1,label:"Household Gmail Threads",sourceType:"email",createdAt:q1,updatedAt:q1},config:{labelIds:["INBOX","FINANCE"]},syncSchedule:{enabled:!0,intervalMs:300000},lastSync:{timestamp:q1,success:!0}},{meta:{id:"source-financial-overview",tenantId:"tenant.family-office",spaceKey:"knowledge.financial-overview",spaceVersion:1,label:"Financial Overview",sourceType:"api",createdAt:q1,updatedAt:q1},config:{},syncSchedule:{enabled:!1}}];var uW=Object.freeze({status:"aborted"});function U(J,X,H){function W(Q,G){if(!Q._zod)Object.defineProperty(Q,"_zod",{value:{def:G,constr:z,traits:new Set},enumerable:!1});if(Q._zod.traits.has(J))return;Q._zod.traits.add(J),X(Q,G);let D=z.prototype,P=Object.keys(D);for(let B=0;B<P.length;B++){let $=P[B];if(!($ in Q))Q[$]=D[$].bind(Q)}}let q=H?.Parent??Object;class Y extends q{}Object.defineProperty(Y,"name",{value:J});function z(Q){var G;let D=H?.Parent?new Y:this;W(D,Q),(G=D._zod).deferred??(G.deferred=[]);for(let P of D._zod.deferred)P();return D}return Object.defineProperty(z,"init",{value:W}),Object.defineProperty(z,Symbol.hasInstance,{value:(Q)=>{if(H?.Parent&&Q instanceof H.Parent)return!0;return Q?._zod?.traits?.has(J)}}),Object.defineProperty(z,"name",{value:J}),z}var yW=Symbol("zod_brand");class J1 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class b1 extends Error{constructor(J){super(`Encountered unidirectional transform during encode: ${J}`);this.name="ZodEncodeError"}}var o1={};function r(J){if(J)Object.assign(o1,J);return o1}var K={};_4(K,{unwrapMessage:()=>_1,uint8ArrayToHex:()=>qX,uint8ArrayToBase64url:()=>HX,uint8ArrayToBase64:()=>h4,stringifyPrimitive:()=>d1,slugify:()=>V0,shallowClone:()=>C4,safeExtend:()=>t9,required:()=>e9,randomString:()=>o9,propertyKeyTypes:()=>N0,promiseAllObject:()=>f9,primitiveTypes:()=>S4,prefixIssues:()=>X1,pick:()=>d9,partial:()=>s9,optionalKeys:()=>Z0,omit:()=>n9,objectClone:()=>u9,numKeys:()=>l9,nullish:()=>S1,normalizeParams:()=>I,mergeDefs:()=>z1,merge:()=>a9,jsonStringifyReplacer:()=>$1,joinValues:()=>l1,issue:()=>A1,isPlainObject:()=>Q1,isObject:()=>I1,hexToUint8Array:()=>WX,getSizableOrigin:()=>j4,getParsedType:()=>r9,getLengthableOrigin:()=>j1,getEnumValues:()=>E1,getElementAtPath:()=>m9,floatSafeRemainder:()=>K0,finalizeIssue:()=>n,extend:()=>i9,escapeRegex:()=>U1,esc:()=>r1,defineLazy:()=>N,createTransparentProxy:()=>p9,cloneDef:()=>y9,clone:()=>d,cleanRegex:()=>k1,cleanEnum:()=>JX,captureStackTrace:()=>p1,cached:()=>C1,base64urlToUint8Array:()=>XX,base64ToUint8Array:()=>T4,assignProp:()=>Y1,assertNotEqual:()=>v9,assertNever:()=>g9,assertIs:()=>x9,assertEqual:()=>h9,assert:()=>c9,allowsEval:()=>R0,aborted:()=>w1,NUMBER_FORMAT_RANGES:()=>L0,Class:()=>v4,BIGINT_FORMAT_RANGES:()=>k4});function h9(J){return J}function v9(J){return J}function x9(J){}function g9(J){throw Error("Unexpected value in exhaustive check")}function c9(J){}function E1(J){let X=Object.values(J).filter((W)=>typeof W==="number");return Object.entries(J).filter(([W,q])=>X.indexOf(+W)===-1).map(([W,q])=>q)}function l1(J,X="|"){return J.map((H)=>d1(H)).join(X)}function $1(J,X){if(typeof X==="bigint")return X.toString();return X}function C1(J){return{get value(){{let H=J();return Object.defineProperty(this,"value",{value:H}),H}throw Error("cached value already set")}}}function S1(J){return J===null||J===void 0}function k1(J){let X=J.startsWith("^")?1:0,H=J.endsWith("$")?J.length-1:J.length;return J.slice(X,H)}function K0(J,X){let H=(J.toString().split(".")[1]||"").length,W=X.toString(),q=(W.split(".")[1]||"").length;if(q===0&&/\d?e-\d?/.test(W)){let G=W.match(/\d?e-(\d?)/);if(G?.[1])q=Number.parseInt(G[1])}let Y=H>q?H:q,z=Number.parseInt(J.toFixed(Y).replace(".","")),Q=Number.parseInt(X.toFixed(Y).replace(".",""));return z%Q/10**Y}var E4=Symbol("evaluating");function N(J,X,H){let W=void 0;Object.defineProperty(J,X,{get(){if(W===E4)return;if(W===void 0)W=E4,W=H();return W},set(q){Object.defineProperty(J,X,{value:q})},configurable:!0})}function u9(J){return Object.create(Object.getPrototypeOf(J),Object.getOwnPropertyDescriptors(J))}function Y1(J,X,H){Object.defineProperty(J,X,{value:H,writable:!0,enumerable:!0,configurable:!0})}function z1(...J){let X={};for(let H of J){let W=Object.getOwnPropertyDescriptors(H);Object.assign(X,W)}return Object.defineProperties({},X)}function y9(J){return z1(J._zod.def)}function m9(J,X){if(!X)return J;return X.reduce((H,W)=>H?.[W],J)}function f9(J){let X=Object.keys(J),H=X.map((W)=>J[W]);return Promise.all(H).then((W)=>{let q={};for(let Y=0;Y<X.length;Y++)q[X[Y]]=W[Y];return q})}function o9(J=10){let H="";for(let W=0;W<J;W++)H+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return H}function r1(J){return JSON.stringify(J)}function V0(J){return J.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var p1="captureStackTrace"in Error?Error.captureStackTrace:(...J)=>{};function I1(J){return typeof J==="object"&&J!==null&&!Array.isArray(J)}var R0=C1(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(J){return!1}});function Q1(J){if(I1(J)===!1)return!1;let X=J.constructor;if(X===void 0)return!0;if(typeof X!=="function")return!0;let H=X.prototype;if(I1(H)===!1)return!1;if(Object.prototype.hasOwnProperty.call(H,"isPrototypeOf")===!1)return!1;return!0}function C4(J){if(Q1(J))return{...J};if(Array.isArray(J))return[...J];return J}function l9(J){let X=0;for(let H in J)if(Object.prototype.hasOwnProperty.call(J,H))X++;return X}var r9=(J)=>{let X=typeof J;switch(X){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(J)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(J))return"array";if(J===null)return"null";if(J.then&&typeof J.then==="function"&&J.catch&&typeof J.catch==="function")return"promise";if(typeof Map<"u"&&J instanceof Map)return"map";if(typeof Set<"u"&&J instanceof Set)return"set";if(typeof Date<"u"&&J instanceof Date)return"date";if(typeof File<"u"&&J instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${X}`)}},N0=new Set(["string","number","symbol"]),S4=new Set(["string","number","bigint","boolean","symbol","undefined"]);function U1(J){return J.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function d(J,X,H){let W=new J._zod.constr(X??J._zod.def);if(!X||H?.parent)W._zod.parent=J;return W}function I(J){let X=J;if(!X)return{};if(typeof X==="string")return{error:()=>X};if(X?.message!==void 0){if(X?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");X.error=X.message}if(delete X.message,typeof X.error==="string")return{...X,error:()=>X.error};return X}function p9(J){let X;return new Proxy({},{get(H,W,q){return X??(X=J()),Reflect.get(X,W,q)},set(H,W,q,Y){return X??(X=J()),Reflect.set(X,W,q,Y)},has(H,W){return X??(X=J()),Reflect.has(X,W)},deleteProperty(H,W){return X??(X=J()),Reflect.deleteProperty(X,W)},ownKeys(H){return X??(X=J()),Reflect.ownKeys(X)},getOwnPropertyDescriptor(H,W){return X??(X=J()),Reflect.getOwnPropertyDescriptor(X,W)},defineProperty(H,W,q){return X??(X=J()),Reflect.defineProperty(X,W,q)}})}function d1(J){if(typeof J==="bigint")return J.toString()+"n";if(typeof J==="string")return`"${J}"`;return`${J}`}function Z0(J){return Object.keys(J).filter((X)=>{return J[X]._zod.optin==="optional"&&J[X]._zod.optout==="optional"})}var L0={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]},k4={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function d9(J,X){let H=J._zod.def,W=z1(J._zod.def,{get shape(){let q={};for(let Y in X){if(!(Y in H.shape))throw Error(`Unrecognized key: "${Y}"`);if(!X[Y])continue;q[Y]=H.shape[Y]}return Y1(this,"shape",q),q},checks:[]});return d(J,W)}function n9(J,X){let H=J._zod.def,W=z1(J._zod.def,{get shape(){let q={...J._zod.def.shape};for(let Y in X){if(!(Y in H.shape))throw Error(`Unrecognized key: "${Y}"`);if(!X[Y])continue;delete q[Y]}return Y1(this,"shape",q),q},checks:[]});return d(J,W)}function i9(J,X){if(!Q1(X))throw Error("Invalid input to extend: expected a plain object");let H=J._zod.def.checks;if(H&&H.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let q=z1(J._zod.def,{get shape(){let Y={...J._zod.def.shape,...X};return Y1(this,"shape",Y),Y},checks:[]});return d(J,q)}function t9(J,X){if(!Q1(X))throw Error("Invalid input to safeExtend: expected a plain object");let H={...J._zod.def,get shape(){let W={...J._zod.def.shape,...X};return Y1(this,"shape",W),W},checks:J._zod.def.checks};return d(J,H)}function a9(J,X){let H=z1(J._zod.def,{get shape(){let W={...J._zod.def.shape,...X._zod.def.shape};return Y1(this,"shape",W),W},get catchall(){return X._zod.def.catchall},checks:[]});return d(J,H)}function s9(J,X,H){let W=z1(X._zod.def,{get shape(){let q=X._zod.def.shape,Y={...q};if(H)for(let z in H){if(!(z in q))throw Error(`Unrecognized key: "${z}"`);if(!H[z])continue;Y[z]=J?new J({type:"optional",innerType:q[z]}):q[z]}else for(let z in q)Y[z]=J?new J({type:"optional",innerType:q[z]}):q[z];return Y1(this,"shape",Y),Y},checks:[]});return d(X,W)}function e9(J,X,H){let W=z1(X._zod.def,{get shape(){let q=X._zod.def.shape,Y={...q};if(H)for(let z in H){if(!(z in Y))throw Error(`Unrecognized key: "${z}"`);if(!H[z])continue;Y[z]=new J({type:"nonoptional",innerType:q[z]})}else for(let z in q)Y[z]=new J({type:"nonoptional",innerType:q[z]});return Y1(this,"shape",Y),Y},checks:[]});return d(X,W)}function w1(J,X=0){if(J.aborted===!0)return!0;for(let H=X;H<J.issues.length;H++)if(J.issues[H]?.continue!==!0)return!0;return!1}function X1(J,X){return X.map((H)=>{var W;return(W=H).path??(W.path=[]),H.path.unshift(J),H})}function _1(J){return typeof J==="string"?J:J?.message}function n(J,X,H){let W={...J,path:J.path??[]};if(!J.message){let q=_1(J.inst?._zod.def?.error?.(J))??_1(X?.error?.(J))??_1(H.customError?.(J))??_1(H.localeError?.(J))??"Invalid input";W.message=q}if(delete W.inst,delete W.continue,!X?.reportInput)delete W.input;return W}function j4(J){if(J instanceof Set)return"set";if(J instanceof Map)return"map";if(J instanceof File)return"file";return"unknown"}function j1(J){if(Array.isArray(J))return"array";if(typeof J==="string")return"string";return"unknown"}function A1(...J){let[X,H,W]=J;if(typeof X==="string")return{message:X,code:"custom",input:H,inst:W};return{...X}}function JX(J){return Object.entries(J).filter(([X,H])=>{return Number.isNaN(Number.parseInt(X,10))}).map((X)=>X[1])}function T4(J){let X=atob(J),H=new Uint8Array(X.length);for(let W=0;W<X.length;W++)H[W]=X.charCodeAt(W);return H}function h4(J){let X="";for(let H=0;H<J.length;H++)X+=String.fromCharCode(J[H]);return btoa(X)}function XX(J){let X=J.replace(/-/g,"+").replace(/_/g,"/"),H="=".repeat((4-X.length%4)%4);return T4(X+H)}function HX(J){return h4(J).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function WX(J){let X=J.replace(/^0x/,"");if(X.length%2!==0)throw Error("Invalid hex string length");let H=new Uint8Array(X.length/2);for(let W=0;W<X.length;W+=2)H[W/2]=Number.parseInt(X.slice(W,W+2),16);return H}function qX(J){return Array.from(J).map((X)=>X.toString(16).padStart(2,"0")).join("")}class v4{constructor(...J){}}var x4=(J,X)=>{J.name="$ZodError",Object.defineProperty(J,"_zod",{value:J._zod,enumerable:!1}),Object.defineProperty(J,"issues",{value:X,enumerable:!1}),J.message=JSON.stringify(X,$1,2),Object.defineProperty(J,"toString",{value:()=>J.message,enumerable:!1})},n1=U("$ZodError",x4),b0=U("$ZodError",x4,{Parent:Error});function g4(J,X=(H)=>H.message){let H={},W=[];for(let q of J.issues)if(q.path.length>0)H[q.path[0]]=H[q.path[0]]||[],H[q.path[0]].push(X(q));else W.push(X(q));return{formErrors:W,fieldErrors:H}}function c4(J,X=(H)=>H.message){let H={_errors:[]},W=(q)=>{for(let Y of q.issues)if(Y.code==="invalid_union"&&Y.errors.length)Y.errors.map((z)=>W({issues:z}));else if(Y.code==="invalid_key")W({issues:Y.issues});else if(Y.code==="invalid_element")W({issues:Y.issues});else if(Y.path.length===0)H._errors.push(X(Y));else{let z=H,Q=0;while(Q<Y.path.length){let G=Y.path[Q];if(Q!==Y.path.length-1)z[G]=z[G]||{_errors:[]};else z[G]=z[G]||{_errors:[]},z[G]._errors.push(X(Y));z=z[G],Q++}}};return W(J),H}var i1=(J)=>(X,H,W,q)=>{let Y=W?Object.assign(W,{async:!1}):{async:!1},z=X._zod.run({value:H,issues:[]},Y);if(z instanceof Promise)throw new J1;if(z.issues.length){let Q=new(q?.Err??J)(z.issues.map((G)=>n(G,Y,r())));throw p1(Q,q?.callee),Q}return z.value};var t1=(J)=>async(X,H,W,q)=>{let Y=W?Object.assign(W,{async:!0}):{async:!0},z=X._zod.run({value:H,issues:[]},Y);if(z instanceof Promise)z=await z;if(z.issues.length){let Q=new(q?.Err??J)(z.issues.map((G)=>n(G,Y,r())));throw p1(Q,q?.callee),Q}return z.value};var T1=(J)=>(X,H,W)=>{let q=W?{...W,async:!1}:{async:!1},Y=X._zod.run({value:H,issues:[]},q);if(Y instanceof Promise)throw new J1;return Y.issues.length?{success:!1,error:new(J??n1)(Y.issues.map((z)=>n(z,q,r())))}:{success:!0,data:Y.value}},u4=T1(b0),h1=(J)=>async(X,H,W)=>{let q=W?Object.assign(W,{async:!0}):{async:!0},Y=X._zod.run({value:H,issues:[]},q);if(Y instanceof Promise)Y=await Y;return Y.issues.length?{success:!1,error:new J(Y.issues.map((z)=>n(z,q,r())))}:{success:!0,data:Y.value}},y4=h1(b0),m4=(J)=>(X,H,W)=>{let q=W?Object.assign(W,{direction:"backward"}):{direction:"backward"};return i1(J)(X,H,q)};var f4=(J)=>(X,H,W)=>{return i1(J)(X,H,W)};var o4=(J)=>async(X,H,W)=>{let q=W?Object.assign(W,{direction:"backward"}):{direction:"backward"};return t1(J)(X,H,q)};var l4=(J)=>async(X,H,W)=>{return t1(J)(X,H,W)};var r4=(J)=>(X,H,W)=>{let q=W?Object.assign(W,{direction:"backward"}):{direction:"backward"};return T1(J)(X,H,q)};var p4=(J)=>(X,H,W)=>{return T1(J)(X,H,W)};var d4=(J)=>async(X,H,W)=>{let q=W?Object.assign(W,{direction:"backward"}):{direction:"backward"};return h1(J)(X,H,q)};var n4=(J)=>async(X,H,W)=>{return h1(J)(X,H,W)};var i4=/^[cC][^\s-]{8,}$/,t4=/^[0-9a-z]+$/,a4=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,s4=/^[0-9a-vA-V]{20}$/,e4=/^[A-Za-z0-9]{27}$/,J6=/^[a-zA-Z0-9_-]{21}$/,X6=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var H6=/^([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})$/,_0=(J)=>{if(!J)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}-${J}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var W6=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var zX="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function q6(){return new RegExp(zX,"u")}var Y6=/^(?:(?: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])$/,z6=/^(([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}|:))$/;var Q6=/^((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])$/,w6=/^(([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])$/,D6=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,E0=/^[A-Za-z0-9_-]*$/;var G6=/^\+(?:[0-9]){6,14}[0-9]$/,U6="(?:(?:\\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])))",P6=new RegExp(`^${U6}$`);function B6(J){return typeof J.precision==="number"?J.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":J.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{${J.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function M6(J){return new RegExp(`^${B6(J)}$`)}function F6(J){let X=B6({precision:J.precision}),H=["Z"];if(J.local)H.push("");if(J.offset)H.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let W=`${X}(?:${H.join("|")})`;return new RegExp(`^${U6}T(?:${W})$`)}var I6=(J)=>{let X=J?`[\\s\\S]{${J?.minimum??0},${J?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${X}$`)},$6=/^-?\d+n?$/,A6=/^-?\d+$/,O6=/^-?\d+(?:\.\d+)?/,K6=/^(?:true|false)$/i;var V6=/^[^A-Z]*$/,R6=/^[^a-z]*$/;var c=U("$ZodCheck",(J,X)=>{var H;J._zod??(J._zod={}),J._zod.def=X,(H=J._zod).onattach??(H.onattach=[])}),N6={number:"number",bigint:"bigint",object:"date"},C0=U("$ZodCheckLessThan",(J,X)=>{c.init(J,X);let H=N6[typeof X.value];J._zod.onattach.push((W)=>{let q=W._zod.bag,Y=(X.inclusive?q.maximum:q.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(X.value<Y)if(X.inclusive)q.maximum=X.value;else q.exclusiveMaximum=X.value}),J._zod.check=(W)=>{if(X.inclusive?W.value<=X.value:W.value<X.value)return;W.issues.push({origin:H,code:"too_big",maximum:X.value,input:W.value,inclusive:X.inclusive,inst:J,continue:!X.abort})}}),S0=U("$ZodCheckGreaterThan",(J,X)=>{c.init(J,X);let H=N6[typeof X.value];J._zod.onattach.push((W)=>{let q=W._zod.bag,Y=(X.inclusive?q.minimum:q.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(X.value>Y)if(X.inclusive)q.minimum=X.value;else q.exclusiveMinimum=X.value}),J._zod.check=(W)=>{if(X.inclusive?W.value>=X.value:W.value>X.value)return;W.issues.push({origin:H,code:"too_small",minimum:X.value,input:W.value,inclusive:X.inclusive,inst:J,continue:!X.abort})}}),Z6=U("$ZodCheckMultipleOf",(J,X)=>{c.init(J,X),J._zod.onattach.push((H)=>{var W;(W=H._zod.bag).multipleOf??(W.multipleOf=X.value)}),J._zod.check=(H)=>{if(typeof H.value!==typeof X.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof H.value==="bigint"?H.value%X.value===BigInt(0):K0(H.value,X.value)===0)return;H.issues.push({origin:typeof H.value,code:"not_multiple_of",divisor:X.value,input:H.value,inst:J,continue:!X.abort})}}),L6=U("$ZodCheckNumberFormat",(J,X)=>{c.init(J,X),X.format=X.format||"float64";let H=X.format?.includes("int"),W=H?"int":"number",[q,Y]=L0[X.format];J._zod.onattach.push((z)=>{let Q=z._zod.bag;if(Q.format=X.format,Q.minimum=q,Q.maximum=Y,H)Q.pattern=A6}),J._zod.check=(z)=>{let Q=z.value;if(H){if(!Number.isInteger(Q)){z.issues.push({expected:W,format:X.format,code:"invalid_type",continue:!1,input:Q,inst:J});return}if(!Number.isSafeInteger(Q)){if(Q>0)z.issues.push({input:Q,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:J,origin:W,continue:!X.abort});else z.issues.push({input:Q,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:J,origin:W,continue:!X.abort});return}}if(Q<q)z.issues.push({origin:"number",input:Q,code:"too_small",minimum:q,inclusive:!0,inst:J,continue:!X.abort});if(Q>Y)z.issues.push({origin:"number",input:Q,code:"too_big",maximum:Y,inst:J})}});var b6=U("$ZodCheckMaxLength",(J,X)=>{var H;c.init(J,X),(H=J._zod.def).when??(H.when=(W)=>{let q=W.value;return!S1(q)&&q.length!==void 0}),J._zod.onattach.push((W)=>{let q=W._zod.bag.maximum??Number.POSITIVE_INFINITY;if(X.maximum<q)W._zod.bag.maximum=X.maximum}),J._zod.check=(W)=>{let q=W.value;if(q.length<=X.maximum)return;let z=j1(q);W.issues.push({origin:z,code:"too_big",maximum:X.maximum,inclusive:!0,input:q,inst:J,continue:!X.abort})}}),_6=U("$ZodCheckMinLength",(J,X)=>{var H;c.init(J,X),(H=J._zod.def).when??(H.when=(W)=>{let q=W.value;return!S1(q)&&q.length!==void 0}),J._zod.onattach.push((W)=>{let q=W._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(X.minimum>q)W._zod.bag.minimum=X.minimum}),J._zod.check=(W)=>{let q=W.value;if(q.length>=X.minimum)return;let z=j1(q);W.issues.push({origin:z,code:"too_small",minimum:X.minimum,inclusive:!0,input:q,inst:J,continue:!X.abort})}}),E6=U("$ZodCheckLengthEquals",(J,X)=>{var H;c.init(J,X),(H=J._zod.def).when??(H.when=(W)=>{let q=W.value;return!S1(q)&&q.length!==void 0}),J._zod.onattach.push((W)=>{let q=W._zod.bag;q.minimum=X.length,q.maximum=X.length,q.length=X.length}),J._zod.check=(W)=>{let q=W.value,Y=q.length;if(Y===X.length)return;let z=j1(q),Q=Y>X.length;W.issues.push({origin:z,...Q?{code:"too_big",maximum:X.length}:{code:"too_small",minimum:X.length},inclusive:!0,exact:!0,input:W.value,inst:J,continue:!X.abort})}}),v1=U("$ZodCheckStringFormat",(J,X)=>{var H,W;if(c.init(J,X),J._zod.onattach.push((q)=>{let Y=q._zod.bag;if(Y.format=X.format,X.pattern)Y.patterns??(Y.patterns=new Set),Y.patterns.add(X.pattern)}),X.pattern)(H=J._zod).check??(H.check=(q)=>{if(X.pattern.lastIndex=0,X.pattern.test(q.value))return;q.issues.push({origin:"string",code:"invalid_format",format:X.format,input:q.value,...X.pattern?{pattern:X.pattern.toString()}:{},inst:J,continue:!X.abort})});else(W=J._zod).check??(W.check=()=>{})}),C6=U("$ZodCheckRegex",(J,X)=>{v1.init(J,X),J._zod.check=(H)=>{if(X.pattern.lastIndex=0,X.pattern.test(H.value))return;H.issues.push({origin:"string",code:"invalid_format",format:"regex",input:H.value,pattern:X.pattern.toString(),inst:J,continue:!X.abort})}}),S6=U("$ZodCheckLowerCase",(J,X)=>{X.pattern??(X.pattern=V6),v1.init(J,X)}),k6=U("$ZodCheckUpperCase",(J,X)=>{X.pattern??(X.pattern=R6),v1.init(J,X)}),j6=U("$ZodCheckIncludes",(J,X)=>{c.init(J,X);let H=U1(X.includes),W=new RegExp(typeof X.position==="number"?`^.{${X.position}}${H}`:H);X.pattern=W,J._zod.onattach.push((q)=>{let Y=q._zod.bag;Y.patterns??(Y.patterns=new Set),Y.patterns.add(W)}),J._zod.check=(q)=>{if(q.value.includes(X.includes,X.position))return;q.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:X.includes,input:q.value,inst:J,continue:!X.abort})}}),T6=U("$ZodCheckStartsWith",(J,X)=>{c.init(J,X);let H=new RegExp(`^${U1(X.prefix)}.*`);X.pattern??(X.pattern=H),J._zod.onattach.push((W)=>{let q=W._zod.bag;q.patterns??(q.patterns=new Set),q.patterns.add(H)}),J._zod.check=(W)=>{if(W.value.startsWith(X.prefix))return;W.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:X.prefix,input:W.value,inst:J,continue:!X.abort})}}),h6=U("$ZodCheckEndsWith",(J,X)=>{c.init(J,X);let H=new RegExp(`.*${U1(X.suffix)}$`);X.pattern??(X.pattern=H),J._zod.onattach.push((W)=>{let q=W._zod.bag;q.patterns??(q.patterns=new Set),q.patterns.add(H)}),J._zod.check=(W)=>{if(W.value.endsWith(X.suffix))return;W.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:X.suffix,input:W.value,inst:J,continue:!X.abort})}});var v6=U("$ZodCheckOverwrite",(J,X)=>{c.init(J,X),J._zod.check=(H)=>{H.value=X.tx(H.value)}});class k0{constructor(J=[]){if(this.content=[],this.indent=0,this)this.args=J}indented(J){this.indent+=1,J(this),this.indent-=1}write(J){if(typeof J==="function"){J(this,{execution:"sync"}),J(this,{execution:"async"});return}let H=J.split(`
2
+ `).filter((Y)=>Y),W=Math.min(...H.map((Y)=>Y.length-Y.trimStart().length)),q=H.map((Y)=>Y.slice(W)).map((Y)=>" ".repeat(this.indent*2)+Y);for(let Y of q)this.content.push(Y)}compile(){let J=Function,X=this?.args,W=[...(this?.content??[""]).map((q)=>` ${q}`)];return new J(...X,W.join(`
3
+ `))}}var g6={major:4,minor:2,patch:1};var L=U("$ZodType",(J,X)=>{var H;J??(J={}),J._zod.def=X,J._zod.bag=J._zod.bag||{},J._zod.version=g6;let W=[...J._zod.def.checks??[]];if(J._zod.traits.has("$ZodCheck"))W.unshift(J);for(let q of W)for(let Y of q._zod.onattach)Y(J);if(W.length===0)(H=J._zod).deferred??(H.deferred=[]),J._zod.deferred?.push(()=>{J._zod.run=J._zod.parse});else{let q=(z,Q,G)=>{let D=w1(z),P;for(let B of Q){if(B._zod.def.when){if(!B._zod.def.when(z))continue}else if(D)continue;let $=z.issues.length,F=B._zod.check(z);if(F instanceof Promise&&G?.async===!1)throw new J1;if(P||F instanceof Promise)P=(P??Promise.resolve()).then(async()=>{if(await F,z.issues.length===$)return;if(!D)D=w1(z,$)});else{if(z.issues.length===$)continue;if(!D)D=w1(z,$)}}if(P)return P.then(()=>{return z});return z},Y=(z,Q,G)=>{if(w1(z))return z.aborted=!0,z;let D=q(Q,W,G);if(D instanceof Promise){if(G.async===!1)throw new J1;return D.then((P)=>J._zod.parse(P,G))}return J._zod.parse(D,G)};J._zod.run=(z,Q)=>{if(Q.skipChecks)return J._zod.parse(z,Q);if(Q.direction==="backward"){let D=J._zod.parse({value:z.value,issues:[]},{...Q,skipChecks:!0});if(D instanceof Promise)return D.then((P)=>{return Y(P,z,Q)});return Y(D,z,Q)}let G=J._zod.parse(z,Q);if(G instanceof Promise){if(Q.async===!1)throw new J1;return G.then((D)=>q(D,W,Q))}return q(G,W,Q)}}J["~standard"]={validate:(q)=>{try{let Y=u4(J,q);return Y.success?{value:Y.data}:{issues:Y.error?.issues}}catch(Y){return y4(J,q).then((z)=>z.success?{value:z.data}:{issues:z.error?.issues})}},vendor:"zod",version:1}}),J0=U("$ZodString",(J,X)=>{L.init(J,X),J._zod.pattern=[...J?._zod.bag?.patterns??[]].pop()??I6(J._zod.bag),J._zod.parse=(H,W)=>{if(X.coerce)try{H.value=String(H.value)}catch(q){}if(typeof H.value==="string")return H;return H.issues.push({expected:"string",code:"invalid_type",input:H.value,inst:J}),H}}),b=U("$ZodStringFormat",(J,X)=>{v1.init(J,X),J0.init(J,X)}),p6=U("$ZodGUID",(J,X)=>{X.pattern??(X.pattern=H6),b.init(J,X)}),d6=U("$ZodUUID",(J,X)=>{if(X.version){let W={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[X.version];if(W===void 0)throw Error(`Invalid UUID version: "${X.version}"`);X.pattern??(X.pattern=_0(W))}else X.pattern??(X.pattern=_0());b.init(J,X)}),n6=U("$ZodEmail",(J,X)=>{X.pattern??(X.pattern=W6),b.init(J,X)}),i6=U("$ZodURL",(J,X)=>{b.init(J,X),J._zod.check=(H)=>{try{let W=H.value.trim(),q=new URL(W);if(X.hostname){if(X.hostname.lastIndex=0,!X.hostname.test(q.hostname))H.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:X.hostname.source,input:H.value,inst:J,continue:!X.abort})}if(X.protocol){if(X.protocol.lastIndex=0,!X.protocol.test(q.protocol.endsWith(":")?q.protocol.slice(0,-1):q.protocol))H.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:X.protocol.source,input:H.value,inst:J,continue:!X.abort})}if(X.normalize)H.value=q.href;else H.value=W;return}catch(W){H.issues.push({code:"invalid_format",format:"url",input:H.value,inst:J,continue:!X.abort})}}}),t6=U("$ZodEmoji",(J,X)=>{X.pattern??(X.pattern=q6()),b.init(J,X)}),a6=U("$ZodNanoID",(J,X)=>{X.pattern??(X.pattern=J6),b.init(J,X)}),s6=U("$ZodCUID",(J,X)=>{X.pattern??(X.pattern=i4),b.init(J,X)}),e6=U("$ZodCUID2",(J,X)=>{X.pattern??(X.pattern=t4),b.init(J,X)}),J8=U("$ZodULID",(J,X)=>{X.pattern??(X.pattern=a4),b.init(J,X)}),X8=U("$ZodXID",(J,X)=>{X.pattern??(X.pattern=s4),b.init(J,X)}),H8=U("$ZodKSUID",(J,X)=>{X.pattern??(X.pattern=e4),b.init(J,X)}),W8=U("$ZodISODateTime",(J,X)=>{X.pattern??(X.pattern=F6(X)),b.init(J,X)}),q8=U("$ZodISODate",(J,X)=>{X.pattern??(X.pattern=P6),b.init(J,X)}),Y8=U("$ZodISOTime",(J,X)=>{X.pattern??(X.pattern=M6(X)),b.init(J,X)}),z8=U("$ZodISODuration",(J,X)=>{X.pattern??(X.pattern=X6),b.init(J,X)}),Q8=U("$ZodIPv4",(J,X)=>{X.pattern??(X.pattern=Y6),b.init(J,X),J._zod.bag.format="ipv4"}),w8=U("$ZodIPv6",(J,X)=>{X.pattern??(X.pattern=z6),b.init(J,X),J._zod.bag.format="ipv6",J._zod.check=(H)=>{try{new URL(`http://[${H.value}]`)}catch{H.issues.push({code:"invalid_format",format:"ipv6",input:H.value,inst:J,continue:!X.abort})}}});var D8=U("$ZodCIDRv4",(J,X)=>{X.pattern??(X.pattern=Q6),b.init(J,X)}),G8=U("$ZodCIDRv6",(J,X)=>{X.pattern??(X.pattern=w6),b.init(J,X),J._zod.check=(H)=>{let W=H.value.split("/");try{if(W.length!==2)throw Error();let[q,Y]=W;if(!Y)throw Error();let z=Number(Y);if(`${z}`!==Y)throw Error();if(z<0||z>128)throw Error();new URL(`http://[${q}]`)}catch{H.issues.push({code:"invalid_format",format:"cidrv6",input:H.value,inst:J,continue:!X.abort})}}});function U8(J){if(J==="")return!0;if(J.length%4!==0)return!1;try{return atob(J),!0}catch{return!1}}var P8=U("$ZodBase64",(J,X)=>{X.pattern??(X.pattern=D6),b.init(J,X),J._zod.bag.contentEncoding="base64",J._zod.check=(H)=>{if(U8(H.value))return;H.issues.push({code:"invalid_format",format:"base64",input:H.value,inst:J,continue:!X.abort})}});function QX(J){if(!E0.test(J))return!1;let X=J.replace(/[-_]/g,(W)=>W==="-"?"+":"/"),H=X.padEnd(Math.ceil(X.length/4)*4,"=");return U8(H)}var B8=U("$ZodBase64URL",(J,X)=>{X.pattern??(X.pattern=E0),b.init(J,X),J._zod.bag.contentEncoding="base64url",J._zod.check=(H)=>{if(QX(H.value))return;H.issues.push({code:"invalid_format",format:"base64url",input:H.value,inst:J,continue:!X.abort})}}),M8=U("$ZodE164",(J,X)=>{X.pattern??(X.pattern=G6),b.init(J,X)});function wX(J,X=null){try{let H=J.split(".");if(H.length!==3)return!1;let[W]=H;if(!W)return!1;let q=JSON.parse(atob(W));if("typ"in q&&q?.typ!=="JWT")return!1;if(!q.alg)return!1;if(X&&(!("alg"in q)||q.alg!==X))return!1;return!0}catch{return!1}}var F8=U("$ZodJWT",(J,X)=>{b.init(J,X),J._zod.check=(H)=>{if(wX(H.value,X.alg))return;H.issues.push({code:"invalid_format",format:"jwt",input:H.value,inst:J,continue:!X.abort})}});var T0=U("$ZodNumber",(J,X)=>{L.init(J,X),J._zod.pattern=J._zod.bag.pattern??O6,J._zod.parse=(H,W)=>{if(X.coerce)try{H.value=Number(H.value)}catch(z){}let q=H.value;if(typeof q==="number"&&!Number.isNaN(q)&&Number.isFinite(q))return H;let Y=typeof q==="number"?Number.isNaN(q)?"NaN":!Number.isFinite(q)?"Infinity":void 0:void 0;return H.issues.push({expected:"number",code:"invalid_type",input:q,inst:J,...Y?{received:Y}:{}}),H}}),I8=U("$ZodNumberFormat",(J,X)=>{L6.init(J,X),T0.init(J,X)}),$8=U("$ZodBoolean",(J,X)=>{L.init(J,X),J._zod.pattern=K6,J._zod.parse=(H,W)=>{if(X.coerce)try{H.value=Boolean(H.value)}catch(Y){}let q=H.value;if(typeof q==="boolean")return H;return H.issues.push({expected:"boolean",code:"invalid_type",input:q,inst:J}),H}}),A8=U("$ZodBigInt",(J,X)=>{L.init(J,X),J._zod.pattern=$6,J._zod.parse=(H,W)=>{if(X.coerce)try{H.value=BigInt(H.value)}catch(q){}if(typeof H.value==="bigint")return H;return H.issues.push({expected:"bigint",code:"invalid_type",input:H.value,inst:J}),H}});var O8=U("$ZodAny",(J,X)=>{L.init(J,X),J._zod.parse=(H)=>H}),K8=U("$ZodUnknown",(J,X)=>{L.init(J,X),J._zod.parse=(H)=>H}),V8=U("$ZodNever",(J,X)=>{L.init(J,X),J._zod.parse=(H,W)=>{return H.issues.push({expected:"never",code:"invalid_type",input:H.value,inst:J}),H}});var R8=U("$ZodDate",(J,X)=>{L.init(J,X),J._zod.parse=(H,W)=>{if(X.coerce)try{H.value=new Date(H.value)}catch(Q){}let q=H.value,Y=q instanceof Date;if(Y&&!Number.isNaN(q.getTime()))return H;return H.issues.push({expected:"date",code:"invalid_type",input:q,...Y?{received:"Invalid Date"}:{},inst:J}),H}});function c6(J,X,H){if(J.issues.length)X.issues.push(...X1(H,J.issues));X.value[H]=J.value}var N8=U("$ZodArray",(J,X)=>{L.init(J,X),J._zod.parse=(H,W)=>{let q=H.value;if(!Array.isArray(q))return H.issues.push({expected:"array",code:"invalid_type",input:q,inst:J}),H;H.value=Array(q.length);let Y=[];for(let z=0;z<q.length;z++){let Q=q[z],G=X.element._zod.run({value:Q,issues:[]},W);if(G instanceof Promise)Y.push(G.then((D)=>c6(D,H,z)));else c6(G,H,z)}if(Y.length)return Promise.all(Y).then(()=>H);return H}});function e1(J,X,H,W){if(J.issues.length)X.issues.push(...X1(H,J.issues));if(J.value===void 0){if(H in W)X.value[H]=void 0}else X.value[H]=J.value}function Z8(J){let X=Object.keys(J.shape);for(let W of X)if(!J.shape?.[W]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${W}": expected a Zod schema`);let H=Z0(J.shape);return{...J,keys:X,keySet:new Set(X),numKeys:X.length,optionalKeys:new Set(H)}}function L8(J,X,H,W,q,Y){let z=[],Q=q.keySet,G=q.catchall._zod,D=G.def.type;for(let P in X){if(Q.has(P))continue;if(D==="never"){z.push(P);continue}let B=G.run({value:X[P],issues:[]},W);if(B instanceof Promise)J.push(B.then(($)=>e1($,H,P,X)));else e1(B,H,P,X)}if(z.length)H.issues.push({code:"unrecognized_keys",keys:z,input:X,inst:Y});if(!J.length)return H;return Promise.all(J).then(()=>{return H})}var DX=U("$ZodObject",(J,X)=>{if(L.init(J,X),!Object.getOwnPropertyDescriptor(X,"shape")?.get){let Q=X.shape;Object.defineProperty(X,"shape",{get:()=>{let G={...Q};return Object.defineProperty(X,"shape",{value:G}),G}})}let W=C1(()=>Z8(X));N(J._zod,"propValues",()=>{let Q=X.shape,G={};for(let D in Q){let P=Q[D]._zod;if(P.values){G[D]??(G[D]=new Set);for(let B of P.values)G[D].add(B)}}return G});let q=I1,Y=X.catchall,z;J._zod.parse=(Q,G)=>{z??(z=W.value);let D=Q.value;if(!q(D))return Q.issues.push({expected:"object",code:"invalid_type",input:D,inst:J}),Q;Q.value={};let P=[],B=z.shape;for(let $ of z.keys){let C=B[$]._zod.run({value:D[$],issues:[]},G);if(C instanceof Promise)P.push(C.then((h)=>e1(h,Q,$,D)));else e1(C,Q,$,D)}if(!Y)return P.length?Promise.all(P).then(()=>Q):Q;return L8(P,D,Q,G,W.value,J)}}),b8=U("$ZodObjectJIT",(J,X)=>{DX.init(J,X);let H=J._zod.parse,W=C1(()=>Z8(X)),q=($)=>{let F=new k0(["shape","payload","ctx"]),C=W.value,h=(g)=>{let x=r1(g);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};F.write("const input = payload.value;");let W1=Object.create(null),p=0;for(let g of C.keys)W1[g]=`key_${p++}`;F.write("const newResult = {};");for(let g of C.keys){let x=W1[g],e=r1(g);F.write(`const ${x} = ${h(g)};`),F.write(`
4
+ if (${x}.issues.length) {
5
+ payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
6
+ ...iss,
7
+ path: iss.path ? [${e}, ...iss.path] : [${e}]
8
+ })));
9
+ }
10
+
11
+
12
+ if (${x}.value === undefined) {
13
+ if (${e} in input) {
14
+ newResult[${e}] = undefined;
15
+ }
16
+ } else {
17
+ newResult[${e}] = ${x}.value;
18
+ }
19
+
20
+ `)}F.write("payload.value = newResult;"),F.write("return payload;");let f1=F.compile();return(g,x)=>f1($,g,x)},Y,z=I1,Q=!o1.jitless,D=Q&&R0.value,P=X.catchall,B;J._zod.parse=($,F)=>{B??(B=W.value);let C=$.value;if(!z(C))return $.issues.push({expected:"object",code:"invalid_type",input:C,inst:J}),$;if(Q&&D&&F?.async===!1&&F.jitless!==!0){if(!Y)Y=q(X.shape);if($=Y($,F),!P)return $;return L8([],C,$,F,B,J)}return H($,F)}});function u6(J,X,H,W){for(let Y of J)if(Y.issues.length===0)return X.value=Y.value,X;let q=J.filter((Y)=>!w1(Y));if(q.length===1)return X.value=q[0].value,q[0];return X.issues.push({code:"invalid_union",input:X.value,inst:H,errors:J.map((Y)=>Y.issues.map((z)=>n(z,W,r())))}),X}var _8=U("$ZodUnion",(J,X)=>{L.init(J,X),N(J._zod,"optin",()=>X.options.some((q)=>q._zod.optin==="optional")?"optional":void 0),N(J._zod,"optout",()=>X.options.some((q)=>q._zod.optout==="optional")?"optional":void 0),N(J._zod,"values",()=>{if(X.options.every((q)=>q._zod.values))return new Set(X.options.flatMap((q)=>Array.from(q._zod.values)));return}),N(J._zod,"pattern",()=>{if(X.options.every((q)=>q._zod.pattern)){let q=X.options.map((Y)=>Y._zod.pattern);return new RegExp(`^(${q.map((Y)=>k1(Y.source)).join("|")})$`)}return});let H=X.options.length===1,W=X.options[0]._zod.run;J._zod.parse=(q,Y)=>{if(H)return W(q,Y);let z=!1,Q=[];for(let G of X.options){let D=G._zod.run({value:q.value,issues:[]},Y);if(D instanceof Promise)Q.push(D),z=!0;else{if(D.issues.length===0)return D;Q.push(D)}}if(!z)return u6(Q,q,J,Y);return Promise.all(Q).then((G)=>{return u6(G,q,J,Y)})}});var E8=U("$ZodIntersection",(J,X)=>{L.init(J,X),J._zod.parse=(H,W)=>{let q=H.value,Y=X.left._zod.run({value:q,issues:[]},W),z=X.right._zod.run({value:q,issues:[]},W);if(Y instanceof Promise||z instanceof Promise)return Promise.all([Y,z]).then(([G,D])=>{return y6(H,G,D)});return y6(H,Y,z)}});function j0(J,X){if(J===X)return{valid:!0,data:J};if(J instanceof Date&&X instanceof Date&&+J===+X)return{valid:!0,data:J};if(Q1(J)&&Q1(X)){let H=Object.keys(X),W=Object.keys(J).filter((Y)=>H.indexOf(Y)!==-1),q={...J,...X};for(let Y of W){let z=j0(J[Y],X[Y]);if(!z.valid)return{valid:!1,mergeErrorPath:[Y,...z.mergeErrorPath]};q[Y]=z.data}return{valid:!0,data:q}}if(Array.isArray(J)&&Array.isArray(X)){if(J.length!==X.length)return{valid:!1,mergeErrorPath:[]};let H=[];for(let W=0;W<J.length;W++){let q=J[W],Y=X[W],z=j0(q,Y);if(!z.valid)return{valid:!1,mergeErrorPath:[W,...z.mergeErrorPath]};H.push(z.data)}return{valid:!0,data:H}}return{valid:!1,mergeErrorPath:[]}}function y6(J,X,H){if(X.issues.length)J.issues.push(...X.issues);if(H.issues.length)J.issues.push(...H.issues);if(w1(J))return J;let W=j0(X.value,H.value);if(!W.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(W.mergeErrorPath)}`);return J.value=W.data,J}var C8=U("$ZodRecord",(J,X)=>{L.init(J,X),J._zod.parse=(H,W)=>{let q=H.value;if(!Q1(q))return H.issues.push({expected:"record",code:"invalid_type",input:q,inst:J}),H;let Y=[],z=X.keyType._zod.values;if(z){H.value={};let Q=new Set;for(let D of z)if(typeof D==="string"||typeof D==="number"||typeof D==="symbol"){Q.add(typeof D==="number"?D.toString():D);let P=X.valueType._zod.run({value:q[D],issues:[]},W);if(P instanceof Promise)Y.push(P.then((B)=>{if(B.issues.length)H.issues.push(...X1(D,B.issues));H.value[D]=B.value}));else{if(P.issues.length)H.issues.push(...X1(D,P.issues));H.value[D]=P.value}}let G;for(let D in q)if(!Q.has(D))G=G??[],G.push(D);if(G&&G.length>0)H.issues.push({code:"unrecognized_keys",input:q,inst:J,keys:G})}else{H.value={};for(let Q of Reflect.ownKeys(q)){if(Q==="__proto__")continue;let G=X.keyType._zod.run({value:Q,issues:[]},W);if(G instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(G.issues.length){if(X.mode==="loose")H.value[Q]=q[Q];else H.issues.push({code:"invalid_key",origin:"record",issues:G.issues.map((P)=>n(P,W,r())),input:Q,path:[Q],inst:J});continue}let D=X.valueType._zod.run({value:q[Q],issues:[]},W);if(D instanceof Promise)Y.push(D.then((P)=>{if(P.issues.length)H.issues.push(...X1(Q,P.issues));H.value[G.value]=P.value}));else{if(D.issues.length)H.issues.push(...X1(Q,D.issues));H.value[G.value]=D.value}}}if(Y.length)return Promise.all(Y).then(()=>H);return H}});var S8=U("$ZodEnum",(J,X)=>{L.init(J,X);let H=E1(X.entries),W=new Set(H);J._zod.values=W,J._zod.pattern=new RegExp(`^(${H.filter((q)=>N0.has(typeof q)).map((q)=>typeof q==="string"?U1(q):q.toString()).join("|")})$`),J._zod.parse=(q,Y)=>{let z=q.value;if(W.has(z))return q;return q.issues.push({code:"invalid_value",values:H,input:z,inst:J}),q}});var k8=U("$ZodTransform",(J,X)=>{L.init(J,X),J._zod.parse=(H,W)=>{if(W.direction==="backward")throw new b1(J.constructor.name);let q=X.transform(H.value,H);if(W.async)return(q instanceof Promise?q:Promise.resolve(q)).then((z)=>{return H.value=z,H});if(q instanceof Promise)throw new J1;return H.value=q,H}});function m6(J,X){if(J.issues.length&&X===void 0)return{issues:[],value:void 0};return J}var j8=U("$ZodOptional",(J,X)=>{L.init(J,X),J._zod.optin="optional",J._zod.optout="optional",N(J._zod,"values",()=>{return X.innerType._zod.values?new Set([...X.innerType._zod.values,void 0]):void 0}),N(J._zod,"pattern",()=>{let H=X.innerType._zod.pattern;return H?new RegExp(`^(${k1(H.source)})?$`):void 0}),J._zod.parse=(H,W)=>{if(X.innerType._zod.optin==="optional"){let q=X.innerType._zod.run(H,W);if(q instanceof Promise)return q.then((Y)=>m6(Y,H.value));return m6(q,H.value)}if(H.value===void 0)return H;return X.innerType._zod.run(H,W)}}),T8=U("$ZodNullable",(J,X)=>{L.init(J,X),N(J._zod,"optin",()=>X.innerType._zod.optin),N(J._zod,"optout",()=>X.innerType._zod.optout),N(J._zod,"pattern",()=>{let H=X.innerType._zod.pattern;return H?new RegExp(`^(${k1(H.source)}|null)$`):void 0}),N(J._zod,"values",()=>{return X.innerType._zod.values?new Set([...X.innerType._zod.values,null]):void 0}),J._zod.parse=(H,W)=>{if(H.value===null)return H;return X.innerType._zod.run(H,W)}}),h8=U("$ZodDefault",(J,X)=>{L.init(J,X),J._zod.optin="optional",N(J._zod,"values",()=>X.innerType._zod.values),J._zod.parse=(H,W)=>{if(W.direction==="backward")return X.innerType._zod.run(H,W);if(H.value===void 0)return H.value=X.defaultValue,H;let q=X.innerType._zod.run(H,W);if(q instanceof Promise)return q.then((Y)=>f6(Y,X));return f6(q,X)}});function f6(J,X){if(J.value===void 0)J.value=X.defaultValue;return J}var v8=U("$ZodPrefault",(J,X)=>{L.init(J,X),J._zod.optin="optional",N(J._zod,"values",()=>X.innerType._zod.values),J._zod.parse=(H,W)=>{if(W.direction==="backward")return X.innerType._zod.run(H,W);if(H.value===void 0)H.value=X.defaultValue;return X.innerType._zod.run(H,W)}}),x8=U("$ZodNonOptional",(J,X)=>{L.init(J,X),N(J._zod,"values",()=>{let H=X.innerType._zod.values;return H?new Set([...H].filter((W)=>W!==void 0)):void 0}),J._zod.parse=(H,W)=>{let q=X.innerType._zod.run(H,W);if(q instanceof Promise)return q.then((Y)=>o6(Y,J));return o6(q,J)}});function o6(J,X){if(!J.issues.length&&J.value===void 0)J.issues.push({code:"invalid_type",expected:"nonoptional",input:J.value,inst:X});return J}var g8=U("$ZodCatch",(J,X)=>{L.init(J,X),N(J._zod,"optin",()=>X.innerType._zod.optin),N(J._zod,"optout",()=>X.innerType._zod.optout),N(J._zod,"values",()=>X.innerType._zod.values),J._zod.parse=(H,W)=>{if(W.direction==="backward")return X.innerType._zod.run(H,W);let q=X.innerType._zod.run(H,W);if(q instanceof Promise)return q.then((Y)=>{if(H.value=Y.value,Y.issues.length)H.value=X.catchValue({...H,error:{issues:Y.issues.map((z)=>n(z,W,r()))},input:H.value}),H.issues=[];return H});if(H.value=q.value,q.issues.length)H.value=X.catchValue({...H,error:{issues:q.issues.map((Y)=>n(Y,W,r()))},input:H.value}),H.issues=[];return H}});var c8=U("$ZodPipe",(J,X)=>{L.init(J,X),N(J._zod,"values",()=>X.in._zod.values),N(J._zod,"optin",()=>X.in._zod.optin),N(J._zod,"optout",()=>X.out._zod.optout),N(J._zod,"propValues",()=>X.in._zod.propValues),J._zod.parse=(H,W)=>{if(W.direction==="backward"){let Y=X.out._zod.run(H,W);if(Y instanceof Promise)return Y.then((z)=>s1(z,X.in,W));return s1(Y,X.in,W)}let q=X.in._zod.run(H,W);if(q instanceof Promise)return q.then((Y)=>s1(Y,X.out,W));return s1(q,X.out,W)}});function s1(J,X,H){if(J.issues.length)return J.aborted=!0,J;return X._zod.run({value:J.value,issues:J.issues},H)}var u8=U("$ZodReadonly",(J,X)=>{L.init(J,X),N(J._zod,"propValues",()=>X.innerType._zod.propValues),N(J._zod,"values",()=>X.innerType._zod.values),N(J._zod,"optin",()=>X.innerType?._zod?.optin),N(J._zod,"optout",()=>X.innerType?._zod?.optout),J._zod.parse=(H,W)=>{if(W.direction==="backward")return X.innerType._zod.run(H,W);let q=X.innerType._zod.run(H,W);if(q instanceof Promise)return q.then(l6);return l6(q)}});function l6(J){return J.value=Object.freeze(J.value),J}var y8=U("$ZodCustom",(J,X)=>{c.init(J,X),L.init(J,X),J._zod.parse=(H,W)=>{return H},J._zod.check=(H)=>{let W=H.value,q=X.fn(W);if(q instanceof Promise)return q.then((Y)=>r6(Y,H,W,J));r6(q,H,W,J);return}});function r6(J,X,H,W){if(!J){let q={code:"custom",input:H,inst:W,path:[...W._zod.def.path??[]],continue:!W._zod.def.abort};if(W._zod.def.params)q.params=W._zod.def.params;X.issues.push(A1(q))}}var GX=(J)=>{let X=typeof J;switch(X){case"number":return Number.isNaN(J)?"NaN":"number";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return X},UX=()=>{let J={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function X(W){return J[W]??null}let H={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(W)=>{switch(W.code){case"invalid_type":return`Invalid input: expected ${W.expected}, received ${GX(W.input)}`;case"invalid_value":if(W.values.length===1)return`Invalid input: expected ${d1(W.values[0])}`;return`Invalid option: expected one of ${l1(W.values,"|")}`;case"too_big":{let q=W.inclusive?"<=":"<",Y=X(W.origin);if(Y)return`Too big: expected ${W.origin??"value"} to have ${q}${W.maximum.toString()} ${Y.unit??"elements"}`;return`Too big: expected ${W.origin??"value"} to be ${q}${W.maximum.toString()}`}case"too_small":{let q=W.inclusive?">=":">",Y=X(W.origin);if(Y)return`Too small: expected ${W.origin} to have ${q}${W.minimum.toString()} ${Y.unit}`;return`Too small: expected ${W.origin} to be ${q}${W.minimum.toString()}`}case"invalid_format":{let q=W;if(q.format==="starts_with")return`Invalid string: must start with "${q.prefix}"`;if(q.format==="ends_with")return`Invalid string: must end with "${q.suffix}"`;if(q.format==="includes")return`Invalid string: must include "${q.includes}"`;if(q.format==="regex")return`Invalid string: must match pattern ${q.pattern}`;return`Invalid ${H[q.format]??W.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${W.divisor}`;case"unrecognized_keys":return`Unrecognized key${W.keys.length>1?"s":""}: ${l1(W.keys,", ")}`;case"invalid_key":return`Invalid key in ${W.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${W.origin}`;default:return"Invalid input"}}};function h0(){return{localeError:UX()}}var m8,W5=Symbol("ZodOutput"),q5=Symbol("ZodInput");class f8{constructor(){this._map=new WeakMap,this._idmap=new Map}add(J,...X){let H=X[0];if(this._map.set(J,H),H&&typeof H==="object"&&"id"in H){if(this._idmap.has(H.id))throw Error(`ID ${H.id} already exists in the registry`);this._idmap.set(H.id,J)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(J){let X=this._map.get(J);if(X&&typeof X==="object"&&"id"in X)this._idmap.delete(X.id);return this._map.delete(J),this}get(J){let X=J._zod.parent;if(X){let H={...this.get(X)??{}};delete H.id;let W={...H,...this._map.get(J)};return Object.keys(W).length?W:void 0}return this._map.get(J)}has(J){return this._map.has(J)}}function PX(){return new f8}(m8=globalThis).__zod_globalRegistry??(m8.__zod_globalRegistry=PX());var P1=globalThis.__zod_globalRegistry;function o8(J,X){return new J({type:"string",...I(X)})}function l8(J,X){return new J({type:"string",coerce:!0,...I(X)})}function r8(J,X){return new J({type:"string",format:"email",check:"string_format",abort:!1,...I(X)})}function v0(J,X){return new J({type:"string",format:"guid",check:"string_format",abort:!1,...I(X)})}function p8(J,X){return new J({type:"string",format:"uuid",check:"string_format",abort:!1,...I(X)})}function d8(J,X){return new J({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...I(X)})}function n8(J,X){return new J({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...I(X)})}function i8(J,X){return new J({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...I(X)})}function t8(J,X){return new J({type:"string",format:"url",check:"string_format",abort:!1,...I(X)})}function a8(J,X){return new J({type:"string",format:"emoji",check:"string_format",abort:!1,...I(X)})}function s8(J,X){return new J({type:"string",format:"nanoid",check:"string_format",abort:!1,...I(X)})}function e8(J,X){return new J({type:"string",format:"cuid",check:"string_format",abort:!1,...I(X)})}function J2(J,X){return new J({type:"string",format:"cuid2",check:"string_format",abort:!1,...I(X)})}function X2(J,X){return new J({type:"string",format:"ulid",check:"string_format",abort:!1,...I(X)})}function H2(J,X){return new J({type:"string",format:"xid",check:"string_format",abort:!1,...I(X)})}function W2(J,X){return new J({type:"string",format:"ksuid",check:"string_format",abort:!1,...I(X)})}function q2(J,X){return new J({type:"string",format:"ipv4",check:"string_format",abort:!1,...I(X)})}function Y2(J,X){return new J({type:"string",format:"ipv6",check:"string_format",abort:!1,...I(X)})}function z2(J,X){return new J({type:"string",format:"cidrv4",check:"string_format",abort:!1,...I(X)})}function Q2(J,X){return new J({type:"string",format:"cidrv6",check:"string_format",abort:!1,...I(X)})}function w2(J,X){return new J({type:"string",format:"base64",check:"string_format",abort:!1,...I(X)})}function D2(J,X){return new J({type:"string",format:"base64url",check:"string_format",abort:!1,...I(X)})}function G2(J,X){return new J({type:"string",format:"e164",check:"string_format",abort:!1,...I(X)})}function U2(J,X){return new J({type:"string",format:"jwt",check:"string_format",abort:!1,...I(X)})}function P2(J,X){return new J({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...I(X)})}function B2(J,X){return new J({type:"string",format:"date",check:"string_format",...I(X)})}function M2(J,X){return new J({type:"string",format:"time",check:"string_format",precision:null,...I(X)})}function F2(J,X){return new J({type:"string",format:"duration",check:"string_format",...I(X)})}function I2(J,X){return new J({type:"number",checks:[],...I(X)})}function $2(J,X){return new J({type:"number",coerce:!0,checks:[],...I(X)})}function A2(J,X){return new J({type:"number",check:"number_format",abort:!1,format:"safeint",...I(X)})}function O2(J,X){return new J({type:"boolean",...I(X)})}function K2(J,X){return new J({type:"boolean",coerce:!0,...I(X)})}function V2(J,X){return new J({type:"bigint",coerce:!0,...I(X)})}function R2(J){return new J({type:"any"})}function N2(J){return new J({type:"unknown"})}function Z2(J,X){return new J({type:"never",...I(X)})}function L2(J,X){return new J({type:"date",...I(X)})}function b2(J,X){return new J({type:"date",coerce:!0,...I(X)})}function O1(J,X){return new C0({check:"less_than",...I(X),value:J,inclusive:!1})}function H1(J,X){return new C0({check:"less_than",...I(X),value:J,inclusive:!0})}function K1(J,X){return new S0({check:"greater_than",...I(X),value:J,inclusive:!1})}function i(J,X){return new S0({check:"greater_than",...I(X),value:J,inclusive:!0})}function x1(J,X){return new Z6({check:"multiple_of",...I(X),value:J})}function X0(J,X){return new b6({check:"max_length",...I(X),maximum:J})}function V1(J,X){return new _6({check:"min_length",...I(X),minimum:J})}function H0(J,X){return new E6({check:"length_equals",...I(X),length:J})}function x0(J,X){return new C6({check:"string_format",format:"regex",...I(X),pattern:J})}function g0(J){return new S6({check:"string_format",format:"lowercase",...I(J)})}function c0(J){return new k6({check:"string_format",format:"uppercase",...I(J)})}function u0(J,X){return new j6({check:"string_format",format:"includes",...I(X),includes:J})}function y0(J,X){return new T6({check:"string_format",format:"starts_with",...I(X),prefix:J})}function m0(J,X){return new h6({check:"string_format",format:"ends_with",...I(X),suffix:J})}function D1(J){return new v6({check:"overwrite",tx:J})}function f0(J){return D1((X)=>X.normalize(J))}function o0(){return D1((J)=>J.trim())}function l0(){return D1((J)=>J.toLowerCase())}function r0(){return D1((J)=>J.toUpperCase())}function p0(){return D1((J)=>V0(J))}function _2(J,X,H){return new J({type:"array",element:X,...I(H)})}function E2(J,X,H){return new J({type:"custom",check:"custom",fn:X,...I(H)})}function C2(J){let X=BX((H)=>{return H.addIssue=(W)=>{if(typeof W==="string")H.issues.push(A1(W,H.value,X._zod.def));else{let q=W;if(q.fatal)q.continue=!1;q.code??(q.code="custom"),q.input??(q.input=H.value),q.inst??(q.inst=X),q.continue??(q.continue=!X._zod.def.abort),H.issues.push(A1(q))}},J(H.value,H)});return X}function BX(J,X){let H=new c({check:"custom",...I(X)});return H._zod.check=J,H}function d0(J){let X=J?.target??"draft-2020-12";if(X==="draft-4")X="draft-04";if(X==="draft-7")X="draft-07";return{processors:J.processors??{},metadataRegistry:J?.metadata??P1,target:X,unrepresentable:J?.unrepresentable??"throw",override:J?.override??(()=>{}),io:J?.io??"output",counter:0,seen:new Map,cycles:J?.cycles??"ref",reused:J?.reused??"inline",external:J?.external??void 0}}function v(J,X,H={path:[],schemaPath:[]}){var W;let q=J._zod.def,Y=X.seen.get(J);if(Y){if(Y.count++,H.schemaPath.includes(J))Y.cycle=H.path;return Y.schema}let z={schema:{},count:1,cycle:void 0,path:H.path};X.seen.set(J,z);let Q=J._zod.toJSONSchema?.();if(Q)z.schema=Q;else{let P={...H,schemaPath:[...H.schemaPath,J],path:H.path},B=J._zod.parent;if(B)z.ref=B,v(B,X,P),X.seen.get(B).isParent=!0;else if(J._zod.processJSONSchema)J._zod.processJSONSchema(X,z.schema,P);else{let $=z.schema,F=X.processors[q.type];if(!F)throw Error(`[toJSONSchema]: Non-representable type encountered: ${q.type}`);F(J,X,$,P)}}let G=X.metadataRegistry.get(J);if(G)Object.assign(z.schema,G);if(X.io==="input"&&y(J))delete z.schema.examples,delete z.schema.default;if(X.io==="input"&&z.schema._prefault)(W=z.schema).default??(W.default=z.schema._prefault);return delete z.schema._prefault,X.seen.get(J).schema}function n0(J,X){let H=J.seen.get(X);if(!H)throw Error("Unprocessed schema. This is a bug in Zod.");let W=(Y)=>{let z=J.target==="draft-2020-12"?"$defs":"definitions";if(J.external){let P=J.external.registry.get(Y[0])?.id,B=J.external.uri??((F)=>F);if(P)return{ref:B(P)};let $=Y[1].defId??Y[1].schema.id??`schema${J.counter++}`;return Y[1].defId=$,{defId:$,ref:`${B("__shared")}#/${z}/${$}`}}if(Y[1]===H)return{ref:"#"};let G=`${"#"}/${z}/`,D=Y[1].schema.id??`__schema${J.counter++}`;return{defId:D,ref:G+D}},q=(Y)=>{if(Y[1].schema.$ref)return;let z=Y[1],{ref:Q,defId:G}=W(Y);if(z.def={...z.schema},G)z.defId=G;let D=z.schema;for(let P in D)delete D[P];D.$ref=Q};if(J.cycles==="throw")for(let Y of J.seen.entries()){let z=Y[1];if(z.cycle)throw Error(`Cycle detected: #/${z.cycle?.join("/")}/<root>
21
+
22
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let Y of J.seen.entries()){let z=Y[1];if(X===Y[0]){q(Y);continue}if(J.external){let G=J.external.registry.get(Y[0])?.id;if(X!==Y[0]&&G){q(Y);continue}}if(J.metadataRegistry.get(Y[0])?.id){q(Y);continue}if(z.cycle){q(Y);continue}if(z.count>1){if(J.reused==="ref"){q(Y);continue}}}}function i0(J,X){let H=J.seen.get(X);if(!H)throw Error("Unprocessed schema. This is a bug in Zod.");let W=(z)=>{let Q=J.seen.get(z),G=Q.def??Q.schema,D={...G};if(Q.ref===null)return;let P=Q.ref;if(Q.ref=null,P){W(P);let B=J.seen.get(P).schema;if(B.$ref&&(J.target==="draft-07"||J.target==="draft-04"||J.target==="openapi-3.0"))G.allOf=G.allOf??[],G.allOf.push(B);else Object.assign(G,B),Object.assign(G,D)}if(!Q.isParent)J.override({zodSchema:z,jsonSchema:G,path:Q.path??[]})};for(let z of[...J.seen.entries()].reverse())W(z[0]);let q={};if(J.target==="draft-2020-12")q.$schema="https://json-schema.org/draft/2020-12/schema";else if(J.target==="draft-07")q.$schema="http://json-schema.org/draft-07/schema#";else if(J.target==="draft-04")q.$schema="http://json-schema.org/draft-04/schema#";else if(J.target==="openapi-3.0");if(J.external?.uri){let z=J.external.registry.get(X)?.id;if(!z)throw Error("Schema is missing an `id` property");q.$id=J.external.uri(z)}Object.assign(q,H.def??H.schema);let Y=J.external?.defs??{};for(let z of J.seen.entries()){let Q=z[1];if(Q.def&&Q.defId)Y[Q.defId]=Q.def}if(J.external);else if(Object.keys(Y).length>0)if(J.target==="draft-2020-12")q.$defs=Y;else q.definitions=Y;try{let z=JSON.parse(JSON.stringify(q));return Object.defineProperty(z,"~standard",{value:{...X["~standard"],jsonSchema:{input:g1(X,"input"),output:g1(X,"output")}},enumerable:!1,writable:!1}),z}catch(z){throw Error("Error converting schema to JSON.")}}function y(J,X){let H=X??{seen:new Set};if(H.seen.has(J))return!1;H.seen.add(J);let W=J._zod.def;if(W.type==="transform")return!0;if(W.type==="array")return y(W.element,H);if(W.type==="set")return y(W.valueType,H);if(W.type==="lazy")return y(W.getter(),H);if(W.type==="promise"||W.type==="optional"||W.type==="nonoptional"||W.type==="nullable"||W.type==="readonly"||W.type==="default"||W.type==="prefault")return y(W.innerType,H);if(W.type==="intersection")return y(W.left,H)||y(W.right,H);if(W.type==="record"||W.type==="map")return y(W.keyType,H)||y(W.valueType,H);if(W.type==="pipe")return y(W.in,H)||y(W.out,H);if(W.type==="object"){for(let q in W.shape)if(y(W.shape[q],H))return!0;return!1}if(W.type==="union"){for(let q of W.options)if(y(q,H))return!0;return!1}if(W.type==="tuple"){for(let q of W.items)if(y(q,H))return!0;if(W.rest&&y(W.rest,H))return!0;return!1}return!1}var S2=(J,X={})=>(H)=>{let W=d0({...H,processors:X});return v(J,W),n0(W,J),i0(W,J)},g1=(J,X)=>(H)=>{let{libraryOptions:W,target:q}=H??{},Y=d0({...W??{},target:q,io:X,processors:{}});return v(J,Y),n0(Y,J),i0(Y,J)};var MX={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},k2=(J,X,H,W)=>{let q=H;q.type="string";let{minimum:Y,maximum:z,format:Q,patterns:G,contentEncoding:D}=J._zod.bag;if(typeof Y==="number")q.minLength=Y;if(typeof z==="number")q.maxLength=z;if(Q){if(q.format=MX[Q]??Q,q.format==="")delete q.format}if(D)q.contentEncoding=D;if(G&&G.size>0){let P=[...G];if(P.length===1)q.pattern=P[0].source;else if(P.length>1)q.allOf=[...P.map((B)=>({...X.target==="draft-07"||X.target==="draft-04"||X.target==="openapi-3.0"?{type:"string"}:{},pattern:B.source}))]}},j2=(J,X,H,W)=>{let q=H,{minimum:Y,maximum:z,format:Q,multipleOf:G,exclusiveMaximum:D,exclusiveMinimum:P}=J._zod.bag;if(typeof Q==="string"&&Q.includes("int"))q.type="integer";else q.type="number";if(typeof P==="number")if(X.target==="draft-04"||X.target==="openapi-3.0")q.minimum=P,q.exclusiveMinimum=!0;else q.exclusiveMinimum=P;if(typeof Y==="number"){if(q.minimum=Y,typeof P==="number"&&X.target!=="draft-04")if(P>=Y)delete q.minimum;else delete q.exclusiveMinimum}if(typeof D==="number")if(X.target==="draft-04"||X.target==="openapi-3.0")q.maximum=D,q.exclusiveMaximum=!0;else q.exclusiveMaximum=D;if(typeof z==="number"){if(q.maximum=z,typeof D==="number"&&X.target!=="draft-04")if(D<=z)delete q.maximum;else delete q.exclusiveMaximum}if(typeof G==="number")q.multipleOf=G},T2=(J,X,H,W)=>{H.type="boolean"},h2=(J,X,H,W)=>{if(X.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")};var v2=(J,X,H,W)=>{H.not={}},x2=(J,X,H,W)=>{},g2=(J,X,H,W)=>{},c2=(J,X,H,W)=>{if(X.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},u2=(J,X,H,W)=>{let q=J._zod.def,Y=E1(q.entries);if(Y.every((z)=>typeof z==="number"))H.type="number";if(Y.every((z)=>typeof z==="string"))H.type="string";H.enum=Y};var y2=(J,X,H,W)=>{if(X.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")};var m2=(J,X,H,W)=>{if(X.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")};var f2=(J,X,H,W)=>{let q=H,Y=J._zod.def,{minimum:z,maximum:Q}=J._zod.bag;if(typeof z==="number")q.minItems=z;if(typeof Q==="number")q.maxItems=Q;q.type="array",q.items=v(Y.element,X,{...W,path:[...W.path,"items"]})},o2=(J,X,H,W)=>{let q=H,Y=J._zod.def;q.type="object",q.properties={};let z=Y.shape;for(let D in z)q.properties[D]=v(z[D],X,{...W,path:[...W.path,"properties",D]});let Q=new Set(Object.keys(z)),G=new Set([...Q].filter((D)=>{let P=Y.shape[D]._zod;if(X.io==="input")return P.optin===void 0;else return P.optout===void 0}));if(G.size>0)q.required=Array.from(G);if(Y.catchall?._zod.def.type==="never")q.additionalProperties=!1;else if(!Y.catchall){if(X.io==="output")q.additionalProperties=!1}else if(Y.catchall)q.additionalProperties=v(Y.catchall,X,{...W,path:[...W.path,"additionalProperties"]})},l2=(J,X,H,W)=>{let q=J._zod.def,Y=q.inclusive===!1,z=q.options.map((Q,G)=>v(Q,X,{...W,path:[...W.path,Y?"oneOf":"anyOf",G]}));if(Y)H.oneOf=z;else H.anyOf=z},r2=(J,X,H,W)=>{let q=J._zod.def,Y=v(q.left,X,{...W,path:[...W.path,"allOf",0]}),z=v(q.right,X,{...W,path:[...W.path,"allOf",1]}),Q=(D)=>("allOf"in D)&&Object.keys(D).length===1,G=[...Q(Y)?Y.allOf:[Y],...Q(z)?z.allOf:[z]];H.allOf=G};var p2=(J,X,H,W)=>{let q=H,Y=J._zod.def;if(q.type="object",X.target==="draft-07"||X.target==="draft-2020-12")q.propertyNames=v(Y.keyType,X,{...W,path:[...W.path,"propertyNames"]});q.additionalProperties=v(Y.valueType,X,{...W,path:[...W.path,"additionalProperties"]})},d2=(J,X,H,W)=>{let q=J._zod.def,Y=v(q.innerType,X,W),z=X.seen.get(J);if(X.target==="openapi-3.0")z.ref=q.innerType,H.nullable=!0;else H.anyOf=[Y,{type:"null"}]},n2=(J,X,H,W)=>{let q=J._zod.def;v(q.innerType,X,W);let Y=X.seen.get(J);Y.ref=q.innerType},i2=(J,X,H,W)=>{let q=J._zod.def;v(q.innerType,X,W);let Y=X.seen.get(J);Y.ref=q.innerType,H.default=JSON.parse(JSON.stringify(q.defaultValue))},t2=(J,X,H,W)=>{let q=J._zod.def;v(q.innerType,X,W);let Y=X.seen.get(J);if(Y.ref=q.innerType,X.io==="input")H._prefault=JSON.parse(JSON.stringify(q.defaultValue))},a2=(J,X,H,W)=>{let q=J._zod.def;v(q.innerType,X,W);let Y=X.seen.get(J);Y.ref=q.innerType;let z;try{z=q.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}H.default=z},s2=(J,X,H,W)=>{let q=J._zod.def,Y=X.io==="input"?q.in._zod.def.type==="transform"?q.out:q.in:q.out;v(Y,X,W);let z=X.seen.get(J);z.ref=Y},e2=(J,X,H,W)=>{let q=J._zod.def;v(q.innerType,X,W);let Y=X.seen.get(J);Y.ref=q.innerType,H.readOnly=!0};var JJ=(J,X,H,W)=>{let q=J._zod.def;v(q.innerType,X,W);let Y=X.seen.get(J);Y.ref=q.innerType};var RX=U("ZodISODateTime",(J,X)=>{W8.init(J,X),S.init(J,X)});function XJ(J){return P2(RX,J)}var NX=U("ZodISODate",(J,X)=>{q8.init(J,X),S.init(J,X)});function HJ(J){return B2(NX,J)}var ZX=U("ZodISOTime",(J,X)=>{Y8.init(J,X),S.init(J,X)});function WJ(J){return M2(ZX,J)}var LX=U("ZodISODuration",(J,X)=>{z8.init(J,X),S.init(J,X)});function qJ(J){return F2(LX,J)}var QJ=(J,X)=>{n1.init(J,X),J.name="ZodError",Object.defineProperties(J,{format:{value:(H)=>c4(J,H)},flatten:{value:(H)=>g4(J,H)},addIssue:{value:(H)=>{J.issues.push(H),J.message=JSON.stringify(J.issues,$1,2)}},addIssues:{value:(H)=>{J.issues.push(...H),J.message=JSON.stringify(J.issues,$1,2)}},isEmpty:{get(){return J.issues.length===0}}})},h5=U("ZodError",QJ),f=U("ZodError",QJ,{Parent:Error});var wJ=i1(f),DJ=t1(f),GJ=T1(f),UJ=h1(f),PJ=m4(f),BJ=f4(f),MJ=o4(f),FJ=l4(f),IJ=r4(f),$J=p4(f),AJ=d4(f),OJ=n4(f);var k=U("ZodType",(J,X)=>{return L.init(J,X),Object.assign(J["~standard"],{jsonSchema:{input:g1(J,"input"),output:g1(J,"output")}}),J.toJSONSchema=S2(J,{}),J.def=X,J.type=X.type,Object.defineProperty(J,"_def",{value:X}),J.check=(...H)=>{return J.clone(K.mergeDefs(X,{checks:[...X.checks??[],...H.map((W)=>typeof W==="function"?{_zod:{check:W,def:{check:"custom"},onattach:[]}}:W)]}))},J.clone=(H,W)=>d(J,H,W),J.brand=()=>J,J.register=(H,W)=>{return H.add(J,W),J},J.parse=(H,W)=>wJ(J,H,W,{callee:J.parse}),J.safeParse=(H,W)=>GJ(J,H,W),J.parseAsync=async(H,W)=>DJ(J,H,W,{callee:J.parseAsync}),J.safeParseAsync=async(H,W)=>UJ(J,H,W),J.spa=J.safeParseAsync,J.encode=(H,W)=>PJ(J,H,W),J.decode=(H,W)=>BJ(J,H,W),J.encodeAsync=async(H,W)=>MJ(J,H,W),J.decodeAsync=async(H,W)=>FJ(J,H,W),J.safeEncode=(H,W)=>IJ(J,H,W),J.safeDecode=(H,W)=>$J(J,H,W),J.safeEncodeAsync=async(H,W)=>AJ(J,H,W),J.safeDecodeAsync=async(H,W)=>OJ(J,H,W),J.refine=(H,W)=>J.check(IH(H,W)),J.superRefine=(H)=>J.check($H(H)),J.overwrite=(H)=>J.check(D1(H)),J.optional=()=>NJ(J),J.nullable=()=>ZJ(J),J.nullish=()=>NJ(ZJ(J)),J.nonoptional=(H)=>DH(J,H),J.array=()=>X4(J),J.or=(H)=>sX([J,H]),J.and=(H)=>JH(J,H),J.transform=(H)=>LJ(J,WH(H)),J.default=(H)=>zH(J,H),J.prefault=(H)=>wH(J,H),J.catch=(H)=>UH(J,H),J.pipe=(H)=>LJ(J,H),J.readonly=()=>MH(J),J.describe=(H)=>{let W=J.clone();return P1.add(W,{description:H}),W},Object.defineProperty(J,"description",{get(){return P1.get(J)?.description},configurable:!0}),J.meta=(...H)=>{if(H.length===0)return P1.get(J);let W=J.clone();return P1.add(W,H[0]),W},J.isOptional=()=>J.safeParse(void 0).success,J.isNullable=()=>J.safeParse(null).success,J}),bJ=U("_ZodString",(J,X)=>{J0.init(J,X),k.init(J,X),J._zod.processJSONSchema=(W,q,Y)=>k2(J,W,q,Y);let H=J._zod.bag;J.format=H.format??null,J.minLength=H.minimum??null,J.maxLength=H.maximum??null,J.regex=(...W)=>J.check(x0(...W)),J.includes=(...W)=>J.check(u0(...W)),J.startsWith=(...W)=>J.check(y0(...W)),J.endsWith=(...W)=>J.check(m0(...W)),J.min=(...W)=>J.check(V1(...W)),J.max=(...W)=>J.check(X0(...W)),J.length=(...W)=>J.check(H0(...W)),J.nonempty=(...W)=>J.check(V1(1,...W)),J.lowercase=(W)=>J.check(g0(W)),J.uppercase=(W)=>J.check(c0(W)),J.trim=()=>J.check(o0()),J.normalize=(...W)=>J.check(f0(...W)),J.toLowerCase=()=>J.check(l0()),J.toUpperCase=()=>J.check(r0()),J.slugify=()=>J.check(p0())}),a0=U("ZodString",(J,X)=>{J0.init(J,X),bJ.init(J,X),J.email=(H)=>J.check(r8(_X,H)),J.url=(H)=>J.check(t8(EX,H)),J.jwt=(H)=>J.check(U2(oX,H)),J.emoji=(H)=>J.check(a8(CX,H)),J.guid=(H)=>J.check(v0(KJ,H)),J.uuid=(H)=>J.check(p8(W0,H)),J.uuidv4=(H)=>J.check(d8(W0,H)),J.uuidv6=(H)=>J.check(n8(W0,H)),J.uuidv7=(H)=>J.check(i8(W0,H)),J.nanoid=(H)=>J.check(s8(SX,H)),J.guid=(H)=>J.check(v0(KJ,H)),J.cuid=(H)=>J.check(e8(kX,H)),J.cuid2=(H)=>J.check(J2(jX,H)),J.ulid=(H)=>J.check(X2(TX,H)),J.base64=(H)=>J.check(w2(yX,H)),J.base64url=(H)=>J.check(D2(mX,H)),J.xid=(H)=>J.check(H2(hX,H)),J.ksuid=(H)=>J.check(W2(vX,H)),J.ipv4=(H)=>J.check(q2(xX,H)),J.ipv6=(H)=>J.check(Y2(gX,H)),J.cidrv4=(H)=>J.check(z2(cX,H)),J.cidrv6=(H)=>J.check(Q2(uX,H)),J.e164=(H)=>J.check(G2(fX,H)),J.datetime=(H)=>J.check(XJ(H)),J.date=(H)=>J.check(HJ(H)),J.time=(H)=>J.check(WJ(H)),J.duration=(H)=>J.check(qJ(H))});function _(J){return o8(a0,J)}var S=U("ZodStringFormat",(J,X)=>{b.init(J,X),bJ.init(J,X)}),_X=U("ZodEmail",(J,X)=>{n6.init(J,X),S.init(J,X)});var KJ=U("ZodGUID",(J,X)=>{p6.init(J,X),S.init(J,X)});var W0=U("ZodUUID",(J,X)=>{d6.init(J,X),S.init(J,X)});var EX=U("ZodURL",(J,X)=>{i6.init(J,X),S.init(J,X)});var CX=U("ZodEmoji",(J,X)=>{t6.init(J,X),S.init(J,X)});var SX=U("ZodNanoID",(J,X)=>{a6.init(J,X),S.init(J,X)});var kX=U("ZodCUID",(J,X)=>{s6.init(J,X),S.init(J,X)});var jX=U("ZodCUID2",(J,X)=>{e6.init(J,X),S.init(J,X)});var TX=U("ZodULID",(J,X)=>{J8.init(J,X),S.init(J,X)});var hX=U("ZodXID",(J,X)=>{X8.init(J,X),S.init(J,X)});var vX=U("ZodKSUID",(J,X)=>{H8.init(J,X),S.init(J,X)});var xX=U("ZodIPv4",(J,X)=>{Q8.init(J,X),S.init(J,X)});var gX=U("ZodIPv6",(J,X)=>{w8.init(J,X),S.init(J,X)});var cX=U("ZodCIDRv4",(J,X)=>{D8.init(J,X),S.init(J,X)});var uX=U("ZodCIDRv6",(J,X)=>{G8.init(J,X),S.init(J,X)});var yX=U("ZodBase64",(J,X)=>{P8.init(J,X),S.init(J,X)});var mX=U("ZodBase64URL",(J,X)=>{B8.init(J,X),S.init(J,X)});var fX=U("ZodE164",(J,X)=>{M8.init(J,X),S.init(J,X)});var oX=U("ZodJWT",(J,X)=>{F8.init(J,X),S.init(J,X)});var q0=U("ZodNumber",(J,X)=>{T0.init(J,X),k.init(J,X),J._zod.processJSONSchema=(W,q,Y)=>j2(J,W,q,Y),J.gt=(W,q)=>J.check(K1(W,q)),J.gte=(W,q)=>J.check(i(W,q)),J.min=(W,q)=>J.check(i(W,q)),J.lt=(W,q)=>J.check(O1(W,q)),J.lte=(W,q)=>J.check(H1(W,q)),J.max=(W,q)=>J.check(H1(W,q)),J.int=(W)=>J.check(VJ(W)),J.safe=(W)=>J.check(VJ(W)),J.positive=(W)=>J.check(K1(0,W)),J.nonnegative=(W)=>J.check(i(0,W)),J.negative=(W)=>J.check(O1(0,W)),J.nonpositive=(W)=>J.check(H1(0,W)),J.multipleOf=(W,q)=>J.check(x1(W,q)),J.step=(W,q)=>J.check(x1(W,q)),J.finite=()=>J;let H=J._zod.bag;J.minValue=Math.max(H.minimum??Number.NEGATIVE_INFINITY,H.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,J.maxValue=Math.min(H.maximum??Number.POSITIVE_INFINITY,H.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,J.isInt=(H.format??"").includes("int")||Number.isSafeInteger(H.multipleOf??0.5),J.isFinite=!0,J.format=H.format??null});function B1(J){return I2(q0,J)}var lX=U("ZodNumberFormat",(J,X)=>{I8.init(J,X),q0.init(J,X)});function VJ(J){return A2(lX,J)}var s0=U("ZodBoolean",(J,X)=>{$8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(H,W,q)=>T2(J,H,W,q)});function _J(J){return O2(s0,J)}var EJ=U("ZodBigInt",(J,X)=>{A8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(W,q,Y)=>h2(J,W,q,Y),J.gte=(W,q)=>J.check(i(W,q)),J.min=(W,q)=>J.check(i(W,q)),J.gt=(W,q)=>J.check(K1(W,q)),J.gte=(W,q)=>J.check(i(W,q)),J.min=(W,q)=>J.check(i(W,q)),J.lt=(W,q)=>J.check(O1(W,q)),J.lte=(W,q)=>J.check(H1(W,q)),J.max=(W,q)=>J.check(H1(W,q)),J.positive=(W)=>J.check(K1(BigInt(0),W)),J.negative=(W)=>J.check(O1(BigInt(0),W)),J.nonpositive=(W)=>J.check(H1(BigInt(0),W)),J.nonnegative=(W)=>J.check(i(BigInt(0),W)),J.multipleOf=(W,q)=>J.check(x1(W,q));let H=J._zod.bag;J.minValue=H.minimum??null,J.maxValue=H.maximum??null,J.format=H.format??null});var rX=U("ZodAny",(J,X)=>{O8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(H,W,q)=>x2(J,H,W,q)});function Y0(){return R2(rX)}var pX=U("ZodUnknown",(J,X)=>{K8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(H,W,q)=>g2(J,H,W,q)});function RJ(){return N2(pX)}var dX=U("ZodNever",(J,X)=>{V8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(H,W,q)=>v2(J,H,W,q)});function nX(J){return Z2(dX,J)}var e0=U("ZodDate",(J,X)=>{R8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(W,q,Y)=>c2(J,W,q,Y),J.min=(W,q)=>J.check(i(W,q)),J.max=(W,q)=>J.check(H1(W,q));let H=J._zod.bag;J.minDate=H.minimum?new Date(H.minimum):null,J.maxDate=H.maximum?new Date(H.maximum):null});function J4(J){return L2(e0,J)}var iX=U("ZodArray",(J,X)=>{N8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(H,W,q)=>f2(J,H,W,q),J.element=X.element,J.min=(H,W)=>J.check(V1(H,W)),J.nonempty=(H)=>J.check(V1(1,H)),J.max=(H,W)=>J.check(X0(H,W)),J.length=(H,W)=>J.check(H0(H,W)),J.unwrap=()=>J.element});function X4(J,X){return _2(iX,J,X)}var tX=U("ZodObject",(J,X)=>{b8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(H,W,q)=>o2(J,H,W,q),K.defineLazy(J,"shape",()=>{return X.shape}),J.keyof=()=>W4(Object.keys(J._zod.def.shape)),J.catchall=(H)=>J.clone({...J._zod.def,catchall:H}),J.passthrough=()=>J.clone({...J._zod.def,catchall:RJ()}),J.loose=()=>J.clone({...J._zod.def,catchall:RJ()}),J.strict=()=>J.clone({...J._zod.def,catchall:nX()}),J.strip=()=>J.clone({...J._zod.def,catchall:void 0}),J.extend=(H)=>{return K.extend(J,H)},J.safeExtend=(H)=>{return K.safeExtend(J,H)},J.merge=(H)=>K.merge(J,H),J.pick=(H)=>K.pick(J,H),J.omit=(H)=>K.omit(J,H),J.partial=(...H)=>K.partial(SJ,J,H[0]),J.required=(...H)=>K.required(kJ,J,H[0])});function CJ(J,X){let H={type:"object",shape:J??{},...K.normalizeParams(X)};return new tX(H)}var aX=U("ZodUnion",(J,X)=>{_8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(H,W,q)=>l2(J,H,W,q),J.options=X.options});function sX(J,X){return new aX({type:"union",options:J,...K.normalizeParams(X)})}var eX=U("ZodIntersection",(J,X)=>{E8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(H,W,q)=>r2(J,H,W,q)});function JH(J,X){return new eX({type:"intersection",left:J,right:X})}var XH=U("ZodRecord",(J,X)=>{C8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(H,W,q)=>p2(J,H,W,q),J.keyType=X.keyType,J.valueType=X.valueType});function H4(J,X,H){return new XH({type:"record",keyType:J,valueType:X,...K.normalizeParams(H)})}var t0=U("ZodEnum",(J,X)=>{S8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(W,q,Y)=>u2(J,W,q,Y),J.enum=X.entries,J.options=Object.values(X.entries);let H=new Set(Object.keys(X.entries));J.extract=(W,q)=>{let Y={};for(let z of W)if(H.has(z))Y[z]=X.entries[z];else throw Error(`Key ${z} not found in enum`);return new t0({...X,checks:[],...K.normalizeParams(q),entries:Y})},J.exclude=(W,q)=>{let Y={...X.entries};for(let z of W)if(H.has(z))delete Y[z];else throw Error(`Key ${z} not found in enum`);return new t0({...X,checks:[],...K.normalizeParams(q),entries:Y})}});function W4(J,X){let H=Array.isArray(J)?Object.fromEntries(J.map((W)=>[W,W])):J;return new t0({type:"enum",entries:H,...K.normalizeParams(X)})}var HH=U("ZodTransform",(J,X)=>{k8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(H,W,q)=>m2(J,H,W,q),J._zod.parse=(H,W)=>{if(W.direction==="backward")throw new b1(J.constructor.name);H.addIssue=(Y)=>{if(typeof Y==="string")H.issues.push(K.issue(Y,H.value,X));else{let z=Y;if(z.fatal)z.continue=!1;z.code??(z.code="custom"),z.input??(z.input=H.value),z.inst??(z.inst=J),H.issues.push(K.issue(z))}};let q=X.transform(H.value,H);if(q instanceof Promise)return q.then((Y)=>{return H.value=Y,H});return H.value=q,H}});function WH(J){return new HH({type:"transform",transform:J})}var SJ=U("ZodOptional",(J,X)=>{j8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(H,W,q)=>JJ(J,H,W,q),J.unwrap=()=>J._zod.def.innerType});function NJ(J){return new SJ({type:"optional",innerType:J})}var qH=U("ZodNullable",(J,X)=>{T8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(H,W,q)=>d2(J,H,W,q),J.unwrap=()=>J._zod.def.innerType});function ZJ(J){return new qH({type:"nullable",innerType:J})}var YH=U("ZodDefault",(J,X)=>{h8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(H,W,q)=>i2(J,H,W,q),J.unwrap=()=>J._zod.def.innerType,J.removeDefault=J.unwrap});function zH(J,X){return new YH({type:"default",innerType:J,get defaultValue(){return typeof X==="function"?X():K.shallowClone(X)}})}var QH=U("ZodPrefault",(J,X)=>{v8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(H,W,q)=>t2(J,H,W,q),J.unwrap=()=>J._zod.def.innerType});function wH(J,X){return new QH({type:"prefault",innerType:J,get defaultValue(){return typeof X==="function"?X():K.shallowClone(X)}})}var kJ=U("ZodNonOptional",(J,X)=>{x8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(H,W,q)=>n2(J,H,W,q),J.unwrap=()=>J._zod.def.innerType});function DH(J,X){return new kJ({type:"nonoptional",innerType:J,...K.normalizeParams(X)})}var GH=U("ZodCatch",(J,X)=>{g8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(H,W,q)=>a2(J,H,W,q),J.unwrap=()=>J._zod.def.innerType,J.removeCatch=J.unwrap});function UH(J,X){return new GH({type:"catch",innerType:J,catchValue:typeof X==="function"?X:()=>X})}var PH=U("ZodPipe",(J,X)=>{c8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(H,W,q)=>s2(J,H,W,q),J.in=X.in,J.out=X.out});function LJ(J,X){return new PH({type:"pipe",in:J,out:X})}var BH=U("ZodReadonly",(J,X)=>{u8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(H,W,q)=>e2(J,H,W,q),J.unwrap=()=>J._zod.def.innerType});function MH(J){return new BH({type:"readonly",innerType:J})}var FH=U("ZodCustom",(J,X)=>{y8.init(J,X),k.init(J,X),J._zod.processJSONSchema=(H,W,q)=>y2(J,H,W,q)});function IH(J,X={}){return E2(FH,J,X)}function $H(J){return C2(J)}var N1={};_4(N1,{string:()=>AH,number:()=>OH,date:()=>RH,boolean:()=>KH,bigint:()=>VH});function AH(J){return l8(a0,J)}function OH(J){return $2(q0,J)}function KH(J){return K2(s0,J)}function VH(J){return V2(EJ,J)}function RH(J){return b2(e0,J)}r(h0());function t(J,X){if(!Boolean(J))throw Error(X)}function z0(J){return typeof J=="object"&&J!==null}function jJ(J,X){if(!Boolean(J))throw Error(X!=null?X:"Unexpected invariant triggered.")}var NH=/\r\n|[\n\r]/g;function Z1(J,X){let H=0,W=1;for(let q of J.body.matchAll(NH)){if(typeof q.index==="number"||jJ(!1),q.index>=X)break;H=q.index+q[0].length,W+=1}return{line:W,column:X+1-H}}function q4(J){return Q0(J.source,Z1(J.source,J.start))}function Q0(J,X){let H=J.locationOffset.column-1,W="".padStart(H)+J.body,q=X.line-1,Y=J.locationOffset.line-1,z=X.line+Y,Q=X.line===1?H:0,G=X.column+Q,D=`${J.name}:${z}:${G}
23
+ `,P=W.split(/\r\n|[\n\r]/g),B=P[q];if(B.length>120){let $=Math.floor(G/80),F=G%80,C=[];for(let h=0;h<B.length;h+=80)C.push(B.slice(h,h+80));return D+TJ([[`${z} |`,C[0]],...C.slice(1,$+1).map((h)=>["|",h]),["|","^".padStart(F)],["|",C[$+1]]])}return D+TJ([[`${z-1} |`,P[q-1]],[`${z} |`,B],["|","^".padStart(G)],[`${z+1} |`,P[q+1]]])}function TJ(J){let X=J.filter(([W,q])=>q!==void 0),H=Math.max(...X.map(([W])=>W.length));return X.map(([W,q])=>W.padStart(H)+(q?" "+q:"")).join(`
24
+ `)}function ZH(J){let X=J[0];if(X==null||"kind"in X||"length"in X)return{nodes:X,source:J[1],positions:J[2],path:J[3],originalError:J[4],extensions:J[5]};return X}class o extends Error{constructor(J,...X){var H,W,q;let{nodes:Y,source:z,positions:Q,path:G,originalError:D,extensions:P}=ZH(X);super(J);this.name="GraphQLError",this.path=G!==null&&G!==void 0?G:void 0,this.originalError=D!==null&&D!==void 0?D:void 0,this.nodes=hJ(Array.isArray(Y)?Y:Y?[Y]:void 0);let B=hJ((H=this.nodes)===null||H===void 0?void 0:H.map((F)=>F.loc).filter((F)=>F!=null));this.source=z!==null&&z!==void 0?z:B===null||B===void 0?void 0:(W=B[0])===null||W===void 0?void 0:W.source,this.positions=Q!==null&&Q!==void 0?Q:B===null||B===void 0?void 0:B.map((F)=>F.start),this.locations=Q&&z?Q.map((F)=>Z1(z,F)):B===null||B===void 0?void 0:B.map((F)=>Z1(F.source,F.start));let $=z0(D===null||D===void 0?void 0:D.extensions)?D===null||D===void 0?void 0:D.extensions:void 0;if(this.extensions=(q=P!==null&&P!==void 0?P:$)!==null&&q!==void 0?q:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),D!==null&&D!==void 0&&D.stack)Object.defineProperty(this,"stack",{value:D.stack,writable:!0,configurable:!0});else if(Error.captureStackTrace)Error.captureStackTrace(this,o);else Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let J=this.message;if(this.nodes){for(let X of this.nodes)if(X.loc)J+=`
25
+
26
+ `+q4(X.loc)}else if(this.source&&this.locations)for(let X of this.locations)J+=`
27
+
28
+ `+Q0(this.source,X);return J}toJSON(){let J={message:this.message};if(this.locations!=null)J.locations=this.locations;if(this.path!=null)J.path=this.path;if(this.extensions!=null&&Object.keys(this.extensions).length>0)J.extensions=this.extensions;return J}}function hJ(J){return J===void 0||J.length===0?void 0:J}var z4={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},LH=new Set(Object.keys(z4));function Q4(J){let X=J===null||J===void 0?void 0:J.kind;return typeof X==="string"&&LH.has(X)}var Y4;(function(J){J.QUERY="query",J.MUTATION="mutation",J.SUBSCRIPTION="subscription"})(Y4||(Y4={}));var E;(function(J){J.NAME="Name",J.DOCUMENT="Document",J.OPERATION_DEFINITION="OperationDefinition",J.VARIABLE_DEFINITION="VariableDefinition",J.SELECTION_SET="SelectionSet",J.FIELD="Field",J.ARGUMENT="Argument",J.FRAGMENT_SPREAD="FragmentSpread",J.INLINE_FRAGMENT="InlineFragment",J.FRAGMENT_DEFINITION="FragmentDefinition",J.VARIABLE="Variable",J.INT="IntValue",J.FLOAT="FloatValue",J.STRING="StringValue",J.BOOLEAN="BooleanValue",J.NULL="NullValue",J.ENUM="EnumValue",J.LIST="ListValue",J.OBJECT="ObjectValue",J.OBJECT_FIELD="ObjectField",J.DIRECTIVE="Directive",J.NAMED_TYPE="NamedType",J.LIST_TYPE="ListType",J.NON_NULL_TYPE="NonNullType",J.SCHEMA_DEFINITION="SchemaDefinition",J.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",J.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",J.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",J.FIELD_DEFINITION="FieldDefinition",J.INPUT_VALUE_DEFINITION="InputValueDefinition",J.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",J.UNION_TYPE_DEFINITION="UnionTypeDefinition",J.ENUM_TYPE_DEFINITION="EnumTypeDefinition",J.ENUM_VALUE_DEFINITION="EnumValueDefinition",J.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",J.DIRECTIVE_DEFINITION="DirectiveDefinition",J.SCHEMA_EXTENSION="SchemaExtension",J.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",J.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",J.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",J.UNION_TYPE_EXTENSION="UnionTypeExtension",J.ENUM_TYPE_EXTENSION="EnumTypeExtension",J.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",J.TYPE_COORDINATE="TypeCoordinate",J.MEMBER_COORDINATE="MemberCoordinate",J.ARGUMENT_COORDINATE="ArgumentCoordinate",J.DIRECTIVE_COORDINATE="DirectiveCoordinate",J.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate"})(E||(E={}));function w4(J){return J===9||J===32}function bH(J){return J>=48&&J<=57}function vJ(J){return J>=97&&J<=122||J>=65&&J<=90}function xJ(J){return vJ(J)||J===95}function gJ(J){return vJ(J)||bH(J)||J===95}function cJ(J,X){let H=J.replace(/"""/g,'\\"""'),W=H.split(/\r\n|[\n\r]/g),q=W.length===1,Y=W.length>1&&W.slice(1).every((F)=>F.length===0||w4(F.charCodeAt(0))),z=H.endsWith('\\"""'),Q=J.endsWith('"')&&!z,G=J.endsWith("\\"),D=Q||G,P=!(X!==null&&X!==void 0&&X.minimize)&&(!q||J.length>70||D||Y||z),B="",$=q&&w4(J.charCodeAt(0));if(P&&!$||Y)B+=`
29
+ `;if(B+=H,P||D)B+=`
30
+ `;return'"""'+B+'"""'}function M1(J){return w0(J,[])}function w0(J,X){switch(typeof J){case"string":return JSON.stringify(J);case"function":return J.name?`[function ${J.name}]`:"[function]";case"object":return _H(J,X);default:return String(J)}}function _H(J,X){if(J===null)return"null";if(X.includes(J))return"[Circular]";let H=[...X,J];if(EH(J)){let W=J.toJSON();if(W!==J)return typeof W==="string"?W:w0(W,H)}else if(Array.isArray(J))return SH(J,H);return CH(J,H)}function EH(J){return typeof J.toJSON==="function"}function CH(J,X){let H=Object.entries(J);if(H.length===0)return"{}";if(X.length>2)return"["+kH(J)+"]";return"{ "+H.map(([q,Y])=>q+": "+w0(Y,X)).join(", ")+" }"}function SH(J,X){if(J.length===0)return"[]";if(X.length>2)return"[Array]";let H=Math.min(10,J.length),W=J.length-H,q=[];for(let Y=0;Y<H;++Y)q.push(w0(J[Y],X));if(W===1)q.push("... 1 more item");else if(W>1)q.push(`... ${W} more items`);return"["+q.join(", ")+"]"}function kH(J){let X=Object.prototype.toString.call(J).replace(/^\[object /,"").replace(/]$/,"");if(X==="Object"&&typeof J.constructor==="function"){let H=J.constructor.name;if(typeof H==="string"&&H!=="")return H}return X}function uJ(J,X){let[H,W]=X?[J,X]:[void 0,J],q=" Did you mean ";if(H)q+=H+" ";let Y=W.map((G)=>`"${G}"`);switch(Y.length){case 0:return"";case 1:return q+Y[0]+"?";case 2:return q+Y[0]+" or "+Y[1]+"?"}let z=Y.slice(0,5),Q=z.pop();return q+z.join(", ")+", or "+Q+"?"}function D4(J){return J}function yJ(J,X){let H=Object.create(null);for(let W of J)H[X(W)]=W;return H}function D0(J,X,H){let W=Object.create(null);for(let q of J)W[X(q)]=H(q);return W}function mJ(J,X){let H=0,W=0;while(H<J.length&&W<X.length){let q=J.charCodeAt(H),Y=X.charCodeAt(W);if(G0(q)&&G0(Y)){let z=0;do++H,z=z*10+q-G4,q=J.charCodeAt(H);while(G0(q)&&z>0);let Q=0;do++W,Q=Q*10+Y-G4,Y=X.charCodeAt(W);while(G0(Y)&&Q>0);if(z<Q)return-1;if(z>Q)return 1}else{if(q<Y)return-1;if(q>Y)return 1;++H,++W}}return J.length-X.length}var G4=48,jH=57;function G0(J){return!isNaN(J)&&G4<=J&&J<=jH}function oJ(J,X){let H=Object.create(null),W=new lJ(J),q=Math.floor(J.length*0.4)+1;for(let Y of X){let z=W.measure(Y,q);if(z!==void 0)H[Y]=z}return Object.keys(H).sort((Y,z)=>{let Q=H[Y]-H[z];return Q!==0?Q:mJ(Y,z)})}class lJ{constructor(J){this._input=J,this._inputLowerCase=J.toLowerCase(),this._inputArray=fJ(this._inputLowerCase),this._rows=[Array(J.length+1).fill(0),Array(J.length+1).fill(0),Array(J.length+1).fill(0)]}measure(J,X){if(this._input===J)return 0;let H=J.toLowerCase();if(this._inputLowerCase===H)return 1;let W=fJ(H),q=this._inputArray;if(W.length<q.length){let D=W;W=q,q=D}let Y=W.length,z=q.length;if(Y-z>X)return;let Q=this._rows;for(let D=0;D<=z;D++)Q[0][D]=D;for(let D=1;D<=Y;D++){let P=Q[(D-1)%3],B=Q[D%3],$=B[0]=D;for(let F=1;F<=z;F++){let C=W[D-1]===q[F-1]?0:1,h=Math.min(P[F]+1,B[F-1]+1,P[F-1]+C);if(D>1&&F>1&&W[D-1]===q[F-2]&&W[D-2]===q[F-1]){let W1=Q[(D-2)%3][F-2];h=Math.min(h,W1+1)}if(h<$)$=h;B[F]=h}if($>X)return}let G=Q[Y%3][z];return G<=X?G:void 0}}function fJ(J){let X=J.length,H=Array(X);for(let W=0;W<X;++W)H[W]=J.charCodeAt(W);return H}function U0(J){if(J==null)return Object.create(null);if(Object.getPrototypeOf(J)===null)return J;let X=Object.create(null);for(let[H,W]of Object.entries(J))X[H]=W;return X}function rJ(J){return`"${J.replace(TH,hH)}"`}var TH=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function hH(J){return vH[J.charCodeAt(0)]}var vH=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","","\\\"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];var pJ=Object.freeze({});function U4(J,X,H=z4){let W=new Map;for(let p of Object.values(E))W.set(p,dJ(X,p));let q=void 0,Y=Array.isArray(J),z=[J],Q=-1,G=[],D=J,P=void 0,B=void 0,$=[],F=[];do{Q++;let p=Q===z.length,f1=p&&G.length!==0;if(p){if(P=F.length===0?void 0:$[$.length-1],D=B,B=F.pop(),f1)if(Y){D=D.slice();let x=0;for(let[e,L4]of G){let b4=e-x;if(L4===null)D.splice(b4,1),x++;else D[b4]=L4}}else{D={...D};for(let[x,e]of G)D[x]=e}Q=q.index,z=q.keys,G=q.edits,Y=q.inArray,q=q.prev}else if(B){if(P=Y?Q:z[Q],D=B[P],D===null||D===void 0)continue;$.push(P)}let g;if(!Array.isArray(D)){var C,h;Q4(D)||t(!1,`Invalid AST Node: ${M1(D)}.`);let x=p?(C=W.get(D.kind))===null||C===void 0?void 0:C.leave:(h=W.get(D.kind))===null||h===void 0?void 0:h.enter;if(g=x===null||x===void 0?void 0:x.call(X,D,P,B,$,F),g===pJ)break;if(g===!1){if(!p){$.pop();continue}}else if(g!==void 0){if(G.push([P,g]),!p)if(Q4(g))D=g;else{$.pop();continue}}}if(g===void 0&&f1)G.push([P,D]);if(p)$.pop();else{var W1;if(q={inArray:Y,index:Q,keys:z,edits:G,prev:q},Y=Array.isArray(D),z=Y?D:(W1=H[D.kind])!==null&&W1!==void 0?W1:[],Q=-1,G=[],B)F.push(B);B=D}}while(q!==void 0);if(G.length!==0)return G[G.length-1][1];return J}function dJ(J,X){let H=J[X];if(typeof H==="object")return H;else if(typeof H==="function")return{enter:H,leave:void 0};return{enter:J.enter,leave:J.leave}}function B0(J){return U4(J,gH)}var xH=80,gH={Name:{leave:(J)=>J.value},Variable:{leave:(J)=>"$"+J.name},Document:{leave:(J)=>M(J.definitions,`
31
+
32
+ `)},OperationDefinition:{leave(J){let X=P4(J.variableDefinitions)?O(`(
33
+ `,M(J.variableDefinitions,`
34
+ `),`
35
+ )`):O("(",M(J.variableDefinitions,", "),")"),H=O("",J.description,`
36
+ `)+M([J.operation,M([J.name,X]),M(J.directives," ")]," ");return(H==="query"?"":H+" ")+J.selectionSet}},VariableDefinition:{leave:({variable:J,type:X,defaultValue:H,directives:W,description:q})=>O("",q,`
37
+ `)+J+": "+X+O(" = ",H)+O(" ",M(W," "))},SelectionSet:{leave:({selections:J})=>a(J)},Field:{leave({alias:J,name:X,arguments:H,directives:W,selectionSet:q}){let Y=O("",J,": ")+X,z=Y+O("(",M(H,", "),")");if(z.length>xH)z=Y+O(`(
38
+ `,P0(M(H,`
39
+ `)),`
40
+ )`);return M([z,M(W," "),q]," ")}},Argument:{leave:({name:J,value:X})=>J+": "+X},FragmentSpread:{leave:({name:J,directives:X})=>"..."+J+O(" ",M(X," "))},InlineFragment:{leave:({typeCondition:J,directives:X,selectionSet:H})=>M(["...",O("on ",J),M(X," "),H]," ")},FragmentDefinition:{leave:({name:J,typeCondition:X,variableDefinitions:H,directives:W,selectionSet:q,description:Y})=>O("",Y,`
41
+ `)+`fragment ${J}${O("(",M(H,", "),")")} on ${X} ${O("",M(W," ")," ")}`+q},IntValue:{leave:({value:J})=>J},FloatValue:{leave:({value:J})=>J},StringValue:{leave:({value:J,block:X})=>X?cJ(J):rJ(J)},BooleanValue:{leave:({value:J})=>J?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:J})=>J},ListValue:{leave:({values:J})=>"["+M(J,", ")+"]"},ObjectValue:{leave:({fields:J})=>"{"+M(J,", ")+"}"},ObjectField:{leave:({name:J,value:X})=>J+": "+X},Directive:{leave:({name:J,arguments:X})=>"@"+J+O("(",M(X,", "),")")},NamedType:{leave:({name:J})=>J},ListType:{leave:({type:J})=>"["+J+"]"},NonNullType:{leave:({type:J})=>J+"!"},SchemaDefinition:{leave:({description:J,directives:X,operationTypes:H})=>O("",J,`
42
+ `)+M(["schema",M(X," "),a(H)]," ")},OperationTypeDefinition:{leave:({operation:J,type:X})=>J+": "+X},ScalarTypeDefinition:{leave:({description:J,name:X,directives:H})=>O("",J,`
43
+ `)+M(["scalar",X,M(H," ")]," ")},ObjectTypeDefinition:{leave:({description:J,name:X,interfaces:H,directives:W,fields:q})=>O("",J,`
44
+ `)+M(["type",X,O("implements ",M(H," & ")),M(W," "),a(q)]," ")},FieldDefinition:{leave:({description:J,name:X,arguments:H,type:W,directives:q})=>O("",J,`
45
+ `)+X+(P4(H)?O(`(
46
+ `,P0(M(H,`
47
+ `)),`
48
+ )`):O("(",M(H,", "),")"))+": "+W+O(" ",M(q," "))},InputValueDefinition:{leave:({description:J,name:X,type:H,defaultValue:W,directives:q})=>O("",J,`
49
+ `)+M([X+": "+H,O("= ",W),M(q," ")]," ")},InterfaceTypeDefinition:{leave:({description:J,name:X,interfaces:H,directives:W,fields:q})=>O("",J,`
50
+ `)+M(["interface",X,O("implements ",M(H," & ")),M(W," "),a(q)]," ")},UnionTypeDefinition:{leave:({description:J,name:X,directives:H,types:W})=>O("",J,`
51
+ `)+M(["union",X,M(H," "),O("= ",M(W," | "))]," ")},EnumTypeDefinition:{leave:({description:J,name:X,directives:H,values:W})=>O("",J,`
52
+ `)+M(["enum",X,M(H," "),a(W)]," ")},EnumValueDefinition:{leave:({description:J,name:X,directives:H})=>O("",J,`
53
+ `)+M([X,M(H," ")]," ")},InputObjectTypeDefinition:{leave:({description:J,name:X,directives:H,fields:W})=>O("",J,`
54
+ `)+M(["input",X,M(H," "),a(W)]," ")},DirectiveDefinition:{leave:({description:J,name:X,arguments:H,repeatable:W,locations:q})=>O("",J,`
55
+ `)+"directive @"+X+(P4(H)?O(`(
56
+ `,P0(M(H,`
57
+ `)),`
58
+ )`):O("(",M(H,", "),")"))+(W?" repeatable":"")+" on "+M(q," | ")},SchemaExtension:{leave:({directives:J,operationTypes:X})=>M(["extend schema",M(J," "),a(X)]," ")},ScalarTypeExtension:{leave:({name:J,directives:X})=>M(["extend scalar",J,M(X," ")]," ")},ObjectTypeExtension:{leave:({name:J,interfaces:X,directives:H,fields:W})=>M(["extend type",J,O("implements ",M(X," & ")),M(H," "),a(W)]," ")},InterfaceTypeExtension:{leave:({name:J,interfaces:X,directives:H,fields:W})=>M(["extend interface",J,O("implements ",M(X," & ")),M(H," "),a(W)]," ")},UnionTypeExtension:{leave:({name:J,directives:X,types:H})=>M(["extend union",J,M(X," "),O("= ",M(H," | "))]," ")},EnumTypeExtension:{leave:({name:J,directives:X,values:H})=>M(["extend enum",J,M(X," "),a(H)]," ")},InputObjectTypeExtension:{leave:({name:J,directives:X,fields:H})=>M(["extend input",J,M(X," "),a(H)]," ")},TypeCoordinate:{leave:({name:J})=>J},MemberCoordinate:{leave:({name:J,memberName:X})=>M([J,O(".",X)])},ArgumentCoordinate:{leave:({name:J,fieldName:X,argumentName:H})=>M([J,O(".",X),O("(",H,":)")])},DirectiveCoordinate:{leave:({name:J})=>M(["@",J])},DirectiveArgumentCoordinate:{leave:({name:J,argumentName:X})=>M(["@",J,O("(",X,":)")])}};function M(J,X=""){var H;return(H=J===null||J===void 0?void 0:J.filter((W)=>W).join(X))!==null&&H!==void 0?H:""}function a(J){return O(`{
59
+ `,P0(M(J,`
60
+ `)),`
61
+ }`)}function O(J,X,H=""){return X!=null&&X!==""?J+X+H:""}function P0(J){return O(" ",J.replace(/\n/g,`
62
+ `))}function P4(J){var X;return(X=J===null||J===void 0?void 0:J.some((H)=>H.includes(`
63
+ `)))!==null&&X!==void 0?X:!1}function M0(J,X){switch(J.kind){case E.NULL:return null;case E.INT:return parseInt(J.value,10);case E.FLOAT:return parseFloat(J.value);case E.STRING:case E.ENUM:case E.BOOLEAN:return J.value;case E.LIST:return J.values.map((H)=>M0(H,X));case E.OBJECT:return D0(J.fields,(H)=>H.name.value,(H)=>M0(H.value,X));case E.VARIABLE:return X===null||X===void 0?void 0:X[J.name.value]}}function c1(J){if(J!=null||t(!1,"Must provide name."),typeof J==="string"||t(!1,"Expected name to be a string."),J.length===0)throw new o("Expected name to be a non-empty string.");for(let X=1;X<J.length;++X)if(!gJ(J.charCodeAt(X)))throw new o(`Names must only contain [_a-zA-Z0-9] but "${J}" does not.`);if(!xJ(J.charCodeAt(0)))throw new o(`Names must start with [_a-zA-Z] but "${J}" does not.`);return J}function B4(J){if(J==="true"||J==="false"||J==="null")throw new o(`Enum values cannot be named: ${J}`);return c1(J)}class u1{constructor(J){var X,H,W,q;let Y=(X=J.parseValue)!==null&&X!==void 0?X:D4;if(this.name=c1(J.name),this.description=J.description,this.specifiedByURL=J.specifiedByURL,this.serialize=(H=J.serialize)!==null&&H!==void 0?H:D4,this.parseValue=Y,this.parseLiteral=(W=J.parseLiteral)!==null&&W!==void 0?W:(z,Q)=>Y(M0(z,Q)),this.extensions=U0(J.extensions),this.astNode=J.astNode,this.extensionASTNodes=(q=J.extensionASTNodes)!==null&&q!==void 0?q:[],J.specifiedByURL==null||typeof J.specifiedByURL==="string"||t(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${M1(J.specifiedByURL)}.`),J.serialize==null||typeof J.serialize==="function"||t(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),J.parseLiteral)typeof J.parseValue==="function"&&typeof J.parseLiteral==="function"||t(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`)}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function nJ(J){return z0(J)&&!Array.isArray(J)}class y1{constructor(J){var X;this.name=c1(J.name),this.description=J.description,this.extensions=U0(J.extensions),this.astNode=J.astNode,this.extensionASTNodes=(X=J.extensionASTNodes)!==null&&X!==void 0?X:[],this._values=typeof J.values==="function"?J.values:iJ(this.name,J.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){if(typeof this._values==="function")this._values=iJ(this.name,this._values());return this._values}getValue(J){if(this._nameLookup===null)this._nameLookup=yJ(this.getValues(),(X)=>X.name);return this._nameLookup[J]}serialize(J){if(this._valueLookup===null)this._valueLookup=new Map(this.getValues().map((H)=>[H.value,H]));let X=this._valueLookup.get(J);if(X===void 0)throw new o(`Enum "${this.name}" cannot represent value: ${M1(J)}`);return X.name}parseValue(J){if(typeof J!=="string"){let H=M1(J);throw new o(`Enum "${this.name}" cannot represent non-string value: ${H}.`+F0(this,H))}let X=this.getValue(J);if(X==null)throw new o(`Value "${J}" does not exist in "${this.name}" enum.`+F0(this,J));return X.value}parseLiteral(J,X){if(J.kind!==E.ENUM){let W=B0(J);throw new o(`Enum "${this.name}" cannot represent non-enum value: ${W}.`+F0(this,W),{nodes:J})}let H=this.getValue(J.value);if(H==null){let W=B0(J);throw new o(`Value "${W}" does not exist in "${this.name}" enum.`+F0(this,W),{nodes:J})}return H.value}toConfig(){let J=D0(this.getValues(),(X)=>X.name,(X)=>({description:X.description,value:X.value,deprecationReason:X.deprecationReason,extensions:X.extensions,astNode:X.astNode}));return{name:this.name,description:this.description,values:J,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function F0(J,X){let H=J.getValues().map((q)=>q.name),W=oJ(X,H);return uJ("the enum value",W)}function iJ(J,X){return nJ(X)||t(!1,`${J} values must be an object with value names as keys.`),Object.entries(X).map(([H,W])=>{return nJ(W)||t(!1,`${J}.${H} must refer to an object with a "value" key representing an internal value but got: ${M1(W)}.`),{name:B4(H),description:W.description,value:W.value!==void 0?W.value:H,deprecationReason:W.deprecationReason,extensions:U0(W.extensions),astNode:W.astNode}})}var aJ=class{name;values;gqlEnum;constructor(J,X){this.name=J,this.values=X,this.gqlEnum=new y1({name:this.name,values:Object.fromEntries(X.map((H)=>[H,{value:H}]))})}getName(){return this.name}getEnumValues(){return this.values}getPothos(){return this.gqlEnum}getZod(){return W4(this.values)}getJson(){return{type:"string",enum:this.values}}getJsonSchema(){return this.getJson()}},L1=(J,X)=>new aJ(J,X);var j=class extends u1{zodSchema;jsonSchemaDef;constructor(J){super(J);this.zodSchema=J.zod,this.jsonSchemaDef=J.jsonSchema}getZod(){return this.zodSchema}getPothos(){return this}getJson(){return typeof this.jsonSchemaDef==="function"?this.jsonSchemaDef():this.jsonSchemaDef}getJsonSchemaDef(){return this.jsonSchemaDef}getJsonSchema(){let J=(X)=>{let H=typeof X==="function"?X():X;if(Array.isArray(H))return H.map((W)=>J(W));if(H&&typeof H==="object"){let W={};for(let[q,Y]of Object.entries(H))W[q]=J(Y);return W}return H};return J(this.getJson())}};var M4=/^[A-Za-z]{2}(?:-[A-Za-z0-9]{2,8})*$/,F4=/^(?:UTC|[A-Za-z_]+\/[A-Za-z_]+)$/,I4=/^[+]?\d[\d\s().-]{3,}$/,$4=/^[A-Z]{3}$/,A4=/^[A-Z]{2}$/,O4=-90,K4=90,V4=-180,R4=180,w={String_unsecure:()=>new j({name:"String_unsecure",description:"Unvalidated string scalar",zod:_(),parseValue:(J)=>_().parse(J),serialize:(J)=>String(J),parseLiteral:(J)=>{if(J.kind!==E.STRING)throw TypeError("Invalid literal");return J.value},jsonSchema:{type:"string"}}),Int_unsecure:()=>new j({name:"Int_unsecure",description:"Unvalidated integer scalar",zod:B1().int(),parseValue:(J)=>{let X=typeof J==="number"?J:Number(J);return B1().int().parse(X)},serialize:(J)=>Math.trunc(typeof J==="number"?J:Number(J)),parseLiteral:(J)=>{if(J.kind!==E.INT)throw TypeError("Invalid literal");return Number(J.value)},jsonSchema:{type:"integer"}}),Float_unsecure:()=>new j({name:"Float_unsecure",description:"Unvalidated float scalar",zod:B1(),parseValue:(J)=>{let X=typeof J==="number"?J:Number(J);return B1().parse(X)},serialize:(J)=>Number(J),parseLiteral:(J)=>{if(J.kind!==E.FLOAT&&J.kind!==E.INT)throw TypeError("Invalid literal");return Number(J.value)},jsonSchema:{type:"number"}}),Boolean:()=>new j({name:"Boolean",description:"Unvalidated boolean scalar",zod:_J(),parseValue:(J)=>N1.boolean().parse(J),serialize:(J)=>Boolean(J),parseLiteral:(J)=>{if(J.kind!==E.BOOLEAN)throw TypeError("Invalid literal");return J.value},jsonSchema:{type:"boolean"}}),ID:()=>new j({name:"ID",description:"Unvalidated id scalar",zod:_(),parseValue:(J)=>_().parse(J),serialize:(J)=>String(J),parseLiteral:(J)=>{if(J.kind!==E.STRING)throw TypeError("Invalid literal");return J.value},jsonSchema:{type:"string"}}),JSON:()=>new j({name:"JSON",zod:Y0(),parseValue:(J)=>J,serialize:(J)=>J,jsonSchema:{}}),JSONObject:()=>new j({name:"JSONObject",zod:H4(_(),Y0()),parseValue:(J)=>H4(_(),Y0()).parse(J),serialize:(J)=>J??{},jsonSchema:{type:"object"}}),Date:()=>new j({name:"Date",zod:J4(),parseValue:(J)=>J instanceof Date?J:new Date(String(J)),serialize:(J)=>J instanceof Date?J.toISOString().split("T")[0]:String(J),jsonSchema:{type:"string",format:"date"}}),DateTime:()=>new j({name:"DateTime",zod:J4(),parseValue:(J)=>J instanceof Date?J:new Date(String(J)),serialize:(J)=>{return J instanceof Date?J.toISOString():String(J)},jsonSchema:{type:"string",format:"date-time"}}),Time:()=>new j({name:"Time",zod:_().regex(/^\d{2}:\d{2}(:\d{2})?$/),parseValue:(J)=>_().regex(/^\d{2}:\d{2}(:\d{2})?$/).parse(J),serialize:(J)=>String(J),jsonSchema:{type:"string",pattern:"^\\d{2}:\\d{2}(:\\d{2})?$"}}),EmailAddress:()=>new j({name:"EmailAddress",zod:_().email(),parseValue:(J)=>_().email().parse(J),serialize:(J)=>String(J),jsonSchema:{type:"string",format:"email"}}),URL:()=>new j({name:"URL",zod:_().url(),parseValue:(J)=>_().url().parse(J),serialize:(J)=>String(J),jsonSchema:{type:"string",format:"uri"}}),PhoneNumber:()=>new j({name:"PhoneNumber",zod:_().regex(I4),parseValue:(J)=>_().regex(I4).parse(J),serialize:(J)=>String(J),jsonSchema:{type:"string",pattern:I4.source}}),NonEmptyString:()=>new j({name:"NonEmptyString",zod:_().min(1),parseValue:(J)=>_().min(1).parse(J),serialize:(J)=>String(J),jsonSchema:{type:"string",minLength:1}}),Locale:()=>new j({name:"Locale",zod:_().regex(M4),parseValue:(J)=>_().regex(M4).parse(J),serialize:(J)=>String(J),jsonSchema:{type:"string",pattern:M4.source}}),TimeZone:()=>new j({name:"TimeZone",zod:_().regex(F4),parseValue:(J)=>_().regex(F4).parse(J),serialize:(J)=>String(J),jsonSchema:{type:"string",pattern:F4.source}}),Latitude:()=>new j({name:"Latitude",zod:B1().min(O4).max(K4),parseValue:(J)=>N1.number().min(O4).max(K4).parse(J),serialize:(J)=>Number(J),jsonSchema:{type:"number",minimum:O4,maximum:K4}}),Longitude:()=>new j({name:"Longitude",zod:B1().min(V4).max(R4),parseValue:(J)=>N1.number().min(V4).max(R4).parse(J),serialize:(J)=>Number(J),jsonSchema:{type:"number",minimum:V4,maximum:R4}}),Currency:()=>new j({name:"Currency",zod:_().regex($4),parseValue:(J)=>_().regex($4).parse(J),serialize:(J)=>String(J),jsonSchema:{type:"string",pattern:$4.source}}),CountryCode:()=>new j({name:"CountryCode",zod:_().regex(A4),parseValue:(J)=>_().regex(A4).parse(J),serialize:(J)=>String(J),jsonSchema:{type:"string",pattern:A4.source}})};var T=class{constructor(J){this.config=J}getZod(){let J=Object.entries(this.config.fields).reduce((X,[H,W])=>{let q=W.type.getZod(),Y=W.isArray?X4(q):q;return X[H]=W.isOptional?Y.optional():Y,X},{});return CJ(J)}getPothosInput(){return this.config.name}};var m=(J)=>new T(J);var sJ={meta:{key:"payments.stripe",version:1,category:"payments",title:"Stripe Payments",description:"Stripe integration for payment processing, charges, and payouts.",domain:"payments",owners:["platform.payments"],tags:["payments","psp"],stability:A.Stable},supportedModes:["managed","byok"],capabilities:{provides:[{key:"payments.psp",version:1}],requires:[{key:"platform.webhooks",optional:!0,reason:"Recommended for reliable event ingestion"}]},configSchema:{schema:{type:"object",properties:{accountId:{type:"string",description:"Connected account ID when using Stripe Connect (BYOK)."},region:{type:"string",description:"Optional Stripe region or data residency hint."}}},example:{accountId:"acct_123",region:"us-east-1"}},secretSchema:{schema:{type:"object",required:["apiKey","webhookSecret"],properties:{apiKey:{type:"string",description:"Stripe secret API key (sk_live_... or sk_test_...)."},webhookSecret:{type:"string",description:"Signing secret for webhook verification."}}},example:{apiKey:"sk_live_***",webhookSecret:"whsec_***"}},healthCheck:{method:"ping",timeoutMs:5000},docsUrl:"https://stripe.com/docs/api",constraints:{rateLimit:{rpm:1000,rph:20000}},byokSetup:{setupInstructions:"Create a restricted Stripe API key with write access to Charges and provide a webhook signing secret.",requiredScopes:["charges:write","customers:read"]}};var eJ={meta:{key:"email.postmark",version:1,category:"email",title:"Postmark Transactional Email",description:"Postmark integration for transactional email delivery.",domain:"communications",owners:["platform.messaging"],tags:["email","transactional"],stability:A.Stable},supportedModes:["managed","byok"],capabilities:{provides:[{key:"email.transactional",version:1}],requires:[{key:"platform.webhooks",optional:!0,reason:"Optional for inbound bounce handling"}]},configSchema:{schema:{type:"object",properties:{messageStream:{type:"string",description:"Optional message stream identifier (e.g., transactional)."},fromEmail:{type:"string",description:"Default From address used for outbound messages."}}},example:{messageStream:"outbound",fromEmail:"notifications@example.com"}},secretSchema:{schema:{type:"object",required:["serverToken"],properties:{serverToken:{type:"string",description:"Server token for the Postmark account."}}},example:{serverToken:"server-***"}},healthCheck:{method:"ping",timeoutMs:3000},docsUrl:"https://postmarkapp.com/developer",constraints:{rateLimit:{rpm:500}},byokSetup:{setupInstructions:"Create a Postmark server token with outbound send permissions and configure allowed from addresses."}};var J9={meta:{key:"vectordb.qdrant",version:1,category:"vector-db",title:"Qdrant Vector Database",description:"Qdrant integration for vector search and embeddings storage.",domain:"ai",owners:["platform.ai"],tags:["vector-db","search"],stability:A.Experimental},supportedModes:["managed","byok"],capabilities:{provides:[{key:"vector-db.search",version:1},{key:"vector-db.storage",version:1}],requires:[{key:"ai.embeddings",optional:!0,reason:"Required if vectors are generated via hosted embedding services"}]},configSchema:{schema:{type:"object",properties:{apiUrl:{type:"string",description:"Base URL for the Qdrant instance (e.g., https://qdrant.example.com)."},collectionPrefix:{type:"string",description:"Prefix applied to all collection names for this tenant."}}},example:{apiUrl:"https://qdrant.example.com",collectionPrefix:"tenant_"}},secretSchema:{schema:{type:"object",properties:{apiKey:{type:"string",description:"API key or token when authentication is enabled."}}},example:{apiKey:"qdrant-api-key"}},healthCheck:{method:"ping",timeoutMs:4000},docsUrl:"https://qdrant.tech/documentation/quick-start/",constraints:{quotas:{collections:100,pointsPerCollection:1e6}},byokSetup:{setupInstructions:"Provide the HTTPS endpoint of your Qdrant cluster and generate an API key with read/write access to the collections that will be managed."}};var X9={meta:{key:"ai-llm.mistral",version:1,category:"ai-llm",title:"Mistral Large Language Model",description:"Mistral integration providing chat completions and embedding generation.",domain:"ai",owners:["platform.ai"],tags:["ai","llm","embeddings"],stability:A.Experimental},supportedModes:["managed","byok"],capabilities:{provides:[{key:"ai.chat",version:1},{key:"ai.embeddings",version:1}]},configSchema:{schema:{type:"object",properties:{model:{type:"string",description:"Default chat completion model (e.g., mistral-large-latest)."},embeddingModel:{type:"string",description:"Embedding model identifier."}}},example:{model:"mistral-large-latest",embeddingModel:"mistral-embed"}},secretSchema:{schema:{type:"object",required:["apiKey"],properties:{apiKey:{type:"string",description:"Mistral API key with access to chat and embeddings endpoints."}}},example:{apiKey:"mistral-***"}},healthCheck:{method:"custom",timeoutMs:5000},docsUrl:"https://docs.mistral.ai/platform/endpoints",constraints:{rateLimit:{rpm:600}},byokSetup:{setupInstructions:"Generate an API key within the Mistral console and ensure the selected models are enabled for the account."}};var H9={meta:{key:"ai-voice.elevenlabs",version:1,category:"ai-voice",title:"ElevenLabs Text-to-Speech",description:"ElevenLabs integration for neural voice synthesis and voice catalog access.",domain:"ai",owners:["platform.ai"],tags:["voice","tts"],stability:A.Beta},supportedModes:["managed","byok"],capabilities:{provides:[{key:"ai.voice.synthesis",version:1}]},configSchema:{schema:{type:"object",properties:{defaultVoiceId:{type:"string",description:"Optional default voice identifier for synthesis requests."}}},example:{defaultVoiceId:"pNInz6obpgDQGcFmaJgB"}},secretSchema:{schema:{type:"object",required:["apiKey"],properties:{apiKey:{type:"string",description:"ElevenLabs API key with text-to-speech permissions."}}},example:{apiKey:"eleven-***"}},healthCheck:{method:"custom",timeoutMs:4000},docsUrl:"https://elevenlabs.io/docs/api-reference/text-to-speech",constraints:{rateLimit:{rpm:120}},byokSetup:{setupInstructions:"Create an ElevenLabs API key and ensure the desired voices are accessible to the key scope."}};var W9={meta:{key:"email.gmail",version:1,category:"email",title:"Google Gmail API",description:"Gmail integration supporting inbound thread ingestion and outbound transactional email.",domain:"communications",owners:["platform.messaging"],tags:["email","gmail"],stability:A.Beta},supportedModes:["managed","byok"],capabilities:{provides:[{key:"email.inbound",version:1},{key:"email.outbound",version:1}]},configSchema:{schema:{type:"object",properties:{labelIds:{type:"array",items:{type:"string"},description:"Optional list of label IDs to scope inbound sync."},includeSpamTrash:{type:"boolean",description:"Whether to include spam or trash messages during sync."}}},example:{labelIds:["INBOX"],includeSpamTrash:!1}},secretSchema:{schema:{type:"object",required:["clientId","clientSecret","refreshToken"],properties:{clientId:{type:"string",description:"OAuth client ID for the Google Cloud project."},clientSecret:{type:"string",description:"OAuth client secret for the Google Cloud project."},refreshToken:{type:"string",description:"OAuth refresh token for delegated Gmail access."},redirectUri:{type:"string",description:"Optional redirect URI used when issuing the refresh token."}}},example:{clientId:"xxx.apps.googleusercontent.com",clientSecret:"secret",refreshToken:"refresh-token"}},healthCheck:{method:"custom",timeoutMs:4000},docsUrl:"https://developers.google.com/gmail/api",constraints:{rateLimit:{rpm:600}},byokSetup:{setupInstructions:"Create an OAuth consent screen and credentials within Google Cloud Console, then authorize the Gmail scopes and store the resulting refresh token."}};var q9={meta:{key:"calendar.google",version:1,category:"calendar",title:"Google Calendar API",description:"Google Calendar integration for event creation, updates, and scheduling automations.",domain:"productivity",owners:["platform.messaging"],tags:["calendar","google"],stability:A.Beta},supportedModes:["managed","byok"],capabilities:{provides:[{key:"calendar.events",version:1}]},configSchema:{schema:{type:"object",properties:{calendarId:{type:"string",description:"Default calendar identifier (defaults to primary)."}}},example:{calendarId:"primary"}},secretSchema:{schema:{type:"object",required:["clientEmail","privateKey"],properties:{clientEmail:{type:"string",description:"Service account client email."},privateKey:{type:"string",description:"Service account private key."},projectId:{type:"string",description:"Google Cloud project ID."}}},example:{clientEmail:"svc-calendar@example.iam.gserviceaccount.com",privateKey:"-----BEGIN PRIVATE KEY-----...",projectId:"calendar-project"}},healthCheck:{method:"custom",timeoutMs:4000},docsUrl:"https://developers.google.com/calendar/api",constraints:{},byokSetup:{setupInstructions:"Create a Google service account with Calendar access and share the target calendars with the service account email."}};var Y9={meta:{key:"sms.twilio",version:1,category:"sms",title:"Twilio Messaging",description:"Twilio SMS integration for transactional and notification messaging.",domain:"communications",owners:["platform.messaging"],tags:["sms","messaging"],stability:A.Stable},supportedModes:["managed","byok"],capabilities:{provides:[{key:"sms.outbound",version:1}]},configSchema:{schema:{type:"object",properties:{fromNumber:{type:"string",description:"Default Twilio phone number used as sender."}}},example:{fromNumber:"+15551234567"}},secretSchema:{schema:{type:"object",required:["accountSid","authToken"],properties:{accountSid:{type:"string",description:"Twilio Account SID."},authToken:{type:"string",description:"Twilio Auth Token."}}},example:{accountSid:"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",authToken:"auth-token"}},healthCheck:{method:"custom",timeoutMs:3000},docsUrl:"https://www.twilio.com/docs/sms/api",constraints:{rateLimit:{rpm:200}},byokSetup:{setupInstructions:"Provide a Twilio account SID, auth token, and verify the outbound sending numbers used by the integration."}};var z9={meta:{key:"storage.gcs",version:1,category:"storage",title:"Google Cloud Storage Buckets",description:"Google Cloud Storage integration for object storage and retrieval.",domain:"infrastructure",owners:["platform.infrastructure"],tags:["storage","gcs","google-cloud"],stability:A.Beta},supportedModes:["managed","byok"],capabilities:{provides:[{key:"storage.objects",version:1}]},configSchema:{schema:{type:"object",required:["bucket"],properties:{bucket:{type:"string",description:"Primary bucket name used for storing objects."},prefix:{type:"string",description:"Optional prefix applied to object keys."}}},example:{bucket:"pfo-tenant-assets",prefix:"documents/"}},secretSchema:{schema:{type:"object",properties:{type:{type:"string",description:"Service account type field from Google credentials JSON (if provided)."},client_email:{type:"string"},private_key:{type:"string"},project_id:{type:"string"}}},example:{type:"service_account",client_email:"svc-account@example.iam.gserviceaccount.com",private_key:"-----BEGIN PRIVATE KEY-----...",project_id:"example-project"}},healthCheck:{method:"ping",timeoutMs:4000},docsUrl:"https://cloud.google.com/storage/docs/apis",constraints:{quotas:{storageGb:5120}},byokSetup:{setupInstructions:"Create a Google Cloud service account with Storage Object Admin role and upload the JSON credentials to the secret store."}};var Q9={meta:{key:"openbanking.powens",version:1,category:"open-banking",title:"Powens Open Banking (Read)",description:"Read-only Open Banking integration powered by Powens, exposing accounts, transactions, and balances.",domain:"finance",owners:["platform.finance"],tags:["open-banking","powens","finance"],stability:A.Experimental},supportedModes:["byok"],capabilities:{provides:[{key:"openbanking.accounts.read",version:1},{key:"openbanking.transactions.read",version:1},{key:"openbanking.balances.read",version:1}]},configSchema:{schema:{type:"object",required:["environment"],properties:{environment:{type:"string",enum:["sandbox","production"],description:"Powens environment to target. Sandbox uses Powens test API base URL, production uses live endpoints."},baseUrl:{type:"string",description:"Optional override for the Powens API base URL. Defaults to Powens environment defaults."},region:{type:"string",description:"Optional Powens region identifier when targeting a specific data residency cluster."},pollingIntervalMs:{type:"number",description:"Optional custom polling interval in milliseconds for background sync jobs (defaults to platform standard)."}}},example:{environment:"sandbox",baseUrl:"https://api-sandbox.powens.com/v2",region:"eu-west-1",pollingIntervalMs:300000}},secretSchema:{schema:{type:"object",required:["clientId","clientSecret"],properties:{clientId:{type:"string",description:"Powens OAuth client identifier obtained from the Powens Console (BYOK project)."},clientSecret:{type:"string",description:"Powens OAuth client secret used to exchange for access tokens."},apiKey:{type:"string",description:"Optional Powens API key (if the tenant project exposes a dedicated API token)."},webhookSecret:{type:"string",description:"Optional webhook signing secret used to verify Powens webhook payloads."}}},example:{clientId:"powens-client-id",clientSecret:"powens-client-secret",apiKey:"powens-api-key",webhookSecret:"powens-webhook-secret"}},healthCheck:{method:"ping",timeoutMs:8000},docsUrl:"https://docs.powens.com/",constraints:{rateLimit:{rph:1e4,rpm:600}},byokSetup:{setupInstructions:"Create a Powens BYOK project, generate OAuth credentials, and optionally configure webhook delivery for account/transaction updates.",requiredScopes:["accounts:read","transactions:read","balances:read"]}};var I0=new T({name:"BankAccountRecord",description:"Canonical representation of a bank account synced from an open banking provider.",fields:{id:{type:w.ID(),isOptional:!1},tenantId:{type:w.ID(),isOptional:!1},userId:{type:w.ID(),isOptional:!1},connectionId:{type:w.ID(),isOptional:!1},externalId:{type:w.NonEmptyString(),isOptional:!1},institutionId:{type:w.NonEmptyString(),isOptional:!1},institutionName:{type:w.NonEmptyString(),isOptional:!1},institutionLogoUrl:{type:w.URL(),isOptional:!0},iban:{type:w.String_unsecure(),isOptional:!0},bic:{type:w.String_unsecure(),isOptional:!0},accountType:{type:w.NonEmptyString(),isOptional:!1},currency:{type:w.Currency(),isOptional:!1},displayName:{type:w.NonEmptyString(),isOptional:!1},accountNumberMasked:{type:w.String_unsecure(),isOptional:!0},productCode:{type:w.String_unsecure(),isOptional:!0},balance:{type:w.Float_unsecure(),isOptional:!0},availableBalance:{type:w.Float_unsecure(),isOptional:!0},lastSyncedAt:{type:w.DateTime(),isOptional:!1},createdAt:{type:w.DateTime(),isOptional:!1},updatedAt:{type:w.DateTime(),isOptional:!1},metadata:{type:w.JSONObject(),isOptional:!0}}}),N4=new T({name:"BankTransactionRecord",description:"Canonical transaction entry mapped from Powens into the open banking ledger.",fields:{id:{type:w.ID(),isOptional:!1},accountId:{type:w.ID(),isOptional:!1},tenantId:{type:w.ID(),isOptional:!1},connectionId:{type:w.ID(),isOptional:!1},externalId:{type:w.NonEmptyString(),isOptional:!1},amount:{type:w.Float_unsecure(),isOptional:!1},currency:{type:w.Currency(),isOptional:!1},date:{type:w.DateTime(),isOptional:!1},bookingDate:{type:w.DateTime(),isOptional:!0},valueDate:{type:w.DateTime(),isOptional:!0},description:{type:w.String_unsecure(),isOptional:!0},counterpartyName:{type:w.String_unsecure(),isOptional:!0},counterpartyAccount:{type:w.String_unsecure(),isOptional:!0},merchantCategoryCode:{type:w.String_unsecure(),isOptional:!0},rawCategory:{type:w.String_unsecure(),isOptional:!0},standardizedCategory:{type:w.String_unsecure(),isOptional:!0},transactionType:{type:w.NonEmptyString(),isOptional:!1},status:{type:w.NonEmptyString(),isOptional:!1},runningBalance:{type:w.Float_unsecure(),isOptional:!0},metadata:{type:w.JSONObject(),isOptional:!0},createdAt:{type:w.DateTime(),isOptional:!1},updatedAt:{type:w.DateTime(),isOptional:!1}}}),$0=new T({name:"AccountBalanceRecord",description:"Canonical balance snapshot computed from Powens balance payloads.",fields:{id:{type:w.ID(),isOptional:!1},accountId:{type:w.ID(),isOptional:!1},tenantId:{type:w.ID(),isOptional:!1},connectionId:{type:w.ID(),isOptional:!1},balanceType:{type:w.NonEmptyString(),isOptional:!1},currentBalance:{type:w.Float_unsecure(),isOptional:!1},availableBalance:{type:w.Float_unsecure(),isOptional:!0},currency:{type:w.Currency(),isOptional:!1},lastUpdatedAt:{type:w.DateTime(),isOptional:!1},createdAt:{type:w.DateTime(),isOptional:!1},metadata:{type:w.JSONObject(),isOptional:!0}}});var Z4=["iban","bic","accountNumberMasked","accountNumber","counterpartyName","counterpartyAccount","description","merchantName","merchantCategoryCode","reference"],u={accountsSynced:"openbanking.accounts.synced",accountsSyncFailed:"openbanking.accounts.sync_failed",transactionsSynced:"openbanking.transactions.synced",transactionsSyncFailed:"openbanking.transactions.sync_failed",balancesRefreshed:"openbanking.balances.refreshed",balancesRefreshFailed:"openbanking.balances.refresh_failed",overviewGenerated:"openbanking.overview.generated"};var F1=(J)=>({...J,meta:{...J.meta,kind:"command"},policy:{...J.policy,idempotent:J.policy?.policy?.idempotent??!1}}),G1=(J)=>({...J,meta:{...J.meta,kind:"query"},policy:{...J.policy,idempotent:!0}});var A9=(J,X)=>()=>(J&&(X=J(J=0)),X);var O9,m1=A9(()=>{O9={byTag:(J)=>J.meta.tags?.[0]??"untagged",byAllTags:(J)=>J.meta.tags?.length?J.meta.tags:["untagged"],byOwner:(J)=>J.meta.owners?.[0]??"unowned",byDomain:(J)=>{return(J.meta.key??J.meta.key??"").split(".")[0]??"default"},byStability:(J)=>J.meta.stability??"stable",byUrlPath:(J)=>(X)=>{if(!X.path)return"root";return X.path.split("/").filter(Boolean).slice(0,J).join("/")||"root"}}});m1();m1();m1();var l3=new T({name:"OpenBankingListAccountsInput",description:"Parameters for listing bank accounts through the open banking provider.",fields:{tenantId:{type:w.ID(),isOptional:!1},userId:{type:w.ID(),isOptional:!1},connectionId:{type:w.ID(),isOptional:!0},includeBalances:{type:w.Boolean(),isOptional:!0},institutionId:{type:w.String_unsecure(),isOptional:!0},cursor:{type:w.String_unsecure(),isOptional:!0},pageSize:{type:w.Int_unsecure(),isOptional:!0}}}),r3=new T({name:"OpenBankingListAccountsOutput",description:"Paginated list of bank accounts available to the tenant and user.",fields:{accounts:{type:I0,isOptional:!1,isArray:!0},nextCursor:{type:w.String_unsecure(),isOptional:!0},hasMore:{type:w.Boolean(),isOptional:!0}}}),p3=new T({name:"OpenBankingGetAccountInput",description:"Parameters for retrieving a specific bank account.",fields:{tenantId:{type:w.ID(),isOptional:!1},accountId:{type:w.ID(),isOptional:!1},includeBalances:{type:w.Boolean(),isOptional:!0},includeLatestTransactions:{type:w.Boolean(),isOptional:!0}}}),d3=new T({name:"OpenBankingSyncAccountsInput",description:"Command payload to trigger an account synchronisation against the open banking provider.",fields:{tenantId:{type:w.ID(),isOptional:!1},userId:{type:w.ID(),isOptional:!0},connectionId:{type:w.ID(),isOptional:!1},accountIds:{type:w.ID(),isArray:!0,isOptional:!0},forceFullRefresh:{type:w.Boolean(),isOptional:!0},triggerWorkflows:{type:w.Boolean(),isOptional:!0}}}),n3=new T({name:"OpenBankingSyncAccountsOutput",description:"Result of a bank account synchronisation run.",fields:{synced:{type:w.Int_unsecure(),isOptional:!1},failed:{type:w.Int_unsecure(),isOptional:!1},errors:{type:w.String_unsecure(),isArray:!0,isOptional:!0},nextSyncSuggestedAt:{type:w.DateTime(),isOptional:!0}}}),K9=G1({meta:{key:"openbanking.accounts.list",version:1,description:"List bank accounts available to a tenant/user via Powens Open Banking.",goal:"Provide downstream workflows with the set of accounts accessible via the configured open banking connection.",context:"Used by Pocket Family Office dashboards and sync workflows to enumerate bank accounts prior to syncing balances or transactions.",owners:["@platform.finance"],tags:["open-banking","powens","accounts"],stability:"experimental"},io:{input:l3,output:r3},policy:{auth:"user"}}),V9=G1({meta:{key:"openbanking.accounts.get",version:1,description:"Retrieve the canonical bank account record for the given account identifier.",goal:"Allow user-facing experiences and automations to display up-to-date account metadata.",context:"Invoked by UI surfaces and workflow automation steps that require detailed metadata for a specific bank account.",owners:["@platform.finance"],tags:["open-banking","powens","accounts"],stability:"experimental"},io:{input:p3,output:I0},policy:{auth:"user"}}),R9=F1({meta:{key:"openbanking.accounts.sync",version:1,description:"Initiate a synchronisation run to refresh bank account metadata from Powens.",goal:"Keep canonical bank account records aligned with the external open banking provider.",context:"Triggered by scheduled workflows or manual operator actions to reconcile account metadata prior to transaction/balance syncs.",owners:["@platform.finance"],tags:["open-banking","powens","accounts"],stability:"experimental"},io:{input:d3,output:n3},policy:{auth:"admin"},telemetry:{success:{event:{key:u.accountsSynced},properties:({input:J,output:X})=>{let H=J,W=X;return{tenantId:H?.tenantId,connectionId:H?.connectionId,synced:W?.synced,failed:W?.failed}}},failure:{event:{key:u.accountsSyncFailed},properties:({input:J,error:X})=>{let H=J;return{tenantId:H?.tenantId,connectionId:H?.connectionId,error:X instanceof Error?X.message:String(X??"unknown")}}}}});var i3=new T({name:"OpenBankingListTransactionsInput",description:"Parameters for listing bank transactions from the canonical ledger.",fields:{tenantId:{type:w.ID(),isOptional:!1},accountId:{type:w.ID(),isOptional:!1},from:{type:w.DateTime(),isOptional:!0},to:{type:w.DateTime(),isOptional:!0},cursor:{type:w.String_unsecure(),isOptional:!0},pageSize:{type:w.Int_unsecure(),isOptional:!0},direction:{type:w.String_unsecure(),isOptional:!0},minimumAmount:{type:w.Float_unsecure(),isOptional:!0},maximumAmount:{type:w.Float_unsecure(),isOptional:!0},category:{type:w.String_unsecure(),isOptional:!0}}}),t3=new T({name:"OpenBankingListTransactionsOutput",description:"Paginated list of transactions for a bank account.",fields:{transactions:{type:N4,isOptional:!1,isArray:!0},nextCursor:{type:w.String_unsecure(),isOptional:!0},hasMore:{type:w.Boolean(),isOptional:!0}}}),a3=new T({name:"OpenBankingSyncTransactionsInput",description:"Command payload to synchronise transactions from the open banking provider into the canonical ledger.",fields:{tenantId:{type:w.ID(),isOptional:!1},accountId:{type:w.ID(),isOptional:!1},from:{type:w.DateTime(),isOptional:!0},to:{type:w.DateTime(),isOptional:!0},connectionId:{type:w.ID(),isOptional:!0},includePending:{type:w.Boolean(),isOptional:!0},backfillDays:{type:w.Int_unsecure(),isOptional:!0}}}),s3=new T({name:"OpenBankingSyncTransactionsOutput",description:"Result of a transaction synchronisation run.",fields:{synced:{type:w.Int_unsecure(),isOptional:!1},failed:{type:w.Int_unsecure(),isOptional:!1},earliestSyncedAt:{type:w.DateTime(),isOptional:!0},latestSyncedAt:{type:w.DateTime(),isOptional:!0},nextSinceToken:{type:w.String_unsecure(),isOptional:!0},errors:{type:w.String_unsecure(),isArray:!0,isOptional:!0}}}),N9=G1({meta:{key:"openbanking.transactions.list",version:1,description:"List bank transactions that have been normalised into the canonical ledger.",goal:"Allow downstream analytics and UI surfaces to page through canonical bank transactions.",context:"Used by Pocket Family Office dashboards, reconciliation workflows, and analytics data views.",owners:["@platform.finance"],tags:["open-banking","powens","transactions"],stability:"experimental"},io:{input:i3,output:t3},policy:{auth:"user"}}),Z9=F1({meta:{key:"openbanking.transactions.sync",version:1,description:"Synchronise transactions for a bank account by calling the configured open banking provider.",goal:"Ensure the canonical transaction ledger stays aligned with the external provider.",context:"Triggered by scheduled workflows or on-demand actions when activity is expected on an account.",owners:["@platform.finance"],tags:["open-banking","powens","transactions"],stability:"experimental"},io:{input:a3,output:s3},policy:{auth:"admin"},telemetry:{success:{event:{key:u.transactionsSynced},properties:({input:J,output:X})=>{let H=J,W=X;return{tenantId:H?.tenantId,accountId:H?.accountId,synced:W?.synced,failed:W?.failed,earliestSyncedAt:W?.earliestSyncedAt,latestSyncedAt:W?.latestSyncedAt}}},failure:{event:{key:u.transactionsSyncFailed},properties:({input:J,error:X})=>{let H=J;return{tenantId:H?.tenantId,accountId:H?.accountId,error:X instanceof Error?X.message:String(X??"unknown")}}}}});var e3=new T({name:"OpenBankingGetBalancesInput",description:"Parameters for retrieving bank account balances from the canonical ledger.",fields:{tenantId:{type:w.ID(),isOptional:!1},accountId:{type:w.ID(),isOptional:!1},balanceTypes:{type:w.String_unsecure(),isArray:!0,isOptional:!0}}}),JW=new T({name:"OpenBankingGetBalancesOutput",description:"Canonical balances for a bank account.",fields:{balances:{type:$0,isOptional:!1,isArray:!0},asOf:{type:w.DateTime(),isOptional:!0}}}),XW=new T({name:"OpenBankingRefreshBalancesInput",description:"Command payload to refresh balances for a bank account via the open banking provider.",fields:{tenantId:{type:w.ID(),isOptional:!1},accountId:{type:w.ID(),isOptional:!1},connectionId:{type:w.ID(),isOptional:!0},balanceTypes:{type:w.String_unsecure(),isArray:!0,isOptional:!0},forceRefresh:{type:w.Boolean(),isOptional:!0}}}),HW=new T({name:"OpenBankingRefreshBalancesOutput",description:"Result of a balance refresh against the open banking provider.",fields:{balances:{type:$0,isOptional:!1,isArray:!0},refreshedAt:{type:w.DateTime(),isOptional:!1},errors:{type:w.String_unsecure(),isArray:!0,isOptional:!0}}}),L9=G1({meta:{key:"openbanking.balances.get",version:1,description:"Retrieve the latest cached balances for a bank account.",goal:"Expose current and available balances required by dashboards and analytics.",context:"Used by Pocket Family Office UI surfaces and automation steps that require balance totals prior to generating summaries.",owners:["@platform.finance"],tags:["open-banking","powens","balances"],stability:"experimental"},io:{input:e3,output:JW},policy:{auth:"user"}}),b9=F1({meta:{key:"openbanking.balances.refresh",version:1,description:"Refresh balances for a bank account via the configured open banking provider.",goal:"Ensure canonical balance records reflect the latest values from Powens.",context:"Triggered by scheduled workflows before generating summaries or forecasting cashflow.",owners:["@platform.finance"],tags:["open-banking","powens","balances"],stability:"experimental"},io:{input:XW,output:HW},policy:{auth:"admin"},telemetry:{success:{event:{key:u.balancesRefreshed},properties:({input:J,output:X})=>{let H=J,W=X;return{tenantId:H?.tenantId,accountId:H?.accountId,refreshedAt:W?.refreshedAt,balanceCount:Array.isArray(W?.balances)?W?.balances.length:void 0}}},failure:{event:{key:u.balancesRefreshFailed},properties:({input:J,error:X})=>{let H=J;return{tenantId:H?.tenantId,accountId:H?.accountId,error:X instanceof Error?X.message:String(X??"unknown")}}}}});var qW=L1("Source",["upload","email","sync"]),YW=L1("Channel",["email","sms","both"]),zW=L1("Period",["P7d","P30d","P90d"]),QW=L1("ObPeriod",["Pweek","Pmonth","Pquarter"]),wW=m({name:"UploadDocumentInput",fields:{bucket:{type:w.NonEmptyString(),isOptional:!1},objectKey:{type:w.NonEmptyString(),isOptional:!1},mimeType:{type:w.NonEmptyString(),isOptional:!1},bytes:{type:w.Int_unsecure(),isOptional:!1},tags:{type:w.String_unsecure(),isOptional:!1,isArray:!0},uploadedAt:{type:w.Date(),isOptional:!1},source:{type:qW,isOptional:!1}}}),DW=m({name:"UploadDocumentOutput",fields:{documentId:{type:w.String_unsecure(),isOptional:!1},ingestionJobId:{type:w.String_unsecure(),isOptional:!1}}}),GW={meta:{key:"pfo.documents.upload",version:1,kind:"command",description:"Stores an object in tenant storage and schedules ingestion into the knowledge base.",goal:"Allow users to ingest financial documents for processing.",context:"Part of the finance domain. Documents are uploaded to object storage and then processed by the ingestion pipeline.",owners:[V.PlatformFinance],tags:["documents","ingestion",R.Guide],stability:A.Experimental},io:{input:wW,output:DW},policy:{auth:"user",rateLimit:{rpm:30,key:"user"}}},UW=m({name:"PaymentReminderInput",fields:{billId:{type:w.String_unsecure(),isOptional:!1},recipientEmail:{type:w.EmailAddress(),isOptional:!1},recipientPhone:{type:w.String_unsecure(),isOptional:!0},dueDate:{type:w.Date(),isOptional:!1},amountCents:{type:w.Int_unsecure(),isOptional:!1},currency:{type:w.Currency(),isOptional:!1},channel:{type:YW,isOptional:!1},memo:{type:w.String_unsecure(),isOptional:!0}}}),PW=m({name:"PaymentReminderOutput",fields:{reminderId:{type:w.String_unsecure(),isOptional:!1},scheduledAt:{type:w.Date(),isOptional:!1}}}),BW={meta:{key:"pfo.reminders.schedule-payment",version:1,kind:"command",description:"Queues outbound email/SMS reminders for upcoming bills and adds an optional calendar hold.",goal:"Ensure bills are paid on time by notifying users.",context:"Finance automation. Reminders are sent via configured channels (email, SMS).",owners:[V.PlatformFinance],tags:["payments","reminders",R.Automation],stability:A.Beta},io:{input:UW,output:PW},policy:{auth:"user"}},MW=m({name:"FinancialSummaryInput",fields:{period:{type:zW,isOptional:!1},includeVoiceSummary:{type:w.Boolean(),isOptional:!1}}}),FW=m({name:"SummaryHighlight",fields:{label:{type:w.String_unsecure(),isOptional:!1},value:{type:w.String_unsecure(),isOptional:!1}}}),IW=m({name:"FinancialSummaryOutput",fields:{summaryId:{type:w.String_unsecure(),isOptional:!1},generatedAt:{type:w.Date(),isOptional:!1},markdown:{type:w.String_unsecure(),isOptional:!1},highlights:{type:FW,isOptional:!1,isArray:!0},cashflowDelta:{type:w.Float_unsecure(),isOptional:!1}}}),$W={meta:{key:"pfo.summary.generate",version:1,kind:"query",description:"Runs RAG over financial documents and email threads to provide a natural-language summary with key metrics.",goal:"Provide a quick overview of financial status and recent activity.",context:"Uses RAG over ingested knowledge. Summaries can be dispatched or viewed in app.",owners:[V.PlatformFinance],tags:["summary","ai",R.Automation],stability:A.Beta},io:{input:MW,output:IW},policy:{auth:"user"}},AW=m({name:"SyncEmailThreadsInput",fields:{labelIds:{type:w.String_unsecure(),isOptional:!1,isArray:!0},maxThreads:{type:w.Int_unsecure(),isOptional:!1},syncSinceMinutes:{type:w.Int_unsecure(),isOptional:!1}}}),OW=m({name:"SyncEmailThreadsOutput",fields:{syncedThreads:{type:w.Int_unsecure(),isOptional:!1},lastMessageAt:{type:w.Date(),isOptional:!0}}}),KW={meta:{key:"pfo.email.sync-threads",version:1,kind:"command",description:"Triggers ingestion of Gmail threads into the operational knowledge space.",goal:"Keep knowledge base up to date with email communications.",context:"Syncs from Gmail integration. Only includes threads matching configured labels.",owners:[V.PlatformMessaging],tags:["gmail","knowledge",R.Automation],stability:A.Beta},io:{input:AW,output:OW},policy:{auth:"user"}},VW=m({name:"SummaryDispatchInput",fields:{summaryId:{type:w.String_unsecure(),isOptional:!1},recipientEmail:{type:w.EmailAddress(),isOptional:!1},recipientName:{type:w.String_unsecure(),isOptional:!0},includeVoice:{type:w.Boolean(),isOptional:!1},voiceRecipient:{type:w.String_unsecure(),isOptional:!0}}}),RW=m({name:"SummaryDispatchOutput",fields:{dispatchId:{type:w.String_unsecure(),isOptional:!1},emailSent:{type:w.Boolean(),isOptional:!1},voiceUrl:{type:w.String_unsecure(),isOptional:!0}}}),NW={meta:{key:"pfo.summary.dispatch",version:1,kind:"command",description:"Delivers the generated summary via email and optionally synthesises a voice note.",goal:"Deliver financial insights to users proactively.",context:"Dispatches summaries generated by pfo.summary.generate via email or voice.",owners:[V.PlatformMessaging],tags:["summary","communications",R.Automation],stability:A.Experimental},io:{input:VW,output:RW},policy:{auth:"user"}},ZW=m({name:"OpenBankingOverviewInput",fields:{tenantId:{type:w.String_unsecure(),isOptional:!1},accountIds:{type:w.String_unsecure(),isOptional:!0,isArray:!0},period:{type:QW,isOptional:!1},asOf:{type:w.Date(),isOptional:!0},includeCategories:{type:w.Boolean(),isOptional:!1},includeCashflowTrend:{type:w.Boolean(),isOptional:!1}}}),LW=m({name:"OpenBankingOverviewOutput",fields:{knowledgeEntryId:{type:w.String_unsecure(),isOptional:!1},periodStart:{type:w.Date(),isOptional:!1},periodEnd:{type:w.Date(),isOptional:!1},generatedAt:{type:w.Date(),isOptional:!1},summaryPath:{type:w.String_unsecure(),isOptional:!0}}}),bW={meta:{key:"pfo.openbanking.generate-overview",version:1,kind:"command",description:"Aggregates balances and transactions into a derived financial overview stored in the knowledge layer.",goal:"Create a periodic financial snapshot.",context:"Aggregates data from open banking integration into a document.",owners:[V.PlatformFinance],tags:["open-banking","summary",R.Automation],stability:A.Experimental},io:{input:ZW,output:LW},policy:{auth:"user"},telemetry:{success:{event:{key:u.overviewGenerated,version:1}}}},VD={"pfo.documents.upload":GW,"pfo.reminders.schedule-payment":BW,"pfo.summary.generate":$W,"pfo.summary.dispatch":NW,"pfo.email.sync-threads":KW,"pfo.openbanking.generate-overview":bW};var ZD={meta:{key:"pfo.workflow.process-uploaded-document",version:1,title:"Process Uploaded Document",description:"Stores an uploaded invoice/contract, queues ingestion, and records any follow-up reminders.",domain:"finance",owners:[V.PlatformFinance],tags:["documents","ingestion",R.Automation],stability:A.Experimental},definition:{entryStepId:"store",steps:[{id:"store",type:"automation",label:"Store and Queue Ingestion",description:"Persist the document to storage and enqueue the knowledge ingestion pipeline.",action:{operation:{key:"pfo.documents.upload",version:1}},requiredIntegrations:["primaryStorage","primaryVectorDb"],retry:{maxAttempts:3,backoff:"exponential",delayMs:500}},{id:"review",type:"human",label:"Optional Human Classification",description:"Finance lead can categorise the document while ingestion completes."}],transitions:[{from:"store",to:"review"}]}};var _D={meta:{key:"pfo.workflow.upcoming-payments-reminder",version:1,title:"Schedule Upcoming Payment Reminder",description:"Collects payment metadata and schedules multi-channel reminders for bills that are due soon.",domain:"finance",owners:[V.PlatformFinance],tags:["payments","reminders",R.Automation],stability:A.Beta},definition:{entryStepId:"collect",steps:[{id:"collect",type:"human",label:"Review Upcoming Bill",description:"Confirm amount, due date, and preferred delivery channels before scheduling reminder."},{id:"schedule",type:"automation",label:"Schedule Reminder",action:{operation:{key:"pfo.reminders.schedule-payment",version:1}},requiredIntegrations:["emailOutbound","smsNotifications","calendarScheduling"],retry:{maxAttempts:2,backoff:"linear",delayMs:1000}}],transitions:[{from:"collect",to:"schedule",condition:"output?.confirmed === true",label:"Reminder confirmed"}]}};var SD={meta:{key:"pfo.workflow.generate-financial-summary",version:1,title:"Generate Financial Summary",description:"Retrieves the latest financial signals, generates an AI summary, and optionally distributes it by voice or email.",domain:"finance",owners:[V.PlatformFinance],tags:["summary","ai",R.Automation],stability:A.Beta},definition:{entryStepId:"summarise",steps:[{id:"summarise",type:"automation",label:"Generate Summary",description:"Run retrieval augmented generation over the knowledge base to produce a household summary.",action:{operation:{key:"pfo.summary.generate",version:1}},requiredIntegrations:["primaryLLM","primaryVectorDb"],retry:{maxAttempts:3,backoff:"exponential",delayMs:750}},{id:"distribute",type:"automation",label:"Distribute Summary",description:"Send the generated summary via email and optionally synthesise a voice note.",action:{operation:{key:"pfo.summary.dispatch",version:1}},requiredIntegrations:["emailOutbound"],retry:{maxAttempts:2,backoff:"linear",delayMs:500}}],transitions:[{from:"summarise",to:"distribute"}]}};var TD={meta:{key:"pfo.workflow.ingest-email-threads",version:1,title:"Ingest Email Threads",description:"Synchronises Gmail threads tagged with finance labels and indexes them into operational knowledge spaces.",domain:"communications",owners:[V.PlatformMessaging],tags:["gmail","knowledge",R.Automation],stability:A.Experimental},definition:{entryStepId:"sync",steps:[{id:"sync",type:"automation",label:"Sync Gmail Threads",description:"Fetches Gmail threads and transforms them into knowledge fragments before vector indexing.",action:{operation:{key:"pfo.email.sync-threads",version:1}},requiredIntegrations:["emailInbound","primaryVectorDb"],retry:{maxAttempts:3,backoff:"exponential",delayMs:1000}},{id:"triage",type:"human",label:"Triage Exceptions",description:"Operators can resolve sync failures or tag important threads for follow-up."}],transitions:[{from:"sync",to:"triage",condition:"output?.syncedThreads === 0",label:"No new threads"}]}};var _9={key:"openbanking.accounts.read",version:1},xD={meta:{key:"pfo.workflow.sync-openbanking-accounts",version:1,title:"Synchronise Open Banking Accounts",description:"Validates Powens connectivity and synchronises bank account metadata into the canonical ledger.",domain:"finance",owners:[V.PlatformFinance],tags:["open-banking","powens",R.Automation],stability:A.Experimental},definition:{entryStepId:"sync-accounts",steps:[{id:"sync-accounts",type:"automation",label:"Sync Accounts",description:"Refresh linked bank accounts via Powens and upsert canonical BankAccount records.",action:{operation:{key:"openbanking.accounts.sync",version:1}},requiredIntegrations:["primaryOpenBanking"],requiredCapabilities:[_9],retry:{maxAttempts:3,backoff:"exponential",delayMs:1000}},{id:"fetch-accounts",type:"automation",label:"Fetch Accounts",description:"Retrieve the latest canonical account snapshot for downstream consumers.",action:{operation:{key:"openbanking.accounts.list",version:1}},requiredIntegrations:["primaryOpenBanking"],requiredCapabilities:[_9],retry:{maxAttempts:2,backoff:"linear",delayMs:750}}],transitions:[{from:"sync-accounts",to:"fetch-accounts"}]}};var E9={key:"openbanking.transactions.read",version:1},uD={meta:{key:"pfo.workflow.sync-openbanking-transactions",version:1,title:"Synchronise Open Banking Transactions",description:"Fetches recent transactions from Powens for each linked account and stores them in the canonical ledger.",domain:"finance",owners:[V.PlatformFinance],tags:["open-banking","powens",R.Automation],stability:A.Experimental},definition:{entryStepId:"sync-transactions",steps:[{id:"sync-transactions",type:"automation",label:"Sync Transactions",description:"Call the Powens provider to pull incremental transactions for active accounts.",action:{operation:{key:"openbanking.transactions.sync",version:1}},requiredIntegrations:["primaryOpenBanking"],requiredCapabilities:[E9],retry:{maxAttempts:4,backoff:"exponential",delayMs:1500}},{id:"list-transactions",type:"automation",label:"List Transactions",description:"Retrieve the canonical transaction list for reporting and downstream analytics.",action:{operation:{key:"openbanking.transactions.list",version:1}},requiredIntegrations:["primaryOpenBanking"],requiredCapabilities:[E9],retry:{maxAttempts:2,backoff:"linear",delayMs:1000}}],transitions:[{from:"sync-transactions",to:"list-transactions"}]}};var C9={key:"openbanking.balances.read",version:1},fD={meta:{key:"pfo.workflow.refresh-openbanking-balances",version:1,title:"Refresh Open Banking Balances",description:"Refreshes balances for synced accounts to surface the latest cash positions in dashboards.",domain:"finance",owners:[V.PlatformFinance],tags:["open-banking","powens",R.Automation],stability:A.Experimental},definition:{entryStepId:"refresh-balances",steps:[{id:"refresh-balances",type:"automation",label:"Refresh Balances",description:"Trigger the Powens provider to obtain current and available balances.",action:{operation:{key:"openbanking.balances.refresh",version:1}},requiredIntegrations:["primaryOpenBanking"],requiredCapabilities:[C9],retry:{maxAttempts:3,backoff:"exponential",delayMs:1000}},{id:"fetch-balances",type:"automation",label:"Fetch Balances",description:"Load the canonical balance snapshots for downstream workflows and dashboards.",action:{operation:{key:"openbanking.balances.get",version:1}},requiredIntegrations:["primaryOpenBanking"],requiredCapabilities:[C9],retry:{maxAttempts:2,backoff:"linear",delayMs:750}}],transitions:[{from:"refresh-balances",to:"fetch-balances"}]}};var _W=[{key:"openbanking.accounts.read",version:1},{key:"openbanking.transactions.read",version:1},{key:"openbanking.balances.read",version:1}],rD={meta:{key:"pfo.workflow.generate-openbanking-overview",version:1,title:"Generate Open Banking Overview",description:"Produces a derived financial overview and stores it in the operational knowledge space.",domain:"finance",owners:[V.PlatformFinance],tags:["open-banking","summary",R.Automation],stability:A.Experimental},definition:{entryStepId:"generate-overview",steps:[{id:"generate-overview",type:"automation",label:"Generate Overview",description:"Aggregate balances, cashflow, and category breakdowns into a knowledge entry.",action:{operation:{key:"pfo.openbanking.generate-overview",version:1}},requiredIntegrations:["primaryOpenBanking"],requiredCapabilities:_W,retry:{maxAttempts:3,backoff:"exponential",delayMs:1500}}],transitions:[]}};var A0={tenantId:{type:"string",required:!0,description:"Tenant identifier for multi-tenant isolation."},appId:{type:"string",required:!0,description:"Application identifier associated with the event."},blueprint:{type:"string",required:!0,description:"Blueprint name@version emitting the telemetry."},configVersion:{type:"number",required:!0,description:"Resolved app config version when the event was generated."},slotId:{type:"string",required:!0,description:"Integration slot identifier (e.g., primaryOpenBanking)."},connectionId:{type:"string",required:!0,description:"Integration connection ID used for the sync."}};function S9(J){return{type:"string",description:J,pii:!1}}var qG={meta:{key:"pfo.telemetry",version:1,title:"Pocket Family Office Telemetry",description:"Operational telemetry for Pocket Family Office workflows, including Powens open banking syncs.",domain:"finance",owners:[V.PlatformFinance],tags:["open-banking",R.Automation],stability:A.Experimental},config:{defaultRetentionDays:180,defaultSamplingRate:1},events:[{key:u.accountsSynced,version:1,semantics:{what:"Open banking account synchronisation completed.",why:"Refresh canonical account metadata for reporting and workflows."},privacy:"internal",properties:{...A0,syncedCount:{type:"number",description:"Number of accounts synced successfully."},failedCount:{type:"number",description:"Number of accounts that failed to sync."},durationMs:{type:"number",description:"Duration of the sync job in milliseconds."}}},{key:u.transactionsSynced,version:1,semantics:{what:"Open banking transaction synchronisation completed.",why:"Keep canonical transaction ledger in sync for analytics."},privacy:"internal",properties:{...A0,accountId:{type:"string",description:"Bank account identifier used during the sync.",pii:!1},syncedCount:{type:"number",description:"Number of transactions synced successfully."},failedCount:{type:"number",description:"Number of transactions that failed to sync."},from:{type:"timestamp",description:"Start timestamp for the sync window."},to:{type:"timestamp",description:"End timestamp for the sync window."}}},{key:u.balancesRefreshed,version:1,semantics:{what:"Open banking balances refreshed.",why:"Provide accurate cash position for dashboards and alerts."},privacy:"internal",properties:{...A0,accountId:S9("Bank account identifier."),balanceTypes:{type:"json",description:"Balance types included in the refresh."},refreshedAt:{type:"timestamp",description:"Timestamp when balances were refreshed."}}},{key:u.overviewGenerated,version:1,semantics:{what:"Derived financial overview generated.",why:"Persist cashflow and category summaries into knowledge space."},privacy:"internal",properties:{...A0,knowledgeEntryId:S9("Identifier of the knowledge document containing the overview."),period:{type:"string",description:"Aggregation period used (week, month, quarter)."},periodStart:{type:"timestamp",description:"Start timestamp for the aggregation window."},periodEnd:{type:"timestamp",description:"End timestamp for the aggregation window."}},tags:["knowledge","analytics"]}]},YG=Z4;var QG={meta:{key:"pocket-family-office",version:1,title:"Pocket Family Office",description:"Personal finance automation with document ingestion, open banking, and AI summaries",domain:"finance",owners:["@platform.finance"],tags:["finance","open-banking","documents","automation","family-office"],stability:"experimental"},operations:[{key:"pfo.documents.upload",version:1}],events:[],presentations:[],opToPresentation:[],presentationsTargets:[],capabilities:{provides:[{key:"pocket-family-office",version:1}],requires:[{key:"identity",version:1},{key:"openbanking",version:1}]}};export{GW as uploadDocumentContract,_D as upcomingPaymentsReminderWorkflow,uD as syncOpenBankingTransactionsWorkflow,xD as syncOpenBankingAccountsWorkflow,KW as syncEmailThreadsContract,BW as schedulePaymentReminderContract,kW as registerPocketFamilyOfficeBlueprint,fD as refreshOpenBankingBalancesWorkflow,ZD as processUploadedDocumentWorkflow,TW as pocketFamilyOfficeTenantSample,qG as pocketFamilyOfficeTelemetry,gW as pocketFamilyOfficeKnowledgeSources,VD as pocketFamilyOfficeContracts,T9 as pocketFamilyOfficeConnections,j9 as pocketFamilyOfficeBlueprint,TD as ingestEmailThreadsWorkflow,vW as getPocketFamilyOfficeConnection,rD as generateOpenBankingOverviewWorkflow,bW as generateOpenBankingOverviewContract,SD as generateFinancialSummaryWorkflow,$W as generateFinancialSummaryContract,NW as dispatchFinancialSummaryContract,QG as PocketFamilyOfficeFeature,YG as OPENBANKING_SENSITIVE_FIELDS};
@@ -0,0 +1,3 @@
1
+ import type { KnowledgeSourceConfig } from '@contractspec/lib.contracts/knowledge/source';
2
+ export declare const pocketFamilyOfficeKnowledgeSources: KnowledgeSourceConfig[];
3
+ //# sourceMappingURL=sources.sample.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sources.sample.d.ts","sourceRoot":"","sources":["../../src/knowledge/sources.sample.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAI1F,eAAO,MAAM,kCAAkC,EAAE,qBAAqB,EAiErE,CAAC"}