@walkeros/web-destination-meta 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/examples/index.js +5517 -25
- package/dist/examples/index.mjs +5517 -25
- package/dist/index.browser.js +1 -1
- package/dist/index.d.mts +90 -29
- package/dist/index.d.ts +90 -29
- package/dist/index.es5.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.browser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Destination=(()=>{var t=Object.defineProperty,e=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,n)=>{for(var a in n)t(e,a,{get:n[a],enumerable:!0})},i={};o(i,{DestinationMeta:()=>p,default:()=>D,destinationMeta:()=>j,examples:()=>l});var r={merge:!0,shallow:!0,extend:!0};function c(t){return"object"==typeof t&&null!==t&&!function(t){return Array.isArray(t)}(t)&&"[object Object]"===Object.prototype.toString.call(t)}function s(t={}){var e;const n=t.timestamp||(new Date).setHours(0,13,37,0),a=t.group||"gr0up",o=t.count||1,i=function(t,e={},n={}){n={...r,...n};const a=Object.entries(e).reduce((e,[a,o])=>{const i=t[a];return n.merge&&Array.isArray(i)&&Array.isArray(o)?e[a]=o.reduce((t,e)=>t.includes(e)?t:[...t,e],[...i]):(n.extend||a in t)&&(e[a]=o),e},{});return n.shallow?{...t,...a}:(Object.assign(t,a),t)}({name:"entity action",data:{string:"foo",number:1,boolean:!0,array:[0,"text",!1],not:void 0},context:{dev:["test",1]},globals:{lang:"elb"},custom:{completely:"random"},user:{id:"us3r",device:"c00k13",session:"s3ss10n"},nested:[{entity:"child",data:{is:"subordinated"},nested:[],context:{element:["child",0]}}],consent:{functional:!0},id:`${n}-${a}-${o}`,trigger:"test",entity:"entity",action:"action",timestamp:n,timing:3.14,group:a,count:o,version:{source:"0.2.0",tagging:1},source:{type:"web",id:"https://localhost:80",previous_id:"http://remotehost:9001"}},t,{merge:!1});if(t.name){const[n,a]=null!=(e=t.name.split(" "))?e:[];n&&a&&(i.entity=n,i.action=a)}return i}function d(t="entity action",e={}){const n=e.timestamp||(new Date).setHours(0,13,37,0),a={data:{id:"ers",name:"Everyday Ruck Snack",color:"black",size:"l",price:420}},o={data:{id:"cc",name:"Cool Cap",size:"one size",price:42}};return s({...{"cart view":{data:{currency:"EUR",value:2*a.data.price},context:{shopping:["cart",0]},globals:{pagegroup:"shop"},nested:[{entity:"product",data:{...a.data,quantity:2},context:{shopping:["cart",0]},nested:[]}],trigger:"load"},"checkout view":{data:{step:"payment",currency:"EUR",value:a.data.price+o.data.price},context:{shopping:["checkout",0]},globals:{pagegroup:"shop"},nested:[{entity:"product",...a,context:{shopping:["checkout",0]},nested:[]},{entity:"product",...o,context:{shopping:["checkout",0]},nested:[]}],trigger:"load"},"order complete":{data:{id:"0rd3r1d",currency:"EUR",shipping:5.22,taxes:73.76,total:555},context:{shopping:["complete",0]},globals:{pagegroup:"shop"},nested:[{entity:"product",...a,context:{shopping:["complete",0]},nested:[]},{entity:"product",...o,context:{shopping:["complete",0]},nested:[]},{entity:"gift",data:{name:"Surprise"},context:{shopping:["complete",0]},nested:[]}],trigger:"load"},"page view":{data:{domain:"www.example.com",title:"walkerOS documentation",referrer:"https://www.elbwalker.com/",search:"?foo=bar",hash:"#hash",id:"/docs/"},globals:{pagegroup:"docs"},trigger:"load"},"product add":{...a,context:{shopping:["intent",0]},globals:{pagegroup:"shop"},nested:[],trigger:"click"},"product view":{...a,context:{shopping:["detail",0]},globals:{pagegroup:"shop"},nested:[],trigger:"load"},"product visible":{data:{...a.data,position:3,promo:!0},context:{shopping:["discover",0]},globals:{pagegroup:"shop"},nested:[],trigger:"load"},"promotion visible":{data:{name:"Setting up tracking easily",position:"hero"},context:{ab_test:["engagement",0]},globals:{pagegroup:"homepage"},trigger:"visible"},"session start":{data:{id:"s3ss10n",start:n,isNew:!0,count:1,runs:1,isStart:!0,storage:!0,referrer:"",device:"c00k13"},user:{id:"us3r",device:"c00k13",session:"s3ss10n",hash:"h4sh",address:"street number",email:"user@example.com",phone:"+49 123 456 789",userAgent:"Mozilla...",browser:"Chrome",browserVersion:"90",deviceType:"desktop",language:"de-DE",country:"DE",region:"HH",city:"Hamburg",zip:"20354",timezone:"Berlin",os:"walkerOS",osVersion:"1.0",screenSize:"1337x420",ip:"127.0.0.0",internal:!0,custom:"value"}}}[t],...e,name:t})}function u(t){return{window:"undefined"!=typeof window?window:globalThis.window,document:"undefined"!=typeof document?document:globalThis.document,...t}}var p={},l={};o(l,{env:()=>g,events:()=>v,mapping:()=>q});var g={};o(g,{init:()=>y,push:()=>h});var m=()=>{},y={window:{fbq:void 0,_fbq:void 0},document:{createElement:()=>({src:"",async:!1,setAttribute:()=>{},removeAttribute:()=>{}}),head:{appendChild:()=>{}}}},h={window:{fbq:Object.assign(m,{callMethod:m,queue:[],push:m,loaded:!0,version:"2.0"}),_fbq:Object.assign(m,{callMethod:m,queue:[],push:m,loaded:!0,version:"2.0"})},document:{createElement:()=>({src:"",async:!1,setAttribute:()=>{},removeAttribute:()=>{}}),head:{appendChild:()=>{}}}},v={};function b(){const t=d("order complete");return["track","Purchase",{value:t.data.total,currency:"EUR",contents:t.nested.filter(t=>"product"===t.entity).map(t=>({id:t.data.id,quantity:1})),content_type:"product",num_items:2},{eventID:t.id}]}function f(){const t=d("product add");return["track","AddToCart",{currency:"EUR",value:t.data.price,contents:[{id:t.data.id,quantity:1}],content_type:"product"},{eventID:t.id}]}function w(){const t=d("cart view");return["track","InitiateCheckout",{currency:"EUR",value:t.data.value,contents:t.nested.filter(t=>"product"===t.entity).map(t=>({id:t.data.id,quantity:t.data.quantity})),num_items:t.nested.filter(t=>"product"===t.entity).length},{eventID:t.id}]}function k(){const t=d("product view");return["track","ViewContent",{currency:"EUR",value:t.data.price,contents:[{id:t.data.id,quantity:1}],content_type:"product"},{eventID:t.id}]}o(v,{AddToCart:()=>f,InitiateCheckout:()=>w,Purchase:()=>b,ViewContent:()=>k});var q={};o(q,{AddToCart:()=>_,InitiateCheckout:()=>E,Purchase:()=>C,ViewContent:()=>A,config:()=>O});var x,C={name:"Purchase",data:{map:{value:"data.total",currency:{value:"EUR"},contents:{loop:["nested",{condition:t=>c(t)&&"product"===t.entity,map:{id:"data.id",quantity:{key:"data.quantity",value:1}}}]},content_type:{value:"product"},num_items:{fn:t=>t.nested.filter(t=>"product"===t.entity).length}}}},_={name:"AddToCart",data:{map:{value:"data.price",currency:{value:"EUR"},contents:{set:[{map:{id:"data.id",quantity:{key:"data.quantity",value:1}}}]},content_type:{value:"product"}}}},E={name:"InitiateCheckout",data:{map:{value:"data.value",currency:{value:"EUR"},contents:{loop:["nested",{condition:t=>c(t)&&"product"===t.entity,map:{id:"data.id",quantity:{key:"data.quantity",value:1}}}]},num_items:{fn:t=>t.nested.filter(t=>"product"===t.entity).length}}}},A={name:"ViewContent",data:{map:{value:"data.price",currency:{value:"EUR"},content_type:{value:"product"},contents:{set:[{map:{id:"data.id",quantity:{key:"data.quantity",value:1}}}]}}}},O={order:{complete:C},product:{view:A,add:_},cart:{view:E}},j={type:"meta-pixel",config:{},init({config:t,env:e}){const{settings:n={},loadScript:a}=t,{pixelId:o}=n;if(a&&function(t,e="https://connect.facebook.net/en_US/fbevents.js"){const{document:n}=u(t),a=n.createElement("script");a.src=e,a.async=!0,n.head.appendChild(a)}(e),!o)return!1;!function(t){const{window:e}=u(t),n=e;if(n.fbq)return;const a=function(...t){a.callMethod?a.callMethod.apply(a,t):a.queue.push(t)};n.fbq=a,n._fbq||(n._fbq=a),a.push=a,a.loaded=!0,a.version="2.0",a.queue=[]}(e);const{window:i}=u(e);return(0,i.fbq)("init",o),t},push(t,{config:e,mapping:n={},data:a,env:o}){const{track:i,trackCustom:r}=n.settings||{},{window:s}=u(o),d=s.fbq;"page view"!==t.name||n.settings||(t.name="PageView");const p=i||r||t.name;d(r?"trackCustom":"track",String(p),c(a)?a:{},{eventID:t.id})}},D=j;return x=i,((o,i,r,c)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let s of n(i))a.call(o,s)||s===r||t(o,s,{get:()=>i[s],enumerable:!(c=e(i,s))||c.enumerable});return o})(t({},"__esModule",{value:!0}),x)})();
|
|
1
|
+
"use strict";var Destination=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,r=(t,n)=>{for(var a in n)e(t,a,{get:n[a],enumerable:!0})},i={};r(i,{DestinationMeta:()=>Nr,default:()=>si,destinationMeta:()=>ii,examples:()=>Ir,schemas:()=>Yr});var s,o,c,d={};r(d,{BRAND:()=>qe,DIRTY:()=>Z,EMPTY_PATH:()=>_,INVALID:()=>j,NEVER:()=>Rt,OK:()=>P,ParseStatus:()=>w,Schema:()=>M,ZodAny:()=>he,ZodArray:()=>ve,ZodBigInt:()=>ce,ZodBoolean:()=>de,ZodBranded:()=>Ve,ZodCatch:()=>Fe,ZodDate:()=>ue,ZodDefault:()=>Le,ZodDiscriminatedUnion:()=>xe,ZodEffects:()=>Re,ZodEnum:()=>Ie,ZodError:()=>h,ZodFirstPartyTypeKind:()=>He,ZodFunction:()=>Te,ZodIntersection:()=>je,ZodIssueCode:()=>p,ZodLazy:()=>Oe,ZodLiteral:()=>Ee,ZodMap:()=>Ae,ZodNaN:()=>Ue,ZodNativeEnum:()=>$e,ZodNever:()=>ge,ZodNull:()=>me,ZodNullable:()=>ze,ZodNumber:()=>oe,ZodObject:()=>_e,ZodOptional:()=>De,ZodParsedType:()=>u,ZodPipeline:()=>Be,ZodPromise:()=>Me,ZodReadonly:()=>Je,ZodRecord:()=>Pe,ZodSchema:()=>M,ZodSet:()=>Ce,ZodString:()=>ie,ZodSymbol:()=>le,ZodTransformer:()=>Re,ZodTuple:()=>Ze,ZodType:()=>M,ZodUndefined:()=>pe,ZodUnion:()=>ke,ZodUnknown:()=>fe,ZodVoid:()=>ye,addIssueToContext:()=>k,any:()=>ct,array:()=>pt,bigint:()=>nt,boolean:()=>at,coerce:()=>Mt,custom:()=>Ke,date:()=>rt,datetimeRegex:()=>te,defaultErrorMap:()=>f,discriminatedUnion:()=>gt,effect:()=>At,enum:()=>jt,function:()=>St,getErrorMap:()=>v,getParsedType:()=>l,instanceof:()=>Qe,intersection:()=>yt,isAborted:()=>A,isAsync:()=>O,isDirty:()=>C,isValid:()=>T,late:()=>Ge,lazy:()=>xt,literal:()=>wt,makeIssue:()=>b,map:()=>_t,nan:()=>tt,nativeEnum:()=>Zt,never:()=>ut,null:()=>ot,nullable:()=>Tt,number:()=>et,object:()=>mt,objectUtil:()=>c,oboolean:()=>$t,onumber:()=>It,optional:()=>Ct,ostring:()=>Nt,pipeline:()=>Et,preprocess:()=>Ot,promise:()=>Pt,quotelessJson:()=>m,record:()=>bt,set:()=>kt,setErrorMap:()=>y,strictObject:()=>ht,string:()=>Xe,symbol:()=>it,transformer:()=>At,tuple:()=>vt,undefined:()=>st,union:()=>ft,unknown:()=>dt,util:()=>s,void:()=>lt}),(o=s||(s={})).assertEqual=e=>{},o.assertIs=function(e){},o.assertNever=function(e){throw new Error},o.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},o.getValidEnumValues=e=>{const t=o.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),n={};for(const a of t)n[a]=e[a];return o.objectValues(n)},o.objectValues=e=>o.objectKeys(e).map(function(t){return e[t]}),o.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},o.find=(e,t)=>{for(const n of e)if(t(n))return n},o.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,o.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},o.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(c||(c={})).mergeShapes=(e,t)=>({...e,...t});var u=s.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),l=e=>{switch(typeof e){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(e)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(e)?u.array:null===e?u.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?u.promise:"undefined"!=typeof Map&&e instanceof Map?u.map:"undefined"!=typeof Set&&e instanceof Set?u.set:"undefined"!=typeof Date&&e instanceof Date?u.date:u.object;default:return u.unknown}},p=s.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),m=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),h=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},a=e=>{for(const r of e.issues)if("invalid_union"===r.code)r.unionErrors.map(a);else if("invalid_return_type"===r.code)a(r.returnTypeError);else if("invalid_arguments"===r.code)a(r.argumentsError);else if(0===r.path.length)n._errors.push(t(r));else{let e=n,a=0;for(;a<r.path.length;){const n=r.path[a];a===r.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(r))):e[n]=e[n]||{_errors:[]},e=e[n],a++}}};return a(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,s.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const a of this.issues)if(a.path.length>0){const n=a.path[0];t[n]=t[n]||[],t[n].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};h.create=e=>new h(e);var f=(e,t)=>{let n;switch(e.code){case p.invalid_type:n=e.received===u.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case p.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,s.jsonStringifyReplacer)}`;break;case p.unrecognized_keys:n=`Unrecognized key(s) in object: ${s.joinValues(e.keys,", ")}`;break;case p.invalid_union:n="Invalid input";break;case p.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${s.joinValues(e.options)}`;break;case p.invalid_enum_value:n=`Invalid enum value. Expected ${s.joinValues(e.options)}, received '${e.received}'`;break;case p.invalid_arguments:n="Invalid function arguments";break;case p.invalid_return_type:n="Invalid function return type";break;case p.invalid_date:n="Invalid date";break;case p.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:s.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case p.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case p.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case p.custom:n="Invalid input";break;case p.invalid_intersection_types:n="Intersection results could not be merged";break;case p.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case p.not_finite:n="Number must be finite";break;default:n=t.defaultError,s.assertNever(e)}return{message:n}},g=f;function y(e){g=e}function v(){return g}var b=e=>{const{data:t,path:n,errorMaps:a,issueData:r}=e,i=[...n,...r.path||[]],s={...r,path:i};if(void 0!==r.message)return{...r,path:i,message:r.message};let o="";const c=a.filter(e=>!!e).slice().reverse();for(const e of c)o=e(s,{data:t,defaultError:o}).message;return{...r,path:i,message:o}},_=[];function k(e,t){const n=v(),a=b({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===f?void 0:f].filter(e=>!!e)});e.common.issues.push(a)}var S,x,w=class e{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const a of t){if("aborted"===a.status)return j;"dirty"===a.status&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){const a=[];for(const e of n){const t=await e.key,n=await e.value;a.push({key:t,value:n})}return e.mergeObjectSync(t,a)}static mergeObjectSync(e,t){const n={};for(const a of t){const{key:t,value:r}=a;if("aborted"===t.status)return j;if("aborted"===r.status)return j;"dirty"===t.status&&e.dirty(),"dirty"===r.status&&e.dirty(),"__proto__"===t.value||void 0===r.value&&!a.alwaysSet||(n[t.value]=r.value)}return{status:e.value,value:n}}},j=Object.freeze({status:"aborted"}),Z=e=>({status:"dirty",value:e}),P=e=>({status:"valid",value:e}),A=e=>"aborted"===e.status,C=e=>"dirty"===e.status,T=e=>"valid"===e.status,O=e=>"undefined"!=typeof Promise&&e instanceof Promise;(x=S||(S={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},x.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;var E=class{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},N=(e,t)=>{if(T(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new h(e.common.issues);return this._error=t,this._error}}};function I(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:a,description:r}=e;if(t&&(n||a))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:r};return{errorMap:(t,r)=>{var i,s;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:r.defaultError}:void 0===r.data?{message:null!=(i=null!=o?o:a)?i:r.defaultError}:"invalid_type"!==t.code?{message:r.defaultError}:{message:null!=(s=null!=o?o:n)?s:r.defaultError}},description:r}}var $,M=class{get description(){return this._def.description}_getType(e){return l(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new w,ctx:{common:e.parent.common,data:e.data,parsedType:l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(O(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const a={common:{issues:[],async:null!=(n=null==t?void 0:t.async)&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)},r=this._parseSync({data:e,path:a.path,parent:a});return N(a,r)}"~validate"(e){var t,n;const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:a});return T(t)?{value:t.value}:{issues:a.common.issues}}catch(e){(null==(n=null==(t=null==e?void 0:e.message)?void 0:t.toLowerCase())?void 0:n.includes("encountered"))&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then(e=>T(e)?{value:e.value}:{issues:a.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)},a=this._parse({data:e,path:n.path,parent:n}),r=await(O(a)?a:Promise.resolve(a));return N(n,r)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,a)=>{const r=e(t),i=()=>a.addIssue({code:p.custom,...n(t)});return"undefined"!=typeof Promise&&r instanceof Promise?r.then(e=>!!e||(i(),!1)):!!r||(i(),!1)})}refinement(e,t){return this._refinement((n,a)=>!!e(n)||(a.addIssue("function"==typeof t?t(n,a):t),!1))}_refinement(e){return new Re({schema:this,typeName:He.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return De.create(this,this._def)}nullable(){return ze.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ve.create(this)}promise(){return Me.create(this,this._def)}or(e){return ke.create([this,e],this._def)}and(e){return je.create(this,e,this._def)}transform(e){return new Re({...I(this._def),schema:this,typeName:He.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Le({...I(this._def),innerType:this,defaultValue:t,typeName:He.ZodDefault})}brand(){return new Ve({typeName:He.ZodBranded,type:this,...I(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Fe({...I(this._def),innerType:this,catchValue:t,typeName:He.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Be.create(this,e)}readonly(){return Je.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},R=/^c[^\s-]{8,}$/i,D=/^[0-9a-z]+$/,z=/^[0-9A-HJKMNP-TV-Z]{26}$/i,L=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,F=/^[a-z0-9_-]{21}$/i,U=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,q=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,V=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,B=/^(?:(?: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])$/,J=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,W=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,K=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,H=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Y=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,G="((\\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])))",Q=new RegExp(`^${G}$`);function X(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function ee(e){return new RegExp(`^${X(e)}$`)}function te(e){let t=`${G}T${X(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function ne(e,t){return!("v4"!==t&&t||!B.test(e))||!("v6"!==t&&t||!W.test(e))}function ae(e,t){if(!U.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const a=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(a));return"object"==typeof r&&null!==r&&((!("typ"in r)||"JWT"===(null==r?void 0:r.typ))&&(!!r.alg&&(!t||r.alg===t)))}catch(e){return!1}}function re(e,t){return!("v4"!==t&&t||!J.test(e))||!("v6"!==t&&t||!K.test(e))}var ie=class e extends M{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==u.string){const t=this._getOrReturnCtx(e);return k(t,{code:p.invalid_type,expected:u.string,received:t.parsedType}),j}const t=new w;let n;for(const a of this._def.checks)if("min"===a.kind)e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),k(n,{code:p.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("max"===a.kind)e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),k(n,{code:p.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("length"===a.kind){const r=e.data.length>a.value,i=e.data.length<a.value;(r||i)&&(n=this._getOrReturnCtx(e,n),r?k(n,{code:p.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&k(n,{code:p.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),t.dirty())}else if("email"===a.kind)V.test(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{validation:"email",code:p.invalid_string,message:a.message}),t.dirty());else if("emoji"===a.kind)$||($=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),$.test(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{validation:"emoji",code:p.invalid_string,message:a.message}),t.dirty());else if("uuid"===a.kind)L.test(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{validation:"uuid",code:p.invalid_string,message:a.message}),t.dirty());else if("nanoid"===a.kind)F.test(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{validation:"nanoid",code:p.invalid_string,message:a.message}),t.dirty());else if("cuid"===a.kind)R.test(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{validation:"cuid",code:p.invalid_string,message:a.message}),t.dirty());else if("cuid2"===a.kind)D.test(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{validation:"cuid2",code:p.invalid_string,message:a.message}),t.dirty());else if("ulid"===a.kind)z.test(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{validation:"ulid",code:p.invalid_string,message:a.message}),t.dirty());else if("url"===a.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),k(n,{validation:"url",code:p.invalid_string,message:a.message}),t.dirty()}else if("regex"===a.kind){a.regex.lastIndex=0;a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{validation:"regex",code:p.invalid_string,message:a.message}),t.dirty())}else if("trim"===a.kind)e.data=e.data.trim();else if("includes"===a.kind)e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),k(n,{code:p.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),t.dirty());else if("toLowerCase"===a.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===a.kind)e.data=e.data.toUpperCase();else if("startsWith"===a.kind)e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),k(n,{code:p.invalid_string,validation:{startsWith:a.value},message:a.message}),t.dirty());else if("endsWith"===a.kind)e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),k(n,{code:p.invalid_string,validation:{endsWith:a.value},message:a.message}),t.dirty());else if("datetime"===a.kind){te(a).test(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{code:p.invalid_string,validation:"datetime",message:a.message}),t.dirty())}else if("date"===a.kind){Q.test(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{code:p.invalid_string,validation:"date",message:a.message}),t.dirty())}else if("time"===a.kind){ee(a).test(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{code:p.invalid_string,validation:"time",message:a.message}),t.dirty())}else"duration"===a.kind?q.test(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{validation:"duration",code:p.invalid_string,message:a.message}),t.dirty()):"ip"===a.kind?ne(e.data,a.version)||(n=this._getOrReturnCtx(e,n),k(n,{validation:"ip",code:p.invalid_string,message:a.message}),t.dirty()):"jwt"===a.kind?ae(e.data,a.alg)||(n=this._getOrReturnCtx(e,n),k(n,{validation:"jwt",code:p.invalid_string,message:a.message}),t.dirty()):"cidr"===a.kind?re(e.data,a.version)||(n=this._getOrReturnCtx(e,n),k(n,{validation:"cidr",code:p.invalid_string,message:a.message}),t.dirty()):"base64"===a.kind?H.test(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{validation:"base64",code:p.invalid_string,message:a.message}),t.dirty()):"base64url"===a.kind?Y.test(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{validation:"base64url",code:p.invalid_string,message:a.message}),t.dirty()):s.assertNever(a);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:p.invalid_string,...S.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:"email",...S.errToObj(e)})}url(e){return this._addCheck({kind:"url",...S.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...S.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...S.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...S.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...S.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...S.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...S.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...S.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...S.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...S.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...S.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...S.errToObj(e)})}datetime(e){var t,n;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!=(t=null==e?void 0:e.offset)&&t,local:null!=(n=null==e?void 0:e.local)&&n,...S.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...S.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...S.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...S.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...S.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...S.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...S.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...S.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...S.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...S.errToObj(t)})}nonempty(e){return this.min(1,S.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}};function se(e,t){const n=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,r=n>a?n:a;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}ie.create=e=>{var t;return new ie({checks:[],typeName:He.ZodString,coerce:null!=(t=null==e?void 0:e.coerce)&&t,...I(e)})};var oe=class e extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==u.number){const t=this._getOrReturnCtx(e);return k(t,{code:p.invalid_type,expected:u.number,received:t.parsedType}),j}let t;const n=new w;for(const a of this._def.checks)if("int"===a.kind)s.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),k(t,{code:p.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty());else if("min"===a.kind){(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),k(t,{code:p.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty())}else if("max"===a.kind){(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),k(t,{code:p.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty())}else"multipleOf"===a.kind?0!==se(e.data,a.value)&&(t=this._getOrReturnCtx(e,t),k(t,{code:p.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):"finite"===a.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),k(t,{code:p.not_finite,message:a.message}),n.dirty()):s.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(t,n,a,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:a,message:S.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:"int",message:S.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:S.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:S.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:S.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&s.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};oe.create=e=>new oe({checks:[],typeName:He.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...I(e)});var ce=class e extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let t;const n=new w;for(const a of this._def.checks)if("min"===a.kind){(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),k(t,{code:p.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty())}else if("max"===a.kind){(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),k(t,{code:p.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty())}else"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),k(t,{code:p.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):s.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return k(t,{code:p.invalid_type,expected:u.bigint,received:t.parsedType}),j}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(t,n,a,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:a,message:S.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}};ce.create=e=>{var t;return new ce({checks:[],typeName:He.ZodBigInt,coerce:null!=(t=null==e?void 0:e.coerce)&&t,...I(e)})};var de=class extends M{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==u.boolean){const t=this._getOrReturnCtx(e);return k(t,{code:p.invalid_type,expected:u.boolean,received:t.parsedType}),j}return P(e.data)}};de.create=e=>new de({typeName:He.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...I(e)});var ue=class e extends M{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==u.date){const t=this._getOrReturnCtx(e);return k(t,{code:p.invalid_type,expected:u.date,received:t.parsedType}),j}if(Number.isNaN(e.data.getTime())){return k(this._getOrReturnCtx(e),{code:p.invalid_date}),j}const t=new w;let n;for(const a of this._def.checks)"min"===a.kind?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),k(n,{code:p.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),t.dirty()):"max"===a.kind?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),k(n,{code:p.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),t.dirty()):s.assertNever(a);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:S.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:S.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}};ue.create=e=>new ue({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:He.ZodDate,...I(e)});var le=class extends M{_parse(e){if(this._getType(e)!==u.symbol){const t=this._getOrReturnCtx(e);return k(t,{code:p.invalid_type,expected:u.symbol,received:t.parsedType}),j}return P(e.data)}};le.create=e=>new le({typeName:He.ZodSymbol,...I(e)});var pe=class extends M{_parse(e){if(this._getType(e)!==u.undefined){const t=this._getOrReturnCtx(e);return k(t,{code:p.invalid_type,expected:u.undefined,received:t.parsedType}),j}return P(e.data)}};pe.create=e=>new pe({typeName:He.ZodUndefined,...I(e)});var me=class extends M{_parse(e){if(this._getType(e)!==u.null){const t=this._getOrReturnCtx(e);return k(t,{code:p.invalid_type,expected:u.null,received:t.parsedType}),j}return P(e.data)}};me.create=e=>new me({typeName:He.ZodNull,...I(e)});var he=class extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return P(e.data)}};he.create=e=>new he({typeName:He.ZodAny,...I(e)});var fe=class extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return P(e.data)}};fe.create=e=>new fe({typeName:He.ZodUnknown,...I(e)});var ge=class extends M{_parse(e){const t=this._getOrReturnCtx(e);return k(t,{code:p.invalid_type,expected:u.never,received:t.parsedType}),j}};ge.create=e=>new ge({typeName:He.ZodNever,...I(e)});var ye=class extends M{_parse(e){if(this._getType(e)!==u.undefined){const t=this._getOrReturnCtx(e);return k(t,{code:p.invalid_type,expected:u.void,received:t.parsedType}),j}return P(e.data)}};ye.create=e=>new ye({typeName:He.ZodVoid,...I(e)});var ve=class e extends M{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==u.array)return k(t,{code:p.invalid_type,expected:u.array,received:t.parsedType}),j;if(null!==a.exactLength){const e=t.data.length>a.exactLength.value,r=t.data.length<a.exactLength.value;(e||r)&&(k(t,{code:e?p.too_big:p.too_small,minimum:r?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&(k(t,{code:p.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&(k(t,{code:p.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>a.type._parseAsync(new E(t,e,t.path,n)))).then(e=>w.mergeArray(n,e));const r=[...t.data].map((e,n)=>a.type._parseSync(new E(t,e,t.path,n)));return w.mergeArray(n,r)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:S.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:S.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:S.toString(n)}})}nonempty(e){return this.min(1,e)}};function be(e){if(e instanceof _e){const t={};for(const n in e.shape){const a=e.shape[n];t[n]=De.create(be(a))}return new _e({...e._def,shape:()=>t})}return e instanceof ve?new ve({...e._def,type:be(e.element)}):e instanceof De?De.create(be(e.unwrap())):e instanceof ze?ze.create(be(e.unwrap())):e instanceof Ze?Ze.create(e.items.map(e=>be(e))):e}ve.create=(e,t)=>new ve({type:e,minLength:null,maxLength:null,exactLength:null,typeName:He.ZodArray,...I(t)});var _e=class e extends M{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=s.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){const t=this._getOrReturnCtx(e);return k(t,{code:p.invalid_type,expected:u.object,received:t.parsedType}),j}const{status:t,ctx:n}=this._processInputParams(e),{shape:a,keys:r}=this._getCached(),i=[];if(!(this._def.catchall instanceof ge&&"strip"===this._def.unknownKeys))for(const e in n.data)r.includes(e)||i.push(e);const s=[];for(const e of r){const t=a[e],r=n.data[e];s.push({key:{status:"valid",value:e},value:t._parse(new E(n,r,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof ge){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)s.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)i.length>0&&(k(n,{code:p.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const a=n.data[t];s.push({key:{status:"valid",value:t},value:e._parse(new E(n,a,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of s){const n=await t.key,a=await t.value;e.push({key:n,value:a,alwaysSet:t.alwaysSet})}return e}).then(e=>w.mergeObjectSync(t,e)):w.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(t){return S.errToObj,new e({...this._def,unknownKeys:"strict",...void 0!==t?{errorMap:(e,n)=>{var a,r,i,s;const o=null!=(i=null==(r=(a=this._def).errorMap)?void 0:r.call(a,e,n).message)?i:n.defaultError;return"unrecognized_keys"===e.code?{message:null!=(s=S.errToObj(t).message)?s:o}:{message:o}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:He.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){const n={};for(const e of s.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){const n={};for(const e of s.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return be(this)}partial(t){const n={};for(const e of s.objectKeys(this.shape)){const a=this.shape[e];t&&!t[e]?n[e]=a:n[e]=a.optional()}return new e({...this._def,shape:()=>n})}required(t){const n={};for(const e of s.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof De;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return Ne(s.objectKeys(this.shape))}};_e.create=(e,t)=>new _e({shape:()=>e,unknownKeys:"strip",catchall:ge.create(),typeName:He.ZodObject,...I(t)}),_e.strictCreate=(e,t)=>new _e({shape:()=>e,unknownKeys:"strict",catchall:ge.create(),typeName:He.ZodObject,...I(t)}),_e.lazycreate=(e,t)=>new _e({shape:e,unknownKeys:"strip",catchall:ge.create(),typeName:He.ZodObject,...I(t)});var ke=class extends M{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map(async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map(e=>new h(e.ctx.common.issues));return k(t,{code:p.invalid_union,unionErrors:n}),j});{let e;const a=[];for(const r of n){const n={...t,common:{...t.common,issues:[]},parent:null},i=r._parseSync({data:t.data,path:t.path,parent:n});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:n}),n.common.issues.length&&a.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const r=a.map(e=>new h(e));return k(t,{code:p.invalid_union,unionErrors:r}),j}}get options(){return this._def.options}};ke.create=(e,t)=>new ke({options:e,typeName:He.ZodUnion,...I(t)});var Se=e=>e instanceof Oe?Se(e.schema):e instanceof Re?Se(e.innerType()):e instanceof Ee?[e.value]:e instanceof Ie?e.options:e instanceof $e?s.objectValues(e.enum):e instanceof Le?Se(e._def.innerType):e instanceof pe?[void 0]:e instanceof me?[null]:e instanceof De?[void 0,...Se(e.unwrap())]:e instanceof ze?[null,...Se(e.unwrap())]:e instanceof Ve||e instanceof Je?Se(e.unwrap()):e instanceof Fe?Se(e._def.innerType):[],xe=class e extends M{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return k(t,{code:p.invalid_type,expected:u.object,received:t.parsedType}),j;const n=this.discriminator,a=t.data[n],r=this.optionsMap.get(a);return r?t.common.async?r._parseAsync({data:t.data,path:t.path,parent:t}):r._parseSync({data:t.data,path:t.path,parent:t}):(k(t,{code:p.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),j)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,a){const r=new Map;for(const e of n){const n=Se(e.shape[t]);if(!n.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of n){if(r.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);r.set(a,e)}}return new e({typeName:He.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...I(a)})}};function we(e,t){const n=l(e),a=l(t);if(e===t)return{valid:!0,data:e};if(n===u.object&&a===u.object){const n=s.objectKeys(t),a=s.objectKeys(e).filter(e=>-1!==n.indexOf(e)),r={...e,...t};for(const n of a){const a=we(e[n],t[n]);if(!a.valid)return{valid:!1};r[n]=a.data}return{valid:!0,data:r}}if(n===u.array&&a===u.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let a=0;a<e.length;a++){const r=we(e[a],t[a]);if(!r.valid)return{valid:!1};n.push(r.data)}return{valid:!0,data:n}}return n===u.date&&a===u.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}var je=class extends M{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=(e,a)=>{if(A(e)||A(a))return j;const r=we(e.value,a.value);return r.valid?((C(e)||C(a))&&t.dirty(),{status:t.value,value:r.data}):(k(n,{code:p.invalid_intersection_types}),j)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>a(e,t)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};je.create=(e,t,n)=>new je({left:e,right:t,typeName:He.ZodIntersection,...I(n)});var Ze=class e extends M{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==u.array)return k(n,{code:p.invalid_type,expected:u.array,received:n.parsedType}),j;if(n.data.length<this._def.items.length)return k(n,{code:p.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),j;!this._def.rest&&n.data.length>this._def.items.length&&(k(n,{code:p.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map((e,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new E(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(a).then(e=>w.mergeArray(t,e)):w.mergeArray(t,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Ze.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ze({items:e,typeName:He.ZodTuple,rest:null,...I(t)})};var Pe=class e extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==u.object)return k(n,{code:p.invalid_type,expected:u.object,received:n.parsedType}),j;const a=[],r=this._def.keyType,i=this._def.valueType;for(const e in n.data)a.push({key:r._parse(new E(n,e,n.path,e)),value:i._parse(new E(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?w.mergeObjectAsync(t,a):w.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(t,n,a){return new e(n instanceof M?{keyType:t,valueType:n,typeName:He.ZodRecord,...I(a)}:{keyType:ie.create(),valueType:t,typeName:He.ZodRecord,...I(n)})}},Ae=class extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==u.map)return k(n,{code:p.invalid_type,expected:u.map,received:n.parsedType}),j;const a=this._def.keyType,r=this._def.valueType,i=[...n.data.entries()].map(([e,t],i)=>({key:a._parse(new E(n,e,n.path,[i,"key"])),value:r._parse(new E(n,t,n.path,[i,"value"]))}));if(n.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const n of i){const a=await n.key,r=await n.value;if("aborted"===a.status||"aborted"===r.status)return j;"dirty"!==a.status&&"dirty"!==r.status||t.dirty(),e.set(a.value,r.value)}return{status:t.value,value:e}})}{const e=new Map;for(const n of i){const a=n.key,r=n.value;if("aborted"===a.status||"aborted"===r.status)return j;"dirty"!==a.status&&"dirty"!==r.status||t.dirty(),e.set(a.value,r.value)}return{status:t.value,value:e}}}};Ae.create=(e,t,n)=>new Ae({valueType:t,keyType:e,typeName:He.ZodMap,...I(n)});var Ce=class e extends M{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==u.set)return k(n,{code:p.invalid_type,expected:u.set,received:n.parsedType}),j;const a=this._def;null!==a.minSize&&n.data.size<a.minSize.value&&(k(n,{code:p.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&n.data.size>a.maxSize.value&&(k(n,{code:p.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const r=this._def.valueType;function i(e){const n=new Set;for(const a of e){if("aborted"===a.status)return j;"dirty"===a.status&&t.dirty(),n.add(a.value)}return{status:t.value,value:n}}const s=[...n.data.values()].map((e,t)=>r._parse(new E(n,e,n.path,t)));return n.common.async?Promise.all(s).then(e=>i(e)):i(s)}min(t,n){return new e({...this._def,minSize:{value:t,message:S.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:S.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Ce.create=(e,t)=>new Ce({valueType:e,minSize:null,maxSize:null,typeName:He.ZodSet,...I(t)});var Te=class e extends M{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.function)return k(t,{code:p.invalid_type,expected:u.function,received:t.parsedType}),j;function n(e,n){return b({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,v(),f].filter(e=>!!e),issueData:{code:p.invalid_arguments,argumentsError:n}})}function a(e,n){return b({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,v(),f].filter(e=>!!e),issueData:{code:p.invalid_return_type,returnTypeError:n}})}const r={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof Me){const e=this;return P(async function(...t){const s=new h([]),o=await e._def.args.parseAsync(t,r).catch(e=>{throw s.addIssue(n(t,e)),s}),c=await Reflect.apply(i,this,o);return await e._def.returns._def.type.parseAsync(c,r).catch(e=>{throw s.addIssue(a(c,e)),s})})}{const e=this;return P(function(...t){const s=e._def.args.safeParse(t,r);if(!s.success)throw new h([n(t,s.error)]);const o=Reflect.apply(i,this,s.data),c=e._def.returns.safeParse(o,r);if(!c.success)throw new h([a(o,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Ze.create(t).rest(fe.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,a){return new e({args:t||Ze.create([]).rest(fe.create()),returns:n||fe.create(),typeName:He.ZodFunction,...I(a)})}},Oe=class extends M{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Oe.create=(e,t)=>new Oe({getter:e,typeName:He.ZodLazy,...I(t)});var Ee=class extends M{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return k(t,{received:t.data,code:p.invalid_literal,expected:this._def.value}),j}return{status:"valid",value:e.data}}get value(){return this._def.value}};function Ne(e,t){return new Ie({values:e,typeName:He.ZodEnum,...I(t)})}Ee.create=(e,t)=>new Ee({value:e,typeName:He.ZodLiteral,...I(t)});var Ie=class e extends M{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return k(t,{expected:s.joinValues(n),received:t.parsedType,code:p.invalid_type}),j}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return k(t,{received:t.data,code:p.invalid_enum_value,options:n}),j}return P(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};Ie.create=Ne;var $e=class extends M{_parse(e){const t=s.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==u.string&&n.parsedType!==u.number){const e=s.objectValues(t);return k(n,{expected:s.joinValues(e),received:n.parsedType,code:p.invalid_type}),j}if(this._cache||(this._cache=new Set(s.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=s.objectValues(t);return k(n,{received:n.data,code:p.invalid_enum_value,options:e}),j}return P(e.data)}get enum(){return this._def.values}};$e.create=(e,t)=>new $e({values:e,typeName:He.ZodNativeEnum,...I(t)});var Me=class extends M{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&!1===t.common.async)return k(t,{code:p.invalid_type,expected:u.promise,received:t.parsedType}),j;const n=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return P(n.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Me.create=(e,t)=>new Me({type:e,typeName:He.ZodPromise,...I(t)});var Re=class extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===He.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,r={addIssue:e=>{k(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),"preprocess"===a.type){const e=a.transform(n.data,r);if(n.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return j;const a=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===a.status?j:"dirty"===a.status||"dirty"===t.value?Z(a.value):a});{if("aborted"===t.value)return j;const a=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===a.status?j:"dirty"===a.status||"dirty"===t.value?Z(a.value):a}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,r);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===a.status?j:("dirty"===a.status&&t.dirty(),e(a.value),{status:t.value,value:a.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>"aborted"===n.status?j:("dirty"===n.status&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if("transform"===a.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!T(e))return j;const i=a.transform(e.value,r);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>T(e)?Promise.resolve(a.transform(e.value,r)).then(e=>({status:t.value,value:e})):j)}s.assertNever(a)}};Re.create=(e,t,n)=>new Re({schema:e,typeName:He.ZodEffects,effect:t,...I(n)}),Re.createWithPreprocess=(e,t,n)=>new Re({schema:t,effect:{type:"preprocess",transform:e},typeName:He.ZodEffects,...I(n)});var De=class extends M{_parse(e){return this._getType(e)===u.undefined?P(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};De.create=(e,t)=>new De({innerType:e,typeName:He.ZodOptional,...I(t)});var ze=class extends M{_parse(e){return this._getType(e)===u.null?P(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ze.create=(e,t)=>new ze({innerType:e,typeName:He.ZodNullable,...I(t)});var Le=class extends M{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===u.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Le.create=(e,t)=>new Le({innerType:e,typeName:He.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...I(t)});var Fe=class extends M{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return O(a)?a.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new h(n.common.issues)},input:n.data})})):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new h(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Fe.create=(e,t)=>new Fe({innerType:e,typeName:He.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...I(t)});var Ue=class extends M{_parse(e){if(this._getType(e)!==u.nan){const t=this._getOrReturnCtx(e);return k(t,{code:p.invalid_type,expected:u.nan,received:t.parsedType}),j}return{status:"valid",value:e.data}}};Ue.create=e=>new Ue({typeName:He.ZodNaN,...I(e)});var qe=Symbol("zod_brand"),Ve=class extends M{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},Be=class e extends M{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?j:"dirty"===e.status?(t.dirty(),Z(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?j:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:He.ZodPipeline})}},Je=class extends M{_parse(e){const t=this._def.innerType._parse(e),n=e=>(T(e)&&(e.value=Object.freeze(e.value)),e);return O(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};function We(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function Ke(e,t={},n){return e?he.create().superRefine((a,r)=>{var i,s;const o=e(a);if(o instanceof Promise)return o.then(e=>{var i,s;if(!e){const e=We(t,a),o=null==(s=null!=(i=e.fatal)?i:n)||s;r.addIssue({code:"custom",...e,fatal:o})}});if(!o){const e=We(t,a),o=null==(s=null!=(i=e.fatal)?i:n)||s;r.addIssue({code:"custom",...e,fatal:o})}}):he.create()}Je.create=(e,t)=>new Je({innerType:e,typeName:He.ZodReadonly,...I(t)});var He,Ye,Ge={object:_e.lazycreate};(Ye=He||(He={})).ZodString="ZodString",Ye.ZodNumber="ZodNumber",Ye.ZodNaN="ZodNaN",Ye.ZodBigInt="ZodBigInt",Ye.ZodBoolean="ZodBoolean",Ye.ZodDate="ZodDate",Ye.ZodSymbol="ZodSymbol",Ye.ZodUndefined="ZodUndefined",Ye.ZodNull="ZodNull",Ye.ZodAny="ZodAny",Ye.ZodUnknown="ZodUnknown",Ye.ZodNever="ZodNever",Ye.ZodVoid="ZodVoid",Ye.ZodArray="ZodArray",Ye.ZodObject="ZodObject",Ye.ZodUnion="ZodUnion",Ye.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Ye.ZodIntersection="ZodIntersection",Ye.ZodTuple="ZodTuple",Ye.ZodRecord="ZodRecord",Ye.ZodMap="ZodMap",Ye.ZodSet="ZodSet",Ye.ZodFunction="ZodFunction",Ye.ZodLazy="ZodLazy",Ye.ZodLiteral="ZodLiteral",Ye.ZodEnum="ZodEnum",Ye.ZodEffects="ZodEffects",Ye.ZodNativeEnum="ZodNativeEnum",Ye.ZodOptional="ZodOptional",Ye.ZodNullable="ZodNullable",Ye.ZodDefault="ZodDefault",Ye.ZodCatch="ZodCatch",Ye.ZodPromise="ZodPromise",Ye.ZodBranded="ZodBranded",Ye.ZodPipeline="ZodPipeline",Ye.ZodReadonly="ZodReadonly";var Qe=(e,t={message:`Input not instance of ${e.name}`})=>Ke(t=>t instanceof e,t),Xe=ie.create,et=oe.create,tt=Ue.create,nt=ce.create,at=de.create,rt=ue.create,it=le.create,st=pe.create,ot=me.create,ct=he.create,dt=fe.create,ut=ge.create,lt=ye.create,pt=ve.create,mt=_e.create,ht=_e.strictCreate,ft=ke.create,gt=xe.create,yt=je.create,vt=Ze.create,bt=Pe.create,_t=Ae.create,kt=Ce.create,St=Te.create,xt=Oe.create,wt=Ee.create,jt=Ie.create,Zt=$e.create,Pt=Me.create,At=Re.create,Ct=De.create,Tt=ze.create,Ot=Re.createWithPreprocess,Et=Be.create,Nt=()=>Xe().optional(),It=()=>et().optional(),$t=()=>at().optional(),Mt={string:e=>ie.create({...e,coerce:!0}),number:e=>oe.create({...e,coerce:!0}),boolean:e=>de.create({...e,coerce:!0}),bigint:e=>ce.create({...e,coerce:!0}),date:e=>ue.create({...e,coerce:!0})},Rt=j,Dt=Symbol("Let zodToJsonSchema decide on which parser to use"),zt={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},Lt=e=>{const t=(e=>"string"==typeof e?{...zt,name:e}:{...zt,...e})(e),n=void 0!==t.name?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}};function Ft(e,t,n,a){(null==a?void 0:a.errorMessages)&&n&&(e.errorMessage={...e.errorMessage,[t]:n})}function Ut(e,t,n,a,r){e[t]=n,Ft(e,t,a,r)}var qt=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")};function Vt(e){if("openAi"!==e.target)return{};const t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:"relative"===e.$refStrategy?qt(t,e.currentPath):t.join("/")}}function Bt(e,t){return bn(e.type._def,t)}function Jt(e,t,n){const a=null!=n?n:t.dateStrategy;if(Array.isArray(a))return{anyOf:a.map((n,a)=>Jt(e,t,n))};switch(a){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Wt(e,t)}}var Wt=(e,t)=>{const n={type:"integer",format:"unix-time"};if("openApi3"===t.target)return n;for(const a of e.checks)switch(a.kind){case"min":Ut(n,"minimum",a.value,a.message,t);break;case"max":Ut(n,"maximum",a.value,a.message,t)}return n};var Kt=void 0,Ht=/^[cC][^\s-]{8,}$/,Yt=/^[0-9a-z]+$/,Gt=/^[0-9A-HJKMNP-TV-Z]{26}$/,Qt=/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,Xt=()=>(void 0===Kt&&(Kt=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Kt),en=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,tn=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,nn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,an=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,rn=/^[a-zA-Z0-9_-]{21}$/,sn=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;function on(e,t){const n={type:"string"};if(e.checks)for(const a of e.checks)switch(a.kind){case"min":Ut(n,"minLength","number"==typeof n.minLength?Math.max(n.minLength,a.value):a.value,a.message,t);break;case"max":Ut(n,"maxLength","number"==typeof n.maxLength?Math.min(n.maxLength,a.value):a.value,a.message,t);break;case"email":switch(t.emailStrategy){case"format:email":un(n,"email",a.message,t);break;case"format:idn-email":un(n,"idn-email",a.message,t);break;case"pattern:zod":ln(n,Qt,a.message,t)}break;case"url":un(n,"uri",a.message,t);break;case"uuid":un(n,"uuid",a.message,t);break;case"regex":ln(n,a.regex,a.message,t);break;case"cuid":ln(n,Ht,a.message,t);break;case"cuid2":ln(n,Yt,a.message,t);break;case"startsWith":ln(n,RegExp(`^${cn(a.value,t)}`),a.message,t);break;case"endsWith":ln(n,RegExp(`${cn(a.value,t)}$`),a.message,t);break;case"datetime":un(n,"date-time",a.message,t);break;case"date":un(n,"date",a.message,t);break;case"time":un(n,"time",a.message,t);break;case"duration":un(n,"duration",a.message,t);break;case"length":Ut(n,"minLength","number"==typeof n.minLength?Math.max(n.minLength,a.value):a.value,a.message,t),Ut(n,"maxLength","number"==typeof n.maxLength?Math.min(n.maxLength,a.value):a.value,a.message,t);break;case"includes":ln(n,RegExp(cn(a.value,t)),a.message,t);break;case"ip":"v6"!==a.version&&un(n,"ipv4",a.message,t),"v4"!==a.version&&un(n,"ipv6",a.message,t);break;case"base64url":ln(n,an,a.message,t);break;case"jwt":ln(n,sn,a.message,t);break;case"cidr":"v6"!==a.version&&ln(n,en,a.message,t),"v4"!==a.version&&ln(n,tn,a.message,t);break;case"emoji":ln(n,Xt(),a.message,t);break;case"ulid":ln(n,Gt,a.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":un(n,"binary",a.message,t);break;case"contentEncoding:base64":Ut(n,"contentEncoding","base64",a.message,t);break;case"pattern:zod":ln(n,nn,a.message,t)}break;case"nanoid":ln(n,rn,a.message,t)}return n}function cn(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let n=0;n<e.length;n++)dn.has(e[n])||(t+="\\"),t+=e[n];return t}(e):e}var dn=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function un(e,t,n,a){var r;e.format||(null==(r=e.anyOf)?void 0:r.some(e=>e.format))?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&a.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.anyOf.push({format:t,...n&&a.errorMessages&&{errorMessage:{format:n}}})):Ut(e,"format",t,n,a)}function ln(e,t,n,a){var r;e.pattern||(null==(r=e.allOf)?void 0:r.some(e=>e.pattern))?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&a.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.allOf.push({pattern:pn(t,a),...n&&a.errorMessages&&{errorMessage:{pattern:n}}})):Ut(e,"pattern",pn(t,a),n,a)}function pn(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;const a=e.flags.includes("i"),r=e.flags.includes("m"),i=e.flags.includes("s"),s=a?e.source.toLowerCase():e.source;let o="",c=!1,d=!1,u=!1;for(let e=0;e<s.length;e++)if(c)o+=s[e],c=!1;else{if(a)if(d){if(s[e].match(/[a-z]/)){u?(o+=s[e],o+=`${s[e-2]}-${s[e]}`.toUpperCase(),u=!1):"-"===s[e+1]&&(null==(n=s[e+2])?void 0:n.match(/[a-z]/))?(o+=s[e],u=!0):o+=`${s[e]}${s[e].toUpperCase()}`;continue}}else if(s[e].match(/[a-z]/)){o+=`[${s[e]}${s[e].toUpperCase()}]`;continue}if(r){if("^"===s[e]){o+="(^|(?<=[\r\n]))";continue}if("$"===s[e]){o+="($|(?=[\r\n]))";continue}}i&&"."===s[e]?o+=d?`${s[e]}\r\n`:`[${s[e]}\r\n]`:(o+=s[e],"\\"===s[e]?c=!0:d&&"]"===s[e]?d=!1:d||"["!==s[e]||(d=!0))}try{new RegExp(o)}catch(n){return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function mn(e,t){var n,a,r,i,s,o,c;if("openAi"===t.target&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),"openApi3"===t.target&&(null==(n=e.keyType)?void 0:n._def.typeName)===He.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((n,a)=>{var r;return{...n,[a]:null!=(r=bn(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",a]}))?r:Vt(t)}},{}),additionalProperties:t.rejectedAdditionalProperties};const d={type:"object",additionalProperties:null!=(a=bn(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))?a:t.allowedAdditionalProperties};if("openApi3"===t.target)return d;if((null==(r=e.keyType)?void 0:r._def.typeName)===He.ZodString&&(null==(i=e.keyType._def.checks)?void 0:i.length)){const{type:n,...a}=on(e.keyType._def,t);return{...d,propertyNames:a}}if((null==(s=e.keyType)?void 0:s._def.typeName)===He.ZodEnum)return{...d,propertyNames:{enum:e.keyType._def.values}};if((null==(o=e.keyType)?void 0:o._def.typeName)===He.ZodBranded&&e.keyType._def.type._def.typeName===He.ZodString&&(null==(c=e.keyType._def.type._def.checks)?void 0:c.length)){const{type:n,...a}=Bt(e.keyType._def,t);return{...d,propertyNames:a}}return d}var hn={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};var fn=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,n)=>bn(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${n}`]})).filter(e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0));return n.length?{anyOf:n}:void 0};function gn(e,t){const n="openAi"===t.target,a={type:"object",properties:{}},r=[],i=e.shape();for(const e in i){let s=i[e];if(void 0===s||void 0===s._def)continue;let o=yn(s);o&&n&&("ZodOptional"===s._def.typeName&&(s=s._def.innerType),s.isNullable()||(s=s.nullable()),o=!1);const c=bn(s._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==c&&(a.properties[e]=c,o||r.push(e))}r.length&&(a.required=r);const s=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return bn(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==s&&(a.additionalProperties=s),a}function yn(e){try{return e.isOptional()}catch(e){return!0}}var vn=(e,t,n)=>{switch(t){case He.ZodString:return on(e,n);case He.ZodNumber:return function(e,t){const n={type:"number"};if(!e.checks)return n;for(const a of e.checks)switch(a.kind){case"int":n.type="integer",Ft(n,"type",a.message,t);break;case"min":"jsonSchema7"===t.target?a.inclusive?Ut(n,"minimum",a.value,a.message,t):Ut(n,"exclusiveMinimum",a.value,a.message,t):(a.inclusive||(n.exclusiveMinimum=!0),Ut(n,"minimum",a.value,a.message,t));break;case"max":"jsonSchema7"===t.target?a.inclusive?Ut(n,"maximum",a.value,a.message,t):Ut(n,"exclusiveMaximum",a.value,a.message,t):(a.inclusive||(n.exclusiveMaximum=!0),Ut(n,"maximum",a.value,a.message,t));break;case"multipleOf":Ut(n,"multipleOf",a.value,a.message,t)}return n}(e,n);case He.ZodObject:return gn(e,n);case He.ZodBigInt:return function(e,t){const n={type:"integer",format:"int64"};if(!e.checks)return n;for(const a of e.checks)switch(a.kind){case"min":"jsonSchema7"===t.target?a.inclusive?Ut(n,"minimum",a.value,a.message,t):Ut(n,"exclusiveMinimum",a.value,a.message,t):(a.inclusive||(n.exclusiveMinimum=!0),Ut(n,"minimum",a.value,a.message,t));break;case"max":"jsonSchema7"===t.target?a.inclusive?Ut(n,"maximum",a.value,a.message,t):Ut(n,"exclusiveMaximum",a.value,a.message,t):(a.inclusive||(n.exclusiveMaximum=!0),Ut(n,"maximum",a.value,a.message,t));break;case"multipleOf":Ut(n,"multipleOf",a.value,a.message,t)}return n}(e,n);case He.ZodBoolean:return{type:"boolean"};case He.ZodDate:return Jt(e,n);case He.ZodUndefined:return function(e){return{not:Vt(e)}}(n);case He.ZodNull:return function(e){return"openApi3"===e.target?{enum:["null"],nullable:!0}:{type:"null"}}(n);case He.ZodArray:return function(e,t){var n,a,r;const i={type:"array"};return(null==(n=e.type)?void 0:n._def)&&(null==(r=null==(a=e.type)?void 0:a._def)?void 0:r.typeName)!==He.ZodAny&&(i.items=bn(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&Ut(i,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&Ut(i,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(Ut(i,"minItems",e.exactLength.value,e.exactLength.message,t),Ut(i,"maxItems",e.exactLength.value,e.exactLength.message,t)),i}(e,n);case He.ZodUnion:case He.ZodDiscriminatedUnion:return function(e,t){if("openApi3"===t.target)return fn(e,t);const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in hn&&(!e._def.checks||!e._def.checks.length))){const e=n.reduce((e,t)=>{const n=hn[t._def.typeName];return n&&!e.includes(n)?[...e,n]:e},[]);return{type:e.length>1?e:e[0]}}if(n.every(e=>"ZodLiteral"===e._def.typeName&&!e.description)){const e=n.reduce((e,t)=>{const n=typeof t._def.value;switch(n){case"string":case"number":case"boolean":return[...e,n];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}},[]);if(e.length===n.length){const t=e.filter((e,t,n)=>n.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:n.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(n.every(e=>"ZodEnum"===e._def.typeName))return{type:"string",enum:n.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return fn(e,t)}(e,n);case He.ZodIntersection:return function(e,t){const n=[bn(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),bn(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(e=>!!e);let a="jsonSchema2019-09"===t.target?{unevaluatedProperties:!1}:void 0;const r=[];return n.forEach(e=>{if("type"in(t=e)&&"string"===t.type||!("allOf"in t)){let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){const{additionalProperties:n,...a}=e;t=a}else a=void 0;r.push(t)}else r.push(...e.allOf),void 0===e.unevaluatedProperties&&(a=void 0);var t}),r.length?{allOf:r,...a}:void 0}(e,n);case He.ZodTuple:return function(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((e,n)=>bn(e._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:bn(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,n)=>bn(e._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])}}(e,n);case He.ZodRecord:return mn(e,n);case He.ZodLiteral:return function(e,t){const n=typeof e.value;return"bigint"!==n&&"number"!==n&&"boolean"!==n&&"string"!==n?{type:Array.isArray(e.value)?"array":"object"}:"openApi3"===t.target?{type:"bigint"===n?"integer":n,enum:[e.value]}:{type:"bigint"===n?"integer":n,const:e.value}}(e,n);case He.ZodEnum:return function(e){return{type:"string",enum:Array.from(e.values)}}(e);case He.ZodNativeEnum:return function(e){const t=e.values,n=Object.keys(e.values).filter(e=>"number"!=typeof t[t[e]]).map(e=>t[e]),a=Array.from(new Set(n.map(e=>typeof e)));return{type:1===a.length?"string"===a[0]?"string":"number":["string","number"],enum:n}}(e);case He.ZodNullable:return function(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return"openApi3"===t.target?{type:hn[e.innerType._def.typeName],nullable:!0}:{type:[hn[e.innerType._def.typeName],"null"]};if("openApi3"===t.target){const n=bn(e.innerType._def,{...t,currentPath:[...t.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}const n=bn(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}(e,n);case He.ZodOptional:return((e,t)=>{var n;if(t.currentPath.toString()===(null==(n=t.propertyPath)?void 0:n.toString()))return bn(e.innerType._def,t);const a=bn(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return a?{anyOf:[{not:Vt(t)},a]}:Vt(t)})(e,n);case He.ZodMap:return function(e,t){return"record"===t.mapStrategy?mn(e,t):{type:"array",maxItems:125,items:{type:"array",items:[bn(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Vt(t),bn(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Vt(t)],minItems:2,maxItems:2}}}(e,n);case He.ZodSet:return function(e,t){const n={type:"array",uniqueItems:!0,items:bn(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&Ut(n,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&Ut(n,"maxItems",e.maxSize.value,e.maxSize.message,t),n}(e,n);case He.ZodLazy:return()=>e.getter()._def;case He.ZodPromise:return function(e,t){return bn(e.type._def,t)}(e,n);case He.ZodNaN:case He.ZodNever:return function(e){return"openAi"===e.target?void 0:{not:Vt({...e,currentPath:[...e.currentPath,"not"]})}}(n);case He.ZodEffects:return function(e,t){return"input"===t.effectStrategy?bn(e.schema._def,t):Vt(t)}(e,n);case He.ZodAny:return Vt(n);case He.ZodUnknown:return function(e){return Vt(e)}(n);case He.ZodDefault:return function(e,t){return{...bn(e.innerType._def,t),default:e.defaultValue()}}(e,n);case He.ZodBranded:return Bt(e,n);case He.ZodReadonly:case He.ZodCatch:return((e,t)=>bn(e.innerType._def,t))(e,n);case He.ZodPipeline:return((e,t)=>{if("input"===t.pipeStrategy)return bn(e.in._def,t);if("output"===t.pipeStrategy)return bn(e.out._def,t);const n=bn(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]});return{allOf:[n,bn(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]})].filter(e=>void 0!==e)}})(e,n);case He.ZodFunction:case He.ZodVoid:case He.ZodSymbol:default:return}};function bn(e,t,n=!1){var a;const r=t.seen.get(e);if(t.override){const i=null==(a=t.override)?void 0:a.call(t,e,t,r,n);if(i!==Dt)return i}if(r&&!n){const e=_n(r,t);if(void 0!==e)return e}const i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);const s=vn(e,e.typeName,t),o="function"==typeof s?bn(s(),t):s;if(o&&kn(e,t,o),t.postProcess){const n=t.postProcess(o,e,t);return i.jsonSchema=o,n}return i.jsonSchema=o,o}var _n=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:qt(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((e,n)=>t.currentPath[n]===e)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Vt(t)):"seen"===t.$refStrategy?Vt(t):void 0}},kn=(e,t,n)=>(e.description&&(n.description=e.description,t.markdownDescription&&(n.markdownDescription=e.description)),n),Sn=(e,t)=>{var n;const a=Lt(t);let r="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce((e,[t,n])=>{var r;return{...e,[t]:null!=(r=bn(n._def,{...a,currentPath:[...a.basePath,a.definitionPath,t]},!0))?r:Vt(a)}},{}):void 0;const i="string"==typeof t?t:"title"===(null==t?void 0:t.nameStrategy)||null==t?void 0:t.name,s=null!=(n=bn(e._def,void 0===i?a:{...a,currentPath:[...a.basePath,a.definitionPath,i]},!1))?n:Vt(a),o="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==o&&(s.title=o),a.flags.hasReferencedOpenAiAnyType&&(r||(r={}),r[a.openAiAnyTypeName]||(r[a.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:"relative"===a.$refStrategy?"1":[...a.basePath,a.definitionPath,a.openAiAnyTypeName].join("/")}}));const c=void 0===i?r?{...s,[a.definitionPath]:r}:s:{$ref:[..."relative"===a.$refStrategy?[]:a.basePath,a.definitionPath,i].join("/"),[a.definitionPath]:{...r,[i]:s}};return"jsonSchema7"===a.target?c.$schema="http://json-schema.org/draft-07/schema#":"jsonSchema2019-09"!==a.target&&"openAi"!==a.target||(c.$schema="https://json-schema.org/draft/2019-09/schema#"),"openAi"===a.target&&("anyOf"in c||"oneOf"in c||"allOf"in c||"type"in c&&Array.isArray(c.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),c},xn=Object.defineProperty,wn=(e,t)=>{for(var n in t)xn(e,n,{get:t[n],enumerable:!0})},jn=d.string(),Zn=d.number(),Pn=(d.boolean(),d.string().min(1)),An=d.number().int().positive(),Cn=d.number().int().nonnegative(),Tn=d.number().describe("Tagging version number");d.union([d.string(),d.number(),d.boolean()]).optional();wn({},{ErrorHandlerSchema:()=>Nn,HandlerSchema:()=>$n,LogHandlerSchema:()=>In,StorageSchema:()=>En,StorageTypeSchema:()=>On,errorHandlerJsonSchema:()=>Dn,handlerJsonSchema:()=>Ln,logHandlerJsonSchema:()=>zn,storageJsonSchema:()=>Rn,storageTypeJsonSchema:()=>Mn});var On=d.enum(["local","session","cookie"]).describe("Storage mechanism: local, session, or cookie"),En=d.object({Local:d.literal("local"),Session:d.literal("session"),Cookie:d.literal("cookie")}).describe("Storage type constants for type-safe references"),Nn=d.any().describe("Error handler function: (error, state?) => void"),In=d.any().describe("Log handler function: (message, verbose?) => void"),$n=d.object({Error:Nn.describe("Error handler function"),Log:In.describe("Log handler function")}).describe("Handler interface with error and log functions"),Mn=Sn(On,{target:"jsonSchema7",$refStrategy:"relative",name:"StorageType"}),Rn=Sn(En,{target:"jsonSchema7",$refStrategy:"relative",name:"Storage"}),Dn=Sn(Nn,{target:"jsonSchema7",$refStrategy:"relative",name:"ErrorHandler"}),zn=Sn(In,{target:"jsonSchema7",$refStrategy:"relative",name:"LogHandler"}),Ln=Sn($n,{target:"jsonSchema7",$refStrategy:"relative",name:"Handler"});d.object({onError:Nn.optional().describe("Error handler function: (error, state?) => void"),onLog:In.optional().describe("Log handler function: (message, verbose?) => void")}).partial(),d.object({verbose:d.boolean().describe("Enable verbose logging for debugging").optional()}).partial(),d.object({queue:d.boolean().describe("Whether to queue events when consent is not granted").optional()}).partial(),d.object({}).partial(),d.object({init:d.boolean().describe("Whether to initialize immediately").optional(),loadScript:d.boolean().describe("Whether to load external script (for web destinations)").optional()}).partial(),d.object({disabled:d.boolean().describe("Set to true to disable").optional()}).partial(),d.object({primary:d.boolean().describe("Mark as primary (only one can be primary)").optional()}).partial(),d.object({settings:d.any().optional().describe("Implementation-specific configuration")}).partial(),d.object({env:d.any().optional().describe("Environment dependencies (platform-specific)")}).partial(),d.object({type:d.string().optional().describe("Instance type identifier"),config:d.any().describe("Instance configuration")}).partial(),d.object({collector:d.any().describe("Collector instance (runtime object)"),config:d.any().describe("Configuration"),env:d.any().describe("Environment dependencies")}).partial(),d.object({batch:d.number().optional().describe("Batch size: bundle N events for batch processing"),batched:d.any().optional().describe("Batch of events to be processed")}).partial(),d.object({ignore:d.boolean().describe("Set to true to skip processing").optional(),condition:d.string().optional().describe("Condition function: return true to process")}).partial(),d.object({sources:d.record(d.string(),d.any()).describe("Map of source instances")}).partial(),d.object({destinations:d.record(d.string(),d.any()).describe("Map of destination instances")}).partial();wn({},{ConsentSchema:()=>Jn,DeepPartialEventSchema:()=>ea,EntitiesSchema:()=>Gn,EntitySchema:()=>Yn,EventSchema:()=>Qn,OrderedPropertiesSchema:()=>Vn,PartialEventSchema:()=>Xn,PropertiesSchema:()=>qn,PropertySchema:()=>Un,PropertyTypeSchema:()=>Fn,SourceSchema:()=>Hn,SourceTypeSchema:()=>Bn,UserSchema:()=>Wn,VersionSchema:()=>Kn,consentJsonSchema:()=>ca,entityJsonSchema:()=>sa,eventJsonSchema:()=>ta,orderedPropertiesJsonSchema:()=>ia,partialEventJsonSchema:()=>na,propertiesJsonSchema:()=>ra,sourceTypeJsonSchema:()=>oa,userJsonSchema:()=>aa});var Fn=d.lazy(()=>d.union([d.boolean(),d.string(),d.number(),d.record(d.string(),Un)])),Un=d.lazy(()=>d.union([Fn,d.array(Fn)])),qn=d.record(d.string(),Un.optional()).describe("Flexible property collection with optional values"),Vn=d.record(d.string(),d.tuple([Un,d.number()]).optional()).describe("Ordered properties with [value, order] tuples for priority control"),Bn=d.union([d.enum(["web","server","app","other"]),d.string()]).describe("Source type: web, server, app, other, or custom"),Jn=d.record(d.string(),d.boolean()).describe("Consent requirement mapping (group name → state)"),Wn=qn.and(d.object({id:d.string().optional().describe("User identifier"),device:d.string().optional().describe("Device identifier"),session:d.string().optional().describe("Session identifier"),hash:d.string().optional().describe("Hashed identifier"),address:d.string().optional().describe("User address"),email:d.string().email().optional().describe("User email address"),phone:d.string().optional().describe("User phone number"),userAgent:d.string().optional().describe("Browser user agent string"),browser:d.string().optional().describe("Browser name"),browserVersion:d.string().optional().describe("Browser version"),deviceType:d.string().optional().describe("Device type (mobile, desktop, tablet)"),os:d.string().optional().describe("Operating system"),osVersion:d.string().optional().describe("Operating system version"),screenSize:d.string().optional().describe("Screen dimensions"),language:d.string().optional().describe("User language"),country:d.string().optional().describe("User country"),region:d.string().optional().describe("User region/state"),city:d.string().optional().describe("User city"),zip:d.string().optional().describe("User postal code"),timezone:d.string().optional().describe("User timezone"),ip:d.string().optional().describe("User IP address"),internal:d.boolean().optional().describe("Internal user flag (employee, test user)")})).describe("User identification and properties"),Kn=qn.and(d.object({source:jn.describe('Walker implementation version (e.g., "2.0.0")'),tagging:Tn})).describe("Walker version information"),Hn=qn.and(d.object({type:Bn.describe("Source type identifier"),id:jn.describe("Source identifier (typically URL on web)"),previous_id:jn.describe("Previous source identifier (typically referrer on web)")})).describe("Event source information"),Yn=d.lazy(()=>d.object({entity:d.string().describe("Entity name"),data:qn.describe("Entity-specific properties"),nested:d.array(Yn).describe("Nested child entities"),context:Vn.describe("Entity context data")})).describe("Nested entity structure with recursive nesting support"),Gn=d.array(Yn).describe("Array of nested entities"),Qn=d.object({name:d.string().describe('Event name in "entity action" format (e.g., "page view", "product add")'),data:qn.describe("Event-specific properties"),context:Vn.describe("Ordered context properties with priorities"),globals:qn.describe("Global properties shared across events"),custom:qn.describe("Custom implementation-specific properties"),user:Wn.describe("User identification and attributes"),nested:Gn.describe("Related nested entities"),consent:Jn.describe("Consent states at event time"),id:Pn.describe("Unique event identifier (timestamp-based)"),trigger:jn.describe("Event trigger identifier"),entity:jn.describe("Parsed entity from event name"),action:jn.describe("Parsed action from event name"),timestamp:An.describe("Unix timestamp in milliseconds since epoch"),timing:Zn.describe("Event processing timing information"),group:jn.describe("Event grouping identifier"),count:Cn.describe("Event count in session"),version:Kn.describe("Walker version information"),source:Hn.describe("Event source information")}).describe("Complete walkerOS event structure"),Xn=Qn.partial().describe("Partial event structure with all fields optional"),ea=d.lazy(()=>Qn.deepPartial()).describe("Deep partial event structure with all nested fields optional"),ta=Sn(Qn,{target:"jsonSchema7",$refStrategy:"relative",name:"Event"}),na=Sn(Xn,{target:"jsonSchema7",$refStrategy:"relative",name:"PartialEvent"}),aa=Sn(Wn,{target:"jsonSchema7",$refStrategy:"relative",name:"User"}),ra=Sn(qn,{target:"jsonSchema7",$refStrategy:"relative",name:"Properties"}),ia=Sn(Vn,{target:"jsonSchema7",$refStrategy:"relative",name:"OrderedProperties"}),sa=Sn(Yn,{target:"jsonSchema7",$refStrategy:"relative",name:"Entity"}),oa=Sn(Bn,{target:"jsonSchema7",$refStrategy:"relative",name:"SourceType"}),ca=Sn(Jn,{target:"jsonSchema7",$refStrategy:"relative",name:"Consent"});wn({},{ConfigSchema:()=>va,LoopSchema:()=>la,MapSchema:()=>ma,PolicySchema:()=>fa,ResultSchema:()=>ba,RuleSchema:()=>ga,RulesSchema:()=>ya,SetSchema:()=>pa,ValueConfigSchema:()=>ha,ValueSchema:()=>da,ValuesSchema:()=>ua,configJsonSchema:()=>Aa,loopJsonSchema:()=>Sa,mapJsonSchema:()=>wa,policyJsonSchema:()=>ja,ruleJsonSchema:()=>Za,rulesJsonSchema:()=>Pa,setJsonSchema:()=>xa,valueConfigJsonSchema:()=>ka,valueJsonSchema:()=>_a});var da=d.lazy(()=>d.union([d.string().describe('String value or property path (e.g., "data.id")'),d.number().describe("Numeric value"),d.boolean().describe("Boolean value"),ha,d.array(da).describe("Array of values")])),ua=d.array(da).describe("Array of transformation values"),la=d.tuple([da,da]).describe("Loop transformation: [source, transform] tuple for array processing"),pa=d.array(da).describe("Set: Array of values for selection or combination"),ma=d.record(d.string(),da).describe("Map: Object mapping keys to transformation values"),ha=d.object({key:d.string().optional().describe('Property path to extract from event (e.g., "data.id", "user.email")'),value:d.union([d.string(),d.number(),d.boolean()]).optional().describe("Static primitive value"),fn:d.string().optional().describe("Custom transformation function as string (serialized)"),map:ma.optional().describe("Object mapping: transform event data to structured output"),loop:la.optional().describe("Loop transformation: [source, transform] for array processing"),set:pa.optional().describe("Set of values: combine or select from multiple values"),consent:Jn.optional().describe("Required consent states to include this value"),condition:d.string().optional().describe("Condition function as string: return true to include value"),validate:d.string().optional().describe("Validation function as string: return true if value is valid")}).refine(e=>Object.keys(e).length>0,{message:"ValueConfig must have at least one property"}).describe("Value transformation configuration with multiple strategies"),fa=d.record(d.string(),da).describe("Policy rules for event pre-processing (key → value mapping)"),ga=d.object({batch:d.number().optional().describe("Batch size: bundle N events for batch processing"),condition:d.string().optional().describe("Condition function as string: return true to process event"),consent:Jn.optional().describe("Required consent states to process this event"),settings:d.any().optional().describe("Destination-specific settings for this event mapping"),data:d.union([da,ua]).optional().describe("Data transformation rules for event"),ignore:d.boolean().optional().describe("Set to true to skip processing this event"),name:d.string().optional().describe('Custom event name override (e.g., "view_item" for "product view")'),policy:fa.optional().describe("Event-level policy overrides (applied after config-level policy)")}).describe("Mapping rule for specific entity-action combination"),ya=d.record(d.string(),d.record(d.string(),d.union([ga,d.array(ga)])).optional()).describe("Nested mapping rules: { entity: { action: Rule | Rule[] } } with wildcard support"),va=d.object({consent:Jn.optional().describe("Required consent states to process any events"),data:d.union([da,ua]).optional().describe("Global data transformation applied to all events"),mapping:ya.optional().describe("Entity-action specific mapping rules"),policy:fa.optional().describe("Pre-processing policy rules applied before mapping")}).describe("Shared mapping configuration for sources and destinations"),ba=d.object({eventMapping:ga.optional().describe("Resolved mapping rule for event"),mappingKey:d.string().optional().describe('Mapping key used (e.g., "product.view")')}).describe("Mapping resolution result"),_a=Sn(da,{target:"jsonSchema7",$refStrategy:"relative",name:"Value"}),ka=Sn(ha,{target:"jsonSchema7",$refStrategy:"relative",name:"ValueConfig"}),Sa=Sn(la,{target:"jsonSchema7",$refStrategy:"relative",name:"Loop"}),xa=Sn(pa,{target:"jsonSchema7",$refStrategy:"relative",name:"Set"}),wa=Sn(ma,{target:"jsonSchema7",$refStrategy:"relative",name:"Map"}),ja=Sn(fa,{target:"jsonSchema7",$refStrategy:"relative",name:"Policy"}),Za=Sn(ga,{target:"jsonSchema7",$refStrategy:"relative",name:"Rule"}),Pa=Sn(ya,{target:"jsonSchema7",$refStrategy:"relative",name:"Rules"}),Aa=Sn(va,{target:"jsonSchema7",$refStrategy:"relative",name:"MappingConfig"});wn({},{BatchSchema:()=>Ra,ConfigSchema:()=>Ca,ContextSchema:()=>Ea,DLQSchema:()=>Ja,DataSchema:()=>Da,DestinationPolicySchema:()=>Oa,DestinationsSchema:()=>Ua,InitDestinationsSchema:()=>Fa,InitSchema:()=>La,InstanceSchema:()=>za,PartialConfigSchema:()=>Ta,PushBatchContextSchema:()=>Ia,PushContextSchema:()=>Na,PushEventSchema:()=>$a,PushEventsSchema:()=>Ma,PushResultSchema:()=>Va,RefSchema:()=>qa,ResultSchema:()=>Ba,batchJsonSchema:()=>Ga,configJsonSchema:()=>Wa,contextJsonSchema:()=>Ha,instanceJsonSchema:()=>Qa,partialConfigJsonSchema:()=>Ka,pushContextJsonSchema:()=>Ya,resultJsonSchema:()=>Xa});var Ca=d.object({consent:Jn.optional().describe("Required consent states to send events to this destination"),settings:d.any().describe("Implementation-specific configuration").optional(),data:d.union([da,ua]).optional().describe("Global data transformation applied to all events for this destination"),env:d.any().describe("Environment dependencies (platform-specific)").optional(),id:Pn.describe("Destination instance identifier (defaults to destination key)").optional(),init:d.boolean().describe("Whether to initialize immediately").optional(),loadScript:d.boolean().describe("Whether to load external script (for web destinations)").optional(),mapping:ya.optional().describe("Entity-action specific mapping rules for this destination"),policy:fa.optional().describe("Pre-processing policy rules applied before event mapping"),queue:d.boolean().describe("Whether to queue events when consent is not granted").optional(),verbose:d.boolean().describe("Enable verbose logging for debugging").optional(),onError:Nn.optional(),onLog:In.optional()}).describe("Destination configuration"),Ta=Ca.deepPartial().describe("Partial destination configuration with all fields deeply optional"),Oa=fa.describe("Destination policy rules for event pre-processing"),Ea=d.object({collector:d.any().describe("Collector instance (runtime object)"),config:Ca.describe("Destination configuration"),data:d.union([d.any(),d.undefined(),d.array(d.union([d.any(),d.undefined()]))]).optional().describe("Transformed event data"),env:d.any().describe("Environment dependencies")}).describe("Destination context for init and push functions"),Na=Ea.extend({mapping:ga.optional().describe("Resolved mapping rule for this specific event")}).describe("Push context with event-specific mapping"),Ia=Na.describe("Batch push context with event-specific mapping"),$a=d.object({event:Qn.describe("The event to process"),mapping:ga.optional().describe("Mapping rule for this event")}).describe("Event with optional mapping for batch processing"),Ma=d.array($a).describe("Array of events with mappings"),Ra=d.object({key:d.string().describe('Batch key (usually mapping key like "product.view")'),events:d.array(Qn).describe("Array of events in batch"),data:d.array(d.union([d.any(),d.undefined(),d.array(d.union([d.any(),d.undefined()]))])).describe("Transformed data for each event"),mapping:ga.optional().describe("Shared mapping rule for batch")}).describe("Batch of events grouped by mapping key"),Da=d.union([d.any(),d.undefined(),d.array(d.union([d.any(),d.undefined()]))]).describe("Transformed event data (Property, undefined, or array)"),za=d.object({config:Ca.describe("Destination configuration"),queue:d.array(Qn).optional().describe("Queued events awaiting consent"),dlq:d.array(d.tuple([Qn,d.any()])).optional().describe("Dead letter queue (failed events with errors)"),type:d.string().optional().describe("Destination type identifier"),env:d.any().optional().describe("Environment dependencies"),init:d.any().optional().describe("Initialization function"),push:d.any().describe("Push function for single events"),pushBatch:d.any().optional().describe("Batch push function"),on:d.any().optional().describe("Event lifecycle hook function")}).describe("Destination instance (runtime object with functions)"),La=d.object({code:za.describe("Destination instance with implementation"),config:Ta.optional().describe("Partial configuration overrides"),env:d.any().optional().describe("Partial environment overrides")}).describe("Destination initialization configuration"),Fa=d.record(d.string(),La).describe("Map of destination IDs to initialization configurations"),Ua=d.record(d.string(),za).describe("Map of destination IDs to runtime instances"),qa=d.object({id:d.string().describe("Destination ID"),destination:za.describe("Destination instance")}).describe("Destination reference (ID + instance)"),Va=d.object({queue:d.array(Qn).optional().describe("Events queued (awaiting consent)"),error:d.any().optional().describe("Error if push failed")}).describe("Push operation result"),Ba=d.object({successful:d.array(qa).describe("Destinations that processed successfully"),queued:d.array(qa).describe("Destinations that queued events"),failed:d.array(qa).describe("Destinations that failed to process")}).describe("Overall destination processing result"),Ja=d.array(d.tuple([Qn,d.any()])).describe("Dead letter queue: [(event, error), ...]"),Wa=Sn(Ca,{target:"jsonSchema7",$refStrategy:"relative",name:"DestinationConfig"}),Ka=Sn(Ta,{target:"jsonSchema7",$refStrategy:"relative",name:"PartialDestinationConfig"}),Ha=Sn(Ea,{target:"jsonSchema7",$refStrategy:"relative",name:"DestinationContext"}),Ya=Sn(Na,{target:"jsonSchema7",$refStrategy:"relative",name:"PushContext"}),Ga=Sn(Ra,{target:"jsonSchema7",$refStrategy:"relative",name:"Batch"}),Qa=Sn(za,{target:"jsonSchema7",$refStrategy:"relative",name:"DestinationInstance"}),Xa=Sn(Ba,{target:"jsonSchema7",$refStrategy:"relative",name:"DestinationResult"});wn({},{CommandTypeSchema:()=>er,ConfigSchema:()=>tr,DestinationsSchema:()=>sr,InitConfigSchema:()=>ar,InstanceSchema:()=>or,PushContextSchema:()=>rr,SessionDataSchema:()=>nr,SourcesSchema:()=>ir,commandTypeJsonSchema:()=>cr,configJsonSchema:()=>dr,initConfigJsonSchema:()=>lr,instanceJsonSchema:()=>mr,pushContextJsonSchema:()=>pr,sessionDataJsonSchema:()=>ur});var er=d.union([d.enum(["action","config","consent","context","destination","elb","globals","hook","init","link","run","user","walker"]),d.string()]).describe("Collector command type: standard commands or custom string for extensions"),tr=d.object({run:d.boolean().describe("Whether to run collector automatically on initialization").optional(),tagging:Tn,globalsStatic:qn.describe("Static global properties that persist across collector runs"),sessionStatic:d.record(d.any()).describe("Static session data that persists across collector runs"),verbose:d.boolean().describe("Enable verbose logging for debugging"),onError:Nn.optional(),onLog:In.optional()}).describe("Core collector configuration"),nr=qn.and(d.object({isStart:d.boolean().describe("Whether this is a new session start"),storage:d.boolean().describe("Whether storage is available"),id:Pn.describe("Session identifier").optional(),start:An.describe("Session start timestamp").optional(),marketing:d.literal(!0).optional().describe("Marketing attribution flag"),updated:An.describe("Last update timestamp").optional(),isNew:d.boolean().describe("Whether this is a new session").optional(),device:Pn.describe("Device identifier").optional(),count:Cn.describe("Event count in session").optional(),runs:Cn.describe("Number of runs").optional()})).describe("Session state and tracking data"),ar=tr.partial().extend({consent:Jn.optional().describe("Initial consent state"),user:Wn.optional().describe("Initial user data"),globals:qn.optional().describe("Initial global properties"),sources:d.any().optional().describe("Source configurations"),destinations:d.any().optional().describe("Destination configurations"),custom:qn.optional().describe("Initial custom implementation-specific properties")}).describe("Collector initialization configuration with initial state"),rr=d.object({mapping:va.optional().describe("Source-level mapping configuration")}).describe("Push context with optional source mapping"),ir=d.record(d.string(),d.any()).describe("Map of source IDs to source instances"),sr=d.record(d.string(),d.any()).describe("Map of destination IDs to destination instances"),or=d.object({push:d.any().describe("Push function for processing events"),command:d.any().describe("Command function for walker commands"),allowed:d.boolean().describe("Whether event processing is allowed"),config:tr.describe("Current collector configuration"),consent:Jn.describe("Current consent state"),count:d.number().describe("Event count (increments with each event)"),custom:qn.describe("Custom implementation-specific properties"),sources:ir.describe("Registered source instances"),destinations:sr.describe("Registered destination instances"),globals:qn.describe("Current global properties"),group:d.string().describe("Event grouping identifier"),hooks:d.any().describe("Lifecycle hook functions"),on:d.any().describe("Event lifecycle configuration"),queue:d.array(Qn).describe("Queued events awaiting processing"),round:d.number().describe("Collector run count (increments with each run)"),session:d.union([d.undefined(),nr]).describe("Current session state"),timing:d.number().describe("Event processing timing information"),user:Wn.describe("Current user data"),version:d.string().describe("Walker implementation version")}).describe("Collector instance with state and methods"),cr=Sn(er,{target:"jsonSchema7",$refStrategy:"relative",name:"CommandType"}),dr=Sn(tr,{target:"jsonSchema7",$refStrategy:"relative",name:"CollectorConfig"}),ur=Sn(nr,{target:"jsonSchema7",$refStrategy:"relative",name:"SessionData"}),lr=Sn(ar,{target:"jsonSchema7",$refStrategy:"relative",name:"InitConfig"}),pr=Sn(rr,{target:"jsonSchema7",$refStrategy:"relative",name:"CollectorPushContext"}),mr=Sn(or,{target:"jsonSchema7",$refStrategy:"relative",name:"CollectorInstance"});wn({},{BaseEnvSchema:()=>hr,ConfigSchema:()=>fr,InitSchema:()=>vr,InitSourceSchema:()=>br,InitSourcesSchema:()=>_r,InstanceSchema:()=>yr,PartialConfigSchema:()=>gr,baseEnvJsonSchema:()=>kr,configJsonSchema:()=>Sr,initSourceJsonSchema:()=>jr,initSourcesJsonSchema:()=>Zr,instanceJsonSchema:()=>wr,partialConfigJsonSchema:()=>xr});var hr=d.object({push:d.any().describe("Collector push function"),command:d.any().describe("Collector command function"),sources:d.any().optional().describe("Map of registered source instances"),elb:d.any().describe("Public API function (alias for collector.push)")}).catchall(d.unknown()).describe("Base environment for dependency injection - platform-specific sources extend this"),fr=va.extend({settings:d.any().describe("Implementation-specific configuration").optional(),env:hr.optional().describe("Environment dependencies (platform-specific)"),id:Pn.describe("Source identifier (defaults to source key)").optional(),onError:Nn.optional(),disabled:d.boolean().describe("Set to true to disable").optional(),primary:d.boolean().describe("Mark as primary (only one can be primary)").optional()}).describe("Source configuration with mapping and environment"),gr=fr.deepPartial().describe("Partial source configuration with all fields deeply optional"),yr=d.object({type:d.string().describe('Source type identifier (e.g., "browser", "dataLayer")'),config:fr.describe("Current source configuration"),push:d.any().describe("Push function - THE HANDLER (flexible signature for platform compatibility)"),destroy:d.any().optional().describe("Cleanup function called when source is removed"),on:d.any().optional().describe("Lifecycle hook function for event types")}).describe("Source instance with push handler and lifecycle methods"),vr=d.any().describe("Source initialization function: (config, env) => Instance | Promise<Instance>"),br=d.object({code:vr.describe("Source initialization function"),config:gr.optional().describe("Partial configuration overrides"),env:hr.partial().optional().describe("Partial environment overrides"),primary:d.boolean().optional().describe("Mark as primary source (only one can be primary)")}).describe("Source initialization configuration"),_r=d.record(d.string(),br).describe("Map of source IDs to initialization configurations"),kr=Sn(hr,{target:"jsonSchema7",$refStrategy:"relative",name:"SourceBaseEnv"}),Sr=Sn(fr,{target:"jsonSchema7",$refStrategy:"relative",name:"SourceConfig"}),xr=Sn(gr,{target:"jsonSchema7",$refStrategy:"relative",name:"PartialSourceConfig"}),wr=Sn(yr,{target:"jsonSchema7",$refStrategy:"relative",name:"SourceInstance"}),jr=Sn(br,{target:"jsonSchema7",$refStrategy:"relative",name:"InitSource"}),Zr=Sn(_r,{target:"jsonSchema7",$refStrategy:"relative",name:"InitSources"});function Pr(e){return Sn(e,{target:"jsonSchema7",$refStrategy:"none"})}var Ar={merge:!0,shallow:!0,extend:!0};function Cr(e){return"object"==typeof e&&null!==e&&!function(e){return Array.isArray(e)}(e)&&"[object Object]"===Object.prototype.toString.call(e)}function Tr(e={}){var t;const n=e.timestamp||(new Date).setHours(0,13,37,0),a=e.group||"gr0up",r=e.count||1,i=function(e,t={},n={}){n={...Ar,...n};const a=Object.entries(t).reduce((t,[a,r])=>{const i=e[a];return n.merge&&Array.isArray(i)&&Array.isArray(r)?t[a]=r.reduce((e,t)=>e.includes(t)?e:[...e,t],[...i]):(n.extend||a in e)&&(t[a]=r),t},{});return n.shallow?{...e,...a}:(Object.assign(e,a),e)}({name:"entity action",data:{string:"foo",number:1,boolean:!0,array:[0,"text",!1],not:void 0},context:{dev:["test",1]},globals:{lang:"elb"},custom:{completely:"random"},user:{id:"us3r",device:"c00k13",session:"s3ss10n"},nested:[{entity:"child",data:{is:"subordinated"},nested:[],context:{element:["child",0]}}],consent:{functional:!0},id:`${n}-${a}-${r}`,trigger:"test",entity:"entity",action:"action",timestamp:n,timing:3.14,group:a,count:r,version:{source:"0.3.0",tagging:1},source:{type:"web",id:"https://localhost:80",previous_id:"http://remotehost:9001"}},e,{merge:!1});if(e.name){const[n,a]=null!=(t=e.name.split(" "))?t:[];n&&a&&(i.entity=n,i.action=a)}return i}function Or(e="entity action",t={}){const n=t.timestamp||(new Date).setHours(0,13,37,0),a={data:{id:"ers",name:"Everyday Ruck Snack",color:"black",size:"l",price:420}},r={data:{id:"cc",name:"Cool Cap",size:"one size",price:42}};return Tr({...{"cart view":{data:{currency:"EUR",value:2*a.data.price},context:{shopping:["cart",0]},globals:{pagegroup:"shop"},nested:[{entity:"product",data:{...a.data,quantity:2},context:{shopping:["cart",0]},nested:[]}],trigger:"load"},"checkout view":{data:{step:"payment",currency:"EUR",value:a.data.price+r.data.price},context:{shopping:["checkout",0]},globals:{pagegroup:"shop"},nested:[{entity:"product",...a,context:{shopping:["checkout",0]},nested:[]},{entity:"product",...r,context:{shopping:["checkout",0]},nested:[]}],trigger:"load"},"order complete":{data:{id:"0rd3r1d",currency:"EUR",shipping:5.22,taxes:73.76,total:555},context:{shopping:["complete",0]},globals:{pagegroup:"shop"},nested:[{entity:"product",...a,context:{shopping:["complete",0]},nested:[]},{entity:"product",...r,context:{shopping:["complete",0]},nested:[]},{entity:"gift",data:{name:"Surprise"},context:{shopping:["complete",0]},nested:[]}],trigger:"load"},"page view":{data:{domain:"www.example.com",title:"walkerOS documentation",referrer:"https://www.elbwalker.com/",search:"?foo=bar",hash:"#hash",id:"/docs/"},globals:{pagegroup:"docs"},trigger:"load"},"product add":{...a,context:{shopping:["intent",0]},globals:{pagegroup:"shop"},nested:[],trigger:"click"},"product view":{...a,context:{shopping:["detail",0]},globals:{pagegroup:"shop"},nested:[],trigger:"load"},"product visible":{data:{...a.data,position:3,promo:!0},context:{shopping:["discover",0]},globals:{pagegroup:"shop"},nested:[],trigger:"load"},"promotion visible":{data:{name:"Setting up tracking easily",position:"hero"},context:{ab_test:["engagement",0]},globals:{pagegroup:"homepage"},trigger:"visible"},"session start":{data:{id:"s3ss10n",start:n,isNew:!0,count:1,runs:1,isStart:!0,storage:!0,referrer:"",device:"c00k13"},user:{id:"us3r",device:"c00k13",session:"s3ss10n",hash:"h4sh",address:"street number",email:"user@example.com",phone:"+49 123 456 789",userAgent:"Mozilla...",browser:"Chrome",browserVersion:"90",deviceType:"desktop",language:"de-DE",country:"DE",region:"HH",city:"Hamburg",zip:"20354",timezone:"Berlin",os:"walkerOS",osVersion:"1.0",screenSize:"1337x420",ip:"127.0.0.0",internal:!0,custom:"value"}}}[e],...t,name:e})}function Er(e){return{window:"undefined"!=typeof window?window:globalThis.window,document:"undefined"!=typeof document?document:globalThis.document,...e}}var Nr={},Ir={};r(Ir,{env:()=>$r,events:()=>zr,mapping:()=>Vr});var $r={};r($r,{init:()=>Rr,push:()=>Dr});var Mr=()=>{},Rr={window:{fbq:void 0,_fbq:void 0},document:{createElement:()=>({src:"",async:!1,setAttribute:()=>{},removeAttribute:()=>{}}),head:{appendChild:()=>{}}}},Dr={window:{fbq:Object.assign(Mr,{callMethod:Mr,queue:[],push:Mr,loaded:!0,version:"2.0"}),_fbq:Object.assign(Mr,{callMethod:Mr,queue:[],push:Mr,loaded:!0,version:"2.0"})},document:{createElement:()=>({src:"",async:!1,setAttribute:()=>{},removeAttribute:()=>{}}),head:{appendChild:()=>{}}}},zr={};function Lr(){const e=Or("order complete");return["track","Purchase",{value:e.data.total,currency:"EUR",contents:e.nested.filter(e=>"product"===e.entity).map(e=>({id:e.data.id,quantity:1})),content_type:"product",num_items:2},{eventID:e.id}]}function Fr(){const e=Or("product add");return["track","AddToCart",{currency:"EUR",value:e.data.price,contents:[{id:e.data.id,quantity:1}],content_type:"product"},{eventID:e.id}]}function Ur(){const e=Or("cart view");return["track","InitiateCheckout",{currency:"EUR",value:e.data.value,contents:e.nested.filter(e=>"product"===e.entity).map(e=>({id:e.data.id,quantity:e.data.quantity})),num_items:e.nested.filter(e=>"product"===e.entity).length},{eventID:e.id}]}function qr(){const e=Or("product view");return["track","ViewContent",{currency:"EUR",value:e.data.price,contents:[{id:e.data.id,quantity:1}],content_type:"product"},{eventID:e.id}]}r(zr,{AddToCart:()=>Fr,InitiateCheckout:()=>Ur,Purchase:()=>Lr,ViewContent:()=>qr});var Vr={};r(Vr,{AddToCart:()=>Jr,InitiateCheckout:()=>Wr,Purchase:()=>Br,ViewContent:()=>Kr,config:()=>Hr});var Br={name:"Purchase",data:{map:{value:"data.total",currency:{value:"EUR"},contents:{loop:["nested",{condition:e=>Cr(e)&&"product"===e.entity,map:{id:"data.id",quantity:{key:"data.quantity",value:1}}}]},content_type:{value:"product"},num_items:{fn:e=>e.nested.filter(e=>"product"===e.entity).length}}}},Jr={name:"AddToCart",data:{map:{value:"data.price",currency:{value:"EUR"},contents:{set:[{map:{id:"data.id",quantity:{key:"data.quantity",value:1}}}]},content_type:{value:"product"}}}},Wr={name:"InitiateCheckout",data:{map:{value:"data.value",currency:{value:"EUR"},contents:{loop:["nested",{condition:e=>Cr(e)&&"product"===e.entity,map:{id:"data.id",quantity:{key:"data.quantity",value:1}}}]},num_items:{fn:e=>e.nested.filter(e=>"product"===e.entity).length}}}},Kr={name:"ViewContent",data:{map:{value:"data.price",currency:{value:"EUR"},content_type:{value:"product"},contents:{set:[{map:{id:"data.id",quantity:{key:"data.quantity",value:1}}}]}}}},Hr={order:{complete:Br},product:{view:Kr,add:Jr},cart:{view:Wr}},Yr={};r(Yr,{CustomEventName:()=>ei,MappingSchema:()=>ni,PixelId:()=>Qr,SettingsSchema:()=>ti,StandardEventName:()=>Xr,mapping:()=>ri,settings:()=>ai});var Gr,Qr=d.string().min(1).regex(/^[0-9]+$/,"Pixel ID must contain only digits"),Xr=d.enum(["PageView","AddPaymentInfo","AddToCart","AddToWishlist","CompleteRegistration","Contact","CustomizeProduct","Donate","FindLocation","InitiateCheckout","Lead","Purchase","Schedule","Search","StartTrial","SubmitApplication","Subscribe","ViewContent"]),ei=d.string().min(1),ti=d.object({pixelId:Qr.describe("Your Meta Pixel ID from Facebook Business Manager (like 1234567890)")}),ni=d.object({track:Xr.describe("Meta Pixel standard event name to send (like PageView or Purchase)").optional(),trackCustom:ei.describe("Custom event name for tracking non-standard events (like NewsletterSignup)").optional()}),ai=Pr(ti),ri=Pr(ni),ii={type:"meta-pixel",config:{},init({config:e,env:t}){const{settings:n,loadScript:a}=e,{pixelId:r}=n||{};if(a&&function(e,t="https://connect.facebook.net/en_US/fbevents.js"){const{document:n}=Er(e),a=n.createElement("script");a.src=t,a.async=!0,n.head.appendChild(a)}(t),!r)return!1;!function(e){const{window:t}=Er(e),n=t;if(n.fbq)return;const a=function(...e){a.callMethod?a.callMethod.apply(a,e):a.queue.push(e)};n.fbq=a,n._fbq||(n._fbq=a),a.push=a,a.loaded=!0,a.version="2.0",a.queue=[]}(t);const{window:i}=Er(t);(0,i.fbq)("init",r)},push(e,{config:t,mapping:n={},data:a,env:r}){const{track:i,trackCustom:s}=n.settings||{},{window:o}=Er(r),c=o.fbq;"page view"!==e.name||n.settings||(e.name="PageView");const d=i||s||e.name;c(s?"trackCustom":"track",String(d),Cr(a)?a:{},{eventID:e.id})}},si=ii;return Gr=i,((r,i,s,o)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let c of n(i))a.call(r,c)||c===s||e(r,c,{get:()=>i[c],enumerable:!(o=t(i,c))||o.enumerable});return r})(e({},"__esModule",{value:!0}),Gr)})();
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Destination as Destination$1, Mapping as Mapping$
|
|
1
|
+
import { Destination as Destination$1, Mapping as Mapping$2, z } from '@walkeros/core';
|
|
2
2
|
import { DestinationWeb } from '@walkeros/web-core';
|
|
3
|
+
import * as zod_to_json_schema from 'zod-to-json-schema';
|
|
3
4
|
|
|
4
5
|
declare global {
|
|
5
6
|
interface Window {
|
|
@@ -7,10 +8,10 @@ declare global {
|
|
|
7
8
|
fbq?: facebook.Pixel.Event;
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
|
-
interface Settings {
|
|
11
|
-
pixelId
|
|
11
|
+
interface Settings$1 {
|
|
12
|
+
pixelId: string;
|
|
12
13
|
}
|
|
13
|
-
interface Mapping {
|
|
14
|
+
interface Mapping$1 {
|
|
14
15
|
track?: StandardEventNames;
|
|
15
16
|
trackCustom?: string;
|
|
16
17
|
}
|
|
@@ -26,24 +27,22 @@ interface Env extends DestinationWeb.Env {
|
|
|
26
27
|
};
|
|
27
28
|
};
|
|
28
29
|
}
|
|
29
|
-
type Types = Destination$1.Types<Settings, Mapping, Env>;
|
|
30
|
+
type Types = Destination$1.Types<Settings$1, Mapping$1, Env>;
|
|
30
31
|
type Destination = DestinationWeb.Destination<Types>;
|
|
31
32
|
type Config = DestinationWeb.Config<Types>;
|
|
32
|
-
type Rule = Mapping$
|
|
33
|
-
type Rules = Mapping$
|
|
33
|
+
type Rule = Mapping$2.Rule<Mapping$1>;
|
|
34
|
+
type Rules = Mapping$2.Rules<Rule>;
|
|
34
35
|
type StandardEventNames = 'PageView' | 'AddPaymentInfo' | 'AddToCart' | 'AddToWishlist' | 'CompleteRegistration' | 'Contact' | 'CustomizeProduct' | 'Donate' | 'FindLocation' | 'InitiateCheckout' | 'Lead' | 'Purchase' | 'Schedule' | 'Search' | 'StartTrial' | 'SubmitApplication' | 'Subscribe' | 'ViewContent' | string;
|
|
35
36
|
|
|
36
|
-
type index$
|
|
37
|
-
type index$
|
|
38
|
-
type index$
|
|
39
|
-
type index$
|
|
40
|
-
type index$
|
|
41
|
-
type index$
|
|
42
|
-
type index$
|
|
43
|
-
|
|
44
|
-
type index$
|
|
45
|
-
declare namespace index$1 {
|
|
46
|
-
export type { index$1_Config as Config, index$1_Destination as Destination, index$1_Env as Env, index$1_Mapping as Mapping, index$1_Rule as Rule, index$1_Rules as Rules, index$1_Settings as Settings, index$1_StandardEventNames as StandardEventNames, index$1_Types as Types };
|
|
37
|
+
type index$2_Config = Config;
|
|
38
|
+
type index$2_Destination = Destination;
|
|
39
|
+
type index$2_Env = Env;
|
|
40
|
+
type index$2_Rule = Rule;
|
|
41
|
+
type index$2_Rules = Rules;
|
|
42
|
+
type index$2_StandardEventNames = StandardEventNames;
|
|
43
|
+
type index$2_Types = Types;
|
|
44
|
+
declare namespace index$2 {
|
|
45
|
+
export type { index$2_Config as Config, index$2_Destination as Destination, index$2_Env as Env, Mapping$1 as Mapping, index$2_Rule as Rule, index$2_Rules as Rules, Settings$1 as Settings, index$2_StandardEventNames as StandardEventNames, index$2_Types as Types };
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
declare const init: Env | undefined;
|
|
@@ -81,22 +80,84 @@ declare const config: {
|
|
|
81
80
|
};
|
|
82
81
|
};
|
|
83
82
|
|
|
84
|
-
declare const
|
|
85
|
-
declare const
|
|
86
|
-
declare const
|
|
87
|
-
declare const
|
|
88
|
-
declare const
|
|
89
|
-
declare namespace mapping {
|
|
90
|
-
export {
|
|
83
|
+
declare const mapping$1_AddToCart: typeof AddToCart;
|
|
84
|
+
declare const mapping$1_InitiateCheckout: typeof InitiateCheckout;
|
|
85
|
+
declare const mapping$1_Purchase: typeof Purchase;
|
|
86
|
+
declare const mapping$1_ViewContent: typeof ViewContent;
|
|
87
|
+
declare const mapping$1_config: typeof config;
|
|
88
|
+
declare namespace mapping$1 {
|
|
89
|
+
export { mapping$1_AddToCart as AddToCart, mapping$1_InitiateCheckout as InitiateCheckout, mapping$1_Purchase as Purchase, mapping$1_ViewContent as ViewContent, mapping$1_config as config };
|
|
91
90
|
}
|
|
92
91
|
|
|
93
|
-
declare const
|
|
94
|
-
declare const
|
|
92
|
+
declare const index$1_env: typeof env;
|
|
93
|
+
declare const index$1_events: typeof events;
|
|
94
|
+
declare namespace index$1 {
|
|
95
|
+
export { index$1_env as env, index$1_events as events, mapping$1 as mapping };
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Meta Pixel ID
|
|
100
|
+
* Must be a numeric string (Facebook Pixel IDs are numeric)
|
|
101
|
+
*/
|
|
102
|
+
declare const PixelId: z.ZodString;
|
|
103
|
+
/**
|
|
104
|
+
* Meta Pixel Standard Event Names
|
|
105
|
+
* https://developers.facebook.com/docs/meta-pixel/reference
|
|
106
|
+
*/
|
|
107
|
+
declare const StandardEventName: z.ZodEnum<["PageView", "AddPaymentInfo", "AddToCart", "AddToWishlist", "CompleteRegistration", "Contact", "CustomizeProduct", "Donate", "FindLocation", "InitiateCheckout", "Lead", "Purchase", "Schedule", "Search", "StartTrial", "SubmitApplication", "Subscribe", "ViewContent"]>;
|
|
108
|
+
/**
|
|
109
|
+
* Custom Event Name
|
|
110
|
+
* Any string for custom tracking
|
|
111
|
+
*/
|
|
112
|
+
declare const CustomEventName: z.ZodString;
|
|
113
|
+
|
|
114
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
115
|
+
pixelId: z.ZodString;
|
|
116
|
+
}, "strip", z.ZodTypeAny, {
|
|
117
|
+
pixelId: string;
|
|
118
|
+
}, {
|
|
119
|
+
pixelId: string;
|
|
120
|
+
}>;
|
|
121
|
+
type Settings = z.infer<typeof SettingsSchema>;
|
|
122
|
+
|
|
123
|
+
declare const MappingSchema: z.ZodObject<{
|
|
124
|
+
track: z.ZodOptional<z.ZodEnum<["PageView", "AddPaymentInfo", "AddToCart", "AddToWishlist", "CompleteRegistration", "Contact", "CustomizeProduct", "Donate", "FindLocation", "InitiateCheckout", "Lead", "Purchase", "Schedule", "Search", "StartTrial", "SubmitApplication", "Subscribe", "ViewContent"]>>;
|
|
125
|
+
trackCustom: z.ZodOptional<z.ZodString>;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
track?: "PageView" | "AddPaymentInfo" | "AddToCart" | "AddToWishlist" | "CompleteRegistration" | "Contact" | "CustomizeProduct" | "Donate" | "FindLocation" | "InitiateCheckout" | "Lead" | "Purchase" | "Schedule" | "Search" | "StartTrial" | "SubmitApplication" | "Subscribe" | "ViewContent" | undefined;
|
|
128
|
+
trackCustom?: string | undefined;
|
|
129
|
+
}, {
|
|
130
|
+
track?: "PageView" | "AddPaymentInfo" | "AddToCart" | "AddToWishlist" | "CompleteRegistration" | "Contact" | "CustomizeProduct" | "Donate" | "FindLocation" | "InitiateCheckout" | "Lead" | "Purchase" | "Schedule" | "Search" | "StartTrial" | "SubmitApplication" | "Subscribe" | "ViewContent" | undefined;
|
|
131
|
+
trackCustom?: string | undefined;
|
|
132
|
+
}>;
|
|
133
|
+
type Mapping = z.infer<typeof MappingSchema>;
|
|
134
|
+
|
|
135
|
+
declare const settings: zod_to_json_schema.JsonSchema7Type & {
|
|
136
|
+
$schema?: string | undefined;
|
|
137
|
+
definitions?: {
|
|
138
|
+
[key: string]: zod_to_json_schema.JsonSchema7Type;
|
|
139
|
+
} | undefined;
|
|
140
|
+
};
|
|
141
|
+
declare const mapping: zod_to_json_schema.JsonSchema7Type & {
|
|
142
|
+
$schema?: string | undefined;
|
|
143
|
+
definitions?: {
|
|
144
|
+
[key: string]: zod_to_json_schema.JsonSchema7Type;
|
|
145
|
+
} | undefined;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
declare const index_CustomEventName: typeof CustomEventName;
|
|
149
|
+
type index_Mapping = Mapping;
|
|
150
|
+
declare const index_MappingSchema: typeof MappingSchema;
|
|
151
|
+
declare const index_PixelId: typeof PixelId;
|
|
152
|
+
type index_Settings = Settings;
|
|
153
|
+
declare const index_SettingsSchema: typeof SettingsSchema;
|
|
154
|
+
declare const index_StandardEventName: typeof StandardEventName;
|
|
95
155
|
declare const index_mapping: typeof mapping;
|
|
156
|
+
declare const index_settings: typeof settings;
|
|
96
157
|
declare namespace index {
|
|
97
|
-
export {
|
|
158
|
+
export { index_CustomEventName as CustomEventName, type index_Mapping as Mapping, index_MappingSchema as MappingSchema, index_PixelId as PixelId, type index_Settings as Settings, index_SettingsSchema as SettingsSchema, index_StandardEventName as StandardEventName, index_mapping as mapping, index_settings as settings };
|
|
98
159
|
}
|
|
99
160
|
|
|
100
161
|
declare const destinationMeta: Destination;
|
|
101
162
|
|
|
102
|
-
export { index$
|
|
163
|
+
export { index$2 as DestinationMeta, destinationMeta as default, destinationMeta, index$1 as examples, index as schemas };
|